mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
A few improvements to library templates. Behavior is still not optimal, but at least now functional. Functional tests still needed, and coming shortly.
This commit is contained in:
@@ -1287,8 +1287,7 @@ class LibraryCommon( BaseController ):
|
||||
filter=dict( deleted=False ),
|
||||
form_type=trans.app.model.FormDefinition.types.LIBRARY_INFO_TEMPLATE )
|
||||
if not forms:
|
||||
msg = "There are no forms on which to base the template, so create a form and "
|
||||
msg += "try again to add the information template to the %s." % library_item_desc
|
||||
msg = "There are no forms on which to base the template, so create a form and try to add the template again."
|
||||
trans.response.send_redirect( web.url_for( controller='forms',
|
||||
action='new',
|
||||
msg=msg,
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
<a class="action-button" href="${h.url_for( controller='library_common', action='ldda_display_info', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), id=trans.security.encode_id( ldda.id ), show_deleted=show_deleted )}">View this dataset's information</a>
|
||||
%endif
|
||||
%if not branch_deleted( folder ) and not ldda.library_dataset.deleted and ( ( cntrller in [ 'library_admin', 'requests_admin' ] or can_add ) and not info_association ):
|
||||
<a class="action-button" href="${h.url_for( controller='library_common', action='add_info_template', cntrller=cntrller, item_type='ldda', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), ldda_id=trans.security.encode_id( ldda.id ), show_deleted=show_deleted )}">Add template to this dataset</a>
|
||||
<a class="action-button" href="${h.url_for( controller='library_common', action='add_info_template', cntrller=cntrller, item_type='ldda', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), ldda_id=trans.security.encode_id( ldda.id ), show_deleted=show_deleted )}">Add a template to this dataset</a>
|
||||
%endif
|
||||
%if not branch_deleted( folder ) and not ldda.library_dataset.deleted and cntrller == 'library_admin' and info_association:
|
||||
<a class="action-button" href="${h.url_for( controller='library_common', action='delete_info_template', cntrller=cntrller, item_type='ldda', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), ldda_id=trans.security.encode_id( ldda.id ), show_deleted=show_deleted )}">Delete this dataset's template</a>
|
||||
@@ -294,7 +294,7 @@
|
||||
<a class="action-button" href="${h.url_for( controller='library_common', action='folder_info', cntrller=cntrller, id=trans.security.encode_id( folder.id ), library_id=library_id, show_deleted=show_deleted )}">Edit this folder's information</a>
|
||||
%endif
|
||||
%if not branch_deleted( folder ) and ( ( cntrller in [ 'library_admin', 'requests_admin' ] or can_add ) and not info_association ):
|
||||
<a class="action-button" href="${h.url_for( controller='library_common', action='add_info_template', cntrller=cntrller, item_type='folder', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), show_deleted=show_deleted )}">Add template to this folder</a>
|
||||
<a class="action-button" href="${h.url_for( controller='library_common', action='add_info_template', cntrller=cntrller, item_type='folder', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), show_deleted=show_deleted )}">Add a template to this folder</a>
|
||||
%endif
|
||||
%if not branch_deleted( folder ) and cntrller == 'library_admin' and info_association:
|
||||
<a class="action-button" href="${h.url_for( controller='library_common', action='delete_info_template', cntrller=cntrller, item_type='folder', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( folder.id ), show_deleted=show_deleted )}">Delete this folder's template</a>
|
||||
|
||||
@@ -265,7 +265,7 @@
|
||||
${field[ 'widget' ].get_html()}
|
||||
</div>
|
||||
<div class="toolParamHelp" style="clear: both;">
|
||||
${field[ 'helptext' ]}
|
||||
${field[ 'helptext' ]}, leave blank to add a different template to this dataset after upload.
|
||||
</div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
<%inherit file="/base.mako"/>
|
||||
<%namespace file="/message.mako" import="render_msg" />
|
||||
<%namespace file="/library/common/common.mako" import="render_template_info" />
|
||||
<% from galaxy import util %>
|
||||
|
||||
<%
|
||||
from galaxy import util
|
||||
from galaxy.web.controllers.library_common import branch_deleted
|
||||
|
||||
if ldda == ldda.library_dataset.library_dataset_dataset_association:
|
||||
current_version = True
|
||||
else:
|
||||
current_version = False
|
||||
if ldda.user:
|
||||
uploaded_by = ldda.user.email
|
||||
else:
|
||||
uploaded_by = 'anonymous'
|
||||
info_association, inherited = ldda.get_info_association( restrict=True )
|
||||
%>
|
||||
|
||||
%if current_version:
|
||||
@@ -27,24 +33,22 @@
|
||||
${render_msg( msg, messagetype )}
|
||||
%endif
|
||||
|
||||
<%
|
||||
if ldda.user:
|
||||
uploaded_by = ldda.user.email
|
||||
else:
|
||||
uploaded_by = 'anonymous'
|
||||
%>
|
||||
|
||||
<div class="toolForm">
|
||||
<div class="toolFormTitle">
|
||||
Information about ${ldda.name}
|
||||
%if not library.deleted and not ldda.library_dataset.folder.deleted and not ldda.deleted:
|
||||
%if not library.deleted and not branch_deleted( ldda.library_dataset.folder ) and not ldda.library_dataset.deleted:
|
||||
<a id="dataset-${ldda.id}-popup" class="popup-arrow" style="display: none;">▼</a>
|
||||
<div popupmenu="dataset-${ldda.id}-popup">
|
||||
%if cntrller=='library_admin' or trans.app.security_agent.can_modify_library_item( current_user_roles, ldda.library_dataset ):
|
||||
<a class="action-button" href="${h.url_for( controller='library_common', action='ldda_edit_info', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), id=trans.security.encode_id( ldda.id ), show_deleted=show_deleted )}">Edit this dataset's information</a>
|
||||
%if not info_association:
|
||||
<a class="action-button" href="${h.url_for( controller='library_common', action='add_info_template', cntrller=cntrller, item_type='ldda', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), ldda_id=trans.security.encode_id( ldda.id ), show_deleted=show_deleted )}">Add a template to this dataset</a>
|
||||
%else:
|
||||
<a class="action-button" href="${h.url_for( controller='library_common', action='delete_info_template', cntrller=cntrller, item_type='ldda', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), ldda_id=trans.security.encode_id( ldda.id ), show_deleted=show_deleted )}">Delete this dataset's template</a>
|
||||
%endif
|
||||
%endif
|
||||
%if cntrller=='library_admin' or trans.app.security_agent.can_manage_dataset( current_user_roles, ldda.dataset ) and trans.app.security_agent.can_manage_library_item( current_user_roles, ldda.library_dataset ):
|
||||
<a class="action-button" href="${h.url_for( controller='library_common', action='ldda_permissions', library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), id=trans.security.encode_id( ldda.id ), show_deleted=show_deleted )}">Edit this dataset's permissions</a>
|
||||
<a class="action-button" href="${h.url_for( controller='library_common', action='ldda_permissions', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), id=trans.security.encode_id( ldda.id ), show_deleted=show_deleted )}">Edit this dataset's permissions</a>
|
||||
%endif
|
||||
%if current_version and ( cntrller=='library_admin' or trans.app.security_agent.can_modify_library_item( current_user_roles, ldda.library_dataset ) ):
|
||||
<a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), replace_id=trans.security.encode_id( ldda.library_dataset.id ), show_deleted=show_deleted )}">Upload a new version of this dataset</a>
|
||||
|
||||
@@ -118,7 +118,10 @@ class TestSecurityAndLibraries( TwillTestCase ):
|
||||
dp = sa_session.query( galaxy.model.DatasetPermissions ) \
|
||||
.filter( galaxy.model.DatasetPermissions.table.c.dataset_id==latest_dataset.id ) \
|
||||
.first()
|
||||
if not dp.action == galaxy.model.Dataset.permitted_actions.DATASET_MANAGE_PERMISSIONS.action:
|
||||
if not dp.action:
|
||||
raise AssertionError( 'The Dataset id %d has no associated DatasetPermissions when is should have "manage permissions".' \
|
||||
% latest_dataset.id )
|
||||
elif not dp.action == galaxy.model.Dataset.permitted_actions.DATASET_MANAGE_PERMISSIONS.action:
|
||||
raise AssertionError( 'The DatasetPermissions.action for dataset id %d is "%s", but it should be "manage permissions"' \
|
||||
% ( latest_dataset.id, dp.action ) )
|
||||
# Change DefaultHistoryPermissions for regular_user1
|
||||
|
||||
Reference in New Issue
Block a user