More ibrary work - highlights:

1) For datasets in the library browser, display message, uploaded by, date instead of format, db, info
2) Replace "Manage this dataset's versions" with "Upload a new version of this dataset"
3) When a library dataset is clicked in the library browser, display it's information rahter than it's peek.
This commit is contained in:
Greg Von Kuster
2009-03-11 10:21:08 -04:00
parent 20c20ef3be
commit 9502a11563
22 changed files with 717 additions and 515 deletions
+20 -27
View File
@@ -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 ):
+19 -33
View File
@@ -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 ):
+8 -5
View File
@@ -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 ):
## </div>
%endif
</th>
<th width="100">Format</th>
<th width="50">Db</th>
<th width="200">Info</th>
<th width="300">Information</th>
<th width="150">Uploaded By</th>
<th width="60">Date</th>
</table>
</div>
</li>
+71 -40
View File
@@ -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
%>
<div class="historyItemWrapper historyItem historyItem-${ldda.state}" id="libraryItem-${ldda.id}">
## Header row for library items (name, state, action buttons)
@@ -17,7 +27,7 @@
%else:
<input type="checkbox" name="ldda_ids" value="${ldda.id}"/>
%endif
<span class="historyItemTitle"><b>${ldda.name}</b></span>
<a href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library.id, folder_id=library_dataset.folder.id, id=ldda.id, info=True )}"><b>${ldda.name[:50]}</b></a>
%if not library.deleted:
<%
library_item_ids = {}
@@ -25,11 +35,13 @@
%>
<a id="dataset-${ldda.id}-popup" class="popup-arrow" style="display: none;">&#9660;</a>
<div popupmenu="dataset-${ldda.id}-popup">
<a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library.id, folder_id=library_dataset.folder.id, id=ldda.id, information=True )}">Edit this dataset's information</a>
<a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library.id, folder_id=library_dataset.folder.id, id=ldda.id, edit_info=True )}">Edit this dataset's information</a>
## We're disabling the ability to add templates at the LDDA and LibraryDataset level, but will leave this here for possible future use
##<a class="action-button" href="${h.url_for( controller='admin', action='info_template', library_id=library.id, library_dataset_id=library_dataset.id, new_template=True )}">Add an information template to this dataset</a>
<a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library.id, folder_id=library_dataset.folder.id, id=ldda.id, permissions=True )}">Edit this dataset's permissions</a>
<a class="action-button" href="${h.url_for( controller='admin', action='library_dataset', id=library_dataset.id, library_id=library.id, versions=True )}">Manage this dataset's versions</a>
%if current_version:
<a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library.id, folder_id=library_dataset.folder.id, replace_id=library_dataset.id )}">Upload a new version of this dataset</a>
%endif
%if ldda.has_data:
<a class="action-button" href="${h.url_for( controller='admin', action='download_dataset_from_folder', id=ldda.id, library_id=library.id )}">Download this dataset</a>
%endif
@@ -38,46 +50,16 @@
</div>
%endif
</td>
<td width="100">${ldda.ext}</td>
<td width="50"><span class="${ldda.dbkey}">${ldda.dbkey}</span></td>
<td width="200">${ldda.info}</td>
<td width="300">${ldda.message}</td>
<td width="150">${uploaded_by}</td>
<td width="60">${ldda.create_time.strftime( "%Y-%m-%d" )}</td>
</tr>
</table>
</div>
## Body for library items, extra info and actions, data "peek"
<div id="info${ldda.id}" class="historyItemBody">
<div>${ldda.blurb}</div>
<div>
%if ldda.has_data:
%for display_app in ldda.datatype.get_display_types():
<% display_links = ldda.datatype.get_display_links( ldda, display_app, app, request.base ) %>
%if len( display_links ) > 0:
${ldda.datatype.get_display_label(display_app)}
%for ldda.name, display_link in display_links:
<a target="_blank" href="${display_link}">${ldda.name}</a>
%endfor
%endif
%endfor
%endif
</div>
%if ldda.peek != "no peek":
<div><pre id="peek${ldda.id}" class="peek">${ldda.display_peek()}</pre></div>
%endif
## Recurse for child datasets
%if len( ldda.visible_children ) > 0:
<div>
There are ${len( ldda.visible_children )} secondary datasets.
%for idx, child in enumerate( ldda.visible_children ):
${ render_dataset( child, selected, library.deleted ) }
%endfor
</div>
%endif
</div>
</div>
</%def>
<%def name="render_existing_library_item_info( library_item, library_id )">
<%def name="render_library_item_info_for_edit( library_item, library_id )">
<%
library_item_type = 'unknown type'
library_item_desc = ''
@@ -123,7 +105,7 @@
<a class="action-button" href="${h.url_for( controller='admin', action='library_item_info', library_id=library_id, id=element.id, library_item_type='library_item_info_elememt', permissions=True )}">Edit this information's permissions</a>
</div>
</label>
<input type="text" name="info_element_${element.id}" value="${element.contents}" size="40"/>
<textarea name="info_element_${element.id}" rows="3" cols="35">${element.contents}</textarea>
<div style="clear: both"></div>
</div>
%endfor
@@ -138,6 +120,55 @@
%endif
</%def>
<%def name="render_library_item_info( library_item, library_id )">
<%
library_item_type = 'unknown type'
library_item_desc = ''
library_item_info_associations = []
if isinstance( library_item, trans.app.model.Library ):
library_item_type = 'library'
library_item_desc = 'library'
library_item_info_associations = library_item.library_info_associations
elif isinstance( library_item, trans.app.model.LibraryFolder ):
library_item_type = 'folder'
library_item_desc = 'folder'
library_item_info_associations = library_item.library_folder_info_associations
elif isinstance( library_item, trans.app.model.LibraryDataset ):
library_item_type = 'library_dataset'
library_item_desc = 'dataset'
library_item_info_associations = library_item.library_dataset_info_associations
elif isinstance( library_item, trans.app.model.LibraryDatasetDatasetAssociation ):
library_item_type = 'library_dataset_dataset_association'
library_item_desc = 'library dataset'
library_item_info_associations = library_item.library_dataset_dataset_info_associations
elif isinstance( library_item, trans.app.model.LibraryItemInfoElement ):
library_item_type = 'library_item_info'
library_item_desc = 'information'
library_item_info_associations = None
%>
%if library_item_info_associations:
<p/>
<div class="toolForm">
<div class="toolFormTitle">Other information about ${library_item_desc} ${library_item.name}</div>
<div class="toolFormBody">
%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 ) %>
<div class="form-row">
<label>${template_element.name}:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
${element.contents}
</div>
<div style="clear: both"></div>
</div>
%endfor
<div style="clear: both"></div>
%endfor
</div>
</div>
%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 )
@@ -168,7 +199,7 @@
<div class="toolFormBody">
%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
<form name="add_template_info" action="${h.url_for( controller='admin', action='library_item_info', library_id=library_id, new_info=True )}" method="post">
%endif
<input type="hidden" name="library_item_id" value="${library_item.id}"/>
@@ -178,7 +209,7 @@
%for info_elem in available_template.elements:
<div class="form-row">
<label>${info_elem.name}</label>
<input type="text" name="info_element_${available_template.id}_${info_elem.id}" value="" size="40"/>
<textarea name="info_element_${available_template.id}_${info_elem.id}" rows="3" cols="35"></textarea>
<div class="toolParamHelp" style="clear: both;">
${info_elem.description}
</div>
+2 -2
View File
@@ -1,7 +1,7 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
<%namespace file="/admin/library/common.mako" import="render_available_templates" />
<%namespace file="/admin/library/common.mako" import="render_existing_library_item_info" />
<%namespace file="/admin/library/common.mako" import="render_library_item_info_for_edit" />
<br/><br/>
<ul class="manage-table-actions">
@@ -39,7 +39,7 @@
<% folder.refresh() %>
%if folder.library_folder_info_associations:
${render_existing_library_item_info( folder, library_id )}
${render_library_item_info_for_edit( folder, library_id )}
%elif folder.library_folder_info_template_associations:
${render_available_templates( folder, library_id, restrict=True )}
%else:
+126
View File
@@ -0,0 +1,126 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
<%namespace file="/admin/library/common.mako" import="render_available_templates" />
<%namespace file="/admin/library/common.mako" import="render_library_item_info_for_edit" />
<% from galaxy import util %>
%if ldda == ldda.library_dataset.library_dataset_dataset_association:
<b><i>This is the latest version of this library dataset</i></b>
%else:
<font color="red"><b><i>This is an expired version of this library dataset</i></b></font>
%endif
<p/>
<ul class="manage-table-actions">
<li>
<a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
</li>
</ul>
%if msg:
${render_msg( msg, messagetype )}
%endif
<%def name="datatype( ldda, datatypes )">
<select name="datatype">
%for ext in datatypes:
%if ldda.ext == ext:
<option value="${ext}" selected="yes">${ext}</option>
%else:
<option value="${ext}">${ext}</option>
%endif
%endfor
</select>
</%def>
<div class="toolForm">
<div class="toolFormTitle">Edit attributes of ${ldda.name}</div>
<div class="toolFormBody">
<form name="edit_attributes" action="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, edit_info=True )}" method="post">
<input type="hidden" name="id" value="${ldda.id}"/>
<br/>
<div class="form-row">
<label>Name:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
<input type="text" name="name" value="${ldda.name}" 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="${ldda.info}" size="40"/>
</div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Message:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
<textarea name="message" rows="3" cols="35">${ldda.message}</textarea>
</div>
<div class="toolParamHelp" style="clear: both;">
This information will be displayed in the library browser
</div>
<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>
<div style="float: left; width: 250px; margin-right: 10px;">
${ldda.metadata.get_html_by_name( name )}
</div>
<div style="clear: both"></div>
</div>
%endif
%endfor
<div class="form-row">
<input type="submit" name="save" value="Save"/>
</div>
</form>
<form name="auto_detect" action="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, edit_info=True )}" method="post">
<input type="hidden" name="id" value="${ldda.id}"/>
<div style="float: left; width: 250px; margin-right: 10px;">
<input type="submit" name="detect" value="Auto-detect"/>
</div>
<div class="toolParamHelp" style="clear: both;">
This will inspect the dataset and attempt to correct the above column values if they are not accurate.
</div>
</form>
</div>
</div>
<p/>
<div class="toolForm">
<div class="toolFormTitle">Change data type of ${ldda.name}</div>
<div class="toolFormBody">
<form name="change_datatype" action="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, edit_info=True )}" method="post">
<input type="hidden" name="id" value="${ldda.id}"/>
<div class="form-row">
<label>New Type:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
${datatype( ldda, datatypes )}
</div>
<div class="toolParamHelp" style="clear: both;">
This will change the datatype of the existing dataset
but <i>not</i> modify its contents. Use this if Galaxy
has incorrectly guessed the type of your dataset.
</div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<input type="submit" name="change" value="Save"/>
</div>
</form>
</div>
</div>
<% ldda.refresh() %>
%if ldda.library_dataset_dataset_info_associations:
${render_library_item_info_for_edit( ldda, library_id )}
%elif ldda.library_dataset_dataset_info_template_associations:
${render_available_templates( ldda, library_id, restrict=True )}
%elif ldda.library_dataset.folder.library_folder_info_template_associations:
${render_available_templates( ldda, library_id, restrict='folder' )}
%else:
${render_available_templates( ldda, library_id, restrict=False )}
%endif
+98 -96
View File
@@ -1,10 +1,17 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
<%namespace file="/admin/library/common.mako" import="render_available_templates" />
<%namespace file="/admin/library/common.mako" import="render_existing_library_item_info" />
<%namespace file="/admin/library/common.mako" import="render_library_item_info" />
<% from galaxy import util %>
%if ldda == ldda.library_dataset.library_dataset_dataset_association:
<%
if ldda == ldda.library_dataset.library_dataset_dataset_association:
current_version = True
else:
current_version = False
%>
%if current_version:
<b><i>This is the latest version of this library dataset</i></b>
%else:
<font color="red"><b><i>This is an expired version of this library dataset</i></b></font>
@@ -21,106 +28,101 @@
${render_msg( msg, messagetype )}
%endif
<%def name="datatype( ldda, datatypes )">
<select name="datatype">
%for ext in datatypes:
%if ldda.ext == ext:
<option value="${ext}" selected="yes">${ext}</option>
%else:
<option value="${ext}">${ext}</option>
%endif
%endfor
</select>
</%def>
<%
if ldda.user:
uploaded_by = ldda.user.email
else:
uploaded_by = 'anonymous'
%>
<div class="toolForm">
<div class="toolFormTitle">Edit attributes of ${ldda.name}</div>
<div class="toolFormTitle">
Information about ${ldda.name}
<a id="dataset-${ldda.id}-popup" class="popup-arrow" style="display: none;">&#9660;</a>
<div popupmenu="dataset-${ldda.id}-popup">
<a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, id=ldda.id, edit_info=True )}">Edit this dataset's information</a>
## We're disabling the ability to add templates at the LDDA and LibraryDataset level, but will leave this here for possible future use
##<a class="action-button" href="${h.url_for( controller='admin', action='info_template', library_id=library_id, library_dataset_id=ldda.library_dataset.id, new_template=True )}">Add an information template to this dataset</a>
<a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, id=ldda.id, permissions=True )}">Edit this dataset's permissions</a>
%if current_version:
<a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, replace_id=ldda.library_dataset.id )}">Upload a new version of this dataset</a>
%endif
%if ldda.has_data:
<a class="action-button" href="${h.url_for( controller='admin', action='download_dataset_from_folder', id=ldda.id, library_id=library_id )}">Download this dataset</a>
%endif
##TODO: need to revamp the way we remove datasets from disk.
##<a class="action-button" confirm="Click OK to remove dataset '${ldda.name}'?" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, id=ldda.id, delete=True )}">Remove this dataset from the library</a>
</div>
</div>
<div class="toolFormBody">
<form name="edit_attributes" action="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, information=True )}" method="post">
<input type="hidden" name="id" value="${ldda.id}"/>
<br/>
<div class="form-row">
<label>Name:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
<input type="text" name="name" value="${ldda.name}" size="40"/>
</div>
<div style="clear: both"></div>
<div class="form-row">
<label>Message:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
${ldda.message}
</div>
<div class="form-row">
<label>Info:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
<input type="text" name="info" value="${ldda.info}" size="40"/>
</div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Message:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
<textarea name="message" rows="3" cols="35">${ldda.message}</textarea>
</div>
<div class="toolParamHelp" style="clear: both;">
This information will be displayed in the library browser
</div>
<div style="clear: both"></div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Uploaded by:</lable>
<div style="float: left; width: 250px; margin-right: 10px;">
${uploaded_by}
</div>
%for name, spec in ldda.metadata.spec.items():
%if spec.visible:
<div class="form-row">
<label>${spec.desc}:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
${ldda.metadata.get_html_by_name( name )}
</div>
<div style="clear: both"></div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Date uploaded:</lable>
<div style="float: left; width: 250px; margin-right: 10px;">
${ldda.create_time.strftime( "%Y-%m-%d" )}
</div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Build:</lable>
<div style="float: left; width: 250px; margin-right: 10px;">
${ldda.dbkey}
</div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Miscellaneous information:</lable>
<div style="float: left; width: 250px; margin-right: 10px;">
${ldda.info}
</div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<div>${ldda.blurb}</div>
</div>
<div class="form-row">
<div id="info${ldda.id}" class="historyItemBody">
%if ldda.peek != "no peek":
<label>Peek:</lable>
<div><pre id="peek${ldda.id}" class="peek">${ldda.display_peek()}</pre></div>
%endif
## Recurse for child datasets
%if len( ldda.visible_children ) > 0:
<div>
There are ${len( ldda.visible_children )} secondary datasets.
%for idx, child in enumerate( ldda.visible_children ):
${ render_dataset( child, selected, library.deleted ) }
%endfor
</div>
%endif
</div>
</div>
</div>
%if ldda.library_dataset_dataset_info_associations:
${render_library_item_info( ldda, library_id )}
%endif
%if current_version:
<% expired_lddas = [ e_ldda for e_ldda in ldda.library_dataset.expired_datasets ] %>
%if expired_lddas:
<div class="toolFormTitle">Expired versions of ${ldda.name}</div>
%for expired_ldda in expired_lddas:
<div class="form-row">
<a href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=expired_ldda.library_dataset.folder.id, id=expired_ldda.id, info=True )}">${expired_ldda.name}</a>
</div>
%endfor
<div class="form-row">
<input type="submit" name="save" value="Save"/>
</div>
</form>
<form name="auto_detect" action="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, information=True )}" method="post">
<input type="hidden" name="id" value="${ldda.id}"/>
<div style="float: left; width: 250px; margin-right: 10px;">
<input type="submit" name="detect" value="Auto-detect"/>
</div>
<div class="toolParamHelp" style="clear: both;">
This will inspect the dataset and attempt to correct the above column values if they are not accurate.
</div>
</form>
</div>
%endif
%endif
</div>
<p/>
<div class="toolForm">
<div class="toolFormTitle">Change data type of ${ldda.name}</div>
<div class="toolFormBody">
<form name="change_datatype" action="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, information=True )}" method="post">
<input type="hidden" name="id" value="${ldda.id}"/>
<div class="form-row">
<label>New Type:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
${datatype( ldda, datatypes )}
</div>
<div class="toolParamHelp" style="clear: both;">
This will change the datatype of the existing dataset
but <i>not</i> modify its contents. Use this if Galaxy
has incorrectly guessed the type of your dataset.
</div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<input type="submit" name="change" value="Save"/>
</div>
</form>
</div>
</div>
<% ldda.refresh() %>
%if ldda.library_dataset_dataset_info_associations:
${render_existing_library_item_info( ldda, library_id )}
%elif ldda.library_dataset_dataset_info_template_associations:
${render_available_templates( ldda, library_id, restrict=True )}
%elif ldda.library_dataset.folder.library_folder_info_template_associations:
${render_available_templates( ldda, library_id, restrict='folder' )}
%else:
${render_available_templates( ldda, library_id, restrict=False )}
%endif
@@ -1,7 +1,7 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
<%namespace file="/admin/library/common.mako" import="render_available_templates" />
<%namespace file="/admin/library/common.mako" import="render_existing_library_item_info" />
<%namespace file="/admin/library/common.mako" import="render_library_item_info_for_edit" />
%if library_dataset == library_dataset.library_dataset_dataset_association.library_dataset:
<b><i>This is the latest version of this library dataset</i></b>
@@ -48,7 +48,7 @@
<% library_dataset.refresh() %>
%if library_dataset.library_dataset_info_associations:
${render_existing_library_item_info( library_dataset, library_id )}
${render_library_item_info_for_edit( library_dataset, library_id )}
%elif library_dataset.folder.library_folder_info_template_associations:
${render_available_templates( library_dataset, library_id, restrict='folder' )}
%else:
@@ -1,55 +0,0 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
%if library_dataset == library_dataset.library_dataset_dataset_association.library_dataset:
<b><i>This is the latest version of this library dataset</i></b>
%else:
<font color="red"><b><i>This is an expired version of this library dataset</i></b></font>
%endif
<p/>
<ul class="manage-table-actions">
<li>
<a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
</li>
</ul>
%if msg:
${render_msg( msg, messagetype )}
%endif
<div class="toolForm">
<div class="toolFormTitle">Set version of ${library_dataset.name}</div>
<div class="toolFormBody">
<form name="library_dataset_version" action="${h.url_for( controller='admin', action='library_dataset', id=library_dataset.id, library_id=library_id, versions=True )}" method="post">
<div class="form-row">
<div style="float: left; width: 250px; margin-right: 10px;">
<div class="form-row">
<input type="radio" name="set_lda_id" value="${library_dataset.library_dataset_dataset_association.id}" checked>${library_dataset.name} (current)
<a id="dataset-${library_dataset.id}-popup" class="popup-arrow" style="display: none;">&#9660;</a>
<div popupmenu="dataset-${library_dataset.id}-popup">
<a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=library_dataset.folder.id, id=library_dataset.library_dataset_dataset_association.id, information=True )}">Edit this dataset's information</a>
<a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=library_dataset.folder.id, id=library_dataset.library_dataset_dataset_association.id, permissions=True )}">Edit this dataset's permissions</a>
<a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=library_dataset.folder.id, replace_id=library_dataset.id )}">Replace this dataset with a new version</a>
</div>
%for ldda in library_dataset.expired_datasets:
<br/>
<input type="radio" name="set_lda_id" value="${ldda.id}" >${ldda.name}
<a id="ldda-${ldda.id}-popup" class="popup-arrow" style="display: none;">&#9660;</a>
<div popupmenu="ldda-${ldda.id}-popup">
<a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=library_dataset.folder.id, id=ldda.id, information=True )}">Edit this dataset's information</a>
<a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=library_dataset.folder.id, id=ldda.id, permissions=True )}">Edit this dataset's permissions</a>
</div>
%endfor
</div>
</div>
<div style="clear: both"></div>
</div>
%if library_dataset.expired_datasets:
<div class="form-row">
<input type="submit" name="change_version_button" value="Save"/>
</div>
%endif
</form>
</div>
</div>
+2 -2
View File
@@ -1,7 +1,7 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
<%namespace file="/admin/library/common.mako" import="render_available_templates" />
<%namespace file="/admin/library/common.mako" import="render_existing_library_item_info" />
<%namespace file="/admin/library/common.mako" import="render_library_item_info_for_edit" />
<br/><br/>
<ul class="manage-table-actions">
@@ -44,7 +44,7 @@
<% library.refresh() %>
%if library.library_info_associations:
${render_existing_library_item_info( library, library.id )}
${render_library_item_info_for_edit( library, library.id )}
%else:
${render_available_templates( library, library.id, restrict=False )}
%endif
+1 -1
View File
@@ -125,7 +125,7 @@
<textarea name="message" rows="3" cols="35"></textarea>
</div>
<div class="toolParamHelp" style="clear: both;">
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
</div>
<div style="clear: both"></div>
</div>
+8 -5
View File
@@ -113,7 +113,11 @@ def name_sorted( l ):
return False
if not show_folder:
return ""
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"
@@ -122,7 +126,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 ]
@@ -242,9 +245,9 @@ def name_sorted( l ):
</div>
</span>
</th>
<th width="100">Format</th>
<th width="50">Db</th>
<th width="200">Info</th>
<th width="500">Information</th>
<th width="150">Uploaded By</th>
<th width="60">Date</th>
</tr>
</table>
</div>
+85 -52
View File
@@ -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
%>
<div class="historyItemWrapper historyItem historyItem-${ldda.state}" id="libraryItem-${ldda.id}">
## Header row for library items (name, state, action buttons)
@@ -17,11 +27,11 @@
%else:
<input type="checkbox" name="ldda_ids" value="${ldda.id}"/>
%endif
<span class="historyItemTitle"><b>${ldda.name}</b></span>
<a href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library.id, folder_id=library_dataset.folder.id, id=ldda.id, info=True )}"><b>${ldda.name[:60]}</b></a>
<a id="dataset-${ldda.id}-popup" class="popup-arrow" style="display: none;">&#9660;</a>
<div popupmenu="dataset-${ldda.id}-popup">
%if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_MODIFY, library_item=ldda.library_dataset ):
<a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library.id, folder_id=library_dataset.folder.id, id=ldda.id, information=True )}">Edit this dataset's information</a>
<a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library.id, folder_id=library_dataset.folder.id, id=ldda.id, edit_info=True )}">Edit this dataset's information</a>
%else:
<a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library.id, folder_id=library_dataset.folder.id, id=ldda.id, information=True )}">View this dataset's information</a>
%endif
@@ -31,8 +41,8 @@
##%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 ):
<a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library.id, folder_id=library_dataset.folder.id, id=ldda.id, permissions=True )}">Edit this dataset's permissions</a>
%if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_MODIFY, library_item=ldda.library_dataset ):
<a class="action-button" href="${h.url_for( controller='library', action='library_dataset', id=library_dataset.id, library_id=library.id, versions=True )}">Manage this dataset's versions</a>
%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 ):
<a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library.id, folder_id=library_dataset.folder.id, replace_id=library_dataset.id )}">Upload a new version of this dataset</a>
%endif
%endif
%if ldda.has_data:
@@ -41,48 +51,19 @@
%endif
</div>
</td>
<td width="100">${ldda.ext}</td>
<td width="50"><span class="${ldda.dbkey}">${ldda.dbkey}</span></td>
<td width="200">${ldda.info}</td>
<td width="500">${ldda.message}</td>
<td width="150">${uploaded_by}</td>
<td width="60">${ldda.create_time.strftime( "%Y-%m-%d" )}</td>
</tr>
</table>
</div>
## Body for library items, extra info and actions, data "peek"
<div id="info${ldda.id}" class="historyItemBody">
<div>${ldda.blurb}</div>
<div>
%if ldda.has_data:
%for display_app in ldda.datatype.get_display_types():
<% display_links = ldda.datatype.get_display_links( ldda, display_app, app, request.base ) %>
%if len( display_links ) > 0:
${ldda.datatype.get_display_label( display_app )}
%for ldda.name, display_link in display_links:
<a target="_blank" href="${display_link}">${ldda.name}</a>
%endfor
%endif
%endfor
%endif
</div>
%if ldda.peek != "no peek":
<div><pre id="peek${ldda.id}" class="peek">${ldda.display_peek()}</pre></div>
%endif
## Recurse for child datasets
%if len( ldda.visible_children ) > 0:
<div>
There are ${len( ldda.visible_children )} secondary datasets.
%for idx, child in enumerate( ldda.visible_children ):
${render_dataset( child, selected, library )}
%endfor
</div>
%endif
</div>
</div>
</%def>
<%def name="render_existing_library_item_info( library_item, library_id )">
<%def name="render_library_item_info_for_edit( library_item, library_id )">
<%
library_item_type = None
library_item_type = 'unknown type'
library_item_desc = ''
library_item_info_associations = []
if isinstance( library_item, trans.app.model.Library ):
library_item_type = 'library'
@@ -100,6 +81,10 @@
library_item_type = 'library_dataset_dataset_association'
library_item_desc = 'library dataset'
library_item_info_associations = library_item.library_dataset_dataset_info_associations
elif isinstance( library_item, trans.app.model.LibraryItemInfoElement ):
library_item_type = 'library_item_info'
library_item_desc = 'information'
library_item_info_associations = None
%>
%if library_item_info_associations:
<p/>
@@ -132,7 +117,7 @@
<label>${template_element.name}:</label>
%endif
%if can_modify:
<input type="text" name="info_element_${element.id}" value="${element.contents}" size="40"/>
<textarea name="info_element_${element.id}" rows="3" cols="35">${element.contents}</textarea>
<% render_submit_button = True %>
%else:
${element.contents}
@@ -153,6 +138,55 @@
%endif
</%def>
<%def name="render_library_item_info( library_item, library_id )">
<%
library_item_type = 'unknown type'
library_item_desc = ''
library_item_info_associations = []
if isinstance( library_item, trans.app.model.Library ):
library_item_type = 'library'
library_item_desc = 'library'
library_item_info_associations = library_item.library_info_associations
elif isinstance( library_item, trans.app.model.LibraryFolder ):
library_item_type = 'folder'
library_item_desc = 'folder'
library_item_info_associations = library_item.library_folder_info_associations
elif isinstance( library_item, trans.app.model.LibraryDataset ):
library_item_type = 'library_dataset'
library_item_desc = 'dataset'
library_item_info_associations = library_item.library_dataset_info_associations
elif isinstance( library_item, trans.app.model.LibraryDatasetDatasetAssociation ):
library_item_type = 'library_dataset_dataset_association'
library_item_desc = 'library dataset'
library_item_info_associations = library_item.library_dataset_dataset_info_associations
elif isinstance( library_item, trans.app.model.LibraryItemInfoElement ):
library_item_type = 'library_item_info'
library_item_desc = 'information'
library_item_info_associations = None
%>
%if library_item_info_associations:
<p/>
<div class="toolForm">
<div class="toolFormTitle">Other information about ${library_item_desc} ${library_item.name}</div>
<div class="toolFormBody">
%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 ) %>
<div class="form-row">
<label>${template_element.name}:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
${element.contents}
</div>
<div style="clear: both"></div>
</div>
%endfor
<div style="clear: both"></div>
%endfor
</div>
</div>
%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 ):
<p/>
<div class="toolForm">
<div class="toolFormTitle">Other information about ${library_item_desc} ${library_item.name}</div>
<div class="toolFormBody">
<p/>
<div class="toolForm">
<div class="toolFormTitle">Other information about ${library_item_desc} ${library_item.name}</div>
<div class="toolFormBody">
%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
<form name="add_template_info" action="${h.url_for( controller='library', action='library_item_info', library_id=library_id, new_info=True )}" method="post">
%endif
<input type="hidden" name="library_item_id" value="${library_item.id}"/>
@@ -208,9 +241,9 @@
</div>
</form>
%endif
</div>
</div>
%endif
%endfor
%endif
%endfor
</div>
</div>
%endif
</%def>
+2 -2
View File
@@ -1,7 +1,7 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
<%namespace file="/library/common.mako" import="render_available_templates" />
<%namespace file="/library/common.mako" import="render_existing_library_item_info" />
<%namespace file="/library/common.mako" import="render_library_item_info_for_edit" />
<br/><br/>
<ul class="manage-table-actions">
@@ -57,7 +57,7 @@
<% folder.refresh() %>
%if folder.library_folder_info_associations:
${render_existing_library_item_info( folder, library_id )}
${render_library_item_info_for_edit( folder, library_id )}
%elif folder.library_folder_info_template_associations:
${render_available_templates( folder, library_id, restrict=True )}
%else:
+149
View File
@@ -0,0 +1,149 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
<%namespace file="/library/common.mako" import="render_available_templates" />
<%namespace file="/library/common.mako" import="render_library_item_info_for_edit" />
<% from galaxy import util %>
%if ldda == ldda.library_dataset.library_dataset_dataset_association:
<b><i>This is the latest version of this library dataset</i></b>
%else:
<font color="red"><b><i>This is an expired version of this library dataset</i></b></font>
%endif
<p/>
<ul class="manage-table-actions">
<li>
<a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
</li>
</ul>
%if msg:
${render_msg( msg, messagetype )}
%endif
<%def name="datatype( ldda, datatypes )">
<select name="datatype">
%for ext in datatypes:
%if ldda.ext == ext:
<option value="${ext}" selected="yes">${ext}</option>
%else:
<option value="${ext}">${ext}</option>
%endif
%endfor
</select>
</%def>
%if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_MODIFY, library_item=ldda.library_dataset ):
<div class="toolForm">
<div class="toolFormTitle">Edit attributes of ${ldda.name}</div>
<div class="toolFormBody">
<form name="edit_attributes" action="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, edit_info=True )}" method="post">
<input type="hidden" name="id" value="${ldda.id}"/>
<div class="form-row">
<label>Name:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
<input type="text" name="name" value="${ldda.name}" 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="${ldda.info}" size="40"/>
</div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Message:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
<textarea name="message" rows="3" cols="35">${ldda.message}</textarea>
</div>
<div class="toolParamHelp" style="clear: both;">
This information will be displayed in the library browser
</div>
<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>
<div style="float: left; width: 250px; margin-right: 10px;">
${ldda.metadata.get_html_by_name( name )}
</div>
<div style="clear: both"></div>
</div>
%endif
%endfor
<div class="form-row">
<input type="submit" name="save" value="Save"/>
</div>
</form>
<form name="auto_detect" action="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, edit_info=True )}" method="post">
<input type="hidden" name="id" value="${ldda.id}"/>
<div style="float: left; width: 250px; margin-right: 10px;">
<input type="submit" name="detect" value="Auto-detect"/>
</div>
<div class="toolParamHelp" style="clear: both;">
This will inspect the dataset and attempt to correct the above column values if they are not accurate.
</div>
</form>
</div>
</div>
<p/>
<div class="toolForm">
<div class="toolFormTitle">Change data type</div>
<div class="toolFormBody">
<form name="change_datatype" action="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, edit_info=True )}" method="post">
<input type="hidden" name="id" value="${ldda.id}"/>
<div class="form-row">
<label>New Type:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
${datatype( ldda, datatypes )}
</div>
<div class="toolParamHelp" style="clear: both;">
This will change the datatype of the existing dataset
but <i>not</i> modify its contents. Use this if Galaxy
has incorrectly guessed the type of your dataset.
</div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<input type="submit" name="change" value="Save"/>
</div>
</form>
</div>
</div>
<p/>
%else:
<div class="toolForm">
<div class="toolFormTitle">View attributes of ${ldda.name}</div>
<div class="toolFormBody">
<div class="form-row">
<b>Name:</b> ${ldda.name}
<div style="clear: both"></div>
<b>Info:</b> ${ldda.info}
<div style="clear: both"></div>
<b>Data Format:</b> ${ldda.ext}
<div style="clear: both"></div>
%for name, spec in ldda.metadata.spec.items():
%if spec.visible:
<b>${spec.desc}:</b>
${ldda.metadata.get( name )}
<div style="clear: both"></div>
%endif
%endfor
</div>
</div>
</div>
%endif
<% ldda.refresh() %>
%if ldda.library_dataset_dataset_info_associations:
${render_library_item_info_for_edit( ldda, library_id )}
%elif ldda.library_dataset_dataset_info_template_associations:
${render_available_templates( ldda, library_id, restrict=True )}
%elif ldda.library_dataset.folder.library_folder_info_template_associations:
${render_available_templates( ldda, library_id, restrict='folder' )}
%else:
${render_available_templates( ldda, library_id, restrict=False )}
%endif
+107 -121
View File
@@ -1,10 +1,17 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
<%namespace file="/library/common.mako" import="render_available_templates" />
<%namespace file="/library/common.mako" import="render_existing_library_item_info" />
<%namespace file="/library/common.mako" import="render_library_item_info" />
<% from galaxy import util %>
%if ldda == ldda.library_dataset.library_dataset_dataset_association:
<%
if ldda == ldda.library_dataset.library_dataset_dataset_association:
current_version = True
else:
current_version = False
%>
%if current_version:
<b><i>This is the latest version of this library dataset</i></b>
%else:
<font color="red"><b><i>This is an expired version of this library dataset</i></b></font>
@@ -21,129 +28,108 @@
${render_msg( msg, messagetype )}
%endif
<%def name="datatype( ldda, datatypes )">
<select name="datatype">
%for ext in datatypes:
%if ldda.ext == ext:
<option value="${ext}" selected="yes">${ext}</option>
%else:
<option value="${ext}">${ext}</option>
%endif
%endfor
</select>
</%def>
<%
if ldda.user:
uploaded_by = ldda.user.email
else:
uploaded_by = 'anonymous'
%>
%if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_MODIFY, library_item=ldda.library_dataset ):
<div class="toolForm">
<div class="toolFormTitle">Edit attributes of ${ldda.name}</div>
<div class="toolFormBody">
<form name="edit_attributes" action="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, information=True )}" method="post">
<input type="hidden" name="id" value="${ldda.id}"/>
<div class="form-row">
<label>Name:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
<input type="text" name="name" value="${ldda.name}" 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="${ldda.info}" size="40"/>
</div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Message:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
<textarea name="message" rows="3" cols="35">${ldda.message}</textarea>
</div>
<div class="toolParamHelp" style="clear: both;">
This information will be displayed in the library browser
</div>
<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>
<div style="float: left; width: 250px; margin-right: 10px;">
${ldda.metadata.get_html_by_name( name )}
</div>
<div style="clear: both"></div>
</div>
%endif
%endfor
<div class="form-row">
<input type="submit" name="save" value="Save"/>
</div>
</form>
<form name="auto_detect" action="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, information=True )}" method="post">
<input type="hidden" name="id" value="${ldda.id}"/>
<div style="float: left; width: 250px; margin-right: 10px;">
<input type="submit" name="detect" value="Auto-detect"/>
</div>
<div class="toolParamHelp" style="clear: both;">
This will inspect the dataset and attempt to correct the above column values if they are not accurate.
</div>
</form>
<div class="toolForm">
<div class="toolFormTitle">
Information about ${ldda.name}
<a id="dataset-${ldda.id}-popup" class="popup-arrow" style="display: none;">&#9660;</a>
<div popupmenu="dataset-${ldda.id}-popup">
%if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_MODIFY, library_item=ldda.library_dataset ):
<a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, id=ldda.id, edit_info=True )}">Edit this dataset's information</a>
%else:
<a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, id=ldda.id, information=True )}">View this dataset's information</a>
%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 ):
## <a class="action-button" href="${h.url_for( controller='library', action='info_template', library_id=library_id, library_dataset_id=ldda.library_dataset.id, new_template=True )}">Add an information template to this dataset</a>
##%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 ):
<a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, id=ldda.id, permissions=True )}">Edit this dataset's permissions</a>
%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 ):
<a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, replace_id=ldda.library_dataset.id )}">Upload a new version of this dataset</a>
%endif
%endif
%if ldda.has_data:
<a class="action-button" href="${h.url_for( controller='library', action='datasets', library_id=library_id, ldda_ids=str( ldda.id ), do_action='add' )}">Import this dataset into your current history</a>
<a class="action-button" href="${h.url_for( controller='library', action='download_dataset_from_folder', id=ldda.id, library_id=library_id )}">Download this dataset</a>
%endif
</div>
</div>
<p/>
<div class="toolForm">
<div class="toolFormTitle">Change data type</div>
<div class="toolFormBody">
<form name="change_datatype" action="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=ldda.library_dataset.folder.id, information=True )}" method="post">
<input type="hidden" name="id" value="${ldda.id}"/>
<div class="form-row">
<label>New Type:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
${datatype( ldda, datatypes )}
</div>
<div class="toolParamHelp" style="clear: both;">
This will change the datatype of the existing dataset
but <i>not</i> modify its contents. Use this if Galaxy
has incorrectly guessed the type of your dataset.
</div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<input type="submit" name="change" value="Save"/>
</div>
</form>
<div class="toolFormBody">
<div class="form-row">
<label>Message:</label>
<div style="float: left; width: 250px; margin-right: 10px;">
${ldda.message}
</div>
<div style="clear: both"></div>
</div>
</div>
<p/>
%else:
<div class="toolForm">
<div class="toolFormTitle">View attributes of ${ldda.name}</div>
<div class="toolFormBody">
<div class="form-row">
<b>Name:</b> ${ldda.name}
<div style="clear: both"></div>
<b>Info:</b> ${ldda.info}
<div style="clear: both"></div>
<b>Data Format:</b> ${ldda.ext}
<div style="clear: both"></div>
%for name, spec in ldda.metadata.spec.items():
%if spec.visible:
<b>${spec.desc}:</b>
${ldda.metadata.get( name )}
<div style="clear: both"></div>
%endif
%endfor
<div class="form-row">
<label>Uploaded by:</lable>
<div style="float: left; width: 250px; margin-right: 10px;">
${uploaded_by}
</div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Date uploaded:</lable>
<div style="float: left; width: 250px; margin-right: 10px;">
${ldda.create_time.strftime( "%Y-%m-%d" )}
</div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Build:</lable>
<div style="float: left; width: 250px; margin-right: 10px;">
${ldda.dbkey}
</div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<label>Miscellaneous information:</lable>
<div style="float: left; width: 250px; margin-right: 10px;">
${ldda.info}
</div>
<div style="clear: both"></div>
</div>
<div class="form-row">
<div>${ldda.blurb}</div>
</div>
<div class="form-row">
<div id="info${ldda.id}" class="historyItemBody">
%if ldda.peek != "no peek":
<label>Peek:</lable>
<div><pre id="peek${ldda.id}" class="peek">${ldda.display_peek()}</pre></div>
%endif
## Recurse for child datasets
%if len( ldda.visible_children ) > 0:
<div>
There are ${len( ldda.visible_children )} secondary datasets.
%for idx, child in enumerate( ldda.visible_children ):
${ render_dataset( child, selected, library.deleted ) }
%endfor
</div>
%endif
</div>
</div>
</div>
%endif
<% ldda.refresh() %>
%if ldda.library_dataset_dataset_info_associations:
${render_existing_library_item_info( ldda, library_id )}
%elif ldda.library_dataset_dataset_info_template_associations:
${render_available_templates( ldda, library_id, restrict=True )}
%elif ldda.library_dataset.folder.library_folder_info_template_associations:
${render_available_templates( ldda, library_id, restrict='folder' )}
%else:
${render_available_templates( ldda, library_id, restrict=False )}
%endif
%if ldda.library_dataset_dataset_info_associations:
${render_library_item_info( ldda, library_id )}
%endif
%if current_version:
<% expired_lddas = [ e_ldda for e_ldda in ldda.library_dataset.expired_datasets ] %>
%if expired_lddas:
<div class="toolFormTitle">Expired versions of ${ldda.name}</div>
%for expired_ldda in expired_lddas:
<div class="form-row">
<a href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=expired_ldda.library_dataset.folder.id, id=expired_ldda.id, info=True )}">${expired_ldda.name}</a>
</div>
%endfor
%endif
%endif
</div>
+2 -2
View File
@@ -1,7 +1,7 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
<%namespace file="/library/common.mako" import="render_available_templates" />
<%namespace file="/library/common.mako" import="render_existing_library_item_info" />
<%namespace file="/library/common.mako" import="render_library_item_info_for_edit" />
%if library_dataset == library_dataset.library_dataset_dataset_association.library_dataset:
<b><i>This is the latest version of this library dataset</i></b>
@@ -64,7 +64,7 @@
<% library_dataset.refresh() %>
%if library_dataset.library_dataset_info_associations:
${render_existing_library_item_info( library_dataset, library_id )}
${render_library_item_info_for_edit( library_dataset, library_id )}
%elif library_dataset.folder.library_folder_info_template_associations:
${render_available_templates( library_dataset, library_id, restrict='folder' )}
%else:
@@ -1,55 +0,0 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
%if library_dataset == library_dataset.library_dataset_dataset_association.library_dataset:
<b><i>This is the latest version of this library dataset</i></b>
%else:
<font color="red"><b><i>This is an expired version of this library dataset</i></b></font>
%endif
<p/>
<ul class="manage-table-actions">
<li>
<a class="action-button" href="${h.url_for( controller='library', action='browse_library', id=library_id )}"><span>Browse this library</span></a>
</li>
</ul>
%if msg:
${render_msg( msg, messagetype )}
%endif
<div class="toolForm">
<div class="toolFormTitle">Set version of ${library_dataset.name}</div>
<div class="toolFormBody">
<form name="library_dataset_version" action="${h.url_for( controller='library', action='library_dataset', id=library_dataset.id, library_id=library_id, versions=True )}" method="post">
<div class="form-row">
<div style="float: left; width: 250px; margin-right: 10px;">
<div class="form-row">
<input type="radio" name="set_lda_id" value="${library_dataset.library_dataset_dataset_association.id}" checked>${library_dataset.name} (current)
<a id="dataset-${library_dataset.id}-popup" class="popup-arrow" style="display: none;">&#9660;</a>
<div popupmenu="dataset-${library_dataset.id}-popup">
<a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=library_dataset.folder.id, id=library_dataset.library_dataset_dataset_association.id, information=True )}">Edit this dataset's information</a>
<a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=library_dataset.folder.id, id=library_dataset.library_dataset_dataset_association.id, permissions=True )}">Edit this dataset's permissions</a>
<a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=library_dataset.folder.id, replace_id=library_dataset.id )}">Replace this dataset with a new version</a>
</div>
%for ldda in library_dataset.expired_datasets:
<br/>
<input type="radio" name="set_lda_id" value="${ldda.id}" >${ldda.name}
<a id="ldda-${ldda.id}-popup" class="popup-arrow" style="display: none;">&#9660;</a>
<div popupmenu="ldda-${ldda.id}-popup">
<a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=library_dataset.folder.id, id=ldda.id, information=True )}">Edit this dataset's information</a>
<a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=library_dataset.folder.id, id=ldda.id, permissions=True )}">Edit this dataset's permissions</a>
</div>
%endfor
</div>
</div>
<div style="clear: both"></div>
</div>
%if library_dataset.expired_datasets:
<div class="form-row">
<input type="submit" name="change_version_button" value="Save"/>
</div>
%endif
</form>
</div>
</div>
+2 -2
View File
@@ -1,7 +1,7 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
<%namespace file="/library/common.mako" import="render_available_templates" />
<%namespace file="/library/common.mako" import="render_existing_library_item_info" />
<%namespace file="/library/common.mako" import="render_library_item_info_for_edit" />
<br/><br/>
<ul class="manage-table-actions">
@@ -60,7 +60,7 @@
<% library.refresh() %>
%if library.library_info_associations:
${render_existing_library_item_info( library, library.id )}
${render_library_item_info_for_edit( library, library.id )}
%else:
${render_available_templates( library, library.id, restrict=False )}
%endif
+1 -1
View File
@@ -130,7 +130,7 @@
<textarea name="message" rows="3" cols="35"></textarea>
</div>
<div class="toolParamHelp" style="clear: both;">
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
</div>
<div style="clear: both"></div>
</div>
+2 -2
View File
@@ -2,7 +2,7 @@
<%namespace file="/message.mako" import="render_msg" />
<%namespace file="/dataset/security_common.mako" import="render_permission_form" />
<%namespace file="/library/common.mako" import="render_available_templates" />
<%namespace file="/library/common.mako" import="render_existing_library_item_info" />
<%namespace file="/library/common.mako" import="render_library_item_info_for_edit" />
%if msg:
${render_msg( msg, messagetype )}
@@ -50,7 +50,7 @@
</div>
</div>
<div class="toolForm">
${render_existing_library_item_info( library, library.id )}
${render_library_item_info_for_edit( library, library.id )}
</div>
</div>
%endif
+10 -10
View File
@@ -491,7 +491,7 @@ class TestSecurityAndLibraries( TwillTestCase ):
self.home()
self.visit_url( '%s/admin/browse_library?id=%s' % ( self.url, str( library_one.id ) ) )
self.check_page_for_string( "1.bed" )
self.check_page_for_string( "hg18" )
self.check_page_for_string( admin_user.email )
def test_085_accessing_dataset_with_private_role_restriction( self ):
"""Testing accessing a dataset with a private role restriction"""
# admin_user should not be able to see 1.bed from the analysis view's access librarys
@@ -571,14 +571,14 @@ class TestSecurityAndLibraries( TwillTestCase ):
self.home()
self.visit_url( '%s/admin/browse_library?id=%s' % ( self.url, str( library_one.id ) ) )
self.check_page_for_string( "2.bed" )
self.check_page_for_string( "hg17" )
self.check_page_for_string( admin_user.email )
def test_095_accessing_datasets_with_role_restriction( self ):
"""Testing accessing a dataset with a role restriction"""
# admin_user should be able to see 2.bed since she is associated with role_two
self.home()
self.visit_url( '%s/library/browse_library?id=%s' % ( self.url, str( library_one.id ) ) )
self.check_page_for_string( "2.bed" )
self.check_page_for_string( "hg17" )
self.check_page_for_string( admin_user.email )
self.logout()
# regular_user1 should be able to see 2.bed since she is associated with group_two
self.login( email = 'test1@bx.psu.edu' )
@@ -586,10 +586,10 @@ class TestSecurityAndLibraries( TwillTestCase ):
self.visit_url( '%s/library/browse_library?id=%s' % ( self.url, str( library_one.id ) ) )
self.check_page_for_string( folder_one.name )
self.check_page_for_string( '2.bed' )
self.check_page_for_string( "hg17" )
self.check_page_for_string( admin_user.email )
# Check the permissions on the dataset - should be 'access', which only allows viewing the information
self.home()
self.visit_url( '%s/library/library_dataset_dataset_association?information=True&library_id=%s&folder_id=%s&id=%s' % ( self.url, str( library_one.id ), str( folder_one.id ), str( ldda_two.id ) ) )
self.visit_url( '%s/library/library_dataset_dataset_association?edit_info=True&library_id=%s&folder_id=%s&id=%s' % ( self.url, str( library_one.id ), str( folder_one.id ), str( ldda_two.id ) ) )
self.check_page_for_string( '2.bed' )
self.check_page_for_string( 'This is the latest version of this library dataset' )
self.check_page_for_string( 'View attributes of 2.bed' )
@@ -653,7 +653,7 @@ class TestSecurityAndLibraries( TwillTestCase ):
assert ldda_three is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda_three from the database'
self.visit_page( 'admin/browse_library?id=%s' % ( str( library_one.id ) ) )
self.check_page_for_string( "3.bed" )
self.check_page_for_string( "hg16" )
self.check_page_for_string( admin_user.email )
self.logout()
def test_105_access_public_library_dataset( self ):
"""Testing accessing a public library dataset"""
@@ -663,7 +663,7 @@ class TestSecurityAndLibraries( TwillTestCase ):
self.visit_url( '%s/library/browse_library?id=%s' % ( self.url, str( library_one.id ) ) )
self.check_page_for_string( library_one.name )
self.check_page_for_string( '3.bed' )
self.check_page_for_string( "hg16" )
self.check_page_for_string( admin_user.email )
self.logout()
# regular_user2 should not be able to see 3.bed
self.login( email = 'test2@bx.psu.edu' )
@@ -671,7 +671,7 @@ class TestSecurityAndLibraries( TwillTestCase ):
self.visit_url( '%s/library/browse_library?id=%s' % ( self.url, str( library_one.id ) ) )
self.check_page_for_string( library_one.name )
self.check_page_for_string( '3.bed' )
self.check_page_for_string( "hg16" )
self.check_page_for_string( admin_user.email )
self.logout()
# regular_user3 should not be able to see 3.bed
self.login( email = 'test3@bx.psu.edu' )
@@ -679,10 +679,10 @@ class TestSecurityAndLibraries( TwillTestCase ):
self.visit_url( '%s/library/browse_library?id=%s' % ( self.url, str( library_one.id ) ) )
self.check_page_for_string( library_one.name )
self.check_page_for_string( '3.bed' )
self.check_page_for_string( "hg16" )
self.check_page_for_string( admin_user.email )
# Test selecting "View this dataset's information"
self.home()
self.visit_url( '%s/library/library_dataset_dataset_association?information=True&library_id=%s&folder_id=%s&id=%s' % ( self.url, str( library_one.id ), str( folder_one.id ), str( ldda_three.id ) ) )
self.visit_url( '%s/library/library_dataset_dataset_association?edit_info=True&library_id=%s&folder_id=%s&id=%s' % ( self.url, str( library_one.id ), str( folder_one.id ), str( ldda_three.id ) ) )
self.check_page_for_string( '3.bed' )
self.check_page_for_string( 'This is the latest version of this library dataset' )
self.check_page_for_string( 'View attributes of 3.bed' )