PageRenderTime 29ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/library/common/move_library_item.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 106 lines | 101 code | 5 blank | 0 comment | 4 complexity | d921d146114cb41c33340c186e71bb94 MD5 | raw file
  1. <%namespace file="/message.mako" import="render_msg" />
  2. <%inherit file="/base.mako"/>
  3. <%def name="javascripts()">
  4. ${parent.javascripts()}
  5. ${h.js("jquery.autocomplete", "autocomplete_tagging" )}
  6. </%def>
  7. <%def name="stylesheets()">
  8. ${parent.stylesheets()}
  9. ${h.css( "autocomplete_tagging" )}
  10. </%def>
  11. <%
  12. if source_library:
  13. source_library_id = trans.security.encode_id( source_library.id )
  14. else:
  15. source_library_id = ''
  16. if target_library:
  17. target_library_id = trans.security.encode_id( target_library.id )
  18. else:
  19. target_library_id = ''
  20. %>
  21. %if message:
  22. ${render_msg( message, status )}
  23. %endif
  24. <b>Move data library items</b>
  25. <br/><br/>
  26. <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">
  27. <div class="toolForm" style="float: left; width: 45%; padding: 0px;">
  28. <div class="toolFormBody">
  29. <input type="hidden" name="source_library_id" value="${source_library_id}"/>
  30. %if target_library:
  31. <input type="hidden" name="target_library_id" value="${target_library_id}"/>
  32. %endif
  33. %if item_type == 'ldda':
  34. %for move_ldda in move_lddas:
  35. <%
  36. checked = ""
  37. encoded_id = trans.security.encode_id( move_ldda.id )
  38. if move_ldda.id in move_ldda_ids:
  39. checked = " checked='checked'"
  40. %>
  41. <div class="form-row">
  42. <input type="checkbox" name="item_id" id="dataset_${encoded_id}" value="${encoded_id}" ${checked}/>
  43. <label for="dataset_${encoded_id}" style="display: inline;font-weight:normal;">${move_ldda.name}</label>
  44. </div>
  45. %endfor
  46. %elif item_type == 'folder':
  47. <div class="form-row">
  48. <% encoded_id = trans.security.encode_id( move_folder.id ) %>
  49. <input type="checkbox" name="item_id" id="folder_${encoded_id}" value="${encoded_id}" checked='checked'/>
  50. <label for="folder_${encoded_id}" style="display: inline;font-weight:normal;">${move_folder.name}</label>
  51. </div>
  52. %endif
  53. </div>
  54. </div>
  55. <div style="float: left; padding-left: 10px; font-size: 36px;">&rarr;</div>
  56. <div class="toolForm" style="float: right; width: 45%; padding: 0px;">
  57. %if target_library:
  58. <div class="toolFormTitle">Select folder within data library: ${h.truncate( target_library.name, 30 )}</div>
  59. %else:
  60. <div class="toolFormTitle">Select a data library</div>
  61. %endif
  62. <div class="toolFormBody">
  63. %if target_library:
  64. <div class="form-row">
  65. %if len( target_folder_id_select_field.options ) > 1:
  66. ${target_folder_id_select_field.get_html()}
  67. %else:
  68. %if source_library and source_library.id == target_library.id:
  69. You are not authorized to move items within the source data library
  70. %else:
  71. You are not authorized to move items into the selected data library
  72. %endif
  73. %endif
  74. %if source_library:
  75. <br/><br/>
  76. %if target_library.id == source_library.id:
  77. <a style="margin-left: 10px;" href="${h.url_for( controller='library_common', action='move_library_item', cntrller=cntrller, item_type=item_type, item_id=item_id, source_library_id=source_library_id, make_target_current=False, use_panels=use_panels, show_deleted=show_deleted )}">Choose another data library</a>
  78. %else:
  79. <a style="margin-left: 10px;" href="${h.url_for( controller='library_common', action='move_library_item', cntrller=cntrller, item_type=item_type, item_id=item_id, source_library_id=source_library_id, make_target_current=True, use_panels=use_panels, show_deleted=show_deleted )}">Choose source data library</a>
  80. %endif
  81. %elif not target_library_folders:
  82. <br/><br/>
  83. <a style="margin-left: 10px;" href="${h.url_for( controller='library_common', action='move_library_item', cntrller=cntrller, item_type=item_type, item_id=item_id, source_library_id=source_library_id, make_target_current=False, use_panels=use_panels, show_deleted=show_deleted )}">Choose another data library</a>
  84. %endif
  85. </div>
  86. %else:
  87. <div class="form-row">
  88. %if len( target_library_id_select_field.options ) > 1:
  89. ${target_library_id_select_field.get_html()}
  90. %else:
  91. You are not authorized to move items to any data libraries
  92. %endif
  93. </div>
  94. %endif
  95. </div>
  96. </div>
  97. <div style="clear: both"></div>
  98. <div class="form-row" align="center">
  99. <input type="submit" class="primary-button" name="move_library_item_button" value="Move"/>
  100. </div>
  101. </form>