/templates/history/share.mako

https://bitbucket.org/h_morita_dbcls/galaxy-central · Mako · 192 lines · 185 code · 1 blank · 6 comment · 2 complexity · a171b347d6171bee6911d6f04f5584a6 MD5 · raw file

  1. <% _=n_ %>
  2. <%inherit file="/base.mako"/>
  3. <%def name="title()">Share histories</%def>
  4. <div class="toolForm">
  5. <div class="toolFormTitle">Share ${len( histories)} histories</div>
  6. <div class="toolFormBody">
  7. %if not can_change and not cannot_change and not no_change_needed:
  8. ## We are sharing histories that contain only public datasets
  9. <form name='share' id='share' action="${h.url_for( action='share' )}" method="post" >
  10. <div class="form-title-row"><b>Histories to be shared:</b></div>
  11. <div class="form-row" style="padding-left: 2em;">
  12. <table width="100%">
  13. <thead>
  14. <th>${_('History Name')}</th>
  15. <th>${_('Number of Datasets')}</th>
  16. </thead>
  17. <tbody>
  18. %for history in histories:
  19. <tr>
  20. <td>
  21. <input type="hidden" name="id" value="${trans.security.encode_id( history.id )}">
  22. ${history.name}
  23. </td>
  24. <td>
  25. %if len( history.datasets ) < 1:
  26. <div class="warningmark">${_('This history contains no data.')}</div>
  27. %else:
  28. ${len(history.datasets)}
  29. %endif
  30. </td>
  31. </tr>
  32. %endfor
  33. </tbody>
  34. </table>
  35. </div>
  36. <div style="clear: both"></div>
  37. <div class="form-row">
  38. <label>Galaxy user emails with which to share histories</label>
  39. <div style="float: left; width: 250px; margin-right: 10px;">
  40. <input type="text" name="email" value="${email}" size="40">
  41. </div>
  42. <div class="toolParamHelp" style="clear: both;">
  43. Enter a Galaxy user email address or a comma-separated list of addresses if sharing with multiple users
  44. </div>
  45. </div>
  46. %if send_to_err:
  47. <div style="clear: both"></div>
  48. <div class="form-row">
  49. <div class="errormessage">${send_to_err}</div>
  50. </div>
  51. %endif
  52. <div style="clear: both"></div>
  53. <div class="form-row">
  54. <input type="submit" name="share_button" value="Submit">
  55. </div>
  56. </form>
  57. %else:
  58. ## We are sharing restricted histories
  59. %if no_change_needed or can_change:
  60. <form name='share_restricted' id=share_restricted' action="${h.url_for( controller='history', action='share_restricted' )}" method="post">
  61. %if send_to_err:
  62. <div style="clear: both"></div>
  63. <div class="form-row">
  64. <div class="errormessage">${send_to_err}</div>
  65. </div>
  66. %endif
  67. ## Needed for rebuilding dicts
  68. <input type="hidden" name="email" value="${email}" size="40">
  69. %for history in histories:
  70. <input type="hidden" name="id" value="${trans.security.encode_id( history.id )}">
  71. %endfor
  72. %if no_change_needed:
  73. ## no_change_needed looks like: {historyX : [hda, hda], historyY : [hda] }
  74. <div style="clear: both"></div>
  75. <div class="form-row">
  76. <div class="donemessage">
  77. The following datasets can be shared with ${email} with no changes
  78. </div>
  79. </div>
  80. %for history, hdas in no_change_needed.items():
  81. <div class="form-row">
  82. <label>History</label>
  83. ${history.name}
  84. </div>
  85. <div style="clear: both"></div>
  86. <div class="form-row">
  87. <label>Datasets</label>
  88. </div>
  89. %for hda in hdas:
  90. <div class="form-row">
  91. ${hda.name}
  92. %if hda.deleted:
  93. (deleted)
  94. %endif
  95. </div>
  96. %endfor
  97. %endfor
  98. %endif
  99. %if can_change:
  100. ## can_change looks like: {historyX : [hda, hda], historyY : [hda] }
  101. <div style="clear: both"></div>
  102. <div class="form-row">
  103. <div class="warningmessage">
  104. The following datasets can be shared with ${email} by updating their permissions
  105. </div>
  106. </div>
  107. %for history, hdas in can_change.items():
  108. <div class="form-row">
  109. <label>History</label>
  110. ${history.name}
  111. </div>
  112. <div style="clear: both"></div>
  113. <div class="form-row">
  114. <label>Datasets</label>
  115. </div>
  116. %for hda in hdas:
  117. <div class="form-row">
  118. ${hda.name}
  119. %if hda.deleted:
  120. (deleted)
  121. %endif
  122. </div>
  123. %endfor
  124. %endfor
  125. %endif
  126. %if cannot_change:
  127. ## cannot_change looks like: {historyX : [hda, hda], historyY : [hda] }
  128. <div style="clear: both"></div>
  129. <div class="form-row">
  130. <div class="errormessage">
  131. The following datasets cannot be shared with ${email} because you are not authorized to
  132. change the permissions on them
  133. </div>
  134. </div>
  135. %for history, hdas in cannot_change.items():
  136. <div class="form-row">
  137. <label>History</label>
  138. ${history.name}
  139. </div>
  140. <div style="clear: both"></div>
  141. <div class="form-row">
  142. <label>Datasets</label>
  143. </div>
  144. %for hda in hdas:
  145. <div class="form-row">
  146. ${hda.name}
  147. %if hda.deleted:
  148. (deleted)
  149. %endif
  150. </div>
  151. %endfor
  152. %endfor
  153. %endif
  154. <div class="toolFormTitle"></div>
  155. <div class="form-row">
  156. <label>How would you like to proceed?</label>
  157. </div>
  158. %if can_change:
  159. <div class="form-row">
  160. <input type="radio" name="action" value="public"> Make datasets public so anyone can access them
  161. %if cannot_change:
  162. (where possible)
  163. %endif
  164. </div>
  165. <div class="form-row">
  166. %if no_change_needed:
  167. <input type="radio" name="action" value="private"> Make datasets private to me and the user(s) with whom I am sharing
  168. %else:
  169. <input type="radio" name="action" value="private" checked> Make datasets private to me and the user(s) with whom I am sharing
  170. %endif
  171. %if cannot_change:
  172. (where possible)
  173. %endif
  174. </div>
  175. %endif
  176. %if no_change_needed:
  177. <div class="form-row">
  178. <input type="radio" name="action" value="share_anyway" checked> Share anyway
  179. %if can_change:
  180. (don't change any permissions)
  181. %endif
  182. </div>
  183. %endif
  184. <div class="form-row">
  185. <input type="submit" name="share_restricted_button" value="Go"><br/>
  186. </div>
  187. </form>
  188. %endif
  189. %endif
  190. </div>
  191. </div>