/templates/common/select_template.mako

https://bitbucket.org/cistrome/cistrome-harvard/ · Mako · 76 lines · 72 code · 4 blank · 0 comment · 3 complexity · 07e15219a3074c35c4a37e57b2c78e37 MD5 · raw file

  1. <%inherit file="/base.mako"/>
  2. <%namespace file="/message.mako" import="render_msg" />
  3. <%
  4. in_library = form_type == trans.model.FormDefinition.types.LIBRARY_INFO_TEMPLATE
  5. in_sample_tracking = form_type == trans.model.FormDefinition.types.RUN_DETAILS_TEMPLATE
  6. if in_library:
  7. # If rendering for a library folder or dataset, inheritance is set by the user, while
  8. # rendering for a RequestType, the template is always available to samples.
  9. from galaxy.web.form_builder import CheckboxField
  10. inheritable_check_box = CheckboxField( 'inheritable' )
  11. %>
  12. <br/><br/>
  13. <ul class="manage-table-actions">
  14. %if in_library:
  15. <li><a class="action-button" href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=library_id, use_panels=use_panels, show_deleted=show_deleted )}"><span>Browse the data library</span></a></li>
  16. %elif in_sample_tracking:
  17. <li><a class="action-button" href="${h.url_for( controller='request_type', action='view_request_type', id=request_type_id )}"><span>Browse the configuration</span></a></li>
  18. %endif
  19. </ul>
  20. %if message:
  21. ${render_msg( message, status )}
  22. %endif
  23. <div class="toolForm">
  24. <div class="toolFormTitle">Select a template for the ${item_desc} '${util.unicodify( item_name )}'</div>
  25. <div class="toolFormBody">
  26. %if form_type == trans.model.FormDefinition.types.LIBRARY_INFO_TEMPLATE:
  27. <form id="select_template" name="select_template" action="${h.url_for( controller='library_common', action='add_template', cntrller=cntrller, item_type=item_type, form_type=trans.model.FormDefinition.types.LIBRARY_INFO_TEMPLATE, library_id=library_id, folder_id=folder_id, ldda_id=ldda_id, use_panels=use_panels, show_deleted=show_deleted )}" method="post" >
  28. %elif form_type == trans.model.FormDefinition.types.RUN_DETAILS_TEMPLATE:
  29. <form id="select_template" name="select_template" action="${h.url_for( controller='request_type', action='add_template', cntrller=cntrller, item_type=item_type, form_type=trans.model.FormDefinition.types.RUN_DETAILS_TEMPLATE, request_type_id=request_type_id, sample_id=sample_id )}" method="post">
  30. %endif
  31. <div class="form-row">
  32. <label>Template:</label>
  33. ${form_id_select_field.get_html()}
  34. </div>
  35. % if form_type == trans.model.FormDefinition.types.LIBRARY_INFO_TEMPLATE and item_type in [ 'library', 'folder' ]:
  36. <div class="form-row">
  37. %if inheritable_checked:
  38. <% inheritable_check_box.checked = True %>
  39. %endif
  40. ${inheritable_check_box.get_html()}
  41. <label for="inheritable" style="display:inline;">Inherit template to contained folders and datasets?</label>
  42. <div class="toolParamHelp" style="clear: both;">
  43. Check if you want this template to be used by other folders and datasets contained within this ${item_desc}
  44. </div>
  45. </div>
  46. %endif
  47. <div class="form-row">
  48. <input type="submit" name="add_template_button" value="Use this template"/>
  49. </div>
  50. </form>
  51. </div>
  52. </div>
  53. <p/>
  54. %if form_id_select_field.get_selected( return_label=True, return_value=True ) != ('Select one', 'none'):
  55. <div class="toolForm">
  56. <div class="toolFormTitle">Layout of selected template</div>
  57. <div class="toolFormBody">
  58. <div class="form-row">
  59. %for i, field in enumerate( widgets ):
  60. <div class="form-row">
  61. <label>${field[ 'label' ]}</label>
  62. ${field[ 'widget' ].get_html( disabled=True )}
  63. <div class="toolParamHelp" style="clear: both;">
  64. ${field[ 'helptext' ]}
  65. </div>
  66. <div style="clear: both"></div>
  67. </div>
  68. %endfor
  69. </div>
  70. </div>
  71. </div>
  72. %endif