diff --git a/lib/galaxy/web/controllers/admin.py b/lib/galaxy/web/controllers/admin.py
index 362440163ec..eac0ebeaaff 100644
--- a/lib/galaxy/web/controllers/admin.py
+++ b/lib/galaxy/web/controllers/admin.py
@@ -886,7 +886,7 @@ class Admin( BaseController ):
return trans.response.send_redirect( web.url_for( controller='admin',
action='library',
id=id,
- information=True,
+ edit_info=True,
msg=util.sanitize_text( msg ),
messagetype='done' ) )
return trans.fill_template( '/admin/library/library_info.mako',
@@ -1090,7 +1090,7 @@ class Admin( BaseController ):
action='folder',
id=id,
library_id=library_id,
- information=True,
+ edit_info=True,
msg=util.sanitize_text( msg ),
messagetype='done' ) )
return trans.fill_template( '/admin/library/folder_info.mako',
@@ -1147,10 +1147,7 @@ class Admin( BaseController ):
messagetype = params.get( 'messagetype', 'done' )
if params.get( 'permissions', False ):
action = 'permissions'
- elif params.get( 'versions', False ):
- action = 'versions'
else:
- # 'information' will be the default
action = 'information'
library_dataset = trans.app.model.LibraryDataset.get( id )
if not library_dataset:
@@ -1181,17 +1178,6 @@ class Admin( BaseController ):
render_templates=params.get( 'render_templates', False ),
msg=msg,
messagetype=messagetype )
- elif action == 'versions':
- if params.get( 'change_version_button', False ):
- target_lda = trans.app.model.LibraryDatasetDatasetAssociation.get( kwd.get( 'set_lda_id' ) )
- library_dataset.library_dataset_dataset_association = target_lda
- trans.app.model.flush()
- msg = 'The current version of this library dataset has been updated to be %s' % target_lda.name
- return trans.fill_template( '/admin/library/library_dataset_versions.mako',
- library_dataset=library_dataset,
- library_id=library_id,
- msg=msg,
- messagetype=messagetype )
elif action == 'permissions':
if params.get( 'update_roles_button', False ):
# The user clicked the Save button on the 'Edit permissions and role associations' form
@@ -1296,9 +1282,10 @@ class Admin( BaseController ):
else:
if params.get( 'permissions', False ):
action = 'permissions'
+ elif params.get( 'edit_info', False ):
+ action = 'edit_info'
else:
- # 'information' will be the default
- action = 'information'
+ action = 'info'
if id.count( ',' ):
ids = id.split( ',' )
id = None
@@ -1341,13 +1328,19 @@ class Admin( BaseController ):
library_id=library_id,
msg=msg,
messagetype=messagetype )
- elif action == 'information':
+ elif action == 'info':
+ return trans.fill_template( '/admin/library/ldda_info.mako',
+ ldda=ldda,
+ library_id=library_id,
+ msg=msg,
+ messagetype=messagetype )
+ elif action == 'edit_info':
if params.get( 'change', False ):
# The user clicked the Save button on the 'Change data type' form
trans.app.datatypes_registry.change_datatype( ldda, params.datatype )
trans.app.model.flush()
msg = "Data type changed for library dataset '%s'" % ldda.name
- return trans.fill_template( "/admin/library/ldda_info.mako",
+ return trans.fill_template( "/admin/library/ldda_edit_info.mako",
ldda=ldda,
library_id=library_id,
datatypes=ldatatypes,
@@ -1383,7 +1376,7 @@ class Admin( BaseController ):
trans.app.model.flush()
msg = 'Attributes updated for library dataset %s' % ldda.name
messagetype = 'done'
- return trans.fill_template( "/admin/library/ldda_info.mako",
+ return trans.fill_template( "/admin/library/ldda_edit_info.mako",
ldda=ldda,
library_id=library_id,
datatypes=ldatatypes,
@@ -1402,7 +1395,7 @@ class Admin( BaseController ):
ldda.datatype.after_edit( ldda )
trans.app.model.flush()
msg = 'Attributes updated for library dataset %s' % ldda.name
- return trans.fill_template( "/admin/library/ldda_info.mako",
+ return trans.fill_template( "/admin/library/ldda_edit_info.mako",
ldda=ldda,
library_id=library_id,
datatypes=ldatatypes,
@@ -1416,7 +1409,7 @@ class Admin( BaseController ):
ldda.deleted = True
ldda.flush()
msg = 'Dataset %s has been removed from this library' % ldda.name
- return trans.fill_template( "/admin/library/ldda_info.mako",
+ return trans.fill_template( "/admin/library/ldda_edit_info.mako",
ldda=ldda,
library_id=library_id,
datatypes=ldatatypes,
@@ -1432,7 +1425,7 @@ class Admin( BaseController ):
# case it resorts to the old dbkey. Setting the dbkey
# sets it properly in the metadata
ldda.metadata.dbkey = ldda.dbkey
- return trans.fill_template( "/admin/library/ldda_info.mako",
+ return trans.fill_template( "/admin/library/ldda_edit_info.mako",
ldda=ldda,
library_id=library_id,
datatypes=ldatatypes,
@@ -1851,7 +1844,7 @@ class Admin( BaseController ):
id=library_item.id,
library_id=library_id,
folder_id=folder_id,
- information=True,
+ edit_info=True,
msg=util.sanitize_text( msg ),
messagetype='error' ) )
user = trans.get_user()
@@ -1883,7 +1876,7 @@ class Admin( BaseController ):
id=library_item.id,
library_id=library_id,
folder_id=folder_id,
- information=True,
+ edit_info=True,
msg=util.sanitize_text( msg ),
messagetype='done' ) )
return trans.fill_template( "/admin/library/new_info.mako",
@@ -1906,7 +1899,7 @@ class Admin( BaseController ):
id=library_item.id,
library_id=library_id,
folder_id=folder_id,
- information=True,
+ edit_info=True,
msg=util.sanitize_text( msg ),
messagetype='done' ) )
elif params.get( 'permissions', False ):
diff --git a/lib/galaxy/web/controllers/library.py b/lib/galaxy/web/controllers/library.py
index cb724f0ba15..da1a0b0e03f 100644
--- a/lib/galaxy/web/controllers/library.py
+++ b/lib/galaxy/web/controllers/library.py
@@ -118,7 +118,7 @@ class Library( BaseController ):
return trans.response.send_redirect( web.url_for( controller='library',
action='library',
id=id,
- information=True,
+ edit_info=True,
msg=util.sanitize_text( msg ),
messagetype='done' ) )
return trans.fill_template( '/library/library_info.mako',
@@ -327,10 +327,7 @@ class Library( BaseController ):
messagetype = params.get( 'messagetype', 'done' )
if params.get( 'permissions', False ):
action = 'permissions'
- elif params.get( 'versions', False ):
- action = 'versions'
else:
- # 'information' will be the default
action = 'information'
library_dataset = trans.app.model.LibraryDataset.get( id )
if not library_dataset:
@@ -368,24 +365,6 @@ class Library( BaseController ):
render_templates=params.get( 'render_templates', False ),
msg=msg,
messagetype=messagetype )
- elif action == 'versions':
- if params.get( 'change_version_button', False ):
- if trans.app.security_agent.allow_action( trans.user,
- trans.app.security_agent.permitted_actions.LIBRARY_MODIFY,
- library_item=library_dataset ):
- target_lda = trans.app.model.LibraryDatasetDatasetAssociation.get( kwd.get( 'set_lda_id' ) )
- library_dataset.library_dataset_dataset_association = target_lda
- trans.app.model.flush()
- msg = 'The current version of this library dataset has been updated to be %s' % target_lda.name
- messagetype = 'done'
- else:
- msg = "You are not authorized to change the versions of this dataset"
- messagetype = "error"
- return trans.fill_template( '/library/library_dataset_versions.mako',
- library_dataset=library_dataset,
- library_id=library_id,
- msg=msg,
- messagetype=messagetype )
elif action == 'permissions':
if params.get( 'update_roles_button', False ):
if trans.app.security_agent.allow_action( trans.user,
@@ -443,9 +422,10 @@ class Library( BaseController ):
if id:
if params.get( 'permissions', False ):
action = 'permissions'
+ elif params.get( 'edit_info', False ):
+ action = 'edit_info'
else:
- # 'information' will be the default
- action = 'information'
+ action = 'info'
if id.count( ',' ):
ids = id.split( ',' )
id = None
@@ -500,7 +480,13 @@ class Library( BaseController ):
library_id=library_id,
msg=msg,
messagetype=messagetype )
- elif action == 'information':
+ elif action == 'info':
+ return trans.fill_template( '/library/ldda_info.mako',
+ ldda=ldda,
+ library_id=library_id,
+ msg=msg,
+ messagetype=messagetype )
+ elif action == 'edit_info':
if params.get( 'change', False ):
# The user clicked the Save button on the 'Change data type' form
if trans.app.security_agent.allow_action( trans.user,
@@ -513,7 +499,7 @@ class Library( BaseController ):
else:
msg = "You are not authorized to change the data type of dataset '%s'" % ldda.name
messagetype = 'error'
- return trans.fill_template( "/library/ldda_info.mako",
+ return trans.fill_template( "/library/ldda_edit_info.mako",
ldda=ldda,
library_id=library_id,
datatypes=ldatatypes,
@@ -555,7 +541,7 @@ class Library( BaseController ):
else:
msg = "you are not authorized to edit the attributes of dataset '%s'" % ldda.name
messagetype = 'error'
- return trans.fill_template( "/library/ldda_info.mako",
+ return trans.fill_template( "/library/ldda_edit_info.mako",
ldda=ldda,
library_id=library_id,
datatypes=ldatatypes,
@@ -581,7 +567,7 @@ class Library( BaseController ):
else:
msg = "you are not authorized to edit the attributes of dataset '%s'" % ldda.name
messagetype = 'error'
- return trans.fill_template( "/library/ldda_info.mako",
+ return trans.fill_template( "/library/ldda_edit_info.mako",
ldda=ldda,
library_id=library_id,
datatypes=ldatatypes,
@@ -602,7 +588,7 @@ class Library( BaseController ):
else:
msg = "you are not authorized to delete dataset '%s'" % ldda.name
messagetype = 'error'
- return trans.fill_template( "/library/ldda_info.mako",
+ return trans.fill_template( "/library/ldda_edit_info.mako",
ldda=ldda,
library_id=library_id,
datatypes=ldatatypes,
@@ -621,7 +607,7 @@ class Library( BaseController ):
# case it resorts to the old dbkey. Setting the dbkey
# sets it properly in the metadata
ldda.metadata.dbkey = ldda.dbkey
- return trans.fill_template( "/library/ldda_info.mako",
+ return trans.fill_template( "/library/ldda_edit_info.mako",
ldda=ldda,
library_id=library_id,
datatypes=ldatatypes,
@@ -1282,7 +1268,7 @@ class Library( BaseController ):
id=library_item.id,
library_id=library_id,
folder_id=folder_id,
- information=True,
+ edit_info=True,
msg=util.sanitize_text( msg ),
messagetype='error' ) )
user = trans.get_user()
@@ -1314,7 +1300,7 @@ class Library( BaseController ):
id=library_item.id,
library_id=library_id,
folder_id=folder_id,
- information=True,
+ edit_info=True,
msg=util.sanitize_text( msg ),
messagetype='done' ) )
return trans.fill_template( "/library/new_info.mako",
@@ -1337,7 +1323,7 @@ class Library( BaseController ):
id=library_item.id,
library_id=library_id,
folder_id=folder_id,
- information=True,
+ edit_info=True,
msg=util.sanitize_text( msg ),
messagetype='done' ) )
elif params.get( 'permissions', False ):
diff --git a/templates/admin/library/browse_library.mako b/templates/admin/library/browse_library.mako
index c3ead8a9aec..8622ed3b7ed 100644
--- a/templates/admin/library/browse_library.mako
+++ b/templates/admin/library/browse_library.mako
@@ -74,7 +74,11 @@ def name_sorted( l ):
<%def name="render_folder( parent, parent_pad, deleted, created_ldda_ids, library_id )">
<%
- pad = parent_pad + 20
+ root_folder = not parent.parent
+ if root_folder:
+ pad = parent_pad
+ else:
+ pad = parent_pad + 20
if parent_pad == 0:
expander = "/static/images/silk/resultset_bottom.png"
folder = "/static/images/silk/folder_page.png"
@@ -83,7 +87,6 @@ def name_sorted( l ):
expander = "/static/images/silk/resultset_next.png"
folder = "/static/images/silk/folder.png"
subfolder = True
- root_folder = not parent.parent
created_ldda_id_list = util.listify( created_ldda_ids )
if created_ldda_id_list:
created_ldda_ids = [ int( ldda_id ) for ldda_id in created_ldda_id_list ]
@@ -208,9 +211,9 @@ def name_sorted( l ):
##
%endif
-
Format
-
Db
-
Info
+
Information
+
Uploaded By
+
Date
diff --git a/templates/admin/library/common.mako b/templates/admin/library/common.mako
index 2b4a817f215..3f5fb11808d 100644
--- a/templates/admin/library/common.mako
+++ b/templates/admin/library/common.mako
@@ -1,3 +1,5 @@
+<% from time import strftime %>
+
<%def name="render_dataset( library_dataset, selected, library )">
<%
## The received data must always be a LibraryDataset object, but the object id passed to methods from the drop down menu
@@ -5,6 +7,14 @@
## lddas ). We also need to make sure we're displaying the latest version of this library_dataset, so we display the attributes
## from the ldda.
ldda = library_dataset.library_dataset_dataset_association
+ if ldda.user:
+ uploaded_by = ldda.user.email
+ else:
+ uploaded_by = 'anonymous'
+ if ldda == ldda.library_dataset.library_dataset_dataset_association:
+ current_version = True
+ else:
+ current_version = False
%>
%for available_template in available_templates:
%if upload in [ False, 'False' ]:
- # Only render a form if we're not within the upload form
+ ## Only render a form if we're not within the upload form
diff --git a/templates/library/common.mako b/templates/library/common.mako
index 6af6df3e675..a6e42f31a8d 100644
--- a/templates/library/common.mako
+++ b/templates/library/common.mako
@@ -1,3 +1,5 @@
+<% from time import strftime %>
+
<%def name="render_dataset( library_dataset, selected, library )">
<%
## The received data must always be a LibraryDataset object, but the object id passed to methods from the drop down menu
@@ -5,6 +7,14 @@
## lddas ). We also need to make sure we're displaying the latest version of this library_dataset, so we display the attributes
## from the ldda.
ldda = library_dataset.library_dataset_dataset_association
+ if ldda.user:
+ uploaded_by = ldda.user.email
+ else:
+ uploaded_by = 'anonymous'
+ if ldda == ldda.library_dataset.library_dataset_dataset_association:
+ current_version = True
+ else:
+ current_version = False
%>
Other information about ${library_item_desc} ${library_item.name}
+
+ %for library_item_info_association in library_item_info_associations:
+ %for template_element in library_item_info_association.library_item_info.library_item_info_template.elements:
+ <% element = library_item_info_association.library_item_info.get_element_by_template_element( template_element ) %>
+
+
+
+ ${element.contents}
+
+
+
+ %endfor
+
+ %endfor
+
+
+ %endif
+%def>
+
<%def name="render_available_templates( library_item, library_id, restrict=False, upload=False )">
<%
available_templates = library_item.get_library_item_info_templates( template_list=[], restrict=restrict )
@@ -177,15 +211,14 @@
library_item_ids[ 'library_id' ] = library_id
%>
%if available_templates:
- ## There should only be 1 template here
- %for available_template in available_templates:
- %if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_ADD, library_item=available_template ):
-
-
-
Other information about ${library_item_desc} ${library_item.name}
-
+
+
+
Other information about ${library_item_desc} ${library_item.name}
+
+ %for available_template in available_templates:
+ %if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_ADD, library_item=available_template ):
%if upload in [ False, 'False' ]:
- # Only render a form if we're not within the upload form
+ ## Only render a form if we're not within the upload form
+ This information will be displayed in the library browser
+
+
+
+ %for name, spec in ldda.metadata.spec.items():
+ %if spec.visible:
+
+
+
+ ${ldda.metadata.get_html_by_name( name )}
+
+
+
+ %endif
+ %endfor
+
+
+
+
+
+
+
+
+
+
+ This will inspect the dataset and attempt to correct the above column values if they are not accurate.
+
+
+
+
+
+
+
Change data type
+
+
+
+
+
+
+ ${datatype( ldda, datatypes )}
+
+
+ This will change the datatype of the existing dataset
+ but not modify its contents. Use this if Galaxy
+ has incorrectly guessed the type of your dataset.
+
+ %if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_MODIFY, library_item=ldda.library_dataset ):
+ Edit this dataset's information
+ %else:
+ View this dataset's information
+ %endif
+ ## We're disabling the ability to add templates at the LDDA and LibraryDataset level, but will leave this here for possible future use
+ ##%if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_ADD, library_item=ldda.library_dataset ):
+ ## Add an information template to this dataset
+ ##%endif
+ %if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.DATASET_MANAGE_PERMISSIONS, dataset=ldda.dataset ) and trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_MANAGE, library_item=ldda.library_dataset ):
+ Edit this dataset's permissions
+ %if current_version and trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_MODIFY, library_item=ldda.library_dataset ):
+ Upload a new version of this dataset
+ %endif
+ %endif
+ %if ldda.has_data:
+ Import this dataset into your current history
+ Download this dataset
+ %endif
-
-
-
Change data type
-
-
-
-
-
-
- ${datatype( ldda, datatypes )}
-
-
- This will change the datatype of the existing dataset
- but not modify its contents. Use this if Galaxy
- has incorrectly guessed the type of your dataset.
-
- This information will be displayed in the library browser
+ This information will be displayed in the "Information" column for this dataset in the library browser