galaxy-dev
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
August 2009
- 12 participants
- 156 discussions
14 Aug '09
details: http://www.bx.psu.edu/hg/galaxy/rev/eb1244477b90
changeset: 2564:eb1244477b90
user: James Taylor <james(a)jamestaylor.org>
date: Fri Aug 14 12:17:45 2009 -0400
description:
Fix for library expand buttons in IE (even though the old way used to work, should work, and was tested).
1 file(s) affected in this change:
templates/library/browse_library.mako
diffs (26 lines):
diff -r bfd2ee7bff9d -r eb1244477b90 templates/library/browse_library.mako
--- a/templates/library/browse_library.mako Fri Aug 14 10:03:15 2009 -0400
+++ b/templates/library/browse_library.mako Fri Aug 14 12:17:45 2009 -0400
@@ -38,14 +38,21 @@
descendents = descendents.add( child_descendents );
});
// Set up expand / hide link
+ // HACK: assume descendents are invisible. The caller actually
+ // ensures this for the root node. However, if we start
+ // remembering folder states, we'll need something
+ // more sophisticated here.
+ var visible = false;
$(q).find( "span.expandLink").click( function() {
- if ( children.is( ":visible" ) ) {
+ if ( visible ) {
descendents.hide();
descendents.removeClass( "expanded" );
q.removeClass( "expanded" );
+ visible = false;
} else {
children.show();
q.addClass( "expanded" );
+ visible = true;
}
});
// Check/uncheck boxes in subfolders.
1
0
14 Aug '09
details: http://www.bx.psu.edu/hg/galaxy/rev/bfd2ee7bff9d
changeset: 2563:bfd2ee7bff9d
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Fri Aug 14 10:03:15 2009 -0400
description:
Functional test fixes for my last commit.
2 file(s) affected in this change:
templates/admin/library/browse_libraries.mako
test/base/twilltestcase.py
diffs (24 lines):
diff -r d2ad22e73b81 -r bfd2ee7bff9d templates/admin/library/browse_libraries.mako
--- a/templates/admin/library/browse_libraries.mako Fri Aug 14 09:22:31 2009 -0400
+++ b/templates/admin/library/browse_libraries.mako Fri Aug 14 10:03:15 2009 -0400
@@ -13,7 +13,7 @@
<ul class="manage-table-actions">
%if not deleted:
<li>
- <a class="action-button" href="${h.url_for( controller='admin', action='library', new=True )}"><span>Create a new library</span></a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='library', new=True )}"><span>Create a new data library</span></a>
</li>
<li>
<a class="action-button" href="${h.url_for( controller='admin', action='deleted_libraries' )}"><span>Manage deleted libraries</span></a>
diff -r d2ad22e73b81 -r bfd2ee7bff9d test/base/twilltestcase.py
--- a/test/base/twilltestcase.py Fri Aug 14 09:22:31 2009 -0400
+++ b/test/base/twilltestcase.py Fri Aug 14 10:03:15 2009 -0400
@@ -1003,7 +1003,7 @@
"""Create a new library"""
self.home()
self.visit_url( "%s/admin/library?new=True" % self.url )
- self.check_page_for_string( 'Create a new library' )
+ self.check_page_for_string( 'Create a new data library' )
tc.fv( "1", "1", name ) # form field 1 is the field named name...
tc.fv( "1", "2", description ) # form field 1 is the field named name...
tc.submit( "create_library_button" )
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/50a38a294296
changeset: 2559:50a38a294296
user: James Taylor <james(a)jamestaylor.org>
date: Thu Aug 13 11:43:46 2009 -0400
description:
Fixing masthead centering again
1 file(s) affected in this change:
templates/base_panels.mako
diffs (51 lines):
diff -r 52ad5635f01a -r 50a38a294296 templates/base_panels.mako
--- a/templates/base_panels.mako Thu Aug 13 11:27:45 2009 -0400
+++ b/templates/base_panels.mako Thu Aug 13 11:43:46 2009 -0400
@@ -115,18 +115,9 @@
## Masthead
<%def name="masthead()">
- <div style="position: absolute; left: 0px; width: 100%; text-align: center">
+ ## Tab area, fills entire width
+ <div style="position: absolute; top: 0; left: 0; width: 100%; text-align: center">
- <div class="title" style="float: left;">
- <a href="/">
- <img border="0" src="${h.url_for('/static/images/galaxyIcon_noText.png')}" style="width: 26px; vertical-align: top;">
- Galaxy
- %if app.config.brand:
- <span class='brand'>/${app.config.brand}</span>
- %endif
- </a>
- </div>
-
<table class="tab-group" border="0" cellspacing="0" style="margin: auto;">
<tr>
@@ -231,6 +222,17 @@
</div>
+ ## Logo, layered over tabs to be clickable
+ <div class="title" style="position: absolute; top: 0; left: 0;">
+ <a href="/">
+ <img border="0" src="${h.url_for('/static/images/galaxyIcon_noText.png')}" style="width: 26px; vertical-align: top;">
+ Galaxy
+ %if app.config.brand:
+ <span class='brand'>/${app.config.brand}</span>
+ %endif
+ </a>
+ </div>
+
</%def>
<%def name="overlay( title='', content='' )">
@@ -283,7 +285,7 @@
</head>
<body scroll="no" class="${self.body_class}">
- <div id="everything" style="position: absolute; width: 100%; height: 100%; min-width: 960px; min-height: 400px;">
+ <div id="everything" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; min-width: 960px;">
## Background displays first
<div id="background"></div>
## Layer iframes over backgrounds
1
0
14 Aug '09
details: http://www.bx.psu.edu/hg/galaxy/rev/ff4b7ca79092
changeset: 2560:ff4b7ca79092
user: James Taylor <james(a)jamestaylor.org>
date: Thu Aug 13 12:03:25 2009 -0400
description:
Resolve issue #129, 'library view jumps to top upon node expansion'
1 file(s) affected in this change:
templates/library/browse_library.mako
diffs (21 lines):
diff -r 50a38a294296 -r ff4b7ca79092 templates/library/browse_library.mako
--- a/templates/library/browse_library.mako Thu Aug 13 11:43:46 2009 -0400
+++ b/templates/library/browse_library.mako Thu Aug 13 12:03:25 2009 -0400
@@ -38,16 +38,14 @@
descendents = descendents.add( child_descendents );
});
// Set up expand / hide link
- $(q).find( "span.expandLink").wrap( "<a href='#' class='expandLink'></a>" ).click( function() {
+ $(q).find( "span.expandLink").click( function() {
if ( children.is( ":visible" ) ) {
descendents.hide();
descendents.removeClass( "expanded" );
q.removeClass( "expanded" );
- // expanded = false;
} else {
children.show();
q.addClass( "expanded" );
- // expanded = true;
}
});
// Check/uncheck boxes in subfolders.
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/172548982c18
changeset: 2561:172548982c18
user: James Taylor <james(a)jamestaylor.org>
date: Thu Aug 13 12:19:00 2009 -0400
description:
Restoring history/grid.mako
1 file(s) affected in this change:
templates/history/grid.mako
diffs (200 lines):
diff -r ff4b7ca79092 -r 172548982c18 templates/history/grid.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/history/grid.mako Thu Aug 13 12:19:00 2009 -0400
@@ -0,0 +1,196 @@
+<%inherit file="/base.mako"/>
+<%def name="title()">${grid.title}</%def>
+
+%if message:
+ <p>
+ <div class="${message_type}message transient-message">${message}</div>
+ <div style="clear: both"></div>
+ </p>
+%endif
+
+<%def name="javascripts()">
+ ${parent.javascripts()}
+ <script type="text/javascript">
+ ## TODO: generalize and move into galaxy.base.js
+ $(document).ready(function() {
+ $(".grid").each( function() {
+ var grid = this;
+ var checkboxes = $(this).find("input.grid-row-select-checkbox");
+ var update = $(this).find( "span.grid-selected-count" );
+ $(checkboxes).each( function() {
+ $(this).change( function() {
+ var n = $(checkboxes).filter("[checked]").size();
+ update.text( n );
+ });
+ })
+ });
+ });
+ ## Can this be moved into base.mako?
+ %if refresh_frames:
+ %if 'masthead' in refresh_frames:
+ ## Refresh masthead == user changes (backward compatibility)
+ if ( parent.user_changed ) {
+ %if trans.user:
+ parent.user_changed( "${trans.user.email}", ${int( app.config.is_admin_user( trans.user ) )} );
+ %else:
+ parent.user_changed( null, false );
+ %endif
+ }
+ %endif
+ %if 'history' in refresh_frames:
+ if ( parent.frames && parent.frames.galaxy_history ) {
+ parent.frames.galaxy_history.location.href="${h.url_for( controller='root', action='history')}";
+ if ( parent.force_right_panel ) {
+ parent.force_right_panel( 'show' );
+ }
+ }
+ %endif
+ %if 'tools' in refresh_frames:
+ if ( parent.frames && parent.frames.galaxy_tools ) {
+ parent.frames.galaxy_tools.location.href="${h.url_for( controller='root', action='tool_menu')}";
+ if ( parent.force_left_panel ) {
+ parent.force_left_panel( 'show' );
+ }
+ }
+ %endif
+ %endif
+ </script>
+</%def>
+
+<%def name="stylesheets()">
+ <link href="${h.url_for('/static/style/base.css')}" rel="stylesheet" type="text/css" />
+ <style>
+ ## Not generic to all grids -- move to base?
+ .count-box {
+ min-width: 1.1em;
+ padding: 5px;
+ border-width: 1px;
+ border-style: solid;
+ text-align: center;
+ display: inline-block;
+ }
+ </style>
+</%def>
+
+%if grid.standard_filters:
+ <div class="grid-header">
+ <h2>${grid.title}</h2>
+ <span class="title">Filter:</span>
+ %for i, filter in enumerate( grid.standard_filters ):
+ %if i > 0:
+ <span>|</span>
+ %endif
+ <span class="filter"><a href="${url( filter.get_url_args() )}">${filter.label}</a></span>
+ %endfor
+ </div>
+%endif
+
+<form name="history_actions" action="${url()}" method="post" >
+ <table class="grid">
+ <thead>
+ <tr>
+ <th></th>
+ %for column in grid.columns:
+ %if column.visible:
+ <%
+ href = ""
+ extra = ""
+ if column.sortable:
+ if sort_key == column.key:
+ if sort_order == "asc":
+ href = url( sort=( "-" + column.key ) )
+ extra = "↓"
+ else:
+ href = url( sort=( column.key ) )
+ extra = "↑"
+ else:
+ href = url( sort=column.key )
+ %>
+ <th\
+ %if column.ncells > 1:
+ colspan="${column.ncells}"
+ %endif
+ >
+ %if href:
+ <a href="${href}">${column.label}</a>
+ %else:
+ ${column.label}
+ %endif
+ <span>${extra}</span>
+ </th>
+ %endif
+ %endfor
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ %for i, item in enumerate( query ):
+ <tr \
+ %if current_item == item:
+ class="current" \
+ %endif
+ >
+ ## Item selection column
+ <td style="width: 1.5em;">
+ <input type="checkbox" name="id" value=${trans.security.encode_id( item.id )} class="grid-row-select-checkbox" />
+ </td>
+ ## Data columns
+ %for column in grid.columns:
+ %if column.visible:
+ <%
+ # Link
+ link = column.get_link( trans, grid, item )
+ if link:
+ href = url( **link )
+ else:
+ href = None
+ # Value (coerced to list so we can loop)
+ value = column.get_value( trans, grid, item )
+ if column.ncells == 1:
+ value = [ value ]
+ %>
+ %for cellnum, v in enumerate( value ):
+ <%
+ # Attach popup menu?
+ if column.attach_popup and cellnum == 0:
+ extra = '<a id="grid-%d-popup" class="popup-arrow" style="display: none;">▼</a>' % i
+ else:
+ extra = ""
+ %>
+ %if href:
+ <td><a href="${href}">${v}</a> ${extra}</td>
+ %else:
+ <td >${v}${extra}</td>
+ %endif
+ </td>
+ %endfor
+ %endif
+ %endfor
+ ## Actions column
+ <td>
+ <div popupmenu="grid-${i}-popup">
+ %for operation in grid.operations:
+ %if operation.allowed( item ):
+ <a class="action-button" href="${url( operation=operation.label, id=item.id )}">${operation.label}</a>
+ %endif
+ %endfor
+ </div>
+ </td>
+ </tr>
+ %endfor
+ </tbody>
+ <tfoot>
+ <tr>
+ <td></td>
+ <td colspan="100">
+ For <span class="grid-selected-count"></span> selected histories:
+ %for operation in grid.operations:
+ %if operation.allow_multiple:
+ <input type="submit" name="operation" value="${operation.label}" class="action-button">
+ %endif
+ %endfor
+ </td>
+ </tr>
+ </tfoot>
+ </table>
+</form>
1
0
14 Aug '09
details: http://www.bx.psu.edu/hg/galaxy/rev/d2ad22e73b81
changeset: 2562:d2ad22e73b81
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Fri Aug 14 09:22:31 2009 -0400
description:
Change GUI references to Library to now be Data Library, and merge 2 history grid templates into 1.
43 file(s) affected in this change:
lib/galaxy/web/controllers/history.py
lib/galaxy/web/controllers/requests.py
lib/galaxy/web/controllers/requests_admin.py
templates/admin/center.mako
templates/admin/dataset_security/role.mako
templates/admin/index.mako
templates/admin/library/browse_libraries.mako
templates/admin/library/browse_library.mako
templates/admin/library/folder_info.mako
templates/admin/library/folder_permissions.mako
templates/admin/library/ldda_edit_info.mako
templates/admin/library/ldda_info.mako
templates/admin/library/ldda_permissions.mako
templates/admin/library/library_dataset_info.mako
templates/admin/library/library_dataset_permissions.mako
templates/admin/library/library_info.mako
templates/admin/library/library_permissions.mako
templates/admin/library/new_dataset.mako
templates/admin/library/new_folder.mako
templates/admin/library/new_library.mako
templates/admin/library/select_info_template.mako
templates/admin/requests/show_request.mako
templates/base_panels.mako
templates/history/shared_grid.mako
templates/history/stored_grid.mako
templates/library/browse_libraries.mako
templates/library/browse_library.mako
templates/library/folder_info.mako
templates/library/folder_permissions.mako
templates/library/ldda_edit_info.mako
templates/library/ldda_info.mako
templates/library/ldda_permissions.mako
templates/library/library_dataset_info.mako
templates/library/library_dataset_permissions.mako
templates/library/library_info.mako
templates/library/library_permissions.mako
templates/library/new_dataset.mako
templates/library/new_folder.mako
templates/library/select_info_template.mako
templates/requests/edit_request.mako
templates/requests/new_request.mako
templates/requests/show_request.mako
test/functional/test_security_and_libraries.py
diffs (1125 lines):
diff -r 172548982c18 -r d2ad22e73b81 lib/galaxy/web/controllers/history.py
--- a/lib/galaxy/web/controllers/history.py Thu Aug 13 12:19:00 2009 -0400
+++ b/lib/galaxy/web/controllers/history.py Fri Aug 14 09:22:31 2009 -0400
@@ -161,7 +161,7 @@
status, message = self._list_undelete( trans, histories )
trans.sa_session.flush()
# Render the list view
- return self.stored_list_grid( trans, status=status, message=message, template='/history/stored_grid.mako', **kwargs )
+ return self.stored_list_grid( trans, status=status, message=message, template='/history/grid.mako', **kwargs )
def _list_delete( self, trans, histories ):
"""Delete histories"""
n_deleted = 0
@@ -239,14 +239,14 @@
if operation == "clone":
if not id:
message = "Select a history to clone"
- return self.shared_list_grid( trans, status='error', message=message, template='/history/shared_grid.mako', **kwargs )
+ return self.shared_list_grid( trans, status='error', message=message, template='/history/grid.mako', **kwargs )
# When cloning shared histories, only copy active datasets
new_kwargs = { 'clone_choice' : 'active' }
return self.clone( trans, id, **new_kwargs )
elif operation == 'unshare':
if not id:
message = "Select a history to unshare"
- return self.shared_list_grid( trans, status='error', message=message, template='/history/shared_grid.mako', **kwargs )
+ return self.shared_list_grid( trans, status='error', message=message, template='/history/grid.mako', **kwargs )
ids = util.listify( id )
histories = []
for history_id in ids:
@@ -260,7 +260,7 @@
message = "Unshared %d shared histories" % len( ids )
status = 'done'
# Render the list view
- return self.shared_list_grid( trans, status=status, message=message, template='/history/shared_grid.mako', **kwargs )
+ return self.shared_list_grid( trans, status=status, message=message, template='/history/grid.mako', **kwargs )
@web.expose
def delete_current( self, trans ):
"""Delete just the active history -- this does not require a logged in user."""
diff -r 172548982c18 -r d2ad22e73b81 lib/galaxy/web/controllers/requests.py
--- a/lib/galaxy/web/controllers/requests.py Thu Aug 13 12:19:00 2009 -0400
+++ b/lib/galaxy/web/controllers/requests.py Fri Aug 14 09:22:31 2009 -0400
@@ -152,16 +152,12 @@
helptext=''))
# library associated
if request.library:
- request_details.append(dict(label='Library',
- value=request.library.name,
- helptext='Associated library where the resultant \
- dataset will be stored'))
+ value = request.library.name
else:
- request_details.append(dict(label='Library',
- value=None,
- helptext='Associated library where the resultant \
- dataset will be stored'))
-
+ value = None
+ request_details.append( dict( label='Data library',
+ value=value,
+ helptext='Data library where the resultant dataset will be stored' ) )
# form fields
for index, field in enumerate(request.type.request_form.fields):
if field['required']:
@@ -492,18 +488,17 @@
else:
lib_list.add_option(lib.name, lib.id)
if lib_id == 'new':
- lib_list.add_option('Create a new library', 'new', selected=True)
+ lib_list.add_option('Create a new data library', 'new', selected=True)
else:
- lib_list.add_option('Create a new library', 'new')
- widget = dict(label='Library',
+ lib_list.add_option('Create a new data library', 'new')
+ widget = dict(label='Data library',
widget=lib_list,
- helptext='Associated library where the resultant \
- dataset will be stored.')
+ helptext='Data library where the resultant dataset will be stored.')
if lib_id == 'new':
- new_lib = dict(label='Create a new Library',
+ new_lib = dict(label='Create a new data library',
widget=TextField('new_library_name', 40,
util.restore_text( params.get( 'new_library_name', '' ) )),
- helptext='Enter a library name here to request a new library')
+ helptext='Enter a name here to request a new data library')
return [widget, new_lib]
else:
return [widget]
@@ -558,7 +553,7 @@
'''
empty_fields = []
if not request.library:
- empty_fields.append('Library')
+ empty_fields.append('Data library')
# check rest of the fields of the form
for index, field in enumerate(request.type.request_form.fields):
if field['required'] == 'required' and request.values.content[index] in ['', None]:
diff -r 172548982c18 -r d2ad22e73b81 lib/galaxy/web/controllers/requests_admin.py
--- a/lib/galaxy/web/controllers/requests_admin.py Thu Aug 13 12:19:00 2009 -0400
+++ b/lib/galaxy/web/controllers/requests_admin.py Fri Aug 14 09:22:31 2009 -0400
@@ -144,10 +144,9 @@
value=str(request.user.email),
helptext=''))
# library associated
- request_details.append(dict(label='Library',
+ request_details.append(dict(label='Data library',
value=trans.app.model.Library.get(request.library_id).name,
- helptext='Associated library where the resultant \
- dataset will be stored'))
+ helptext='Data library where the resultant dataset will be stored'))
# form fields
for index, field in enumerate(request.type.request_form.fields):
if field['required']:
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/center.mako
--- a/templates/admin/center.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/center.mako Fri Aug 14 09:22:31 2009 -0400
@@ -17,7 +17,7 @@
<li>
<strong>Manage groups</strong> - provides a view of all groups along with the members of the group and the roles associated with
each group (both private and non-private roles). Non-private roles include a link to a page that allows you to manage the users
- and groups that are associated with the role. The page also includes a view of the library datasets that are associated with the
+ and groups that are associated with the role. The page also includes a view of the data library datasets that are associated with the
role and the permissions applied to each dataset.
</li>
<p/>
@@ -32,9 +32,9 @@
<p/>
<ul>
<li>
- <strong>Manage libraries</strong> - Dataset libraries enable a Galaxy administrator to upload datasets into a library. Currently,
- only administrators can create dataset libraries, but permission to perform the following functions on the library can be granted to
- users (a library item is one of: a library, a library folder, a library dataset).
+ <strong>Manage data libraries</strong> - Data libraries enable a Galaxy administrator to upload datasets into a data library. Currently,
+ only administrators can create data libraries, but permission to perform the following functions on the data library can be granted to
+ users (a library item is one of: a data library, a library folder, a library dataset).
<p/>
<ul>
<li><strong>add library item</strong> - Role members can add library items to this library or folder</li>
@@ -42,12 +42,12 @@
<li><strong>manage library permissions</strong> - Role members can manage permissions applied to this library item</li>
</ul>
<p/>
- The default behavior is for no permissions to be applied to a library item, but applied permissions are inherited downward, so it is
- important to set desired permissions on a new library when it is created. When this is done, new folders and datasets added to the
- library will automatically inherit those permissions. In the same way, permissions can be applied to a folder, which will be
+ The default behavior is for no permissions to be applied to a data library item, but applied permissions are inherited downward, so it is
+ important to set desired permissions on a new data library when it is created. When this is done, new folders and datasets added to the
+ data library will automatically inherit those permissions. In the same way, permissions can be applied to a folder, which will be
automatically inherited by all contained datasets and sub-folders.
<p/>
- The "Libraries" menu item allows users to access the datasets in a library as long as they are not restricted from accessing them.
+ The "Data Libraries" menu item allows users to access the datasets in a data library as long as they are not restricted from accessing them.
Importing a library dataset into a history will not make a copy of the dataset, but will be a "pointer" to the dataset on disk. This
approach allows for multiple users to use a single (possibly very large) dataset file.
</li>
@@ -72,7 +72,7 @@
</ul>
</li>
</ul>
-<p><strong>Data Security and Dataset Libraries</strong></p>
+<p><strong>Data Security and Data Libraries</strong></p>
<p/>
<strong>Security</strong> - Data security in Galaxy is a new feature, so familiarize yourself with the details which can be found
here or in our <a href="http://g2.trac.bx.psu.edu/wiki/SecurityFeatures" target="_blank">data security page</a>. The data security
@@ -121,8 +121,8 @@
<strong>access</strong> - users associated with the role can import this dataset into their history for analysis.
<p>
If no roles with the "access" permission are associated with a dataset, the dataset is "public" and may be accessed by
- anyone. Public library datasets will be accessible to all users (as well as anyone not logged in during a Galaxy session)
- from the list of libraries displayed when the "Libraries" menu item is selected.
+ anyone. Public data library datasets will be accessible to all users (as well as anyone not logged in during a Galaxy session)
+ from the list of data libraries displayed when the "Data Libraries" menu item is selected.
</p>
<p>
Associating a dataset with a role that includes the "access" permission restricts the set of users that can access it.
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/dataset_security/role.mako
--- a/templates/admin/dataset_security/role.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/dataset_security/role.mako Fri Aug 14 09:22:31 2009 -0400
@@ -84,7 +84,7 @@
<br clear="left"/>
<br/>
%if len( library_dataset_actions ) > 0:
- <h3>Library datasets associated with role '${role.name}'</h3>
+ <h3>Data library datasets associated with role '${role.name}'</h3>
<table class="manage-table colored" border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td>
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/index.mako
--- a/templates/admin/index.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/index.mako Fri Aug 14 09:22:31 2009 -0400
@@ -89,7 +89,7 @@
</div>
<div class="toolSectionBody">
<div class="toolSectionBg">
- <div class="toolTitle"><a href="${h.url_for( controller='admin', action='browse_libraries' )}" target="galaxy_main">Manage libraries</a></div>
+ <div class="toolTitle"><a href="${h.url_for( controller='admin', action='browse_libraries' )}" target="galaxy_main">Manage data libraries</a></div>
</div>
</div>
<div class="toolSectionPad"></div>
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/library/browse_libraries.mako
--- a/templates/admin/library/browse_libraries.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/library/browse_libraries.mako Fri Aug 14 09:22:31 2009 -0400
@@ -1,13 +1,13 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
-<%def name="title()">Browse Libraries</%def>
+<%def name="title()">Browse Data Libraries</%def>
<h2>
%if deleted:
Deleted
%endif
- Libraries
+ Data Libraries
</h2>
<ul class="manage-table-actions">
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/library/browse_library.mako
--- a/templates/admin/library/browse_library.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/library/browse_library.mako Fri Aug 14 09:22:31 2009 -0400
@@ -162,16 +162,16 @@
%if deleted:
Deleted
%endif
- Library '${library.name}'
+ Data Library “${library.name}”
</h2>
<ul class="manage-table-actions">
%if not deleted:
<li>
- <a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library.id, folder_id=library.root_folder.id )}"><span>Add datasets to this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library.id, folder_id=library.root_folder.id )}"><span>Add datasets to this data library</span></a>
</li>
<li>
- <a class="action-button" href="${h.url_for( controller='admin', action='folder', new=True, id=library.root_folder.id, library_id=library.id )}">Add a folder to this library</a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='folder', new=True, id=library.root_folder.id, library_id=library.id )}">Add a folder to this data library</a>
</li>
%endif
</ul>
@@ -200,24 +200,24 @@
library_item_ids = {}
library_item_ids[ 'library' ] = library.id
%>
- <a class="action-button" href="${h.url_for( controller='admin', action='library', id=library.id, information=True )}">Edit this library's information</a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='library', id=library.id, information=True )}">Edit this data library's information</a>
## Editing templates disabled until we determine optimal approach to re-linking library item to new version of form definition
##%if library.info_association:
## <% form_id = library.info_association[0].template.id %>
- ## <a class="action-button" href="${h.url_for( controller='forms', action='edit', form_id=form_id, show_form=True )}">Edit this library's information template</a>
+ ## <a class="action-button" href="${h.url_for( controller='forms', action='edit', form_id=form_id, show_form=True )}">Edit this data library's information template</a>
##%else:
%if not library.info_association:
- <a class="action-button" href="${h.url_for( controller='admin', action='info_template', library_id=library.id, add=True )}">Add an information template to this library</a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='info_template', library_id=library.id, add=True )}">Add an information template to this data library</a>
%endif
- <a class="action-button" href="${h.url_for( controller='admin', action='library', id=library.id, permissions=True )}">Edit this library's permissions</a>
- <a class="action-button" confirm="Click OK to delete the library named '${library.name}'." href="${h.url_for( controller='admin', action='delete_library_item', library_id=library.id, library_item_id=library.id, library_item_type='library' )}">Delete this library and its contents</a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='library', id=library.id, permissions=True )}">Edit this data library's permissions</a>
+ <a class="action-button" confirm="Click OK to delete the library named '${library.name}'." href="${h.url_for( controller='admin', action='delete_library_item', library_id=library.id, library_item_id=library.id, library_item_type='library' )}">Delete this data library and its contents</a>
%if show_deleted:
- <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library.id, show_deleted=False )}">Hide deleted library items</a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library.id, show_deleted=False )}">Hide deleted data library items</a>
%else:
- <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library.id, show_deleted=True )}">Show deleted library items</a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library.id, show_deleted=True )}">Show deleted data library items</a>
%endif
%elif not library.purged:
- <a class="action-button" href="${h.url_for( controller='admin', action='undelete_library_item', library_id=library.id, library_item_id=library.id, library_item_type='library' )}">Undelete this library</a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='undelete_library_item', library_id=library.id, library_item_id=library.id, library_item_type='library' )}">Undelete this data library</a>
%endif
</div>
</th>
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/library/folder_info.mako
--- a/templates/admin/library/folder_info.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/library/folder_info.mako Fri Aug 14 09:22:31 2009 -0400
@@ -5,7 +5,7 @@
<br/><br/>
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/library/folder_permissions.mako
--- a/templates/admin/library/folder_permissions.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/library/folder_permissions.mako Fri Aug 14 09:22:31 2009 -0400
@@ -5,7 +5,7 @@
<br/><br/>
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/library/ldda_edit_info.mako
--- a/templates/admin/library/ldda_edit_info.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/library/ldda_edit_info.mako Fri Aug 14 09:22:31 2009 -0400
@@ -12,7 +12,7 @@
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/library/ldda_info.mako
--- a/templates/admin/library/ldda_info.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/library/ldda_info.mako Fri Aug 14 09:22:31 2009 -0400
@@ -20,7 +20,7 @@
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id, deleted=library.deleted, show_deleted=show_deleted )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id, deleted=library.deleted, show_deleted=show_deleted )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/library/ldda_permissions.mako
--- a/templates/admin/library/ldda_permissions.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/library/ldda_permissions.mako Fri Aug 14 09:22:31 2009 -0400
@@ -15,7 +15,7 @@
<br/><br/>
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/library/library_dataset_info.mako
--- a/templates/admin/library/library_dataset_info.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/library/library_dataset_info.mako Fri Aug 14 09:22:31 2009 -0400
@@ -11,7 +11,7 @@
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/library/library_dataset_permissions.mako
--- a/templates/admin/library/library_dataset_permissions.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/library/library_dataset_permissions.mako Fri Aug 14 09:22:31 2009 -0400
@@ -11,7 +11,7 @@
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/library/library_info.mako
--- a/templates/admin/library/library_info.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/library/library_info.mako Fri Aug 14 09:22:31 2009 -0400
@@ -5,7 +5,7 @@
<br/><br/>
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library.id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library.id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/library/library_permissions.mako
--- a/templates/admin/library/library_permissions.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/library/library_permissions.mako Fri Aug 14 09:22:31 2009 -0400
@@ -5,7 +5,7 @@
<br/><br/>
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library.id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library.id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/library/new_dataset.mako
--- a/templates/admin/library/new_dataset.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/library/new_dataset.mako Fri Aug 14 09:22:31 2009 -0400
@@ -4,7 +4,7 @@
<% import os, os.path %>
-<b>Create new library datasets</b>
+<b>Create new data library datasets</b>
<a id="upload-librarydataset--popup" class="popup-arrow" style="display: none;">▼</a>
<div popupmenu="upload-librarydataset--popup">
<a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_file' )}">Upload files</a>
@@ -16,7 +16,7 @@
<br/><br/>
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
@@ -142,7 +142,7 @@
<textarea name="message" rows="3" cols="35"></textarea>
</div>
<div class="toolParamHelp" style="clear: both;">
- This information will be displayed in the "Information" column for this dataset in the library browser
+ This information will be displayed in the "Information" column for this dataset in the data library browser
</div>
<div style="clear: both"></div>
</div>
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/library/new_folder.mako
--- a/templates/admin/library/new_folder.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/library/new_folder.mako Fri Aug 14 09:22:31 2009 -0400
@@ -4,7 +4,7 @@
<br/<br/>
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/library/new_library.mako
--- a/templates/admin/library/new_library.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/library/new_library.mako Fri Aug 14 09:22:31 2009 -0400
@@ -6,13 +6,13 @@
%endif
<div class="toolForm">
- <div class="toolFormTitle">Create a new library</div>
+ <div class="toolFormTitle">Create a new data library</div>
<div class="toolFormBody">
<form name="library" action="${h.url_for( controller='admin', action='library' )}" method="post" >
<div class="form-row">
<label>Name:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
- <input type="text" name="name" value="New Library" size="40"/>
+ <input type="text" name="name" value="New data library" size="40"/>
</div>
<div style="clear: both"></div>
</div>
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/library/select_info_template.mako
--- a/templates/admin/library/select_info_template.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/library/select_info_template.mako Fri Aug 14 09:22:31 2009 -0400
@@ -4,7 +4,7 @@
<br/><br/>
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/admin/requests/show_request.mako
--- a/templates/admin/requests/show_request.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/admin/requests/show_request.mako Fri Aug 14 09:22:31 2009 -0400
@@ -48,7 +48,7 @@
%if not rd['value']:
<i>None</i>
%else:
- %if rd['label'] == 'Library':
+ %if rd['label'] == 'Data library':
<a href="${h.url_for( controller='admin', action='browse_library', id=request.library.id )}">${rd['value']}</a>
%else:
${rd['value']}
diff -r 172548982c18 -r d2ad22e73b81 templates/base_panels.mako
--- a/templates/base_panels.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/base_panels.mako Fri Aug 14 09:22:31 2009 -0400
@@ -139,14 +139,14 @@
${tab( "workflow", "Workflow", h.url_for( controller='workflow', action='index' ))}
- ${tab( "libraries", "Libraries", h.url_for( controller='library', action='index' ))}
+ ${tab( "libraries", "Data Libraries", h.url_for( controller='library', action='index' ))}
%if trans.request_types():
<td class="tab">
<a>Lab</a>
<div class="submenu">
<ul>
- <li><a target="requests" href="${h.url_for( controller='requests', action='index' )}">Sequencing Requests</a></li>
+ <li><a href="${h.url_for( controller='requests', action='index' )}">Sequencing Requests</a></li>
</ul>
</div>
</td>
diff -r 172548982c18 -r d2ad22e73b81 templates/history/shared_grid.mako
--- a/templates/history/shared_grid.mako Thu Aug 13 12:19:00 2009 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-<%def name="title()">${grid.title}</%def>
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- <script type="text/javascript">
- ## TODO: generalize and move into galaxy.base.js
- $(document).ready(function() {
- $(".grid").each( function() {
- var grid = this;
- var checkboxes = $(this).find("input.grid-row-select-checkbox");
- var update = $(this).find( "span.grid-selected-count" );
- $(checkboxes).each( function() {
- $(this).change( function() {
- var n = $(checkboxes).filter("[checked]").size();
- update.text( n );
- });
- })
- });
- });
- ## Can this be moved into base.mako?
- %if refresh_frames:
- %if 'masthead' in refresh_frames:
- ## Refresh masthead == user changes (backward compatibility)
- if ( parent.user_changed ) {
- %if trans.user:
- parent.user_changed( "${trans.user.email}", ${int( app.config.is_admin_user( trans.user ) )} );
- %else:
- parent.user_changed( null, false );
- %endif
- }
- %endif
- %if 'history' in refresh_frames:
- if ( parent.frames && parent.frames.galaxy_history ) {
- parent.frames.galaxy_history.location.href="${h.url_for( controller='root', action='history')}";
- if ( parent.force_right_panel ) {
- parent.force_right_panel( 'show' );
- }
- }
- %endif
- %if 'tools' in refresh_frames:
- if ( parent.frames && parent.frames.galaxy_tools ) {
- parent.frames.galaxy_tools.location.href="${h.url_for( controller='root', action='tool_menu')}";
- if ( parent.force_left_panel ) {
- parent.force_left_panel( 'show' );
- }
- }
- %endif
- %endif
- </script>
-</%def>
-
-<%def name="stylesheets()">
- <link href="${h.url_for('/static/style/base.css')}" rel="stylesheet" type="text/css" />
- <style>
- ## Not generic to all grids -- move to base?
- .count-box {
- min-width: 1.1em;
- padding: 5px;
- border-width: 1px;
- border-style: solid;
- text-align: center;
- display: inline-block;
- }
- </style>
-</%def>
-
-%if grid.standard_filters:
- <div class="grid-header">
- <h2>${grid.title}</h2>
- <span class="title">Filter:</span>
- %for i, filter in enumerate( grid.standard_filters ):
- %if i > 0:
- <span>|</span>
- %endif
- <span class="filter"><a href="${url( filter.get_url_args() )}">${filter.label}</a></span>
- %endfor
- </div>
-%endif
-
-%if message:
- <p>
- <div class="${message_type}message transient-message">${message}</div>
- <div style="clear: both"></div>
- </p>
-%endif
-%if msg:
- ${render_msg( msg, messagetype )}
-%endif
-
-<form name="history_shared_by_others" action="${url()}" method="post" >
- <table class="grid">
- <thead>
- <tr>
- <th></th>
- %for column in grid.columns:
- %if column.visible:
- <%
- href = ""
- extra = ""
- if column.sortable:
- if sort_key == column.key:
- if sort_order == "asc":
- href = url( sort=( "-" + column.key ) )
- extra = "↓"
- else:
- href = url( sort=( column.key ) )
- extra = "↑"
- else:
- href = url( sort=column.key )
- %>
- <th\
- %if column.ncells > 1:
- colspan="${column.ncells}"
- %endif
- >
- %if href:
- <a href="${href}">${column.label}</a>
- %else:
- ${column.label}
- %endif
- <span>${extra}</span>
- </th>
- %endif
- %endfor
- <th></th>
- </tr>
- </thead>
- <tbody>
- %for i, history in enumerate( query ):
- <tr>
- ## Item selection column
- <td style="width: 1.5em;">
- <input type="checkbox" name="id" value=${trans.security.encode_id( history.id )} class="grid-row-select-checkbox" />
- </td>
- ## Data columns
- %for column in grid.columns:
- %if column.visible:
- <%
- # Link
- link = column.get_link( trans, grid, history )
- if link:
- href = url( **link )
- else:
- href = None
- # Value (coerced to list so we can loop)
- value = column.get_value( trans, grid, history )
- if column.ncells == 1:
- value = [ value ]
- %>
- %for cellnum, v in enumerate( value ):
- <%
- # Attach popup menu?
- if column.attach_popup and cellnum == 0:
- extra = '<a id="grid-%d-popup" class="popup-arrow" style="display: none;">▼</a>' % i
- else:
- extra = ""
- %>
- %if href:
- <td><a href="${href}">${v}</a> ${extra}</td>
- %else:
- <td >${v}${extra}</td>
- %endif
- </td>
- %endfor
- %endif
- %endfor
- ## Actions column
- <td>
- <div popupmenu="grid-${i}-popup">
- %for operation in grid.operations:
- %if operation.allowed( history ):
- <a class="action-button" href="${url( operation=operation.label, id=history.id )}">${operation.label}</a>
- %endif
- %endfor
- </div>
- </td>
- </tr>
- %endfor
- </tbody>
- <tfoot>
- <tr>
- <td></td>
- <td colspan="100">
- For <span class="grid-selected-count"></span> selected histories:
- %for operation in grid.operations:
- %if operation.allow_multiple:
- <input type="submit" name="operation" value="${operation.label}" class="action-button">
- %endif
- %endfor
- </td>
- </tr>
- </tfoot>
- </table>
-</form>
diff -r 172548982c18 -r d2ad22e73b81 templates/history/stored_grid.mako
--- a/templates/history/stored_grid.mako Thu Aug 13 12:19:00 2009 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,196 +0,0 @@
-<%inherit file="/base.mako"/>
-<%def name="title()">${grid.title}</%def>
-
-%if message:
- <p>
- <div class="${message_type}message transient-message">${message}</div>
- <div style="clear: both"></div>
- </p>
-%endif
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- <script type="text/javascript">
- ## TODO: generalize and move into galaxy.base.js
- $(document).ready(function() {
- $(".grid").each( function() {
- var grid = this;
- var checkboxes = $(this).find("input.grid-row-select-checkbox");
- var update = $(this).find( "span.grid-selected-count" );
- $(checkboxes).each( function() {
- $(this).change( function() {
- var n = $(checkboxes).filter("[checked]").size();
- update.text( n );
- });
- })
- });
- });
- ## Can this be moved into base.mako?
- %if refresh_frames:
- %if 'masthead' in refresh_frames:
- ## Refresh masthead == user changes (backward compatibility)
- if ( parent.user_changed ) {
- %if trans.user:
- parent.user_changed( "${trans.user.email}", ${int( app.config.is_admin_user( trans.user ) )} );
- %else:
- parent.user_changed( null, false );
- %endif
- }
- %endif
- %if 'history' in refresh_frames:
- if ( parent.frames && parent.frames.galaxy_history ) {
- parent.frames.galaxy_history.location.href="${h.url_for( controller='root', action='history')}";
- if ( parent.force_right_panel ) {
- parent.force_right_panel( 'show' );
- }
- }
- %endif
- %if 'tools' in refresh_frames:
- if ( parent.frames && parent.frames.galaxy_tools ) {
- parent.frames.galaxy_tools.location.href="${h.url_for( controller='root', action='tool_menu')}";
- if ( parent.force_left_panel ) {
- parent.force_left_panel( 'show' );
- }
- }
- %endif
- %endif
- </script>
-</%def>
-
-<%def name="stylesheets()">
- <link href="${h.url_for('/static/style/base.css')}" rel="stylesheet" type="text/css" />
- <style>
- ## Not generic to all grids -- move to base?
- .count-box {
- min-width: 1.1em;
- padding: 5px;
- border-width: 1px;
- border-style: solid;
- text-align: center;
- display: inline-block;
- }
- </style>
-</%def>
-
-%if grid.standard_filters:
- <div class="grid-header">
- <h2>${grid.title}</h2>
- <span class="title">Filter:</span>
- %for i, filter in enumerate( grid.standard_filters ):
- %if i > 0:
- <span>|</span>
- %endif
- <span class="filter"><a href="${url( filter.get_url_args() )}">${filter.label}</a></span>
- %endfor
- </div>
-%endif
-
-<form name="history_actions" action="${url()}" method="post" >
- <table class="grid">
- <thead>
- <tr>
- <th></th>
- %for column in grid.columns:
- %if column.visible:
- <%
- href = ""
- extra = ""
- if column.sortable:
- if sort_key == column.key:
- if sort_order == "asc":
- href = url( sort=( "-" + column.key ) )
- extra = "↓"
- else:
- href = url( sort=( column.key ) )
- extra = "↑"
- else:
- href = url( sort=column.key )
- %>
- <th\
- %if column.ncells > 1:
- colspan="${column.ncells}"
- %endif
- >
- %if href:
- <a href="${href}">${column.label}</a>
- %else:
- ${column.label}
- %endif
- <span>${extra}</span>
- </th>
- %endif
- %endfor
- <th></th>
- </tr>
- </thead>
- <tbody>
- %for i, item in enumerate( query ):
- <tr \
- %if current_item == item:
- class="current" \
- %endif
- >
- ## Item selection column
- <td style="width: 1.5em;">
- <input type="checkbox" name="id" value=${trans.security.encode_id( item.id )} class="grid-row-select-checkbox" />
- </td>
- ## Data columns
- %for column in grid.columns:
- %if column.visible:
- <%
- # Link
- link = column.get_link( trans, grid, item )
- if link:
- href = url( **link )
- else:
- href = None
- # Value (coerced to list so we can loop)
- value = column.get_value( trans, grid, item )
- if column.ncells == 1:
- value = [ value ]
- %>
- %for cellnum, v in enumerate( value ):
- <%
- # Attach popup menu?
- if column.attach_popup and cellnum == 0:
- extra = '<a id="grid-%d-popup" class="popup-arrow" style="display: none;">▼</a>' % i
- else:
- extra = ""
- %>
- %if href:
- <td><a href="${href}">${v}</a> ${extra}</td>
- %else:
- <td >${v}${extra}</td>
- %endif
- </td>
- %endfor
- %endif
- %endfor
- ## Actions column
- <td>
- <div popupmenu="grid-${i}-popup">
- %for operation in grid.operations:
- %if operation.allowed( item ):
- <a class="action-button" href="${url( operation=operation.label, id=item.id )}">${operation.label}</a>
- %endif
- %endfor
- </div>
- </td>
- </tr>
- %endfor
- </tbody>
- <tfoot>
- <tr>
- <td></td>
- <td colspan="100">
- For <span class="grid-selected-count"></span> selected histories:
- %for operation in grid.operations:
- %if operation.allow_multiple:
- <input type="submit" name="operation" value="${operation.label}" class="action-button">
- %endif
- %endfor
- </td>
- </tr>
- </tfoot>
- </table>
-</form>
diff -r 172548982c18 -r d2ad22e73b81 templates/library/browse_libraries.mako
--- a/templates/library/browse_libraries.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/library/browse_libraries.mako Fri Aug 14 09:22:31 2009 -0400
@@ -1,9 +1,9 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
-<%def name="title()">Browse Libraries</%def>
+<%def name="title()">Browse Data Libraries</%def>
-<h2>Libraries</h2>
+<h2>Data Libraries</h2>
%if msg:
${render_msg( msg, messagetype )}
diff -r 172548982c18 -r d2ad22e73b81 templates/library/browse_library.mako
--- a/templates/library/browse_library.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/library/browse_library.mako Fri Aug 14 09:22:31 2009 -0400
@@ -2,7 +2,7 @@
<%namespace file="/message.mako" import="render_msg" />
<% from galaxy import util %>
-<%def name="title()">Browse Library</%def>
+<%def name="title()">Browse data library</%def>
<%def name="stylesheets()">
<link href="${h.url_for('/static/style/base.css')}" rel="stylesheet" type="text/css" />
<link href="${h.url_for('/static/style/library.css')}" rel="stylesheet" type="text/css" />
@@ -211,7 +211,7 @@
%endfor
</%def>
-<h2>Library “${library.name}”</h2>
+<h2>Data Library “${library.name}”</h2>
<ul class="manage-table-actions">
%if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_ADD, library_item=library ):
diff -r 172548982c18 -r d2ad22e73b81 templates/library/folder_info.mako
--- a/templates/library/folder_info.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/library/folder_info.mako Fri Aug 14 09:22:31 2009 -0400
@@ -5,7 +5,7 @@
<br/><br/>
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/library/folder_permissions.mako
--- a/templates/library/folder_permissions.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/library/folder_permissions.mako Fri Aug 14 09:22:31 2009 -0400
@@ -5,7 +5,7 @@
<br/><br/>
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/library/ldda_edit_info.mako
--- a/templates/library/ldda_edit_info.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/library/ldda_edit_info.mako Fri Aug 14 09:22:31 2009 -0400
@@ -12,7 +12,7 @@
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/library/ldda_info.mako
--- a/templates/library/ldda_info.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/library/ldda_info.mako Fri Aug 14 09:22:31 2009 -0400
@@ -19,7 +19,7 @@
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/library/ldda_permissions.mako
--- a/templates/library/ldda_permissions.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/library/ldda_permissions.mako Fri Aug 14 09:22:31 2009 -0400
@@ -15,7 +15,7 @@
<br/><br/>
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/library/library_dataset_info.mako
--- a/templates/library/library_dataset_info.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/library/library_dataset_info.mako Fri Aug 14 09:22:31 2009 -0400
@@ -11,7 +11,7 @@
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/library/library_dataset_permissions.mako
--- a/templates/library/library_dataset_permissions.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/library/library_dataset_permissions.mako Fri Aug 14 09:22:31 2009 -0400
@@ -11,7 +11,7 @@
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/library/library_info.mako
--- a/templates/library/library_info.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/library/library_info.mako Fri Aug 14 09:22:31 2009 -0400
@@ -5,7 +5,7 @@
<br/><br/>
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library.id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library.id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/library/library_permissions.mako
--- a/templates/library/library_permissions.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/library/library_permissions.mako Fri Aug 14 09:22:31 2009 -0400
@@ -5,7 +5,7 @@
<br/><br/>
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library.id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library.id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/library/new_dataset.mako
--- a/templates/library/new_dataset.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/library/new_dataset.mako Fri Aug 14 09:22:31 2009 -0400
@@ -16,7 +16,7 @@
<br/><br/>
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
@@ -68,7 +68,7 @@
%elif upload_option == 'upload_directory':
<div class="form-row">
<%
- # Directories of files from the Libraries view are restricted to a
+ # Directories of files from the Data Libraries view are restricted to a
# sub-directory named the same as the current user's email address
# contained within the configured setting for user_library_import_dir
user_library_import_dir = os.path.join( trans.app.config.user_library_import_dir, trans.user.email )
diff -r 172548982c18 -r d2ad22e73b81 templates/library/new_folder.mako
--- a/templates/library/new_folder.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/library/new_folder.mako Fri Aug 14 09:22:31 2009 -0400
@@ -4,7 +4,7 @@
<br/<br/>
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/library/select_info_template.mako
--- a/templates/library/select_info_template.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/library/select_info_template.mako Fri Aug 14 09:22:31 2009 -0400
@@ -4,7 +4,7 @@
<br/><br/>
<ul class="manage-table-actions">
<li>
- <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
+ <a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
</li>
</ul>
diff -r 172548982c18 -r d2ad22e73b81 templates/requests/edit_request.mako
--- a/templates/requests/edit_request.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/requests/edit_request.mako Fri Aug 14 09:22:31 2009 -0400
@@ -58,7 +58,7 @@
<div class="form-row">
<label>${field['label']}</label>
${field['widget'].get_html()}
- %if field['label'] == 'Library' and new_library:
+ %if field['label'] == 'Data library' and new_library:
${new_library.get_html()}
%endif
<div class="toolParamHelp" style="clear: both;">
diff -r 172548982c18 -r d2ad22e73b81 templates/requests/new_request.mako
--- a/templates/requests/new_request.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/requests/new_request.mako Fri Aug 14 09:22:31 2009 -0400
@@ -58,7 +58,7 @@
<div class="form-row">
<label>${field['label']}</label>
${field['widget'].get_html()}
- %if field['label'] == 'Library' and new_library:
+ %if field['label'] == 'Data library' and new_library:
${new_library.get_html()}
%endif
<div class="toolParamHelp" style="clear: both;">
diff -r 172548982c18 -r d2ad22e73b81 templates/requests/show_request.mako
--- a/templates/requests/show_request.mako Thu Aug 13 12:19:00 2009 -0400
+++ b/templates/requests/show_request.mako Fri Aug 14 09:22:31 2009 -0400
@@ -79,7 +79,7 @@
%if not rd['value']:
<i>None</i>
%else:
- %if rd['label'] == 'Library':
+ %if rd['label'] == 'Data library':
%if rd['value']:
<a href="${h.url_for( controller='library', action='browse_library', id=request.library.id )}">${rd['value']}</a>
%else:
diff -r 172548982c18 -r d2ad22e73b81 test/functional/test_security_and_libraries.py
--- a/test/functional/test_security_and_libraries.py Thu Aug 13 12:19:00 2009 -0400
+++ b/test/functional/test_security_and_libraries.py Fri Aug 14 09:22:31 2009 -0400
@@ -1451,7 +1451,7 @@
check_edit_page2( latest_3_lddas )
self.home()
def test_195_upload_directory_of_files_from_libraries_view( self ):
- """Testing uploading a directory of files to a root folder from the Libraries view"""
+ """Testing uploading a directory of files to a root folder from the Data Libraries view"""
# admin_user will not have the option sto upload a directory of files from the
# Libraries view since a sub-directory named the same as their email is not contained
# in the configured user_library_import_dir. However, since members of role_one have
1
0
14 Aug '09
details: http://www.bx.psu.edu/hg/galaxy/rev/52ad5635f01a
changeset: 2558:52ad5635f01a
user: James Taylor <james(a)jamestaylor.org>
date: Thu Aug 13 11:27:45 2009 -0400
description:
Integrate 'rerun' support from Assaf Gordan. Not supported for all tools, but checking whether the link should be displayed is expensive currently, this can be improved ghopefully.
2 file(s) affected in this change:
lib/galaxy/web/controllers/tool_runner.py
templates/root/history_common.mako
diffs (118 lines):
diff -r ad5232a4dbc5 -r 52ad5635f01a lib/galaxy/web/controllers/tool_runner.py
--- a/lib/galaxy/web/controllers/tool_runner.py Thu Aug 13 11:00:00 2009 -0400
+++ b/lib/galaxy/web/controllers/tool_runner.py Thu Aug 13 11:27:45 2009 -0400
@@ -5,6 +5,7 @@
from galaxy.web.base.controller import *
from galaxy.util.bunch import Bunch
from galaxy.tools import DefaultToolState
+from galaxy.tools.parameters.basic import UnvalidatedValue
import logging
log = logging.getLogger( __name__ )
@@ -52,6 +53,80 @@
add_frame.wiki_url = trans.app.config.wiki_url
add_frame.from_noframe = True
return trans.fill_template( template, history=history, toolbox=toolbox, tool=tool, util=util, add_frame=add_frame, **vars )
+
+ @web.expose
+ def rerun( self, trans, id=None, from_noframe=None, **kwd ):
+ """
+ Given a HistoryDatasetAssociation id, find the job and that created
+ the dataset, extract the parameters, and display the appropriate tool
+ form with parameters already filled in.
+ """
+ if not id:
+ error( "'id' parameter is required" );
+ try:
+ id = int( id )
+ except:
+ error( "Invalid value for 'id' parameter" )
+ # Get the dataset object
+ data = trans.app.model.HistoryDatasetAssociation.get( id )
+ # Get the associated job, if any. If this hda was copied from another,
+ # we need to find the job that created the origial hda
+ job_hda = data
+ while job_hda.copied_from_history_dataset_association:
+ job_hda = job_hda.copied_from_history_dataset_association
+ if not job_hda.creating_job_associations:
+ error( "Could not find the job for this dataset" )
+ # Get the job object
+ job = None
+ for assoc in job_hda.creating_job_associations:
+ job = assoc.job
+ break
+ if not job:
+ raise Exception("Failed to get job information for dataset hid %d" % hid)
+ # Get the tool object
+ tool_id = job.tool_id
+ try:
+ # Load the tool
+ toolbox = self.get_toolbox()
+ tool = toolbox.tools_by_id.get( tool_id, None )
+ except:
+ #this is expected, so not an exception
+ error( "This dataset was created by an obsolete tool (%s). Can't re-run." % tool_id )
+ # Can't rerun upload, external data sources, et cetera. Workflow
+ # compatible will proxy this for now
+ if not tool.is_workflow_compatible:
+ error( "The '%s' tool does not currently support rerunning." % tool.name )
+ # Get the job's parameters
+ try:
+ params_objects = job.get_param_values( trans.app )
+ except:
+ raise Exception( "Failed to get paramemeters for dataset id %d " % hid )
+ # Unpack unvalidated values to strings, they'll be validated when the
+ # form is submitted (this happens when re-running a job that was
+ # initially run by a workflow)
+ validated_params = {}
+ for name, value in params_objects.items():
+ if isinstance( value, UnvalidatedValue ):
+ validated_params [ str(name) ] = str(value)
+ else:
+ validated_params [ str(name) ] = value
+ params_objects = validated_params
+ # Create a fake tool_state for the tool, with the parameters values
+ state = tool.new_state( trans )
+ state.inputs = params_objects
+ tool_state_string = util.object_to_string(state.encode(tool, trans.app))
+ # Setup context for template
+ history = trans.get_history()
+ template = "tool_form.mako"
+ vars = dict( tool_state=state, errors = {} )
+ # Is the "add frame" stuff neccesary here?
+ add_frame = AddFrameData()
+ add_frame.debug = trans.debug
+ if from_noframe is not None:
+ add_frame.wiki_url = trans.app.config.wiki_url
+ add_frame.from_noframe = True
+ return trans.fill_template( template, history=history, toolbox=toolbox, tool=tool, util=util, add_frame=add_frame, **vars )
+
@web.expose
def redirect( self, trans, redirect_url=None, **kwd ):
diff -r ad5232a4dbc5 -r 52ad5635f01a templates/root/history_common.mako
--- a/templates/root/history_common.mako Thu Aug 13 11:00:00 2009 -0400
+++ b/templates/root/history_common.mako Thu Aug 13 11:27:45 2009 -0400
@@ -51,9 +51,12 @@
<div>${_('Job is currently running')}</div>
%elif data_state == "error":
<div>
- An error occurred running this job: <i>${data.display_info().strip()}</i>,
- <a href="${h.url_for( controller='dataset', action='errors', id=data.id )}" target="galaxy_main">report this error</a>
+ An error occurred running this job: <i>${data.display_info().strip()}</i>
</div>
+ <div>
+ <a href="${h.url_for( controller='dataset', action='errors', id=data.id )}" target="galaxy_main">report this error</a>
+ | <a href="${h.url_for( controller='tool_runner', action='rerun', id=data.id )}" target="galaxy_main">rerun</a>
+ </div>
%elif data_state == "discarded":
<div>
The job creating this dataset was cancelled before completion.
@@ -77,6 +80,7 @@
<div>
%if data.has_data:
<a href="${h.url_for( action='display', id=data.id, tofile='yes', toext=data.ext )}" target="_blank">save</a>
+ | <a href="${h.url_for( controller='tool_runner', action='rerun', id=data.id )}" target="galaxy_main">rerun</a>
%for display_app in data.datatype.get_display_types():
<% display_links = data.datatype.get_display_links( data, display_app, app, request.base ) %>
%if len( display_links ) > 0:
1
0
14 Aug '09
details: http://www.bx.psu.edu/hg/galaxy/rev/ad5232a4dbc5
changeset: 2557:ad5232a4dbc5
user: Dan Blankenberg <dan(a)bx.psu.edu>
date: Thu Aug 13 11:00:00 2009 -0400
description:
When setting metadata external is configured, using the 'Auto-detect' function on a hda will now launch an external job process.
13 file(s) affected in this change:
lib/galaxy/app.py
lib/galaxy/datatypes/registry.py
lib/galaxy/jobs/__init__.py
lib/galaxy/jobs/runners/local.py
lib/galaxy/model/__init__.py
lib/galaxy/tools/__init__.py
lib/galaxy/tools/actions/metadata.py
lib/galaxy/tools/actions/upload.py
lib/galaxy/web/controllers/root.py
static/june_2007_style/blue/history.css
static/june_2007_style/history.css.tmpl
templates/mobile/history/detail.mako
templates/root/history_common.mako
diffs (287 lines):
diff -r 846f6a7ee80c -r ad5232a4dbc5 lib/galaxy/app.py
--- a/lib/galaxy/app.py Wed Aug 12 15:56:03 2009 -0400
+++ b/lib/galaxy/app.py Thu Aug 13 11:00:00 2009 -0400
@@ -37,6 +37,8 @@
self.toolbox = tools.ToolBox( self.config.tool_config, self.config.tool_path, self )
# Load datatype converters
self.datatypes_registry.load_datatype_converters( self.toolbox )
+ #load external metadata tool
+ self.datatypes_registry.load_external_metadata_tool( self.toolbox )
# Load datatype indexers
self.datatypes_registry.load_datatype_indexers( self.toolbox )
#Load security policy
diff -r 846f6a7ee80c -r ad5232a4dbc5 lib/galaxy/datatypes/registry.py
--- a/lib/galaxy/datatypes/registry.py Wed Aug 12 15:56:03 2009 -0400
+++ b/lib/galaxy/datatypes/registry.py Thu Aug 13 11:00:00 2009 -0400
@@ -1,7 +1,7 @@
"""
Provides mapping between extensions and datatypes, mime-types, etc.
"""
-import os
+import os, tempfile
import logging
import data, tabular, interval, images, sequence, qualityscore, genetics, xml, coverage, tracks, chrominfo
import galaxy.util
@@ -18,6 +18,7 @@
self.datatype_converters = odict()
self.datatype_indexers = odict()
self.converters = []
+ self.set_external_metadata_tool = None
self.indexers = []
self.sniff_order = []
self.upload_file_formats = []
@@ -251,6 +252,31 @@
self.datatype_converters[source_datatype][target_datatype] = converter
self.log.debug( "Loaded converter: %s", converter.id )
+ def load_external_metadata_tool( self, toolbox ):
+ """Adds a tool which is used to set external metadata"""
+ #we need to be able to add a job to the queue to set metadata. The queue will currently only accept jobs with an associated tool.
+ #We'll create a special tool to be used for Auto-Detecting metadata; this is less than ideal, but effective
+ #Properly building a tool without relying on parsing an XML file is near impossible...so we'll create a temporary file
+ tool_xml_text = """
+ <tool id="__SET_METADATA__" name="Set External Metadata" version="1.0.0" tool_type="set_metadata">
+ <type class="SetMetadataTool" module="galaxy.tools"/>
+ <action module="galaxy.tools.actions.metadata" class="SetMetadataToolAction"/>
+ <command>$__SET_EXTERNAL_METADATA_COMMAND_LINE__</command>
+ <inputs>
+ <param format="data" name="input1" type="data" label="File to set metadata on."/>
+ <param name="__ORIGINAL_DATASET_STATE__" type="hidden" value=""/>
+ <param name="__SET_EXTERNAL_METADATA_COMMAND_LINE__" type="hidden" value=""/>
+ </inputs>
+ </tool>
+ """
+ tmp_name = tempfile.NamedTemporaryFile()
+ tmp_name.write( tool_xml_text )
+ tmp_name.flush()
+ set_meta_tool = toolbox.load_tool( tmp_name.name )
+ toolbox.tools_by_id[ set_meta_tool.id ] = set_meta_tool
+ self.set_external_metadata_tool = set_meta_tool
+ self.log.debug( "Loaded external metadata tool: %s", self.set_external_metadata_tool.id )
+
def load_datatype_indexers( self, toolbox ):
"""Adds indexers from self.indexers to the toolbox from app"""
for elem in self.indexers:
diff -r 846f6a7ee80c -r ad5232a4dbc5 lib/galaxy/jobs/__init__.py
--- a/lib/galaxy/jobs/__init__.py Wed Aug 12 15:56:03 2009 -0400
+++ b/lib/galaxy/jobs/__init__.py Thu Aug 13 11:00:00 2009 -0400
@@ -274,7 +274,7 @@
elif idata.state == idata.states.ERROR:
job_wrapper.fail( "input data %d is in error state" % ( idata.hid ) )
return JOB_INPUT_ERROR
- elif idata.state != idata.states.OK:
+ elif idata.state != idata.states.OK and not ( idata.state == idata.states.SETTING_METADATA and job.tool_id is not None and job.tool_id == self.app.datatypes_registry.set_external_metadata_tool.id ):
# need to requeue
return JOB_WAIT
return JOB_READY
@@ -543,7 +543,7 @@
# Certain tools require tasks to be completed after job execution
# ( this used to be performed in the "exec_after_process" hook, but hooks are deprecated ).
if self.tool.tool_type is not None:
- self.tool.exec_after_process( self.queue.app, inp_data, out_data, param_dict )
+ self.tool.exec_after_process( self.queue.app, inp_data, out_data, param_dict, job = job )
# Call 'exec_after_process' hook
self.tool.call_hook( 'exec_after_process', self.queue.app, inp_data=inp_data,
out_data=out_data, param_dict=param_dict,
diff -r 846f6a7ee80c -r ad5232a4dbc5 lib/galaxy/jobs/runners/local.py
--- a/lib/galaxy/jobs/runners/local.py Wed Aug 12 15:56:03 2009 -0400
+++ b/lib/galaxy/jobs/runners/local.py Thu Aug 13 11:00:00 2009 -0400
@@ -104,7 +104,7 @@
#run the metadata setting script here
#this is terminatable when output dataset/job is deleted
#so that long running set_meta()s can be cancelled without having to reboot the server
- if job_wrapper.get_state() not in [ model.Job.states.ERROR, model.Job.states.DELETED ] and self.app.config.set_metadata_externally:
+ if job_wrapper.get_state() not in [ model.Job.states.ERROR, model.Job.states.DELETED ] and self.app.config.set_metadata_externally and job_wrapper.output_paths:
external_metadata_script = job_wrapper.setup_external_metadata( output_fnames = job_wrapper.get_output_fnames(), kwds = { 'overwrite' : False } ) #we don't want to overwrite metadata that was copied over in init_meta(), as per established behavior
log.debug( 'executing external set_meta script for job %d: %s' % ( job_wrapper.job_id, external_metadata_script ) )
external_metadata_proc = subprocess.Popen( args = external_metadata_script,
diff -r 846f6a7ee80c -r ad5232a4dbc5 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py Wed Aug 12 15:56:03 2009 -0400
+++ b/lib/galaxy/model/__init__.py Thu Aug 13 11:00:00 2009 -0400
@@ -330,7 +330,8 @@
OK = 'ok',
EMPTY = 'empty',
ERROR = 'error',
- DISCARDED = 'discarded' )
+ DISCARDED = 'discarded',
+ SETTING_METADATA = 'setting_metadata' )
permitted_actions = get_permitted_actions( filter='DATASET' )
file_path = "/tmp/"
engine = None
diff -r 846f6a7ee80c -r ad5232a4dbc5 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py Wed Aug 12 15:56:03 2009 -0400
+++ b/lib/galaxy/tools/__init__.py Thu Aug 13 11:00:00 2009 -0400
@@ -1468,7 +1468,7 @@
out_data[ name ] = data
return out_data
- def exec_after_process( self, app, inp_data, out_data, param_dict ):
+ def exec_after_process( self, app, inp_data, out_data, param_dict, job = None ):
if self.tool_type == 'data_source':
name, data = out_data.items()[0]
data.set_size()
@@ -1572,6 +1572,18 @@
dataset.history.add( new_data )
new_data.flush()
return primary_datasets
+
+class SetMetadataTool( Tool ):
+ def exec_after_process( self, app, inp_data, out_data, param_dict, job = None ):
+ for name, dataset in inp_data.iteritems():
+ external_metadata = galaxy.datatypes.metadata.JobExternalOutputMetadataWrapper( job )
+ if external_metadata.external_metadata_set_successfully( dataset ):
+ dataset.metadata.from_JSON_dict( external_metadata.get_output_filenames_by_dataset( dataset ).filename_out )
+ # If setting external metadata has failed, how can we inform the user?
+ # For now, we'll leave the default metadata and set the state back to its original.
+ dataset.datatype.after_edit( dataset )
+ dataset.state = param_dict.get( '__ORIGINAL_DATASET_STATE__' )
+ dataset.flush()
# ---- Utility classes to be factored out -----------------------------------
diff -r 846f6a7ee80c -r ad5232a4dbc5 lib/galaxy/tools/actions/metadata.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/galaxy/tools/actions/metadata.py Thu Aug 13 11:00:00 2009 -0400
@@ -0,0 +1,48 @@
+from . import ToolAction
+from galaxy.datatypes.metadata import JobExternalOutputMetadataWrapper
+
+import logging
+log = logging.getLogger( __name__ )
+
+class SetMetadataToolAction( ToolAction ):
+ """Tool action used for setting external metadata on an existing dataset"""
+
+ def execute( self, tool, trans, incoming = {}, set_output_hid = False ):
+ for name, value in incoming.iteritems():
+ if isinstance( value, trans.app.model.HistoryDatasetAssociation ):
+ dataset = value
+ dataset_name = name
+ break
+ else:
+ raise Exception( 'The dataset to set metadata on could not be determined.' )
+
+ # Create the job object
+ job = trans.app.model.Job()
+ job.session_id = trans.get_galaxy_session().id
+ job.history_id = trans.history.id
+ job.tool_id = tool.id
+ try:
+ # For backward compatibility, some tools may not have versions yet.
+ job.tool_version = tool.version
+ except:
+ job.tool_version = "1.0.0"
+ job.flush() #ensure job.id is available
+
+ #add parameters to job_parameter table
+ incoming[ '__ORIGINAL_DATASET_STATE__' ] = dataset.state #store original dataset state, so we can restore it. A seperate table might be better (no chance of 'loosing' the original state)?
+ external_metadata_wrapper = JobExternalOutputMetadataWrapper( job )
+ cmd_line = external_metadata_wrapper.setup_external_metadata( dataset, exec_dir = None, tmp_dir = trans.app.config.new_file_path, dataset_files_path = trans.app.model.Dataset.file_path, output_fnames = None, config_root = None, datatypes_config = None, kwds = { 'overwrite' : True } )
+ incoming[ '__SET_EXTERNAL_METADATA_COMMAND_LINE__' ] = cmd_line
+ for name, value in tool.params_to_strings( incoming, trans.app ).iteritems():
+ job.add_parameter( name, value )
+ #add the dataset to job_to_input_dataset table
+ job.add_input_dataset( dataset_name, dataset )
+ #Need a special state here to show that metadata is being set and also allow the job to run
+ # i.e. if state was set to 'running' the set metadata job would never run, as it would wait for input (the dataset to set metadata on) to be in a ready state
+ dataset.state = dataset.states.SETTING_METADATA
+ trans.app.model.flush()
+
+ # Queue the job for execution
+ trans.app.job_queue.put( job.id, tool )
+ trans.log_event( "Added set external metadata job to the job queue, id: %s" % str(job.id), tool_id=job.tool_id )
+ return []
diff -r 846f6a7ee80c -r ad5232a4dbc5 lib/galaxy/tools/actions/upload.py
--- a/lib/galaxy/tools/actions/upload.py Wed Aug 12 15:56:03 2009 -0400
+++ b/lib/galaxy/tools/actions/upload.py Thu Aug 13 11:00:00 2009 -0400
@@ -1,4 +1,5 @@
import os, shutil, urllib, StringIO, re, gzip, tempfile, shutil, zipfile
+from . import ToolAction
from galaxy import datatypes, jobs
from galaxy.datatypes import sniff
from galaxy import model, util
@@ -8,7 +9,7 @@
import logging
log = logging.getLogger( __name__ )
-class UploadToolAction( object ):
+class UploadToolAction( ToolAction ):
# Action for uploading files
def __init__( self ):
self.empty = False
diff -r 846f6a7ee80c -r ad5232a4dbc5 lib/galaxy/web/controllers/root.py
--- a/lib/galaxy/web/controllers/root.py Wed Aug 12 15:56:03 2009 -0400
+++ b/lib/galaxy/web/controllers/root.py Thu Aug 13 11:00:00 2009 -0400
@@ -297,10 +297,15 @@
if name not in [ 'name', 'info', 'dbkey' ]:
if spec.get( 'default' ):
setattr( data.metadata, name, spec.unwrap( spec.get( 'default' ) ) )
- data.set_meta()
- data.datatype.after_edit( data )
+ if trans.app.config.set_metadata_externally:
+ msg = 'Attributes have been queued to be updated'
+ trans.app.datatypes_registry.set_external_metadata_tool.tool_action.execute( trans.app.datatypes_registry.set_external_metadata_tool, trans, incoming = { 'input1':data } )
+ else:
+ msg = 'Attributes updated'
+ data.set_meta()
+ data.datatype.after_edit( data )
trans.app.model.flush()
- return trans.show_ok_message( "Attributes updated", refresh_frames=['history'] )
+ return trans.show_ok_message( msg, refresh_frames=['history'] )
elif params.convert_data:
target_type = kwd.get("target_type", None)
if target_type:
diff -r 846f6a7ee80c -r ad5232a4dbc5 static/june_2007_style/blue/history.css
--- a/static/june_2007_style/blue/history.css Wed Aug 12 15:56:03 2009 -0400
+++ b/static/june_2007_style/blue/history.css Thu Aug 13 11:00:00 2009 -0400
@@ -13,6 +13,8 @@
div.historyItem-empty .state-icon{background:url(history-states.png) no-repeat 0px -25px;}
div.historyItem-running{border-color:#AAAA66;background:#FFFFCC;}
div.historyItem-running .state-icon{background-image:url(data_running.gif);}
+div.historyItem-setting_metadata{border-color:#AAAA66;background:#FFFFCC;}
+div.historyItem-setting_metadata .state-icon{background-image:url(data_running.gif);}
div.historyItem-upload{border-color:#6666AA;background:#CCCCFF;}
div.historyItem-upload .state-icon{background-image:url(data_upload.gif);}
div.historyItem-queued{background:#EEEEEE;}
diff -r 846f6a7ee80c -r ad5232a4dbc5 static/june_2007_style/history.css.tmpl
--- a/static/june_2007_style/history.css.tmpl Wed Aug 12 15:56:03 2009 -0400
+++ b/static/june_2007_style/history.css.tmpl Thu Aug 13 11:00:00 2009 -0400
@@ -72,6 +72,14 @@
}
div.historyItem-running {
+ border-color: $history_running_border;
+ background: $history_running_bg;
+ .state-icon {
+ background-image: url(data_running.gif);
+ }
+}
+
+div.historyItem-setting_metadata {
border-color: $history_running_border;
background: $history_running_bg;
.state-icon {
diff -r 846f6a7ee80c -r ad5232a4dbc5 templates/mobile/history/detail.mako
--- a/templates/mobile/history/detail.mako Wed Aug 12 15:56:03 2009 -0400
+++ b/templates/mobile/history/detail.mako Thu Aug 13 11:00:00 2009 -0400
@@ -51,6 +51,8 @@
<div>
The job creating this dataset was cancelled before completion.
</div>
+ %elif data_state == 'setting_metadata':
+ <div>Metadata is being Auto-Detected.</div>
%elif data_state == "empty":
<div>No data: <i>${data.display_info()}</i></div>
%elif data_state == "ok":
diff -r 846f6a7ee80c -r ad5232a4dbc5 templates/root/history_common.mako
--- a/templates/root/history_common.mako Wed Aug 12 15:56:03 2009 -0400
+++ b/templates/root/history_common.mako Thu Aug 13 11:00:00 2009 -0400
@@ -58,6 +58,8 @@
<div>
The job creating this dataset was cancelled before completion.
</div>
+ %elif data_state == 'setting_metadata':
+ <div>${_('Metadata is being Auto-Detected.')}</div>
%elif data_state == "empty":
<div>${_('No data: ')}<i>${data.display_info()}</i></div>
%elif data_state == "ok":
1
0
Hello,
I've recently upgrade to the latest version, and after Greg and Ross explained the security model (in small words, so I'll understand), I played a bit with the new model.
I have some usability issue with the new way sharing histories work.
It might be because we are relatively a small and tight user base, and the model was designed to work with disperse teams from around them world, where security must be enforced by an appointed security administrator. We don't have security administrator. We need galaxy to be secured, but without the hassle of administration - and everything should 'just work'.
The following describe four issues (the description is exaggerated on purpose, please take no offense)
Regards,
gordon.
1) Steps needed to share histories
----------------------------------
Usage scenario: User A wants to share datasets with User B.
'Old way' (with public datasets, no security):
1. Login as User A.
2. Select History.
3. Click "options"
4. Click "share this history"
5. Enter email of user B
6. Click "Share".
Outcome:
user B has the new history in his histories list, and can view all files.
'New way' (still with public datasets, no security):
1. Login as User A.
2. Select History.
3. Click "Options"
4. click "share"
5. Enter email of user B.
6. click "share"
Outcome:
user B doesn't have the history in his histories list.
What User B needs to do:
1. click "options"
2. click the *other* list link (there are two of them, both named 'link', and one has to actually read the rest of the sentence to know what's the different between them).
3. Find the needed shared history, no dates or options to sort by.
4. click on the tiny triangle button, which will show a pop-up menu with only one button 'clone' (which he's going to click anyway, so why not make it available as a huge button on the main page?).
5. click 'clone'.
6. User sees a technical question about cloning deleted items. there's no default selection, so you can't just click "clone". you have to read and understand what's going on.
Don't underestimate the annoyance of this:
You advertise galaxy as easy to use for biologists, who don't need to understand the technical aspects - so why make them read technical details and choose these options?
7. Only then, the shared+cloned history appears in the history list.
With security model in place (meaning datasets are not public), things get more confusing.
User A wants to share history with user B.
User A's implied wish: "I want User B to view my files".
When User A clicks "share", enters the email and click "share", he is then presented with four permission related options.
The last one is "Don't Share".
This is kind of funny. it reminds me of clicking the "start" button to shutdown the computer in you-know-which operating system.
The scenario of selecting "Don't Share" and clicking "Go" button - this is a no-op. why is it needed ?
If this wasn't a web-application - then yes, this modal dialog would require a 'cancel' button.
But this is a web-application. just click on another link instead of clicking "go".
A "go" button implies something will be done.
The second-to-last is "Share Anyway (don't change any permission)".
This is a problem waiting to happen - you are explicitly allowing the user to do something that you know will not work.
>From a technical perspective, that's OK - a knowledgeable user can later on manually set permissions, or can later on whine to the administrator about permission problems (or my favorite: User A tells User B to ask the admin to give him permissions).
IMHO, a program should not allow a user to do anything that will definitely not work.
The first option is "make datasets public".
This is bad option for two reasons:
1. User A don't want to make his datasets public (otherwise he would not set permissions on them). All he wants is to allow User B to view his files.
2. If permissions problem persist, Users will get accustomed to just 'make everything public' because that's the easy solution. and this will make the whole security thing redundant.
Also remember that PUBLIC means anybody can view them - anybody, not just people you shared it with. This is not obvious. this means "no security".
The second option is "make datasets private to me and the user...".
This seems like what the user actually wants, but it has strange side effects (see item 3, below).
2) Deleting shared history
--------------------------
Scenario: User A wants to delete the current history.
the history happens to be shared.
1. Click "options"
2. Click "delete current history"
3. Message box appears: "Are you sure?". click yes.
4. Red warning appears: "History has been shared, unshare it before deleting it".
1. There's no link to 'unshare' it, how do I do that?
There's no "unshare" button anywhere.
You have to go the the list of histories, find the history in the list, click on the "shared" link, then "unshare" it.
quite unintuitive...
2. If I shared the history with twenty users, I need to click the little triangle button and then the "unshare" link for each of them.
quite annoying.
Why not have an "unshare all" button ?
3. There's no confirmation needed to unshare a history, no user intervention.
So theoretically, there's no reason that a "delete" operation would not automatically unshare all shares, then delete the history.
5. This is the real confusing part:
To me, "share" means: "allow other users to view the files in this history",
and "unshare" means: "don't allow other users to view the files in the history".
But in the new galaxy model, "share" means: allow other users to clone the history and then view my files",
and "unshare" means: "don't allow other users to clone (or clone again) the history".
The old galaxy had no concept of "unshare" - and that's logical - once you shared your files - you can't take them away.
In the new Galaxy, "unshare" is not really unsharing: if another user has cloned the shared history, he still has access to your files (de-facto: they are still shared).
the other user simply can't clone your history again.
--------
3) Side Effect of Ad-Hoc sharing roles
---------------------------------------
Here are the exact steps I made, and two problems that happen with them.
##
## Creating base configuration
##
$ hg clone http://www.bx.psu.edu/hg/galaxy galaxy1
$ cd galaxy1
# (my default is python 2.6, too bad for me)
$ sed -i 's/^python /python2.5 /' run.sh
$ sed -i 's/^python /python2.5 /' setup.sh
$ sh setup.sh
$ sh run.sh
---
In galaxy
#
# First user
#
User -> Register
username: gordon1(a)cshl.edu
User -> Preferences -> Change Default Permissions for new histories
Roles Associated: [Added 'gordon1(a)cshl.edu']
(click 'save')
User -> Logout
#
# Second User
#
User -> Register
username: gordon2(a)cshl.edu
User -> Preferences -> Change Default Permissions for new histories
Roles Associated: [Added 'gordon2(a)cshl.edu']
(click 'save')
User -> Logout
#
# Third User
#
User -> Register
username: gordon3(a)cshl.edu
User -> Preferences -> Change Default Permissions for new histories
Roles Associated: [Added 'gordon3(a)cshl.edu']
(click 'save')
User -> Logout
-------------------
This is the base configuration.
The following test cases start from this configuration.
-------------------
User->Login username: gordon1(a)cshl.edu
# History 1
Options -> delete current history (because of subtle permission issue, see item 4, below)
Rename History: "His 1 of Gordon1"
Get Data->Upload File: (pasted text: "Data 1 of His 1 of Gordon 1")
Rename Dataset to "Data 1 of His 1 of Gordon 1"
Options -> Share Current History
Username: 'gordon2(a)cshl.edu'
(click 'submit')
Permissions dialog: How would you like to proceed?
- "Make datasets private to me and the users ..." (option 2)
(click 'go')
# Note: the second file is uploaded AFTER the share.
Get Data->Upload File: (pasted text: "Data 2 of His 1 of Gordon 1")
Rename Dataset to "Data 2 of His 1 of Gordon 1"
User -> Logout
#
# New as the second user
#
User->Login username: gordon2(a)cshl.edu
Options->List Shared histories (the 'other' list link)
(seeing two histories shared from gordon1)
On "His1", click the little triangle button, then 'clone'.
Select "clone all history items" (option 1), click "clone"
Options -> List
(two histories, 1 unnamed, and one cloned).
Switch to the cloned history.
#
# Problem 1:
#
In the second user's history pane:
The first dataset is OK, the second one is blocked.
Technically this is correct, because the second dataset was created after the share, and the new ad-hoc role was not applied to it.
but from a usability POV, this is confusing - the history was cloned by the second user AFTER the first user created the files.
In real life:
1. User A shares a History with User B.
2. User A adds more files to the history
3. User A tells user B: "I've added more files, clone the history again"
4. User B clones the history (with the new items), but the new items are blocked.
In the 'previous' version of galaxy (before the changeset that introduced the share mechanism), the "share" action literally meant "Copy the current content of the this history to other users" - and you could do it multiple times, with different contents of the same history. This is not the case anymore.
Also, going back to the first user (gordon1) and re-sharing the history doesn't work (a red warning appears that this history is already shared). A non-technical user (who doesn't care about roles/groups/permissions and just wants things to work) will be very frustrated. The technical solution of visiting every dataset and adding the role is maybe good for one or two datasets, but not to twelve datasets that were created by a workflow.
#
# Problem 2 :
# (this might be a bug)
# continuing from the previously described state
User -> Logout
User -> Login, username: gordon1(a)cshl.edu (first user)
Options -> List Histories
Switch to "His 1 of Gordon1"
This history contains two datasets:
Dataset 1 ( "Data 1 of His 1 Of Gordon 1" ) has:
[access] roles associated: "Sharing role for: gordon1(a)cshl.edu, gordon2(a)cshl.edu"
roles not associated: "gordon1(a)cshl.edu"
Dataset 2 ( "Data 2 of his 1 of gordon 1") has:
[access] roles associated: "gordon1(a)cshl.edu"
roles not associated: "sharing role for: gordon1(a)cshl.edu, gordon2(a)cshl.edu".
Options -> Share
username: gordon3(a)cshl.edu (third user)
(click 'submit')
Permissions dialog: How would you like to proceed?
- "Make datasets private to me and the users ..." (option 2)
(click 'go')
The roles of all the datasets is reset to 'sharing role for: gordon1(a)cshl.edu, gordon3(a)cshl.edu"
Meaning that the second user (gordon2), which was previously allowed to view at least one dataset,
is now deprived of even this privilege.
Even if this is technically correct, from a usability POV it is very confusing.
What the first user did:
1. share history with second user (implied: I want the second user to view my files).
2. share history with third user (implied: I want the third user to also view my files).
But the outcome is that the second user is now blocked.
4) Subtle security bug/feature:
-------------------------------
The first time a NEW user logs on, an empty history is created.
Going to USER->Preferences->Change default permissions
Does not change the permissions of current history, and there's no button to create a new history (because this is an empty history).
So the files in the current history will be public.
While technically correct, this behavior is confusing.
What the user wants is: "everything I create from now on has X permissions",
But what technically is done is: "New histories will have X permissions, but you are currently in an old history which uses the old settings".
---------------------------
Thanks for reading so far.
2
3
12 Aug '09
details: http://www.bx.psu.edu/hg/galaxy/rev/846f6a7ee80c
changeset: 2556:846f6a7ee80c
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Wed Aug 12 15:56:03 2009 -0400
description:
1) Enhancements for sharing histories based on feedback from Assaf Gordon ( resolves ticket # 125 ):
- Make "Histories shared with you by others" page a grid
- Eliminate the option to clone deleted or all items for the user to which the history has been shared
- Eliminate the "don't share" option when sharing histories
- When the "share anyway" option is chosen, make sure there is something in "no_change_needed" dict
2) Fix library view template display for ldda information page ( resolves ticket 128 )
13 file(s) affected in this change:
lib/galaxy/web/controllers/admin.py
lib/galaxy/web/controllers/history.py
lib/galaxy/web/controllers/library.py
lib/galaxy/web/framework/helpers/grids.py
templates/admin/requests/grid.mako
templates/history/grid.mako
templates/history/list_shared.mako
templates/history/options.mako
templates/history/share.mako
templates/history/shared_grid.mako
templates/history/stored_grid.mako
test/base/twilltestcase.py
test/functional/test_history_functions.py
diffs (1262 lines):
diff -r 2630316ff75e -r 846f6a7ee80c lib/galaxy/web/controllers/admin.py
--- a/lib/galaxy/web/controllers/admin.py Tue Aug 11 16:56:47 2009 -0400
+++ b/lib/galaxy/web/controllers/admin.py Wed Aug 12 15:56:03 2009 -0400
@@ -1214,7 +1214,6 @@
template = info_association.template
# See if we have any field contents
info = info_association.info
- log.debug("####In library_dataset_dataset_association, info.content: %s" % str( info.content))
if info:
field_contents = {}
for index, value in enumerate( info.content ):
diff -r 2630316ff75e -r 846f6a7ee80c lib/galaxy/web/controllers/history.py
--- a/lib/galaxy/web/controllers/history.py Tue Aug 11 16:56:47 2009 -0400
+++ b/lib/galaxy/web/controllers/history.py Wed Aug 12 15:56:03 2009 -0400
@@ -12,7 +12,6 @@
# States for passing messages
SUCCESS, INFO, WARNING, ERROR = "done", "info", "warning", "error"
-
class HistoryListGrid( grids.Grid ):
# Custom column types
@@ -70,8 +69,43 @@
def apply_default_filter( self, trans, query ):
return query.filter_by( user=trans.user, purged=False )
+class SharedHistoryListGrid( grids.Grid ):
+ # Custom column types
+ class DatasetsByStateColumn( grids.GridColumn ):
+ def get_value( self, trans, grid, history ):
+ rval = []
+ for state in ( 'ok', 'running', 'queued', 'error' ):
+ total = sum( 1 for d in history.active_datasets if d.state == state )
+ if total:
+ rval.append( '<div class="count-box state-color-%s">%s</div>' % ( state, total ) )
+ else:
+ rval.append( '' )
+ return rval
+ class SharedByColumn( grids.GridColumn ):
+ def get_value( self, trans, grid, history ):
+ return history.user.email
+ # Grid definition
+ title = "Histories shared with you by others"
+ model_class = model.History
+ default_sort_key = "-update_time"
+ columns = [
+ grids.GridColumn( "Name", key="name" ),
+ DatasetsByStateColumn( "Datasets (by state)", ncells=4 ),
+ grids.GridColumn( "Created", key="create_time", format=time_ago ),
+ grids.GridColumn( "Last Updated", key="update_time", format=time_ago ),
+ SharedByColumn( "Shared by", key="user_id" )
+ ]
+ operations = [
+ grids.GridOperation( "Clone" ),
+ grids.GridOperation( "Unshare" )
+ ]
+ standard_filters = []
+ def build_initial_query( self, session ):
+ return session.query( self.model_class ).join( 'users_shared_with' )
+ def apply_default_filter( self, trans, query ):
+ return query.filter( model.HistoryUserShareAssociation.user == trans.user )
+
class HistoryController( BaseController ):
-
@web.expose
def index( self, trans ):
return ""
@@ -80,7 +114,8 @@
"""XML history list for functional tests"""
return trans.fill_template( "/history/list_as_xml.mako" )
- list_grid = HistoryListGrid()
+ stored_list_grid = HistoryListGrid()
+ shared_list_grid = SharedHistoryListGrid()
@web.expose
@web.require_login( "work with multiple histories" )
@@ -91,7 +126,6 @@
if 'operation' in kwargs:
history_ids = util.listify( kwargs.get( 'id', [] ) )
histories = []
- shared_by_others = []
operation = kwargs['operation'].lower()
if operation == "share":
return self.share( trans, **kwargs )
@@ -127,7 +161,7 @@
status, message = self._list_undelete( trans, histories )
trans.sa_session.flush()
# Render the list view
- return self.list_grid( trans, status=status, message=message, template='/history/grid.mako', **kwargs )
+ return self.stored_list_grid( trans, status=status, message=message, template='/history/stored_grid.mako', **kwargs )
def _list_delete( self, trans, histories ):
"""Delete histories"""
n_deleted = 0
@@ -195,18 +229,38 @@
# No message
return None, None
@web.expose
- def list_shared( self, trans, **kwd ):
+ def list_shared( self, trans, **kwargs ):
"""List histories shared with current user by others"""
- params = util.Params( kwd )
- msg = util.restore_text( params.get( 'msg', '' ) )
- shared_by_others = trans.sa_session \
- .query( model.HistoryUserShareAssociation ) \
- .filter_by( user=trans.user ) \
- .join( 'history' ) \
- .filter( model.History.deleted == False ) \
- .order_by( desc( model.History.update_time ) ) \
- .all()
- return trans.fill_template( "/history/list_shared.mako", shared_by_others=shared_by_others, msg=msg, messagetype='done' )
+ msg = util.restore_text( kwargs.get( 'msg', '' ) )
+ status = message = None
+ if 'operation' in kwargs:
+ id = kwargs.get( 'id', None )
+ operation = kwargs['operation'].lower()
+ if operation == "clone":
+ if not id:
+ message = "Select a history to clone"
+ return self.shared_list_grid( trans, status='error', message=message, template='/history/shared_grid.mako', **kwargs )
+ # When cloning shared histories, only copy active datasets
+ new_kwargs = { 'clone_choice' : 'active' }
+ return self.clone( trans, id, **new_kwargs )
+ elif operation == 'unshare':
+ if not id:
+ message = "Select a history to unshare"
+ return self.shared_list_grid( trans, status='error', message=message, template='/history/shared_grid.mako', **kwargs )
+ ids = util.listify( id )
+ histories = []
+ for history_id in ids:
+ history = get_history( trans, history_id, check_ownership=False )
+ histories.append( history )
+ for history in histories:
+ # Current user is the user with which the histories were shared
+ association = trans.app.model.HistoryUserShareAssociation.filter_by( user=trans.user, history=history ).one()
+ association.delete()
+ association.flush()
+ message = "Unshared %d shared histories" % len( ids )
+ status = 'done'
+ # Render the list view
+ return self.shared_list_grid( trans, status=status, message=message, template='/history/shared_grid.mako', **kwargs )
@web.expose
def delete_current( self, trans ):
"""Delete just the active history -- this does not require a logged in user."""
@@ -323,6 +377,9 @@
can_change, cannot_change, no_change_needed, unique_no_change_needed, send_to_err = \
self._populate_restricted( trans, user, histories, send_to_users, None, send_to_err, unique=True )
send_to_err += err_msg
+ if cannot_change and not no_change_needed and not can_change:
+ send_to_err = "The histories you are sharing do not contain any datasets that can be accessed by the users with which you are sharing."
+ return trans.fill_template( "/history/share.mako", histories=histories, email=email, send_to_err=send_to_err )
if can_change or cannot_change:
return trans.fill_template( "/history/share.mako",
histories=histories,
@@ -350,8 +407,6 @@
email=email,
err_msg=err_msg,
share_button=True ) )
- if action == "no_share":
- trans.response.send_redirect( url_for( controller='root', action='history_options' ) )
user = trans.get_user()
histories, send_to_users, send_to_err = self._get_histories_and_users( trans, user, id, email )
send_to_err = ''
@@ -629,29 +684,38 @@
@web.expose
@web.require_login( "clone shared Galaxy history" )
def clone( self, trans, id, **kwd ):
- history = get_history( trans, id, check_ownership=False )
+ """Clone a list of histories"""
params = util.Params( kwd )
+ ids = util.listify( id )
+ histories = []
+ for history_id in ids:
+ history = get_history( trans, history_id, check_ownership=False )
+ histories.append( history )
clone_choice = params.get( 'clone_choice', None )
if not clone_choice:
return trans.fill_template( "/history/clone.mako", history=history )
user = trans.get_user()
- if history.user == user:
- owner = True
+ for history in histories:
+ if history.user == user:
+ owner = True
+ else:
+ if trans.sa_session.query( trans.app.model.HistoryUserShareAssociation ) \
+ .filter_by( user=user, history=history ).count() == 0:
+ return trans.show_error_message( "The history you are attempting to clone is not owned by you or shared with you. " )
+ owner = False
+ name = "Clone of '%s'" % history.name
+ if not owner:
+ name += " shared by '%s'" % history.user.email
+ if clone_choice == 'activatable':
+ new_history = history.copy( name=name, target_user=user, activatable=True )
+ elif clone_choice == 'active':
+ name += " (active items only)"
+ new_history = history.copy( name=name, target_user=user )
+ if len( histories ) == 1:
+ msg = 'Clone with name "%s" is now included in your previously stored histories.' % new_history.name
else:
- if trans.sa_session.query( trans.app.model.HistoryUserShareAssociation ) \
- .filter_by( user=user, history=history ).count() == 0:
- return trans.show_error_message( "The history you are attempting to clone is not owned by you or shared with you. " )
- owner = False
- name = "Clone of '%s'" % history.name
- if not owner:
- name += " shared by '%s'" % history.user.email
- if clone_choice == 'activatable':
- new_history = history.copy( name=name, target_user=user, activatable=True )
- elif clone_choice == 'active':
- name += " (active items only)"
- new_history = history.copy( name=name, target_user=user )
- # Render the list view
- return trans.show_ok_message( 'Clone with name "%s" is now included in your list of stored histories.' % new_history.name )
+ msg = '%d cloned histories are now included in your previously stored histories.' % len( histories )
+ return trans.show_ok_message( msg )
## ---- Utility methods -------------------------------------------------------
diff -r 2630316ff75e -r 846f6a7ee80c lib/galaxy/web/controllers/library.py
--- a/lib/galaxy/web/controllers/library.py Tue Aug 11 16:56:47 2009 -0400
+++ b/lib/galaxy/web/controllers/library.py Wed Aug 12 15:56:03 2009 -0400
@@ -469,7 +469,7 @@
msg=util.sanitize_text( msg ),
messagetype='error' ) )
# See if we have any associated templates
- info_association = folder.get_info_association()
+ info_association = ldda.get_info_association()
if info_association:
template = info_association.template
# See if we have any field contents
diff -r 2630316ff75e -r 846f6a7ee80c lib/galaxy/web/framework/helpers/grids.py
--- a/lib/galaxy/web/framework/helpers/grids.py Tue Aug 11 16:56:47 2009 -0400
+++ b/lib/galaxy/web/framework/helpers/grids.py Wed Aug 12 15:56:03 2009 -0400
@@ -156,9 +156,7 @@
elif column_filter == "All":
del filter_args[self.key]
return query
-
-
-
+
class GridOperation( object ):
def __init__( self, label, key=None, condition=None, allow_multiple=True ):
self.label = label
diff -r 2630316ff75e -r 846f6a7ee80c templates/admin/requests/grid.mako
--- a/templates/admin/requests/grid.mako Tue Aug 11 16:56:47 2009 -0400
+++ b/templates/admin/requests/grid.mako Wed Aug 12 15:56:03 2009 -0400
@@ -101,7 +101,7 @@
%if not len(query.all()):
- There are no request(s).
+ There are no requests.
%else:
<form name="history_actions" action="${url()}" method="post" >
<table class="grid">
diff -r 2630316ff75e -r 846f6a7ee80c templates/history/grid.mako
--- a/templates/history/grid.mako Tue Aug 11 16:56:47 2009 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-<%inherit file="/base.mako"/>
-<%def name="title()">${grid.title}</%def>
-
-%if message:
- <p>
- <div class="${message_type}message transient-message">${message}</div>
- <div style="clear: both"></div>
- </p>
-%endif
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- <script type="text/javascript">
- ## TODO: generalize and move into galaxy.base.js
- $(document).ready(function() {
- $(".grid").each( function() {
- var grid = this;
- var checkboxes = $(this).find("input.grid-row-select-checkbox");
- var update = $(this).find( "span.grid-selected-count" );
- $(checkboxes).each( function() {
- $(this).change( function() {
- var n = $(checkboxes).filter("[checked]").size();
- update.text( n );
- });
- })
- });
- });
- ## Can this be moved into base.mako?
- %if refresh_frames:
- %if 'masthead' in refresh_frames:
- ## Refresh masthead == user changes (backward compatibility)
- if ( parent.user_changed ) {
- %if trans.user:
- parent.user_changed( "${trans.user.email}", ${int( app.config.is_admin_user( trans.user ) )} );
- %else:
- parent.user_changed( null, false );
- %endif
- }
- %endif
- %if 'history' in refresh_frames:
- if ( parent.frames && parent.frames.galaxy_history ) {
- parent.frames.galaxy_history.location.href="${h.url_for( controller='root', action='history')}";
- if ( parent.force_right_panel ) {
- parent.force_right_panel( 'show' );
- }
- }
- %endif
- %if 'tools' in refresh_frames:
- if ( parent.frames && parent.frames.galaxy_tools ) {
- parent.frames.galaxy_tools.location.href="${h.url_for( controller='root', action='tool_menu')}";
- if ( parent.force_left_panel ) {
- parent.force_left_panel( 'show' );
- }
- }
- %endif
- %endif
- </script>
-</%def>
-
-<%def name="stylesheets()">
- <link href="${h.url_for('/static/style/base.css')}" rel="stylesheet" type="text/css" />
- <style>
- ## Not generic to all grids -- move to base?
- .count-box {
- min-width: 1.1em;
- padding: 5px;
- border-width: 1px;
- border-style: solid;
- text-align: center;
- display: inline-block;
- }
- </style>
-</%def>
-
-<div class="grid-header">
- <h2>${grid.title}</h2>
- <span class="title">Filter:</span>
- %for i, filter in enumerate( grid.standard_filters ):
- %if i > 0:
- <span>|</span>
- %endif
- <span class="filter"><a href="${url( filter.get_url_args() )}">${filter.label}</a></span>
- %endfor
-</div>
-
-<form name="history_actions" action="${url()}" method="post" >
- <table class="grid">
- <thead>
- <tr>
- <th></th>
- %for column in grid.columns:
- %if column.visible:
- <%
- href = ""
- extra = ""
- if column.sortable:
- if sort_key == column.key:
- if sort_order == "asc":
- href = url( sort=( "-" + column.key ) )
- extra = "↓"
- else:
- href = url( sort=( column.key ) )
- extra = "↑"
- else:
- href = url( sort=column.key )
- %>
- <th\
- %if column.ncells > 1:
- colspan="${column.ncells}"
- %endif
- >
- %if href:
- <a href="${href}">${column.label}</a>
- %else:
- ${column.label}
- %endif
- <span>${extra}</span>
- </th>
- %endif
- %endfor
- <th></th>
- </tr>
- </thead>
- <tbody>
- %for i, item in enumerate( query ):
- <tr \
- %if current_item == item:
- class="current" \
- %endif
- >
- ## Item selection column
- <td style="width: 1.5em;">
- <input type="checkbox" name="id" value=${trans.security.encode_id( item.id )} class="grid-row-select-checkbox" />
- </td>
- ## Data columns
- %for column in grid.columns:
- %if column.visible:
- <%
- # Link
- link = column.get_link( trans, grid, item )
- if link:
- href = url( **link )
- else:
- href = None
- # Value (coerced to list so we can loop)
- value = column.get_value( trans, grid, item )
- if column.ncells == 1:
- value = [ value ]
- %>
- %for cellnum, v in enumerate( value ):
- <%
- # Attach popup menu?
- if column.attach_popup and cellnum == 0:
- extra = '<a id="grid-%d-popup" class="popup-arrow" style="display: none;">▼</a>' % i
- else:
- extra = ""
- %>
- %if href:
- <td><a href="${href}">${v}</a> ${extra}</td>
- %else:
- <td >${v}${extra}</td>
- %endif
- </td>
- %endfor
- %endif
- %endfor
- ## Actions column
- <td>
- <div popupmenu="grid-${i}-popup">
- %for operation in grid.operations:
- %if operation.allowed( item ):
- <a class="action-button" href="${url( operation=operation.label, id=item.id )}">${operation.label}</a>
- %endif
- %endfor
- </div>
- </td>
- </tr>
- %endfor
- </tbody>
- <tfoot>
- <tr>
- <td></td>
- <td colspan="100">
- For <span class="grid-selected-count"></span> selected histories:
- %for operation in grid.operations:
- %if operation.allow_multiple:
- <input type="submit" name="operation" value="${operation.label}" class="action-button">
- %endif
- %endfor
- </td>
- </tr>
- </tfoot>
- </table>
-</form>
diff -r 2630316ff75e -r 846f6a7ee80c templates/history/list_shared.mako
--- a/templates/history/list_shared.mako Tue Aug 11 16:56:47 2009 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-%if msg:
- ${render_msg( msg, messagetype )}
-%endif
-
-%if shared_by_others:
- <table class="colored" border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr class="header">
- <th>Name</th>
- <th>Owner</th>
- </tr>
- %for i, association in enumerate( shared_by_others ):
- <% history = association.history %>
- <tr>
- <td>
- ${history.name}
- <a id="shared-${i}-popup" class="popup-arrow" style="display: none;">▼</a>
- <div popupmenu="shared-${i}-popup">
- <a class="action-button" href="${h.url_for( controller='history', action='clone', id=trans.security.encode_id( history.id ) )}">Clone</a>
- </div>
- </td>
- <td>${history.user.email}</td>
- </tr>
- %endfor
- </table>
-%else:
- No histories have been shared with you.
-%endif
diff -r 2630316ff75e -r 846f6a7ee80c templates/history/options.mako
--- a/templates/history/options.mako Tue Aug 11 16:56:47 2009 -0400
+++ b/templates/history/options.mako Wed Aug 12 15:56:03 2009 -0400
@@ -12,7 +12,7 @@
<ul>
%if user:
- <li><a href="${h.url_for( controller='history', action='list')}" target="galaxy_main">List</a> previously stored histories</li>
+ <li><a href="${h.url_for( controller='history', action='list')}" target="galaxy_main">Previously</a> stored histories</li>
%if len( history.active_datasets ) > 0:
<li><a href="${h.url_for( controller='root', action='history_new' )}">Create</a> a new empty history</li>
<li><a href="${h.url_for( controller='workflow', action='build_from_current_history' )}">Construct workflow</a> from current history</li>
@@ -27,6 +27,6 @@
<li><a href="${h.url_for( controller='history', action='rename', id=trans.security.encode_id( history.id ) )}" target="galaxy_main">Rename</a> current history (stored as "${history.name}")</li>
<li><a href="${h.url_for( controller='history', action='delete_current' )}" confirm="Are you sure you want to delete the current history?">Delete</a> current history</div>
%if user and user.histories_shared_by_others:
- <li><a href="${h.url_for( controller='history', action='list_shared')}" target="galaxy_main">List</a> histories shared with you by others</li>
+ <li><a href="${h.url_for( controller='history', action='list_shared')}" target="galaxy_main">Histories</a> shared with you by others</li>
%endif
</ul>
diff -r 2630316ff75e -r 846f6a7ee80c templates/history/share.mako
--- a/templates/history/share.mako Tue Aug 11 16:56:47 2009 -0400
+++ b/templates/history/share.mako Wed Aug 12 15:56:03 2009 -0400
@@ -57,134 +57,136 @@
</form>
%else:
## We are sharing restricted histories
- <form name='share_restricted' id=share_restricted' action="${h.url_for( controller='history', action='share_restricted' )}" method="post">
- %if send_to_err:
- <div style="clear: both"></div>
- <div class="form-row">
- <div class="errormessage">${send_to_err}</div>
- </div>
- %endif
- ## Needed for rebuilding dicts
- <input type="hidden" name="email" value="${email}" size="40">
- %for history in histories:
- <input type="hidden" name="id" value="${trans.security.encode_id( history.id )}">
- %endfor
- %if no_change_needed:
- ## no_change_needed looks like: {historyX : [hda, hda], historyY : [hda] }
- <div style="clear: both"></div>
- <div class="form-row">
- <div class="donemessage">
- The following datasets can be shared with ${email} with no changes
- </div>
- </div>
- %for history, hdas in no_change_needed.items():
- <div class="form-row">
- <label>History</label>
- ${history.name}
- </div>
+ %if no_change_needed or can_change:
+ <form name='share_restricted' id=share_restricted' action="${h.url_for( controller='history', action='share_restricted' )}" method="post">
+ %if send_to_err:
<div style="clear: both"></div>
<div class="form-row">
- <label>Datasets</label>
+ <div class="errormessage">${send_to_err}</div>
</div>
- %for hda in hdas:
- <div class="form-row">
- ${hda.name}
- %if hda.deleted:
- (deleted)
- %endif
- </div>
- %endfor
+ %endif
+ ## Needed for rebuilding dicts
+ <input type="hidden" name="email" value="${email}" size="40">
+ %for history in histories:
+ <input type="hidden" name="id" value="${trans.security.encode_id( history.id )}">
%endfor
- %endif
- %if can_change:
- ## can_change looks like: {historyX : [hda, hda], historyY : [hda] }
- <div style="clear: both"></div>
- <div class="form-row">
- <div class="warningmessage">
- The following datasets can be shared with ${email} by updating their permissions
- </div>
- </div>
- %for history, hdas in can_change.items():
- <div class="form-row">
- <label>History</label>
- ${history.name}
- </div>
+ %if no_change_needed:
+ ## no_change_needed looks like: {historyX : [hda, hda], historyY : [hda] }
<div style="clear: both"></div>
<div class="form-row">
- <label>Datasets</label>
- </div>
- %for hda in hdas:
+ <div class="donemessage">
+ The following datasets can be shared with ${email} with no changes
+ </div>
+ </div>
+ %for history, hdas in no_change_needed.items():
<div class="form-row">
- ${hda.name}
- %if hda.deleted:
- (deleted)
- %endif
+ <label>History</label>
+ ${history.name}
</div>
+ <div style="clear: both"></div>
+ <div class="form-row">
+ <label>Datasets</label>
+ </div>
+ %for hda in hdas:
+ <div class="form-row">
+ ${hda.name}
+ %if hda.deleted:
+ (deleted)
+ %endif
+ </div>
+ %endfor
%endfor
- %endfor
- %endif
- %if cannot_change:
- ## cannot_change looks like: {historyX : [hda, hda], historyY : [hda] }
- <div style="clear: both"></div>
- <div class="form-row">
- <div class="errormessage">
- The following datasets cannot be shared with ${email} because you are not authorized to
- change the permissions on them
- </div>
- </div>
- %for history, hdas in cannot_change.items():
- <div class="form-row">
- <label>History</label>
- ${history.name}
- </div>
+ %endif
+ %if can_change:
+ ## can_change looks like: {historyX : [hda, hda], historyY : [hda] }
<div style="clear: both"></div>
<div class="form-row">
- <label>Datasets</label>
+ <div class="warningmessage">
+ The following datasets can be shared with ${email} by updating their permissions
+ </div>
</div>
- %for hda in hdas:
+ %for history, hdas in can_change.items():
<div class="form-row">
- ${hda.name}
- %if hda.deleted:
- (deleted)
- %endif
+ <label>History</label>
+ ${history.name}
</div>
+ <div style="clear: both"></div>
+ <div class="form-row">
+ <label>Datasets</label>
+ </div>
+ %for hda in hdas:
+ <div class="form-row">
+ ${hda.name}
+ %if hda.deleted:
+ (deleted)
+ %endif
+ </div>
+ %endfor
%endfor
- %endfor
- %endif
- <div class="toolFormTitle"></div>
- <div class="form-row">
- Deleted items can be eliminated by the users with which you are sharing the history.
- </div>
- <div class="form-row">
- <label>How would you like to proceed?</label>
- </div>
- %if can_change:
+ %endif
+ %if cannot_change:
+ ## cannot_change looks like: {historyX : [hda, hda], historyY : [hda] }
+ <div style="clear: both"></div>
+ <div class="form-row">
+ <div class="errormessage">
+ The following datasets cannot be shared with ${email} because you are not authorized to
+ change the permissions on them
+ </div>
+ </div>
+ %for history, hdas in cannot_change.items():
+ <div class="form-row">
+ <label>History</label>
+ ${history.name}
+ </div>
+ <div style="clear: both"></div>
+ <div class="form-row">
+ <label>Datasets</label>
+ </div>
+ %for hda in hdas:
+ <div class="form-row">
+ ${hda.name}
+ %if hda.deleted:
+ (deleted)
+ %endif
+ </div>
+ %endfor
+ %endfor
+ %endif
+ <div class="toolFormTitle"></div>
<div class="form-row">
- <input type="radio" name="action" value="public"> Make datasets public so anyone can access them
- %if cannot_change:
- (where possible)
- %endif
+ <label>How would you like to proceed?</label>
</div>
+ %if can_change:
+ <div class="form-row">
+ <input type="radio" name="action" value="public"> Make datasets public so anyone can access them
+ %if cannot_change:
+ (where possible)
+ %endif
+ </div>
+ <div class="form-row">
+ %if no_change_needed:
+ <input type="radio" name="action" value="private"> Make datasets private to me and the user(s) with whom I am sharing
+ %else:
+ <input type="radio" name="action" value="private" checked> Make datasets private to me and the user(s) with whom I am sharing
+ %endif
+ %if cannot_change:
+ (where possible)
+ %endif
+ </div>
+ %endif
+ %if no_change_needed:
+ <div class="form-row">
+ <input type="radio" name="action" value="share_anyway" checked> Share anyway
+ %if can_change:
+ (don't change any permissions)
+ %endif
+ </div>
+ %endif
<div class="form-row">
- <input type="radio" name="action" value="private"> Make datasets private to me and the user(s) with whom I am sharing
- %if cannot_change:
- (where possible)
- %endif
+ <input type="submit" name="share_restricted_button" value="Go"><br/>
</div>
- %endif
- <div class="form-row">
- <input type="radio" name="action" value="share_anyway"> Share anyway
- %if can_change:
- (don't change any permissions)
- %endif
- </div>
- <div class="form-row">
- <input type="radio" name="action" value="no_share" checked> Don't share
- </div>
- <div class="form-row">
- <input type="submit" name="share_restricted_button" value="Go"><br/>
- </div>
- </form>
+ </form>
+ %endif
%endif
</div>
</div>
diff -r 2630316ff75e -r 846f6a7ee80c templates/history/shared_grid.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/history/shared_grid.mako Wed Aug 12 15:56:03 2009 -0400
@@ -0,0 +1,197 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+<%def name="title()">${grid.title}</%def>
+
+<%def name="javascripts()">
+ ${parent.javascripts()}
+ <script type="text/javascript">
+ ## TODO: generalize and move into galaxy.base.js
+ $(document).ready(function() {
+ $(".grid").each( function() {
+ var grid = this;
+ var checkboxes = $(this).find("input.grid-row-select-checkbox");
+ var update = $(this).find( "span.grid-selected-count" );
+ $(checkboxes).each( function() {
+ $(this).change( function() {
+ var n = $(checkboxes).filter("[checked]").size();
+ update.text( n );
+ });
+ })
+ });
+ });
+ ## Can this be moved into base.mako?
+ %if refresh_frames:
+ %if 'masthead' in refresh_frames:
+ ## Refresh masthead == user changes (backward compatibility)
+ if ( parent.user_changed ) {
+ %if trans.user:
+ parent.user_changed( "${trans.user.email}", ${int( app.config.is_admin_user( trans.user ) )} );
+ %else:
+ parent.user_changed( null, false );
+ %endif
+ }
+ %endif
+ %if 'history' in refresh_frames:
+ if ( parent.frames && parent.frames.galaxy_history ) {
+ parent.frames.galaxy_history.location.href="${h.url_for( controller='root', action='history')}";
+ if ( parent.force_right_panel ) {
+ parent.force_right_panel( 'show' );
+ }
+ }
+ %endif
+ %if 'tools' in refresh_frames:
+ if ( parent.frames && parent.frames.galaxy_tools ) {
+ parent.frames.galaxy_tools.location.href="${h.url_for( controller='root', action='tool_menu')}";
+ if ( parent.force_left_panel ) {
+ parent.force_left_panel( 'show' );
+ }
+ }
+ %endif
+ %endif
+ </script>
+</%def>
+
+<%def name="stylesheets()">
+ <link href="${h.url_for('/static/style/base.css')}" rel="stylesheet" type="text/css" />
+ <style>
+ ## Not generic to all grids -- move to base?
+ .count-box {
+ min-width: 1.1em;
+ padding: 5px;
+ border-width: 1px;
+ border-style: solid;
+ text-align: center;
+ display: inline-block;
+ }
+ </style>
+</%def>
+
+%if grid.standard_filters:
+ <div class="grid-header">
+ <h2>${grid.title}</h2>
+ <span class="title">Filter:</span>
+ %for i, filter in enumerate( grid.standard_filters ):
+ %if i > 0:
+ <span>|</span>
+ %endif
+ <span class="filter"><a href="${url( filter.get_url_args() )}">${filter.label}</a></span>
+ %endfor
+ </div>
+%endif
+
+%if message:
+ <p>
+ <div class="${message_type}message transient-message">${message}</div>
+ <div style="clear: both"></div>
+ </p>
+%endif
+%if msg:
+ ${render_msg( msg, messagetype )}
+%endif
+
+<form name="history_shared_by_others" action="${url()}" method="post" >
+ <table class="grid">
+ <thead>
+ <tr>
+ <th></th>
+ %for column in grid.columns:
+ %if column.visible:
+ <%
+ href = ""
+ extra = ""
+ if column.sortable:
+ if sort_key == column.key:
+ if sort_order == "asc":
+ href = url( sort=( "-" + column.key ) )
+ extra = "↓"
+ else:
+ href = url( sort=( column.key ) )
+ extra = "↑"
+ else:
+ href = url( sort=column.key )
+ %>
+ <th\
+ %if column.ncells > 1:
+ colspan="${column.ncells}"
+ %endif
+ >
+ %if href:
+ <a href="${href}">${column.label}</a>
+ %else:
+ ${column.label}
+ %endif
+ <span>${extra}</span>
+ </th>
+ %endif
+ %endfor
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ %for i, history in enumerate( query ):
+ <tr>
+ ## Item selection column
+ <td style="width: 1.5em;">
+ <input type="checkbox" name="id" value=${trans.security.encode_id( history.id )} class="grid-row-select-checkbox" />
+ </td>
+ ## Data columns
+ %for column in grid.columns:
+ %if column.visible:
+ <%
+ # Link
+ link = column.get_link( trans, grid, history )
+ if link:
+ href = url( **link )
+ else:
+ href = None
+ # Value (coerced to list so we can loop)
+ value = column.get_value( trans, grid, history )
+ if column.ncells == 1:
+ value = [ value ]
+ %>
+ %for cellnum, v in enumerate( value ):
+ <%
+ # Attach popup menu?
+ if column.attach_popup and cellnum == 0:
+ extra = '<a id="grid-%d-popup" class="popup-arrow" style="display: none;">▼</a>' % i
+ else:
+ extra = ""
+ %>
+ %if href:
+ <td><a href="${href}">${v}</a> ${extra}</td>
+ %else:
+ <td >${v}${extra}</td>
+ %endif
+ </td>
+ %endfor
+ %endif
+ %endfor
+ ## Actions column
+ <td>
+ <div popupmenu="grid-${i}-popup">
+ %for operation in grid.operations:
+ %if operation.allowed( history ):
+ <a class="action-button" href="${url( operation=operation.label, id=history.id )}">${operation.label}</a>
+ %endif
+ %endfor
+ </div>
+ </td>
+ </tr>
+ %endfor
+ </tbody>
+ <tfoot>
+ <tr>
+ <td></td>
+ <td colspan="100">
+ For <span class="grid-selected-count"></span> selected histories:
+ %for operation in grid.operations:
+ %if operation.allow_multiple:
+ <input type="submit" name="operation" value="${operation.label}" class="action-button">
+ %endif
+ %endfor
+ </td>
+ </tr>
+ </tfoot>
+ </table>
+</form>
diff -r 2630316ff75e -r 846f6a7ee80c templates/history/stored_grid.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/history/stored_grid.mako Wed Aug 12 15:56:03 2009 -0400
@@ -0,0 +1,196 @@
+<%inherit file="/base.mako"/>
+<%def name="title()">${grid.title}</%def>
+
+%if message:
+ <p>
+ <div class="${message_type}message transient-message">${message}</div>
+ <div style="clear: both"></div>
+ </p>
+%endif
+
+<%def name="javascripts()">
+ ${parent.javascripts()}
+ <script type="text/javascript">
+ ## TODO: generalize and move into galaxy.base.js
+ $(document).ready(function() {
+ $(".grid").each( function() {
+ var grid = this;
+ var checkboxes = $(this).find("input.grid-row-select-checkbox");
+ var update = $(this).find( "span.grid-selected-count" );
+ $(checkboxes).each( function() {
+ $(this).change( function() {
+ var n = $(checkboxes).filter("[checked]").size();
+ update.text( n );
+ });
+ })
+ });
+ });
+ ## Can this be moved into base.mako?
+ %if refresh_frames:
+ %if 'masthead' in refresh_frames:
+ ## Refresh masthead == user changes (backward compatibility)
+ if ( parent.user_changed ) {
+ %if trans.user:
+ parent.user_changed( "${trans.user.email}", ${int( app.config.is_admin_user( trans.user ) )} );
+ %else:
+ parent.user_changed( null, false );
+ %endif
+ }
+ %endif
+ %if 'history' in refresh_frames:
+ if ( parent.frames && parent.frames.galaxy_history ) {
+ parent.frames.galaxy_history.location.href="${h.url_for( controller='root', action='history')}";
+ if ( parent.force_right_panel ) {
+ parent.force_right_panel( 'show' );
+ }
+ }
+ %endif
+ %if 'tools' in refresh_frames:
+ if ( parent.frames && parent.frames.galaxy_tools ) {
+ parent.frames.galaxy_tools.location.href="${h.url_for( controller='root', action='tool_menu')}";
+ if ( parent.force_left_panel ) {
+ parent.force_left_panel( 'show' );
+ }
+ }
+ %endif
+ %endif
+ </script>
+</%def>
+
+<%def name="stylesheets()">
+ <link href="${h.url_for('/static/style/base.css')}" rel="stylesheet" type="text/css" />
+ <style>
+ ## Not generic to all grids -- move to base?
+ .count-box {
+ min-width: 1.1em;
+ padding: 5px;
+ border-width: 1px;
+ border-style: solid;
+ text-align: center;
+ display: inline-block;
+ }
+ </style>
+</%def>
+
+%if grid.standard_filters:
+ <div class="grid-header">
+ <h2>${grid.title}</h2>
+ <span class="title">Filter:</span>
+ %for i, filter in enumerate( grid.standard_filters ):
+ %if i > 0:
+ <span>|</span>
+ %endif
+ <span class="filter"><a href="${url( filter.get_url_args() )}">${filter.label}</a></span>
+ %endfor
+ </div>
+%endif
+
+<form name="history_actions" action="${url()}" method="post" >
+ <table class="grid">
+ <thead>
+ <tr>
+ <th></th>
+ %for column in grid.columns:
+ %if column.visible:
+ <%
+ href = ""
+ extra = ""
+ if column.sortable:
+ if sort_key == column.key:
+ if sort_order == "asc":
+ href = url( sort=( "-" + column.key ) )
+ extra = "↓"
+ else:
+ href = url( sort=( column.key ) )
+ extra = "↑"
+ else:
+ href = url( sort=column.key )
+ %>
+ <th\
+ %if column.ncells > 1:
+ colspan="${column.ncells}"
+ %endif
+ >
+ %if href:
+ <a href="${href}">${column.label}</a>
+ %else:
+ ${column.label}
+ %endif
+ <span>${extra}</span>
+ </th>
+ %endif
+ %endfor
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ %for i, item in enumerate( query ):
+ <tr \
+ %if current_item == item:
+ class="current" \
+ %endif
+ >
+ ## Item selection column
+ <td style="width: 1.5em;">
+ <input type="checkbox" name="id" value=${trans.security.encode_id( item.id )} class="grid-row-select-checkbox" />
+ </td>
+ ## Data columns
+ %for column in grid.columns:
+ %if column.visible:
+ <%
+ # Link
+ link = column.get_link( trans, grid, item )
+ if link:
+ href = url( **link )
+ else:
+ href = None
+ # Value (coerced to list so we can loop)
+ value = column.get_value( trans, grid, item )
+ if column.ncells == 1:
+ value = [ value ]
+ %>
+ %for cellnum, v in enumerate( value ):
+ <%
+ # Attach popup menu?
+ if column.attach_popup and cellnum == 0:
+ extra = '<a id="grid-%d-popup" class="popup-arrow" style="display: none;">▼</a>' % i
+ else:
+ extra = ""
+ %>
+ %if href:
+ <td><a href="${href}">${v}</a> ${extra}</td>
+ %else:
+ <td >${v}${extra}</td>
+ %endif
+ </td>
+ %endfor
+ %endif
+ %endfor
+ ## Actions column
+ <td>
+ <div popupmenu="grid-${i}-popup">
+ %for operation in grid.operations:
+ %if operation.allowed( item ):
+ <a class="action-button" href="${url( operation=operation.label, id=item.id )}">${operation.label}</a>
+ %endif
+ %endfor
+ </div>
+ </td>
+ </tr>
+ %endfor
+ </tbody>
+ <tfoot>
+ <tr>
+ <td></td>
+ <td colspan="100">
+ For <span class="grid-selected-count"></span> selected histories:
+ %for operation in grid.operations:
+ %if operation.allow_multiple:
+ <input type="submit" name="operation" value="${operation.label}" class="action-button">
+ %endif
+ %endfor
+ </td>
+ </tr>
+ </tfoot>
+ </table>
+</form>
diff -r 2630316ff75e -r 846f6a7ee80c test/base/twilltestcase.py
--- a/test/base/twilltestcase.py Tue Aug 11 16:56:47 2009 -0400
+++ b/test/base/twilltestcase.py Wed Aug 12 15:56:03 2009 -0400
@@ -182,7 +182,7 @@
self.home()
self.visit_page( "root/history_options" )
if user:
- self.check_page_for_string( 'List</a> previously stored histories' )
+ self.check_page_for_string( 'Previously</a> stored histories' )
if active_datasets:
self.check_page_for_string( 'Create</a> a new empty history' )
self.check_page_for_string( 'Construct workflow</a> from current history' )
@@ -190,7 +190,7 @@
self.check_page_for_string( 'Share</a> current history' )
self.check_page_for_string( 'Change default permissions</a> for current history' )
if histories_shared_by_others:
- self.check_page_for_string( 'List</a> histories shared with you by others' )
+ self.check_page_for_string( 'Histories</a> shared with you by others' )
if activatable_datasets:
self.check_page_for_string( 'Show deleted</a> datasets in current history' )
self.check_page_for_string( 'Rename</a> current history' )
diff -r 2630316ff75e -r 846f6a7ee80c test/functional/test_history_functions.py
--- a/test/functional/test_history_functions.py Tue Aug 11 16:56:47 2009 -0400
+++ b/test/functional/test_history_functions.py Wed Aug 12 15:56:03 2009 -0400
@@ -183,7 +183,7 @@
self.view_shared_histories( check_str=history3.name, check_str2=admin_user.email )
self.clone_history( self.security.encode_id( history3.id ),
'activatable',
- check_str_after_submit='is now included in your list of stored histories.' )
+ check_str_after_submit='is now included in your previously stored histories.' )
global history3_clone1
history3_clone1 = galaxy.model.History.filter( and_( galaxy.model.History.table.c.deleted==False,
galaxy.model.History.table.c.user_id==regular_user1.id ) ) \
@@ -216,7 +216,7 @@
# Test cloning activatable datasets
self.clone_history( self.security.encode_id( history3.id ),
'activatable',
- check_str_after_submit='is now included in your list of stored histories.' )
+ check_str_after_submit='is now included in your previously stored histories.' )
global history3_clone2
history3_clone2 = galaxy.model.History.filter( and_( galaxy.model.History.table.c.deleted==False,
galaxy.model.History.table.c.user_id==admin_user.id ) ) \
@@ -244,7 +244,7 @@
# Test cloning only active datasets
self.clone_history( self.security.encode_id( history3.id ),
'active',
- check_str_after_submit='is now included in your list of stored histories.' )
+ check_str_after_submit='is now included in your previously stored histories.' )
global history3_clone3
history3_clone3 = galaxy.model.History.filter( and_( galaxy.model.History.table.c.deleted==False,
galaxy.model.History.table.c.user_id==admin_user.id ) ) \
@@ -355,7 +355,7 @@
# Clone restricted history5
self.clone_history( self.security.encode_id( history5.id ),
'activatable',
- check_str_after_submit='is now included in your list of stored histories.' )
+ check_str_after_submit='is now included in your previously stored histories.' )
global history5_clone1
history5_clone1 = galaxy.model.History.filter( and_( galaxy.model.History.table.c.deleted==False,
galaxy.model.History.table.c.user_id==regular_user1.id ) ) \
@@ -411,7 +411,7 @@
# Clone restricted history5
self.clone_history( self.security.encode_id( history5.id ),
'activatable',
- check_str_after_submit='is now included in your list of stored histories.' )
+ check_str_after_submit='is now included in your previously stored histories.' )
global history5_clone2
history5_clone2 = galaxy.model.History.filter( and_( galaxy.model.History.table.c.deleted==False,
galaxy.model.History.table.c.user_id==regular_user2.id ) ) \
@@ -484,7 +484,7 @@
# Clone restricted history5
self.clone_history( self.security.encode_id( history5.id ),
'activatable',
- check_str_after_submit='is now included in your list of stored histories.' )
+ check_str_after_submit='is now included in your previously stored histories.' )
global history5_clone3
history5_clone3 = galaxy.model.History.filter( and_( galaxy.model.History.table.c.deleted==False,
galaxy.model.History.table.c.user_id==regular_user2.id ) ) \
@@ -522,7 +522,7 @@
# Clone restricted history5
self.clone_history( self.security.encode_id( history5.id ),
'activatable',
- check_str_after_submit='is now included in your list of stored histories.' )
+ check_str_after_submit='is now included in your previously stored histories.' )
global history5_clone4
history5_clone4 = galaxy.model.History.filter( and_( galaxy.model.History.table.c.deleted==False,
galaxy.model.History.table.c.user_id==regular_user3.id ) ) \
@@ -591,15 +591,6 @@
pass
self.logout()
self.login( email=admin_user.email )
- email = '%s,%s' % ( regular_user2.email, regular_user3.email )
- check_str_after_submit = 'The following datasets can be shared with %s with no changes' % email
- check_str_after_submit2 = 'The following datasets can be shared with %s by updating their permissions' % email
- action_check_str_after_submit = 'History Options'
- self.share_current_history( email,
- check_str_after_submit=check_str_after_submit,
- check_str_after_submit2=check_str_after_submit2,
- action='no_share',
- action_check_str_after_submit=action_check_str_after_submit )
def test_070_history_show_and_hide_deleted_datasets( self ):
"""Testing displaying deleted history items"""
# Logged in as admin_user
1
0