%def>
## Render the grid's basic elements. Each of these elements can be subclassed.
<%def name="body()">
${render_content()}
%def>
<%def name="title()">Browse data library%def>
<%def name="stylesheets()">
${parent.stylesheets()}
${h.css( "library" )}
%def>
<%def name="javascripts()">
${parent.javascripts()}
${h.js("class", "jquery.jstore")}
${self.grid_javascripts()}
%def>
<%def name="grid_javascripts()">
%def>
<%def name="render_dataset( cntrller, ldda, library_dataset, selected, library, folder, pad, parent, row_counter, tracked_datasets, show_deleted=False )">
<%
## The received ldda must always be a LibraryDatasetDatasetAssociation object. The object id passed to methods
## from the drop down menu should be the ldda id to prevent id collision ( which could happen when displaying
## children, which are always 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.
from galaxy.web.controllers.library_common import active_folders, active_folders_and_lddas, activatable_folders_and_lddas, branch_deleted
if ldda.user:
uploaded_by = ldda.user.email
else:
uploaded_by = 'anonymous'
if ldda == library_dataset.library_dataset_dataset_association:
current_version = True
if trans.user_is_admin() and cntrller == 'library_admin':
can_modify = can_manage = True
elif cntrller in [ 'library', 'requests' ]:
can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, library_dataset )
can_manage = trans.app.security_agent.can_manage_library_item( current_user_roles, library_dataset )
else:
can_modify = can_manage = False
else:
current_version = False
if current_version and ldda.state not in ( 'ok', 'error', 'empty', 'deleted', 'discarded' ):
tracked_datasets[ldda.id] = ldda.state
info_association, inherited = ldda.get_info_association( restrict=True )
%>
%if current_version and ( not ldda.library_dataset.deleted or show_deleted ):
%if ldda.library_dataset.deleted:
%endif
%if not library.deleted:
%if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify:
Edit information
%else:
View information
%endif
%if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify and not info_association:
Add template
%endif
%if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify and info_association:
Edit templateDelete template
%endif
%if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_manage:
%if not trans.app.security_agent.dataset_is_public( ldda.dataset ):
Make public
%endif
Edit permissions
%endif
%if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify:
Upload a new version of this dataset
%endif
%if not branch_deleted( folder ) and not ldda.library_dataset.deleted and ldda.has_data:
Import this dataset into your current historyDownload this dataset
%endif
%if can_modify:
%if not library.deleted and not branch_deleted( folder ) and not ldda.library_dataset.deleted:
Delete this dataset
%elif not library.deleted and not branch_deleted( folder ) and not ldda.library_dataset.purged and ldda.library_dataset.deleted:
Undelete this dataset
%endif
%endif
%endif
${render_library_item_info( ldda )}
${uploaded_by}
${ldda.create_time.strftime( "%Y-%m-%d" )}
${ldda.get_size( nice_size=True )}
<%
my_row = row_counter.count
row_counter.increment()
%>
%endif
%def>
<%def name="render_folder( cntrller, folder, folder_pad, created_ldda_ids, library, hidden_folder_ids, tracked_datasets, show_deleted=False, parent=None, row_counter=None, root_folder=False )">
<%
from galaxy.web.controllers.library_common import active_folders, active_folders_and_lddas, activatable_folders_and_lddas, branch_deleted
if root_folder:
pad = folder_pad
expander = h.url_for("/static/images/silk/resultset_bottom.png")
folder_img = h.url_for("/static/images/silk/folder_page.png")
else:
pad = folder_pad + 20
expander = h.url_for("/static/images/silk/resultset_next.png")
folder_img = h.url_for("/static/images/silk/folder.png")
if created_ldda_ids:
created_ldda_ids = util.listify( created_ldda_ids )
if str( folder.id ) in hidden_folder_ids:
return ""
my_row = None
if trans.user_is_admin() and cntrller == 'library_admin':
can_add = can_modify = can_manage = True
elif cntrller in [ 'library', 'requests' ]:
can_access, folder_ids = trans.app.security_agent.check_folder_contents( trans.user, current_user_roles, folder )
if not can_access:
can_show, folder_ids = \
trans.app.security_agent.show_library_item( trans.user,
current_user_roles,
folder,
[ trans.app.security_agent.permitted_actions.LIBRARY_ADD,
trans.app.security_agent.permitted_actions.LIBRARY_MODIFY,
trans.app.security_agent.permitted_actions.LIBRARY_MANAGE ] )
if not can_show:
return ""
can_add = trans.app.security_agent.can_add_library_item( current_user_roles, folder )
can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, folder )
can_manage = trans.app.security_agent.can_manage_library_item( current_user_roles, folder )
else:
can_add = can_modify = can_manage = False
info_association, inherited = folder.get_info_association( restrict=True )
%>
%if not root_folder and ( not folder.deleted or show_deleted ):
%if folder.deleted:
%endif
%if not branch_deleted( folder ):
%if not library.deleted:
%if not branch_deleted( folder ) and can_add:
Add datasetsAdd sub-folder
%endif
%if not branch_deleted( folder ):
%if can_modify:
Edit information
%else:
View information
%endif
%endif
%if not branch_deleted( folder ) and can_modify and not info_association:
Add template
%endif
%if not branch_deleted( folder ) and can_modify and info_association:
Edit templateDelete template
%endif
%if not branch_deleted( folder ) and can_manage:
%if not trans.app.security_agent.folder_is_public( folder ):
Make public
%endif
Edit permissions
%endif
%if can_modify:
%if not library.deleted and not folder.deleted:
Delete this folder
%elif not library.deleted and folder.deleted and not folder.purged:
Undelete this folder
%endif
%endif
%if message:
${render_msg( message, status )}
%endif
%if library.synopsis not in [ 'None', None ]:
${library.synopsis}
%endif
%if tracked_datasets:
%endif
## Help about compression types
TIP: You can download individual library files by selecting "Download this dataset" from the context menu (triangle) next to the dataset's name.
%if len( comptypes ) > 1:
TIP: Multiple compression options are available for downloading library datasets:
%if 'gz' in comptypes:
gzip: Recommended for fast network connections
%if trans.app.config.upstream_gzip:
NOTE: The file you receive will be an uncompressed .tar file - this is because the Galaxy server compresses it and your browser decompresses it on the fly.
%endif
%endif
%if 'bz2' in comptypes:
bzip2: Recommended for slower network connections (smaller size but takes longer to compress)
%endif
%if 'zip' in comptypes:
zip: Not recommended but is provided as an option for those who cannot open the above formats