<%namespace file="/message.mako" import="render_msg" /> <%namespace file="/library/common/library_item_info.mako" import="render_library_item_info" /> <%namespace file="/library/common/common.mako" import="render_actions_on_multiple_items" /> <%! def inherit(context): if context.get('use_panels'): return '/webapps/galaxy/base_panels.mako' else: return '/base.mako' %> <%inherit file="${inherit(context)}"/> <%def name="init()"> <% self.has_left_panel=False self.has_right_panel=False self.message_box_visible=False self.active_view="user" self.overlay_visible=False %> ## ## Override methods from base.mako and base_panels.mako ## <%def name="center_panel()">
${render_content()}
## Render the grid's basic elements. Each of these elements can be subclassed. <%def name="body()"> ${render_content()} <%def name="title()">Browse data library <%def name="stylesheets()"> ${parent.stylesheets()} ${h.css( "library" )} <%def name="javascripts()"> ${parent.javascripts()} ${h.js("class", "jquery.jstore")} ${self.grid_javascripts()} <%def name="grid_javascripts()"> <%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 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 template Delete 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 history Download 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 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 folder.deleted: %endif %if not branch_deleted( folder ): %if not library.deleted:
%if not branch_deleted( folder ) and can_add: Add datasets Add 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 template Delete 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
%endif %endif %if folder.description: ${folder.description} %endif <% my_row = row_counter.count row_counter.increment() %> %endif %if cntrller == 'library': <% sub_folders = active_folders( trans, folder ) %> %for sub_folder in sub_folders: ${render_folder( cntrller, sub_folder, pad, created_ldda_ids, library, hidden_folder_ids, tracked_datasets, show_deleted=show_deleted, parent=my_row, row_counter=row_counter, root_folder=False )} %endfor %for library_dataset in folder.active_library_datasets: <% ldda = library_dataset.library_dataset_dataset_association can_access = trans.app.security_agent.can_access_dataset( current_user_roles, ldda.dataset ) selected = created_ldda_ids and str( ldda.id ) in created_ldda_ids %> %if can_access: ${render_dataset( cntrller, ldda, library_dataset, selected, library, folder, pad, my_row, row_counter, tracked_datasets, show_deleted=show_deleted )} %endif %endfor %elif trans.user_is_admin() and cntrller == 'library_admin': <% if show_deleted: sub_folders, lddas = activatable_folders_and_lddas( trans, folder ) else: sub_folders, lddas = active_folders_and_lddas( trans, folder ) %> %for sub_folder in sub_folders: ${render_folder( cntrller, sub_folder, pad, created_ldda_ids, library, [], tracked_datasets, show_deleted=show_deleted, parent=my_row, row_counter=row_counter, root_folder=False )} %endfor %for ldda in lddas: <% library_dataset = ldda.library_dataset selected = created_ldda_ids and str( ldda.id ) in created_ldda_ids %> ${render_dataset( cntrller, ldda, library_dataset, selected, library, folder, pad, my_row, row_counter, tracked_datasets, show_deleted=show_deleted )} %endfor %endif <%def name="render_content()"> <% from galaxy import util from galaxy.web.controllers.library_common import branch_deleted from time import strftime if trans.user_is_admin() and cntrller == 'library_admin': can_add = can_modify = can_manage = True elif cntrller in [ 'library', 'requests' ]: can_add = trans.app.security_agent.can_add_library_item( current_user_roles, library ) can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, library ) can_manage = trans.app.security_agent.can_manage_library_item( current_user_roles, library ) else: can_add = can_modify = can_manage = False info_association, inherited = library.get_info_association() tracked_datasets = {} class RowCounter( object ): def __init__( self ): self.count = 0 def increment( self ): self.count += 1 def __str__( self ): return str( self.count ) %>

Data Library “${library.name}”

%if message: ${render_msg( message, status )} %endif %if library.synopsis not in [ 'None', None ]:
${library.synopsis}

%endif
<% row_counter = RowCounter() %> %if cntrller in [ 'library', 'requests' ]: ${self.render_folder( 'library', library.root_folder, 0, created_ldda_ids, library, hidden_folder_ids, tracked_datasets, show_deleted=show_deleted, parent=None, row_counter=row_counter, root_folder=True )} %if not library.deleted: ${render_actions_on_multiple_items()} %endif %elif ( trans.user_is_admin() and cntrller in [ 'library_admin', 'requests_admin' ] ): ${self.render_folder( 'library_admin', library.root_folder, 0, created_ldda_ids, library, [], tracked_datasets, show_deleted=show_deleted, parent=None, row_counter=row_counter, root_folder=True )} %if not library.deleted and not show_deleted: ${render_actions_on_multiple_items()} %endif %endif
Name Information Uploaded By Date File Size
%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:

%endif