PageRenderTime 28ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/library/common/library_dataset_search_results.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 137 lines | 120 code | 13 blank | 4 comment | 13 complexity | f9280bd795fc00dfffafce6d6ab57bb1 MD5 | raw file
  1. <%namespace file="/message.mako" import="render_msg" />
  2. <%namespace file="/library/common/browse_library.mako" import="render_dataset" />
  3. <%namespace file="/library/common/common.mako" import="render_actions_on_multiple_items" />
  4. <%namespace file="/library/common/common.mako" import="render_compression_types_help" />
  5. <%namespace file="/library/common/common.mako" import="common_javascripts" />
  6. <%!
  7. def inherit(context):
  8. if context.get('use_panels'):
  9. return '/webapps/galaxy/base_panels.mako'
  10. else:
  11. return '/base.mako'
  12. %>
  13. <%inherit file="${inherit(context)}"/>
  14. <%def name="init()">
  15. <%
  16. self.has_left_panel=False
  17. self.has_right_panel=False
  18. self.message_box_visible=False
  19. self.active_view="user"
  20. self.overlay_visible=False
  21. %>
  22. </%def>
  23. ##
  24. ## Override methods from base.mako and base_panels.mako
  25. ##
  26. <%def name="center_panel()">
  27. <div style="overflow: auto; height: 100%;">
  28. <div class="page-container" style="padding: 10px;">
  29. ${render_content()}
  30. </div>
  31. </div>
  32. </%def>
  33. ## Render the grid's basic elements. Each of these elements can be subclassed.
  34. <%def name="body()">
  35. ${render_content()}
  36. </%def>
  37. <%def name="stylesheets()">
  38. ${parent.stylesheets()}
  39. ${h.css( "library" )}
  40. </%def>
  41. <%def name="javascripts()">
  42. ${parent.javascripts()}
  43. ${h.js("jstorage")}
  44. ${common_javascripts()}
  45. </%def>
  46. <%def name="render_searched_components()">
  47. <ul style="padding-left: 1em; list-style-type: disc;">
  48. <li>name</li>
  49. <li>info</li>
  50. <li>dbkey (genome build)</li>
  51. <li>message</li>
  52. %if trans.app.config.enable_lucene_library_search:
  53. <li>disk file content</li>
  54. %endif
  55. </ul>
  56. <br/>
  57. </%def>
  58. <%def name="render_content()">
  59. <%
  60. from galaxy import util
  61. from galaxy.web.controllers.library_common import branch_deleted
  62. from time import strftime
  63. class RowCounter( object ):
  64. def __init__( self ):
  65. self.count = 0
  66. def increment( self ):
  67. self.count += 1
  68. def __str__( self ):
  69. return str( self.count )
  70. %>
  71. <br/><br/>
  72. <ul class="manage-table-actions">
  73. <li>
  74. <a class="action-button" href="${h.url_for( controller=cntrller, action='browse_libraries' )}" target="galaxy_main">Browse data libraries</a></div>
  75. </li>
  76. </ul>
  77. <h2>Results for search on &ldquo;${search_term}&rdquo;</h2>
  78. %if message:
  79. ${render_msg( message, status )}
  80. %endif
  81. %if lddas:
  82. <p>The string "${search_term}" was found in at least one of the following information components of the displayed library datasets.</p>
  83. ${render_searched_components()}
  84. <form name="act_on_multiple_datasets" action="${h.url_for( controller='library_common', action='act_on_multiple_datasets', cntrller=cntrller, use_panels=use_panels, show_deleted=show_deleted )}" onSubmit="javascript:return checkForm();" method="post">
  85. <input type="hidden" name="search_term" value="${search_term}"/>
  86. <table cellspacing="0" cellpadding="0" border="0" width="100%" class="grid" id="library-grid">
  87. <thead>
  88. <tr class="libraryTitle">
  89. <th>
  90. <input type="checkbox" id="checkAll" name=select_all_datasets_checkbox value="true" onclick='checkAllFields(1);'/><input type="hidden" name=select_all_datasets_checkbox value="true"/>
  91. Name
  92. </th>
  93. <th>Message</th>
  94. <th>Uploaded By</th>
  95. <th>Date</th>
  96. <th>File Size</th>
  97. </tr>
  98. </thead>
  99. <%
  100. tracked_datasets = {}
  101. row_counter = RowCounter()
  102. my_row = row_counter.count
  103. %>
  104. %for ldda in lddas:
  105. <%
  106. library_dataset = ldda.library_dataset
  107. folder = library_dataset.folder
  108. library = folder.parent_library
  109. %>
  110. ${render_dataset( cntrller, ldda, library_dataset, False, library, folder, 0, my_row, row_counter, tracked_datasets, show_deleted=False )}
  111. <%
  112. my_row = row_counter.count
  113. row_counter.increment()
  114. %>
  115. %endfor
  116. ${render_actions_on_multiple_items( actions_to_exclude=[ 'manage_permissions' ] )}
  117. </table>
  118. </form>
  119. ${render_compression_types_help( comptypes )}
  120. %elif status != 'error':
  121. <p>The string "${search_term}" was not found in any of the following information components for any library datasets that you can access.</p>
  122. ${render_searched_components()}
  123. %endif
  124. </%def>