HTML escape user-settable values in Data Libraries. Update tests to reflect that e.g. quotes are now html escaped within pages. Eliminate the unnecessary use of Params() object for these controllers.

This commit is contained in:
Daniel Blankenberg
2014-12-08 12:27:48 -05:00
parent 902d961f5a
commit b219af01e2
17 changed files with 428 additions and 451 deletions
@@ -3,7 +3,7 @@ from galaxy import model, util
from galaxy import web
from galaxy.model.orm import and_, not_, or_
from galaxy.web.base.controller import BaseUIController
from galaxy.web.framework.helpers import grids
from galaxy.web.framework.helpers import escape, grids
from library_common import get_comptypes, lucene_search, whoosh_search
@@ -79,7 +79,6 @@ class Library( BaseUIController ):
@web.expose
def list( self, trans, **kwd ):
params = util.Params( kwd )
# define app configuration for generic mako template
app = {
'jscript' : "galaxy.library"
@@ -89,10 +88,9 @@ class Library( BaseUIController ):
@web.expose
def index( self, trans, **kwd ):
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
default_action = params.get( 'default_action', None )
message = escape( kwd.get( 'message', '' ) )
status = escape( kwd.get( 'status', 'done' ) )
default_action = kwd.get( 'default_action', None )
return trans.fill_template( "/library/index.mako",
default_action=default_action,
message=message,
@@ -5,7 +5,7 @@ import galaxy.util
from galaxy import web
from galaxy.web.base.controller import BaseUIController
from galaxy.web.framework.helpers import grids, time_ago
from galaxy.web.framework.helpers import escape, grids, time_ago
from library_common import get_comptypes, lucene_search, whoosh_search
# from galaxy.model.orm import *
@@ -141,20 +141,19 @@ class LibraryAdmin( BaseUIController ):
lddas=lddas,
show_deleted=show_deleted,
use_panels=use_panels,
message=message,
status=status )
message=escape( message ),
status=escape( status ) )
# Render the list view
return self.library_list_grid( trans, **kwd )
@web.expose
@web.require_admin
def create_library( self, trans, **kwd ):
params = galaxy.util.Params( kwd )
message = galaxy.util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
if params.get( 'create_library_button', False ):
name = galaxy.util.restore_text( params.get( 'name', 'No name' ) )
description = galaxy.util.restore_text( params.get( 'description', '' ) )
synopsis = galaxy.util.restore_text( params.get( 'synopsis', '' ) )
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
if kwd.get( 'create_library_button', False ):
name = kwd.get( 'name', 'No name' )
description = kwd.get( 'description', '' )
synopsis = kwd.get( 'synopsis', '' )
if synopsis in [ 'None', None ]:
synopsis = ''
library = trans.app.model.Library( name=name, description=description, synopsis=synopsis )
@@ -167,9 +166,9 @@ class LibraryAdmin( BaseUIController ):
action='browse_library',
cntrller='library_admin',
id=trans.security.encode_id( library.id ),
message=galaxy.util.sanitize_text( message ),
message=message,
status='done' ) )
return trans.fill_template( '/admin/library/new_library.mako', message=message, status=status )
return trans.fill_template( '/admin/library/new_library.mako', message=escape( message ), status=escape( status ) )
@web.expose
@web.require_admin
def delete_library( self, trans, id, **kwd ):
@@ -196,8 +195,7 @@ class LibraryAdmin( BaseUIController ):
# TODO: change this function to purge_library_item, behaving similar to delete_library_item
# assuming we want the ability to purge libraries.
# This function is currently only used by the functional tests.
params = galaxy.util.Params( kwd )
library = trans.sa_session.query( trans.app.model.Library ).get( trans.security.decode_id( params.id ) )
library = trans.sa_session.query( trans.app.model.Library ).get( trans.security.decode_id( kwd.get( 'id' ) ) )
def purge_folder( library_folder ):
for lf in library_folder.folders:
purge_folder( lf )
@@ -226,7 +224,7 @@ class LibraryAdmin( BaseUIController ):
message = "Library '%s' has not been marked deleted, so it cannot be purged" % ( library.name )
return trans.response.send_redirect( web.url_for( controller='library_admin',
action='browse_libraries',
message=galaxy.util.sanitize_text( message ),
message=message,
status='error' ) )
else:
purge_folder( library.root_folder )
@@ -236,5 +234,5 @@ class LibraryAdmin( BaseUIController ):
message = "Library '%s' and all of its contents have been purged, datasets will be removed from disk via the cleanup_datasets script" % library.name
return trans.response.send_redirect( web.url_for( controller='library_admin',
action='browse_libraries',
message=galaxy.util.sanitize_text( message ),
message=message,
status='done' ) )
File diff suppressed because it is too large Load Diff
@@ -236,29 +236,29 @@
%if current_version and ( not ldda.library_dataset.deleted or show_deleted ):
<tr class="datasetRow"
%if parent is not None:
parent="${parent}"
parent="${parent | h}"
%endif
id="libraryItem-${ldda.id}">
id="libraryItem-${ldda.id | h}">
<td style="padding-left: ${pad+20}px;">
<input style="float: left;" type="checkbox" name="ldda_ids" id="${trans.security.encode_id( ldda.id )}" value="${trans.security.encode_id( ldda.id )}"
<input style="float: left;" type="checkbox" name="ldda_ids" id="${trans.security.encode_id( ldda.id ) | h}" value="${trans.security.encode_id( ldda.id ) | h}"
%if selected:
checked="checked"
%endif
/>
%if simple:
<label for="${trans.security.encode_id( ldda.id )}">${ util.unicodify( ldda.name )}</label>
<label for="${trans.security.encode_id( ldda.id ) | h}">${ util.unicodify( ldda.name ) | h}</label>
%else:
<div style="float: left; margin-left: 1px;" class="menubutton split popup" id="dataset-${ldda.id}-popup">
<div style="float: left; margin-left: 1px;" class="menubutton split popup" id="dataset-${ldda.id | h}-popup">
<a class="view-info" href="${h.url_for( controller='library_common', action='ldda_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 ), use_panels=use_panels, show_deleted=show_deleted )}">
%if ldda.library_dataset.deleted:
<div class="libraryItem-error">${util.unicodify( ldda.name )}</div>
<div class="libraryItem-error">${util.unicodify( ldda.name ) | h}</div>
%else:
${util.unicodify( ldda.name )}
${util.unicodify( ldda.name ) | h}
%endif
</a>
</div>
%if not library.deleted:
<div popupmenu="dataset-${ldda.id}-popup">
<div popupmenu="dataset-${ldda.id | h}-popup">
%if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify:
<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( folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit information</a>
<a class="action-button" href="${h.url_for( controller='library_common', action='move_library_item', cntrller=cntrller, item_type='ldda', item_id=trans.security.encode_id( ldda.id ), source_library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Move this dataset</a>
@@ -287,7 +287,7 @@
%endif
%if can_modify:
%if not library.deleted and not branch_deleted( folder ) and not ldda.library_dataset.deleted:
<a class="action-button" confirm="Click OK to delete dataset '${util.unicodify( ldda.name )}'." href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library_dataset.id ), item_type='library_dataset', show_deleted=show_deleted )}">Delete this dataset</a>
<a class="action-button" confirm="Click OK to delete dataset '${util.unicodify( ldda.name ) | h}'." href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library_dataset.id ), item_type='library_dataset', show_deleted=show_deleted )}">Delete this dataset</a>
%elif not library.deleted and not branch_deleted( folder ) and not ldda.library_dataset.purged and ldda.library_dataset.deleted:
<a class="action-button" href="${h.url_for( controller='library_common', action='undelete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library_dataset.id ), item_type='library_dataset', show_deleted=show_deleted )}">Undelete this dataset</a>
%endif
@@ -298,10 +298,10 @@
</td>
% if not simple:
<td id="libraryItemInfo">${render_library_item_info( ldda )}</td>
<td>${ldda.extension}</td>
<td>${ldda.extension | h}</td>
% endif
<td>${ldda.create_time.strftime( trans.app.config.pretty_datetime_format )}</td>
<td>${ldda.get_size( nice_size=True )}</td>
<td>${ldda.create_time.strftime( trans.app.config.pretty_datetime_format ) | h}</td>
<td>${ldda.get_size( nice_size=True ) | h}</td>
</tr>
<%
my_row = row_counter.count
@@ -355,28 +355,28 @@
%>
%if not root_folder and ( not folder.deleted or show_deleted ):
<% encoded_id = trans.security.encode_id( folder.id ) %>
<tr id="folder-${encoded_id}" class="folderRow libraryOrFolderRow"
<tr id="folder-${encoded_id | h}" class="folderRow libraryOrFolderRow"
%if parent is not None:
parent="${parent}"
parent="${parent | h}"
style="display: none;"
%endif
>
<td style="padding-left: ${folder_pad}px;">
<td style="padding-left: ${folder_pad | h}px;">
<input type="checkbox" class="folderCheckbox"/>
<span class="expandLink folder-${encoded_id}-click">
<div style="float: left; margin-left: 2px;" class="menubutton split popup" id="folder_img-${folder.id}-popup">
<a class="folder-${encoded_id}-click" href="javascript:void(0);">
<span class="expandLink folder-${encoded_id | h}-click">
<div style="float: left; margin-left: 2px;" class="menubutton split popup" id="folder_img-${folder.id | h}-popup">
<a class="folder-${encoded_id | h}-click" href="javascript:void(0);">
<span class="rowIcon"></span>
%if folder.deleted:
<div class="libraryItem-error">${folder.name}</div>
<div class="libraryItem-error">${folder.name | h}</div>
%else:
${folder.name}
${folder.name | h}
%endif
</a>
</div>
</span>
%if not library.deleted:
<div popupmenu="folder_img-${folder.id}-popup">
<div popupmenu="folder_img-${folder.id | h}-popup">
%if not branch_deleted( folder ) and can_add:
<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( folder.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add datasets</a>
<a class="action-button" href="${h.url_for( controller='library_common', action='create_folder', cntrller=cntrller, parent_id=trans.security.encode_id( folder.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add sub-folder</a>
@@ -407,7 +407,7 @@
%endif
%if can_modify:
%if not library.deleted and not folder.deleted:
<a class="action-button" confirm="Click OK to delete the folder '${folder.name}.'" href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( folder.id ), item_type='folder', show_deleted=show_deleted )}">Delete this folder</a>
<a class="action-button" confirm="Click OK to delete the folder '${folder.name | h}.'" href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( folder.id ), item_type='folder', show_deleted=show_deleted )}">Delete this folder</a>
%elif not library.deleted and folder.deleted and not folder.purged:
<a class="action-button" href="${h.url_for( controller='library_common', action='undelete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( folder.id ), item_type='folder', show_deleted=show_deleted )}">Undelete this folder</a>
%endif
@@ -416,7 +416,7 @@
%endif
<td>
%if folder.description:
${folder.description}
${folder.description | h}
%endif
<td colspan="3"></td>
</tr>
@@ -504,7 +504,7 @@
return str( self.count )
%>
<h2>Data Library &ldquo;${library.name}&rdquo;</h2>
<h2>Data Library &ldquo;${library.name | h}&rdquo;</h2>
<ul class="manage-table-actions">
%if not library.deleted and ( is_admin or can_add ):
@@ -517,7 +517,7 @@
%if not library.deleted:
%if can_modify:
<a class="action-button" href="${h.url_for( controller='library_common', action='library_info', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit information</a>
<a class="action-button" confirm="Click OK to delete the library named '${library.name}'." href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library.id ), item_type='library' )}">Delete this data library</a>
<a class="action-button" confirm="Click OK to delete the library named '${library.name | h}'." href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library.id ), item_type='library' )}">Delete this data library</a>
%if show_deleted:
<a class="action-button" href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=False )}">Hide deleted items</a>
%else:
@@ -555,7 +555,7 @@
%if library.synopsis not in [ '', 'None', None ]:
<div class="libraryItemBody">
${library.synopsis}
${library.synopsis | h}
</div>
%endif
@@ -610,6 +610,6 @@
${render_compression_types_help( comptypes )}
%endif
%if not has_accessible_folders:
The data library '${library.name}' does not contain any datasets that you can access.
The data library '${library.name | h}' does not contain any datasets that you can access.
%endif
</%def>
@@ -228,29 +228,29 @@
%if current_version and ( not ldda.library_dataset.deleted or show_deleted ):
<tr class="datasetRow"
%if parent is not None:
parent="${parent}"
parent="${parent | h}"
%endif
id="libraryItem-${ldda.id}">
id="libraryItem-${ldda.id | h}">
<td style="padding-left: ${pad+20}px;">
<input style="float: left;" type="checkbox" name="ldda_ids" id="${trans.security.encode_id( ldda.id )}" value="${trans.security.encode_id( ldda.id )}"
<input style="float: left;" type="checkbox" name="ldda_ids" id="${trans.security.encode_id( ldda.id ) | h}" value="${trans.security.encode_id( ldda.id ) | h}"
%if selected:
checked="checked"
%endif
/>
%if simple:
<label for="${trans.security.encode_id( ldda.id )}">${ util.unicodify( ldda.name )}</label>
<label for="${trans.security.encode_id( ldda.id ) | h}">${ util.unicodify( ldda.name ) | h}</label>
%else:
<div style="float: left; margin-left: 1px;" class="menubutton split popup" id="dataset-${ldda.id}-popup">
<div style="float: left; margin-left: 1px;" class="menubutton split popup" id="dataset-${ldda.id | h}-popup">
<a class="view-info" href="${h.url_for( controller='library_common', action='ldda_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 ), use_panels=use_panels, show_deleted=show_deleted )}">
%if ldda.library_dataset.deleted:
<div class="libraryItem-error">${util.unicodify( ldda.name )}</div>
<div class="libraryItem-error">${util.unicodify( ldda.name ) | h}</div>
%else:
${util.unicodify( ldda.name )}
${util.unicodify( ldda.name ) | h}
%endif
</a>
</div>
%if not library.deleted:
<div popupmenu="dataset-${ldda.id}-popup">
<div popupmenu="dataset-${ldda.id | h}-popup">
%if not branch_deleted( folder ) and not ldda.library_dataset.deleted and can_modify:
<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( folder.id ), id=trans.security.encode_id( ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit information</a>
<a class="action-button" href="${h.url_for( controller='library_common', action='move_library_item', cntrller=cntrller, item_type='ldda', item_id=trans.security.encode_id( ldda.id ), source_library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Move this dataset</a>
@@ -279,7 +279,7 @@
%endif
%if can_modify:
%if not library.deleted and not branch_deleted( folder ) and not ldda.library_dataset.deleted:
<a class="action-button" confirm="Click OK to delete dataset '${util.unicodify( ldda.name )}'." href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library_dataset.id ), item_type='library_dataset', show_deleted=show_deleted )}">Delete this dataset</a>
<a class="action-button" confirm="Click OK to delete dataset '${util.unicodify( ldda.name ) | h}'." href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library_dataset.id ), item_type='library_dataset', show_deleted=show_deleted )}">Delete this dataset</a>
%elif not library.deleted and not branch_deleted( folder ) and not ldda.library_dataset.purged and ldda.library_dataset.deleted:
<a class="action-button" href="${h.url_for( controller='library_common', action='undelete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library_dataset.id ), item_type='library_dataset', show_deleted=show_deleted )}">Undelete this dataset</a>
%endif
@@ -290,10 +290,10 @@
</td>
% if not simple:
<td id="libraryItemInfo">${render_library_item_info( ldda )}</td>
<td>${ldda.extension}</td>
<td>${ldda.extension | h}</td>
% endif
<td>${ldda.create_time.strftime( "%Y-%m-%d" )}</td>
<td>${ldda.get_size( nice_size=True )}</td>
<td>${ldda.create_time.strftime( "%Y-%m-%d" ) | h}</td>
<td>${ldda.get_size( nice_size=True ) | h}</td>
</tr>
<%
my_row = row_counter.count
@@ -362,28 +362,28 @@
%>
%if not root_folder and ( not folder.deleted or show_deleted ):
<% encoded_id = trans.security.encode_id( folder.id ) %>
<tr id="folder-${encoded_id}" class="folderRow libraryOrFolderRow"
<tr id="folder-${encoded_id | h}" class="folderRow libraryOrFolderRow"
%if parent is not None:
parent="${parent}"
parent="${parent | h}"
style="display: none;"
%endif
>
<td style="padding-left: ${folder_pad}px;">
<td style="padding-left: ${folder_pad | h}px;">
<input type="checkbox" class="folderCheckbox"/>
<span class="expandLink folder-${encoded_id}-click">
<div style="float: left; margin-left: 2px;" class="menubutton split popup" id="folder_img-${folder.id}-popup">
<a class="folder-${encoded_id}-click" href="javascript:void(0);">
<span class="expandLink folder-${encoded_id | h}-click">
<div style="float: left; margin-left: 2px;" class="menubutton split popup" id="folder_img-${folder.id | h}-popup">
<a class="folder-${encoded_id | h}-click" href="javascript:void(0);">
<span class="rowIcon"></span>
%if folder.deleted:
<div class="libraryItem-error">${folder.name}</div>
<div class="libraryItem-error">${folder.name | h}</div>
%else:
${folder.name}
${folder.name | h}
%endif
</a>
</div>
</span>
%if not library.deleted:
<div popupmenu="folder_img-${folder.id}-popup">
<div popupmenu="folder_img-${folder.id | h}-popup">
%if not branch_deleted( folder ) and can_add:
<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( folder.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add datasets</a>
<a class="action-button" href="${h.url_for( controller='library_common', action='create_folder', cntrller=cntrller, parent_id=trans.security.encode_id( folder.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add sub-folder</a>
@@ -414,7 +414,7 @@
%endif
%if can_modify:
%if not library.deleted and not folder.deleted:
<a class="action-button" confirm="Click OK to delete the folder '${folder.name}.'" href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( folder.id ), item_type='folder', show_deleted=show_deleted )}">Delete this folder</a>
<a class="action-button" confirm="Click OK to delete the folder '${folder.name | h}.'" href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( folder.id ), item_type='folder', show_deleted=show_deleted )}">Delete this folder</a>
%elif not library.deleted and folder.deleted and not folder.purged:
<a class="action-button" href="${h.url_for( controller='library_common', action='undelete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( folder.id ), item_type='folder', show_deleted=show_deleted )}">Undelete this folder</a>
%endif
@@ -423,7 +423,7 @@
%endif
<td>
%if folder.description:
${folder.description}
${folder.description | h}
%endif
<td colspan="3"></td>
</tr>
@@ -515,12 +515,12 @@
<li><a class="action-button" href="${h.url_for( controller='library_common', action='create_folder', cntrller=cntrller, parent_id=trans.security.encode_id( library.root_folder.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add folder</a></li>
%endif
%if ( ( not library.deleted ) and ( can_modify or can_manage ) ) or ( can_modify and not library.purged ) or ( library.purged ):
<li><a class="action-button" id="library-${library.id}-popup" class="menubutton">Library Actions</a></li>
<div popupmenu="library-${library.id}-popup">
<li><a class="action-button" id="library-${library.id | h}-popup" class="menubutton">Library Actions</a></li>
<div popupmenu="library-${library.id | h}-popup">
%if not library.deleted:
%if can_modify:
<a class="action-button" href="${h.url_for( controller='library_common', action='library_info', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit information</a>
<a class="action-button" confirm="Click OK to delete the library named '${library.name}'." href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library.id ), item_type='library' )}">Delete this data library</a>
<a class="action-button" confirm="Click OK to delete the library named '${library.name | h}'." href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library.id ), item_type='library' )}">Delete this data library</a>
%if show_deleted:
<a class="action-button" href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=False )}">Hide deleted items</a>
%else:
@@ -558,7 +558,7 @@
%if library.synopsis not in [ '', 'None', None ]:
<div class="libraryItemBody">
${library.synopsis}
${library.synopsis | h}
</div>
%endif
@@ -616,6 +616,6 @@
${render_compression_types_help( comptypes )}
%endif
%if not has_accessible_folders:
The data library '${library.name}' does not contain any datasets that you can access.
The data library '${library.name | h}' does not contain any datasets that you can access.
%endif
</%def>
@@ -88,19 +88,19 @@
else:
tool_form_title = 'Upload files'
%>
<div class="toolFormTitle">${tool_form_title}</div>
<div class="toolFormTitle">${tool_form_title | h}</div>
<div class="toolFormBody">
<form name="upload_library_dataset" id="upload_library_dataset" action="${action}" enctype="multipart/form-data" method="post">
<input type="hidden" name="tool_id" value="upload1"/>
<input type="hidden" name="tool_state" value="None"/>
<input type="hidden" name="cntrller" value="${cntrller}"/>
<input type="hidden" name="library_id" value="${library_id}"/>
<input type="hidden" name="folder_id" value="${folder_id}"/>
<input type="hidden" name="show_deleted" value="${show_deleted}"/>
<input type="hidden" name="cntrller" value="${cntrller | h}"/>
<input type="hidden" name="library_id" value="${library_id | h}"/>
<input type="hidden" name="folder_id" value="${folder_id | h}"/>
<input type="hidden" name="show_deleted" value="${show_deleted | h}"/>
%if replace_dataset not in [ None, 'None' ]:
<input type="hidden" name="replace_id" value="${trans.security.encode_id( replace_dataset.id )}"/>
<input type="hidden" name="replace_id" value="${trans.security.encode_id( replace_dataset.id ) | h}"/>
<div class="form-row">
You are currently selecting a new file to replace '<a href="${h.url_for( controller='library_common', action='ldda_info', cntrller=cntrller, library_id=library_id, folder_id=folder_id, id=trans.security.encode_id( replace_dataset.library_dataset_dataset_association.id ) )}">${util.unicodify( replace_dataset.name )}</a>'.
You are currently selecting a new file to replace '<a href="${h.url_for( controller='library_common', action='ldda_info', cntrller=cntrller, library_id=library_id, folder_id=folder_id, id=trans.security.encode_id( replace_dataset.library_dataset_dataset_association.id ) )}">${util.unicodify( replace_dataset.name ) | h}</a>'.
<div style="clear: both"></div>
</div>
%endif
@@ -120,7 +120,7 @@
<select name="file_type">
<option value="auto" selected>Auto-detect</option>
%for file_format in file_formats:
<option value="${file_format}">${file_format}</option>
<option value="${file_format | h}">${file_format | h}</option>
%endfor
</select>
</div>
@@ -176,23 +176,23 @@
%for entry in os.listdir( import_dir ):
## Do not include entries that are not directories
%if os.path.isdir( os.path.join( import_dir, entry ) ):
<option>${entry}</option>
<option>${entry | h}</option>
%endif
%endfor
%else:
%if ( trans.user_is_admin() and cntrller == 'library_admin' ):
<option>${import_dir}</option>
<option>${import_dir | h}</option>
%else:
<option>${trans.user.email}</option>
<option>${trans.user.email | h}</option>
%endif
%endif
</select>
</div>
<div class="toolParamHelp" style="clear: both;">
%if contains_directories:
Upload all files in a sub-directory of <strong>${import_dir}</strong> on the Galaxy server.
Upload all files in a sub-directory of <strong>${import_dir | h}</strong> on the Galaxy server.
%else:
Upload all files in <strong>${import_dir}</strong> on the Galaxy server.
Upload all files in <strong>${import_dir | h}</strong> on the Galaxy server.
%endif
</div>
<div style="clear: both"></div>
@@ -282,9 +282,9 @@
%>
%for dbkey in dbkeys:
%if dbkey[1] == default_selected:
<option value="${dbkey[1]}" selected>${dbkey[0]}</option>
<option value="${dbkey[1] | h}" selected>${dbkey[0] | h}</option>
%else:
<option value="${dbkey[1]}">${dbkey[0]}</option>
<option value="${dbkey[1] | h}">${dbkey[0] | h}</option>
%endif
%endfor
</select>
@@ -295,7 +295,7 @@
<label>Message:</label>
<div class="form-row-input">
%if ldda_message:
<textarea name="ldda_message" rows="3" cols="35">${ldda_message}</textarea>
<textarea name="ldda_message" rows="3" cols="35">${ldda_message | h}</textarea>
%else:
<textarea name="ldda_message" rows="3" cols="35"></textarea>
%endif
@@ -320,13 +320,13 @@
%if widgets:
%for i, field in enumerate( widgets ):
<div class="form-row">
<label>${field[ 'label' ]}</label>
<label>${field[ 'label' ] | h}</label>
<div class="form-row-input">
${field[ 'widget' ].get_html()}
</div>
<div class="toolParamHelp" style="clear: both;">
%if field[ 'helptext' ]:
${field[ 'helptext' ]}<br/>
${field[ 'helptext' ] | h}<br/>
%endif
*Inherited template field
</div>
@@ -342,14 +342,14 @@
</div>
%elif upload_option == 'import_from_history':
<div class="toolForm">
<div class="toolFormTitle">Active datasets in your current history (${ util.unicodify( history.name )})</div>
<div class="toolFormTitle">Active datasets in your current history (${ util.unicodify( history.name ) | h})</div>
<div class="toolFormBody">
%if history and history.active_datasets:
<form name="add_history_datasets_to_library" action="${h.url_for( controller='library_common', action='add_history_datasets_to_library', cntrller=cntrller, library_id=library_id )}" enctype="multipart/form-data" method="post">
<input type="hidden" name="folder_id" value="${folder_id}"/>
<input type="hidden" name="show_deleted" value="${show_deleted}"/>
<input type="hidden" name="folder_id" value="${folder_id | h}"/>
<input type="hidden" name="show_deleted" value="${show_deleted | h}"/>
<input type="hidden" name="upload_option" value="import_from_history"/>
<input type="hidden" name="ldda_message" value="${ldda_message}"/>
<input type="hidden" name="ldda_message" value="${ldda_message | h}"/>
<%
role_ids_selected = ''
if roles_select_list:
@@ -357,32 +357,32 @@
if selected:
role_ids_selected = ','.join( selected )
%>
<input type="hidden" name="roles" value="${role_ids_selected}"/>
<input type="hidden" name="roles" value="${role_ids_selected | h}"/>
%if replace_dataset not in [ None, 'None' ]:
<input type="hidden" name="replace_id" value="${trans.security.encode_id( replace_dataset.id )}"/>
<input type="hidden" name="replace_id" value="${trans.security.encode_id( replace_dataset.id ) | h}"/>
<div class="form-row">
You are currently selecting a new file to replace '<a href="${h.url_for( controller='library_common', action='ldda_info', cntrller=cntrller, library_id=library_id, folder_id=folder_id, id=trans.security.encode_id( replace_dataset.library_dataset_dataset_association.id ) )}">${ util.unicodify( replace_dataset.name )}</a>'.
You are currently selecting a new file to replace '<a href="${h.url_for( controller='library_common', action='ldda_info', cntrller=cntrller, library_id=library_id, folder_id=folder_id, id=trans.security.encode_id( replace_dataset.library_dataset_dataset_association.id ) )}">${ util.unicodify( replace_dataset.name ) | h}</a>'.
<div style="clear: both"></div>
</div>
%endif
%for hda in history.visible_datasets:
<% encoded_id = trans.security.encode_id( hda.id ) %>
<div class="form-row">
<input name="hda_ids" id="hist_${encoded_id}" value="${encoded_id}" type="checkbox"/>
<label for="hist_${encoded_id}" style="display: inline;font-weight:normal;">${hda.hid}: ${ util.unicodify( hda.name )}</label>
<input name="hda_ids" id="hist_${encoded_id | h}" value="${encoded_id | h}" type="checkbox"/>
<label for="hist_${encoded_id | h}" style="display: inline;font-weight:normal;">${hda.hid | h}: ${ util.unicodify( hda.name ) | h}</label>
</div>
%endfor
%if widgets:
<input type="hidden" name="template_id" value="${template_id}"/>
<input type="hidden" name="template_id" value="${template_id | h}"/>
%for i, field in enumerate( widgets ):
<div class="form-row">
<label>${field[ 'label' ]}</label>
<label>${field[ 'label' ] | h}</label>
<div class="form-row-input">
${field[ 'widget' ].get_html()}
</div>
<div class="toolParamHelp" style="clear: both;">
%if field[ 'helptext' ]:
${field[ 'helptext' ]}<br/>
${field[ 'helptext' ] | h}<br/>
%endif
*Inherited template field
</div>
@@ -34,8 +34,8 @@
checked = " checked='checked'"
%>
<div class="form-row">
<input type="checkbox" name="ldda_ids" id="dataset_${encoded_id}" value="${encoded_id}" ${checked}/>
<label for="dataset_${encoded_id}" style="display: inline;font-weight:normal;">${util.unicodify( source_ldda.name )}</label>
<input type="checkbox" name="ldda_ids" id="dataset_${encoded_id | h}" value="${encoded_id | h}" ${checked}/>
<label for="dataset_${encoded_id | h}" style="display: inline;font-weight:normal;">${util.unicodify( source_ldda.name ) | h}</label>
</div>
%endfor
%else:
@@ -61,7 +61,7 @@
else:
current_history_text = ""
%>
<option value="${encoded_id}"${selected_text}>${i + 1}: ${h.truncate( util.unicodify( target_history.name ), 30 )}${current_history_text}</option>
<option value="${encoded_id | h}"${selected_text}>${i + 1}: ${h.truncate( util.unicodify( target_history.name ), 30 ) | h}${current_history_text | h}</option>
%endfor
</select>
<br/><br/>
@@ -77,8 +77,8 @@
current_history_text = ""
%>
<div class="form-row">
<input type="checkbox" name="target_history_ids" id="target_history_${encoded_id}" value="${encoded_id}"/>
<label for="target_history_${encoded_id}" style="display: inline; font-weight:normal;">${i + 1}: ${util.unicodify( target_history.name )}${current_history_text}</label>
<input type="checkbox" name="target_history_ids" id="target_history_${encoded_id | h}" value="${encoded_id | h}"/>
<label for="target_history_${encoded_id | h}" style="display: inline; font-weight:normal;">${i + 1}: ${util.unicodify( target_history.name ) | h}${current_history_text | h}</label>
</div>
%endfor
</div>
@@ -34,9 +34,9 @@
<select name="datatype">
%for ext in file_formats:
%if ldda.ext == ext:
<option value="${ext}" selected="yes">${ext}</option>
<option value="${ext | h}" selected="yes">${ext | h}</option>
%else:
<option value="${ext}">${ext}</option>
<option value="${ext | h}">${ext | h}</option>
%endif
%endfor
</select>
@@ -44,24 +44,24 @@
%if ( trans.user_is_admin() and cntrller=='library_admin' ) or trans.app.security_agent.can_modify_library_item( current_user_roles, ldda.library_dataset ):
<div class="toolForm">
<div class="toolFormTitle">Edit attributes of ${util.unicodify( ldda.name )}</div>
<div class="toolFormTitle">Edit attributes of ${util.unicodify( ldda.name ) | h}</div>
<div class="toolFormBody">
<form name="edit_attributes" action="${h.url_for( controller='library_common', action='ldda_edit_info', cntrller=cntrller, library_id=library_id, folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), use_panels=use_panels, show_deleted=show_deleted, )}" method="post">
<input type="hidden" name="id" value="${trans.security.encode_id( ldda.id )}"/>
<input type="hidden" name="id" value="${trans.security.encode_id( ldda.id ) | h}"/>
<div class="form-row">
<label>Name:</label>
<input type="text" name="name" value="${util.unicodify( ldda.name )}" size="40"/>
<input type="text" name="name" value="${util.unicodify( ldda.name ) | h}" size="40"/>
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Info:</label>
<input type="text" name="info" value="${util.unicodify( ldda.info )}" size="40"/>
<input type="text" name="info" value="${util.unicodify( ldda.info ) | h}" size="40"/>
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Message:</label>
%if ldda.message:
<textarea name="message" rows="3" cols="35">${ldda.message}</textarea>
<textarea name="message" rows="3" cols="35">${ldda.message | h}</textarea>
%else:
<textarea name="message" rows="3" cols="35"></textarea>
%endif
@@ -73,7 +73,7 @@
%for name, spec in ldda.metadata.spec.items():
%if spec.visible:
<div class="form-row">
<label>${spec.desc}:</label>
<label>${spec.desc | h}:</label>
${ldda.metadata.get_html_by_name( name, trans=trans )}
<div style="clear: both"></div>
</div>
@@ -85,7 +85,7 @@
</form>
<form name="auto_detect" action="${h.url_for( controller='library_common', action='ldda_edit_info', cntrller=cntrller, library_id=library_id, folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), use_panels=use_panels, show_deleted=show_deleted, )}" method="post">
<div class="form-row">
<input type="hidden" name="id" value="${trans.security.encode_id( ldda.id )}"/>
<input type="hidden" name="id" value="${trans.security.encode_id( ldda.id ) | h}"/>
<input type="submit" name="detect" value="Auto-detect"/>
<div class="toolParamHelp" style="clear: both;">
This will inspect the dataset and attempt to correct the above column values if they are not accurate.
@@ -101,7 +101,7 @@
%if ldda.datatype.allow_datatype_change:
<form name="change_datatype" action="${h.url_for( controller='library_common', action='ldda_edit_info', cntrller=cntrller, library_id=library_id, folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), use_panels=use_panels, show_deleted=show_deleted, )}" method="post">
<div class="form-row">
<input type="hidden" name="id" value="${trans.security.encode_id( ldda.id )}"/>
<input type="hidden" name="id" value="${trans.security.encode_id( ldda.id ) | h}"/>
<label>New Type:</label>
${datatype( ldda, file_formats )}
<div class="toolParamHelp" style="clear: both;">
@@ -129,10 +129,10 @@
<div class="form-row">
<label>Extended Metadata:</label>
</div>
<input type="hidden" name="id" value="${trans.security.encode_id( ldda.id )}"/>
<input type="hidden" name="id" value="${trans.security.encode_id( ldda.id ) | h}"/>
<div class="form-row">
%if ldda.extended_metadata:
<textarea name="extended_metadata" rows="15" cols="35">${util.pretty_print_json(ldda.extended_metadata.data)}</textarea>
<textarea name="extended_metadata" rows="15" cols="35">${util.pretty_print_json(ldda.extended_metadata.data) | h}</textarea>
%else:
<textarea name="extended_metadata" rows="15" cols="35"></textarea>
%endif
@@ -147,28 +147,28 @@
<p/>
%else:
<div class="toolForm">
<div class="toolFormTitle">View information about ${util.unicodify( ldda.name )}</div>
<div class="toolFormTitle">View information about ${util.unicodify( ldda.name ) | h}</div>
<div class="toolFormBody">
<div class="form-row">
<label>Name:</label>
${util.unicodify( ldda.name )}
${util.unicodify( ldda.name ) | h}
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Info:</label>
${util.unicodify( ldda.info )}
${util.unicodify( ldda.info ) | h}
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Data Format:</label>
${ldda.ext}
${ldda.ext | h}
<div style="clear: both"></div>
</div>
%for name, spec in ldda.metadata.spec.items():
%if spec.visible:
<div class="form-row">
<label>${spec.desc}:</label>
${ldda.metadata.get( name )}
<label>${spec.desc | h}:</label>
${ldda.metadata.get( name ) | h}
<div style="clear: both"></div>
</div>
%endif
@@ -47,9 +47,9 @@
<div class="toolForm">
<div class="toolFormTitle">
Information about <div class="menubutton popup" id="dataset-${ldda.id}-popup">${util.unicodify( ldda.name )}</div>
Information about <div class="menubutton popup" id="dataset-${ldda.id | h}-popup">${util.unicodify( ldda.name ) | h}</div>
%if not library.deleted and not branch_deleted( ldda.library_dataset.folder ) and not ldda.library_dataset.deleted:
<div popupmenu="dataset-${ldda.id}-popup">
<div popupmenu="dataset-${ldda.id | h}-popup">
%if can_modify:
<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 ), use_panels=use_panels, show_deleted=show_deleted )}">Edit information</a>
%if not info_association:
@@ -81,52 +81,52 @@
%if ldda.message:
<div class="form-row">
<label>Message:</label>
<pre>${ldda.message}</pre>
<pre>${ldda.message | h}</pre>
<div style="clear: both"></div>
</div>
%endif
<div class="form-row">
<label>Uploaded by:</label>
${uploaded_by}
${uploaded_by | h}
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Date uploaded:</label>
${ldda.create_time.strftime( trans.app.config.pretty_datetime_format )}
${ldda.create_time.strftime( trans.app.config.pretty_datetime_format ) | h}
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>File size:</label>
${ldda.get_size( nice_size=True )}
${ldda.get_size( nice_size=True ) | h}
<div style="clear: both"></div>
</div>
%if ldda.dataset.uuid:
<div class="form-row">
<label>UUID:</label>
${ldda.dataset.uuid}
${ldda.dataset.uuid | h}
<div style="clear: both"></div>
</div>
%endif
%if ldda.tool_version:
<div class="form-row">
<label>Tool version:</label>
${ldda.tool_version}
${ldda.tool_version | h}
<div style="clear: both"></div>
</div>
%endif
<div class="form-row">
<label>Data type:</label>
${ldda.ext}
${ldda.ext | h}
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Build:</label>
${ldda.dbkey}
${ldda.dbkey | h}
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Miscellaneous information:</label>
${util.unicodify( ldda.info )}
${util.unicodify( ldda.info ) | h}
<div style="clear: both"></div>
</div>
%if ldda.creating_job_associations:
@@ -134,25 +134,25 @@
%if job.stdout and job.stdout.strip() != '':
<div class="form-row">
<label>Job Standard Output</label>
<pre>${job.stdout}</pre>
<pre>${job.stdout | h}</pre>
<div style="clear: both"></div>
</div>
%endif
%if job.stderr and job.stderr.strip() != '':
<div class="form-row">
<label>Job Standard Error</label>
<pre>${job.stderr}</pre>
<pre>${job.stderr | h}</pre>
<div style="clear: both"></div>
</div>
%endif
%endif
<div class="form-row">
<div>${ldda.blurb}</div>
<div>${ldda.blurb | h}</div>
</div>
## We want to display all metadata item here, whether marked visible or not since they are all pretty useful
%for name, spec in ldda.metadata.spec.items():
<div class="form-row">
<label>${spec.desc.replace( ' (click box & select)', '' )}:</label>
<label>${spec.desc.replace( ' (click box & select)', '' ) | h}:</label>
<%
metadata_val = ldda.metadata.get( name )
if isinstance( metadata_val, trans.model.MetadataFile ):
@@ -162,29 +162,29 @@
metadata_val = [ str( item ) for item in metadata_val ]
metadata_val = ', '.join( metadata_val )
%>
${metadata_val}
${metadata_val | h}
<div style="clear: both"></div>
</div>
%endfor
%if ldda.peek != "no peek":
<div class="form-row">
<div id="info${ldda.id}" class="historyItemBody">
<div id="info${ldda.id | h}" class="historyItemBody">
<label>Peek:</label>
<div><pre id="peek${ldda.id}" class="peek">${util.unicodify( ldda.display_peek() )}</pre></div>
<div><pre id="peek${ldda.id | h}" class="peek">${util.unicodify( ldda.display_peek() )}</pre></div>
</div>
</div>
%endif
%if ldda.extended_metadata:
<div class="form-row">
<label>Extended Metadata:</label>
<pre>${util.pretty_print_json(ldda.extended_metadata.data)}</pre>
<pre>${util.pretty_print_json(ldda.extended_metadata.data) | h}</pre>
<div style="clear: both"></div>
</div>
%endif
%if trans.user_is_admin() and cntrller == 'library_admin':
<div class="form-row">
<label>Disk file:</label>
${ldda.file_name}
${ldda.file_name | h}
<div style="clear: both"></div>
</div>
%endif
@@ -211,16 +211,16 @@
<tr>
<td>
%if hda.history:
<a target="_blank" href="${h.url_for( controller='history', action='view', id=trans.security.encode_id( hda.history_id ) )}">${hda.history.get_display_name()}</a>
<a target="_blank" href="${h.url_for( controller='history', action='view', id=trans.security.encode_id( hda.history_id ) )}">${hda.history.get_display_name() | h}</a>
%else:
no history
%endif
</td>
<td>${hda.get_display_name()}</td>
<td>${time_ago( hda.update_time )}</td>
<td>${hda.get_display_name() | h}</td>
<td>${time_ago( hda.update_time ) | h}</td>
<td>
%if hda.history and hda.history.user:
${hda.history.user.email}
${hda.history.user.email | h}
%else:
anonymous
%endif
@@ -256,9 +256,9 @@
library_display_name = 'no library'
%>
%if containing_library:
<a href="${h.url_for( controller='library_common', action='browse_library', id=trans.security.encode_id( containing_library.id ), cntrller=cntrller, use_panels=use_panels )}">${library_display_name}</a>
<a href="${h.url_for( controller='library_common', action='browse_library', id=trans.security.encode_id( containing_library.id ), cntrller=cntrller, use_panels=use_panels )}">${library_display_name | h}</a>
%else:
${library_display_name}
${library_display_name | h}
%endif
</td>
<td>
@@ -269,14 +269,14 @@
if folder_display_name == library_display_name:
folder_display_name = 'library root'
%>
${folder_display_name}
${copied_ldda.library_dataset.folder.get_display_name()}
${folder_display_name | h}
${copied_ldda.library_dataset.folder.get_display_name() | h}
</td>
<td>${copied_ldda.get_display_name()}</td>
<td>${time_ago( copied_ldda.update_time )}</td>
<td>${copied_ldda.get_display_name() | h}</td>
<td>${time_ago( copied_ldda.update_time ) | h}</td>
<td>
%if copied_ldda.user:
${copied_ldda.user.email}
${copied_ldda.user.email | h}
%else:
anonymous
%endif
@@ -292,10 +292,10 @@
<% expired_lddas = [ e_ldda for e_ldda in ldda.library_dataset.expired_datasets ] %>
%if expired_lddas:
<br/>
<div class="toolFormTitle">Expired versions of ${util.unicodify( ldda.name )}</div>
<div class="toolFormTitle">Expired versions of ${util.unicodify( ldda.name ) | h}</div>
%for expired_ldda in expired_lddas:
<div class="form-row">
<a href="${h.url_for( controller='library_common', action='ldda_info', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( expired_ldda.library_dataset.folder.id ), id=trans.security.encode_id( expired_ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">${util.unicodify( expired_ldda.name )}</a>
<a href="${h.url_for( controller='library_common', action='ldda_info', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( expired_ldda.library_dataset.folder.id ), id=trans.security.encode_id( expired_ldda.id ), use_panels=use_panels, show_deleted=show_deleted )}">${util.unicodify( expired_ldda.name ) | h}</a>
</div>
%endfor
%endif
@@ -27,10 +27,10 @@
<tr>
<td>
<div class="rowTitle">
<span class="historyItemTitle"><b>${ldd_assoc.name}</b></span>
<a id="ldda-${ldd_assoc.id}-popup" class="popup-arrow" style="display: none;">&#9660;</a>
<span class="historyItemTitle"><b>${ldd_assoc.name | h}</b></span>
<a id="ldda-${ldd_assoc.id | h}-popup" class="popup-arrow" style="display: none;">&#9660;</a>
</div>
<div popupmenu="ldd_assoc-${ldd_assoc.id}-popup">
<div popupmenu="ldd_assoc-${ldd_assoc.id | h}-popup">
<a class="action-button" href="${h.url_for( controller='library_common', action='library_dataset_info', id=trans.security.encode_id( ldd_assoc.library_dataset_id ), library_id=library_id )}">Manage this dataset's versions</a>
</div>
</td>
@@ -25,20 +25,20 @@
%if ( trans.user_is_admin() and cntrller=='library_admin' ) or trans.app.security_agent.can_modify_library_item( current_user_roles, library_dataset ):
<div class="toolForm">
<div class="toolFormTitle">Edit attributes of ${util.unicodify( library_dataset.name )}</div>
<div class="toolFormTitle">Edit attributes of ${util.unicodify( library_dataset.name ) | h}</div>
<div class="toolFormBody">
<form name="edit_attributes" action="${h.url_for( controller='library_common', action='library_dataset_info', id=trans.security.encode_id( library_dataset.id ), library_id=library_id, show_deleted=show_deleted )}" method="post">
<div class="form-row">
<label>Name:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
<input type="text" name="name" value="${util.unicodify( library_dataset.name )}" size="40"/>
<input type="text" name="name" value="${util.unicodify( library_dataset.name ) | h}" size="40"/>
</div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Info:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
<input type="text" name="info" value="${util.unicodify( library_dataset.info )}" size="40"/>
<input type="text" name="info" value="${util.unicodify( library_dataset.info ) | h}" size="40"/>
</div>
<div style="clear: both"></div>
</div>
@@ -50,12 +50,12 @@
</div>
%else:
<div class="toolForm">
<div class="toolFormTitle">View information about ${util.unicodify( library_dataset.name )}</div>
<div class="toolFormTitle">View information about ${util.unicodify( library_dataset.name ) | h}</div>
<div class="toolFormBody">
<div class="form-row">
<b>Name:</b> ${util.unicodify( library_dataset.name )}
<b>Name:</b> ${util.unicodify( library_dataset.name ) | h}
<div style="clear: both"></div>
<b>Info:</b> ${util.unicodify( library_dataset.info )}
<b>Info:</b> ${util.unicodify( library_dataset.info ) | h}
<div style="clear: both"></div>
<b>Dataset Versions:</b>
<div style="clear: both"></div>
@@ -85,17 +85,17 @@
</li>
</ul>
<h2>Results for search on &ldquo;${search_term}&rdquo;</h2>
<h2>Results for search on &ldquo;${search_term | h}&rdquo;</h2>
%if message:
${render_msg( message, status )}
%endif
%if lddas:
<p>The string "${search_term}" was found in at least one of the following information components of the displayed library datasets.</p>
<p>The string "${search_term | h}" was found in at least one of the following information components of the displayed library datasets.</p>
${render_searched_components()}
<form name="act_on_multiple_datasets" action="${h.url_for( controller='library_common', action='act_on_multiple_datasets', cntrller=cntrller, use_panels=use_panels, show_deleted=show_deleted )}" onSubmit="javascript:return checkForm();" method="post">
<input type="hidden" name="search_term" value="${search_term}"/>
<input type="hidden" name="search_term" value="${search_term | h}"/>
<table cellspacing="0" cellpadding="0" border="0" width="100%" class="grid" id="library-grid">
<thead>
<tr class="libraryTitle">
@@ -131,7 +131,7 @@
</form>
${render_compression_types_help( comptypes )}
%elif status != 'error':
<p>The string "${search_term}" was not found in any of the following information components for any library datasets that you can access.</p>
<p>The string "${search_term | h}" was not found in any of the following information components for any library datasets that you can access.</p>
${render_searched_components()}
%endif
</%def>
@@ -35,10 +35,10 @@
<div class="toolForm">
<div class="toolFormTitle">
<div class="menubutton split popup" id="library-${library.id}-popup">
<a href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">${library.name[:50]}</a>
<a href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">${library.name[:50] | h}</a>
</div>
%if can_add or can_modify or can_manage:
<div popupmenu="library-${library.id}-popup">
<div popupmenu="library-${library.id | h}-popup">
%if not library.deleted:
%if can_add and not library.info_association:
<a class="action-button" href="${h.url_for( controller='library_common', action='add_template', cntrller=cntrller, item_type='library', form_type=trans.model.FormDefinition.types.LIBRARY_INFO_TEMPLATE, library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Use template</a>
@@ -47,7 +47,7 @@
<a class="action-button" href="${h.url_for( controller='library_common', action='library_permissions', cntrller=cntrller, id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Edit permissions</a>
%endif
%if can_modify:
<a class="action-button" confirm="Click OK to delete the library named '${library.name}'." href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library.id ), item_type='library' )}">Delete this data library</a>
<a class="action-button" confirm="Click OK to delete the library named '${library.name | h}'." href="${h.url_for( controller='library_common', action='delete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library.id ), item_type='library' )}">Delete this data library</a>
%endif
%elif can_modify and not library.purged:
<a class="action-button" href="${h.url_for( controller='library_common', action='undelete_library_item', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), item_id=trans.security.encode_id( library.id ), item_type='library' )}">Undelete this data library</a>
@@ -1,14 +1,14 @@
<%def name="render_library_item_info( ldda )">
%if ldda.state == 'error':
<div class="libraryItem-${ldda.state}">Job error <i>(click name for more info)</i></div>
<div class="libraryItem-${ldda.state | h}">Job error <i>(click name for more info)</i></div>
%elif ldda.state == 'queued':
<div class="libraryItem-${ldda.state}">This job is queued</div>
<div class="libraryItem-${ldda.state | h}">This job is queued</div>
%elif ldda.state == 'running':
<div class="libraryItem-${ldda.state}">This job is running</div>
<div class="libraryItem-${ldda.state | h}">This job is running</div>
%elif ldda.state == 'upload':
<div class="libraryItem-${ldda.state}">This dataset is uploading</div>
<div class="libraryItem-${ldda.state | h}">This dataset is uploading</div>
%else:
${ldda.message}
${ldda.message | h}
%endif
</%def>
@@ -31,9 +31,9 @@
<form name="move_library_item" action="${h.url_for( controller='library_common', action='move_library_item', cntrller=cntrller, item_type=item_type, make_target_current=make_target_current, use_panels=use_panels, show_deleted=show_deleted )}" method="post">
<div class="toolForm" style="float: left; width: 45%; padding: 0px;">
<div class="toolFormBody">
<input type="hidden" name="source_library_id" value="${source_library_id}"/>
<input type="hidden" name="source_library_id" value="${source_library_id | h}"/>
%if target_library:
<input type="hidden" name="target_library_id" value="${target_library_id}"/>
<input type="hidden" name="target_library_id" value="${target_library_id | h}"/>
%endif
%if item_type == 'ldda':
%for move_ldda in move_lddas:
@@ -44,15 +44,15 @@
checked = " checked='checked'"
%>
<div class="form-row">
<input type="checkbox" name="item_id" id="dataset_${encoded_id}" value="${encoded_id}" ${checked}/>
<label for="dataset_${encoded_id}" style="display: inline;font-weight:normal;">${util.unicodify( move_ldda.name )}</label>
<input type="checkbox" name="item_id" id="dataset_${encoded_id | h}" value="${encoded_id | h}" ${checked}/>
<label for="dataset_${encoded_id | h}" style="display: inline;font-weight:normal;">${util.unicodify( move_ldda.name ) | h}</label>
</div>
%endfor
%elif item_type == 'folder':
<div class="form-row">
<% encoded_id = trans.security.encode_id( move_folder.id ) %>
<input type="checkbox" name="item_id" id="folder_${encoded_id}" value="${encoded_id}" checked='checked'/>
<label for="folder_${encoded_id}" style="display: inline;font-weight:normal;">${move_folder.name}</label>
<input type="checkbox" name="item_id" id="folder_${encoded_id | h}" value="${encoded_id | h}" checked='checked'/>
<label for="folder_${encoded_id | h}" style="display: inline;font-weight:normal;">${move_folder.name | h}</label>
</div>
%endif
</div>
@@ -60,7 +60,7 @@
<div style="float: left; padding-left: 10px; font-size: 36px;">&rarr;</div>
<div class="toolForm" style="float: right; width: 45%; padding: 0px;">
%if target_library:
<div class="toolFormTitle">Select folder within data library: ${h.truncate( target_library.name, 30 )}</div>
<div class="toolFormTitle">Select folder within data library: ${h.truncate( target_library.name, 30 ) | h}</div>
%else:
<div class="toolFormTitle">Select a data library</div>
%endif
+8 -8
View File
@@ -18,7 +18,7 @@ from base.asserts import verify_assertions
from galaxy.util import asbool
from galaxy.util.json import loads
from galaxy.web import security
from galaxy.web.framework.helpers import iff
from galaxy.web.framework.helpers import iff, escape
from urlparse import urlparse
from galaxy import eggs
@@ -109,7 +109,7 @@ class TwillTestCase( unittest.TestCase ):
tc.fv( "1", "name", name )
tc.fv( "1", "description", description )
tc.submit( "new_folder_button" )
check_str = "The new folder named '%s' has been added to the data library." % name
check_str = escape( "The new folder named '%s' has been added to the data library." % name )
self.check_page_for_string( check_str )
def add_samples( self, cntrller, request_id, sample_value_tuples, folder_options=[], strings_displayed=[], strings_displayed_after_submit=[] ):
@@ -216,7 +216,7 @@ class TwillTestCase( unittest.TestCase ):
for check_str in strings_not_displayed:
try:
self.check_page_for_string( check_str )
raise AssertionError( "String (%s) incorrectly displayed when browing library." % check_str )
raise AssertionError( "String (%s) incorrectly displayed when browsing library." % check_str )
except:
pass
@@ -227,7 +227,7 @@ class TwillTestCase( unittest.TestCase ):
for check_str in strings_not_displayed:
try:
self.check_page_for_string( check_str )
raise AssertionError( "String (%s) incorrectly displayed when browing library." % check_str )
raise AssertionError( "String (%s) incorrectly displayed when browsing library." % check_str )
except:
pass
@@ -238,7 +238,7 @@ class TwillTestCase( unittest.TestCase ):
for check_str in strings_not_displayed:
try:
self.check_page_for_string( check_str )
raise AssertionError( "String (%s) incorrectly displayed when browing library." % check_str )
raise AssertionError( "String (%s) incorrectly displayed when browsing library." % check_str )
except:
pass
@@ -576,7 +576,7 @@ class TwillTestCase( unittest.TestCase ):
tc.fv( "1", "description", description )
tc.fv( "1", "synopsis", synopsis )
tc.submit( "create_library_button" )
check_str = "The new library named '%s' has been created" % name
check_str = escape( "The new library named '%s' has been created" % name )
self.check_page_for_string( check_str )
def create_user_with_info( self, email, password, username, user_info_values, user_type_fd_id='', cntrller='user',
@@ -1442,7 +1442,7 @@ class TwillTestCase( unittest.TestCase ):
if new_ldda_name:
tc.fv( '1', 'name', new_ldda_name )
tc.submit( 'save' )
check_str = "Attributes updated for library dataset '%s'." % new_ldda_name
check_str = escape( "Attributes updated for library dataset '%s'." % new_ldda_name )
self.check_page_for_string( check_str )
if template_refresh_field_contents:
# A template containing an AddressField is displayed on the upload form, so we need to refresh the form
@@ -1493,7 +1493,7 @@ class TwillTestCase( unittest.TestCase ):
key = '%s_in' % pi
url = "%s&%s=%s" % ( url, key, role_ids_str )
self.visit_url( "%s/%s" % ( self.url, url ) )
check_str = "Permissions updated for library '%s'." % library_name
check_str = escape( "Permissions updated for library '%s'." % library_name )
self.check_page_for_string( check_str )
def library_wait( self, library_id, cntrller='library_admin', maxiter=90 ):
+2 -2
View File
@@ -107,7 +107,7 @@ class TestLibraryFeatures( TwillTestCase ):
assert subfolder1 is not None, 'Problem retrieving subfolder1 from the database'
self.browse_library( cntrller='library_admin',
library_id=self.security.encode_id( library1.id ),
strings_displayed=[ subfolder1.name, subfolder1.description ] )
strings_displayed=[ escape( subfolder1.name ), escape( subfolder1.description ) ] )
def test_040_add_2nd_folder_to_library1( self ):
"""Testing adding a 2nd folder to a library1"""
@@ -578,7 +578,7 @@ class TestLibraryFeatures( TwillTestCase ):
library_id=self.security.encode_id( library2.id ),
folder_id=self.security.encode_id( library2.root_folder.id ),
ldda_id=self.security.encode_id( ldda8.id ),
strings_displayed=[ 'The uploaded files need grooming, so change your <b>Copy data into Galaxy?</b> selection to be' ] )
strings_displayed=[ 'The uploaded files need grooming, so change your' ] )
def test_999_reset_data_for_later_test_runs( self ):
"""Reseting data to enable later test runs to pass"""