/templates/library/common/import_datasets_to_histories.mako

https://bitbucket.org/cistrome/cistrome-harvard/ · Mako · 106 lines · 103 code · 3 blank · 0 comment · 5 complexity · 86902a53d34a7c07ee129433ba88a85d MD5 · raw file

  1. <%namespace file="/message.mako" import="render_msg" />
  2. <%inherit file="/base.mako"/>
  3. <%namespace file="/message.mako" import="javascripts" />
  4. <%def name="title()">Import library datasets to histories</%def>
  5. <%def name="javascripts()">
  6. ${parent.javascripts()}
  7. ${h.js( "jquery", "galaxy.base" )}
  8. <script type="text/javascript">
  9. $(function() {
  10. $("#select-multiple").click(function() {
  11. $("#single-dest-select").val("");
  12. $("#single-destination").hide();
  13. $("#multiple-destination").show();
  14. });
  15. });
  16. </script>
  17. </%def>
  18. %if message:
  19. ${render_msg( message, status )}
  20. %endif
  21. <b>Import library datasets into histories</b>
  22. <br/><br/>
  23. <form action="${h.url_for( controller='library_common', action='import_datasets_to_histories', cntrller=cntrller, use_panels=use_panels, show_deleted=show_deleted )}" method="post">
  24. <div class="toolForm" style="float: left; width: 45%; padding: 0px;">
  25. <div class="toolFormBody">
  26. %if source_lddas:
  27. %for source_ldda in source_lddas:
  28. <%
  29. checked = ""
  30. encoded_id = trans.security.encode_id( source_ldda.id )
  31. if source_ldda.id in ldda_ids:
  32. checked = " checked='checked'"
  33. %>
  34. <div class="form-row">
  35. <input type="checkbox" name="ldda_ids" id="dataset_${encoded_id}" value="${encoded_id}" ${checked}/>
  36. <label for="dataset_${encoded_id}" style="display: inline;font-weight:normal;">${source_ldda.name}</label>
  37. </div>
  38. %endfor
  39. %else:
  40. <div class="form-row">This folder has no accessible library datasets.</div>
  41. %endif
  42. </div>
  43. </div>
  44. <div style="float: left; padding-left: 10px; font-size: 36px;">&rarr;</div>
  45. <div class="toolForm" style="float: right; width: 45%; padding: 0px;">
  46. <div class="toolFormTitle">Destination Histories:</div>
  47. <div class="toolFormBody">
  48. <div class="form-row" id="single-destination">
  49. <select id="single-dest-select" name="target_history_ids">
  50. %for i, target_history in enumerate( target_histories ):
  51. <%
  52. encoded_id = trans.security.encode_id( target_history.id )
  53. if encoded_id == selected_history_id:
  54. selected_text = " selected"
  55. else:
  56. selected_text = ""
  57. if target_history == current_history:
  58. current_history_text = " (current history)"
  59. else:
  60. current_history_text = ""
  61. %>
  62. <option value="${encoded_id}"${selected_text}>${i + 1}: ${h.truncate( target_history.name, 30 )}${current_history_text}</option>
  63. %endfor
  64. </select>
  65. <br/><br/>
  66. <a style="margin-left: 10px;" href="javascript:void(0);" id="select-multiple">Choose multiple histories</a>
  67. </div>
  68. <div id="multiple-destination" style="display: none;">
  69. %for i, target_history in enumerate( target_histories ):
  70. <%
  71. encoded_id = trans.security.encode_id( target_history.id )
  72. if target_history == current_history:
  73. current_history_text = " (current history)"
  74. else:
  75. current_history_text = ""
  76. %>
  77. <div class="form-row">
  78. <input type="checkbox" name="target_history_ids" id="target_history_${encoded_id}" value="${encoded_id}"/>
  79. <label for="target_history_${encoded_id}" style="display: inline; font-weight:normal;">${i + 1}: ${target_history.name}${current_history_text}</label>
  80. </div>
  81. %endfor
  82. </div>
  83. %if trans.get_user():
  84. <%
  85. checked = ""
  86. if "create_new_history" in target_history_ids:
  87. checked = " checked='checked'"
  88. %>
  89. <hr />
  90. <div style="text-align: center; color: #888;">&mdash; OR &mdash;</div>
  91. <div class="form-row">
  92. <label for="new_history_name" style="display: inline; font-weight:normal;">New history named:</label>
  93. <input type="textbox" name="new_history_name" />
  94. </div>
  95. %endif
  96. </div>
  97. </div>
  98. <div style="clear: both"></div>
  99. <div class="form-row" align="center">
  100. <input type="submit" class="primary-button" name="import_datasets_to_histories_button" value="Import library datasets"/>
  101. </div>
  102. </form>
  103. </div>