/templates/requests/common/find_samples.mako

https://bitbucket.org/cistrome/cistrome-harvard/ · Mako · 95 lines · 89 code · 6 blank · 0 comment · 4 complexity · 113b3aac0a25d6a7645c5c1bab173560 MD5 · raw file

  1. <%inherit file="/base.mako"/>
  2. <%namespace file="/message.mako" import="render_msg" />
  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. <% is_admin = cntrller == 'requests_admin' and trans.user_is_admin() %>
  12. <br/>
  13. <br/>
  14. <ul class="manage-table-actions">
  15. <li>
  16. <a class="action-button" href="${h.url_for( controller=cntrller, action='browse_requests' )}">Browse requests</a>
  17. </li>
  18. </ul>
  19. %if message:
  20. ${render_msg( message, status )}
  21. %endif
  22. <div class="toolForm">
  23. <div class="toolFormTitle">Find samples</div>
  24. <div class="toolFormBody">
  25. <form name="find_request" id="find_request" action="${h.url_for( controller='requests_common', action='find_samples', cntrller=cntrller )}" method="post" >
  26. <div class="form-row">
  27. <label>Find samples using:</label>
  28. ${search_type.get_html()}
  29. <div class="toolParamHelp" style="clear: both;">
  30. Select a sample attribute for searching. To search <br/>
  31. for a sample with a dataset name, select the dataset <br/>
  32. option above. This will return all the samples that <br/>
  33. are associated with a dataset with that name. <br/>
  34. </div>
  35. </div>
  36. <div class="form-row">
  37. <label>Show only sequencing requests in state:</label>
  38. ${request_states.get_html()}
  39. </div>
  40. <div class="form-row">
  41. ${search_box.get_html()}
  42. <input type="submit" name="find_samples_button" value="Find"/>
  43. <div class="toolParamHelp" style="clear: both;">
  44. <p>
  45. Wildcard search (%) can be used as placeholder for any sequence of characters or words.<br/>
  46. For example, to search for samples starting with 'mysample' use 'mysample%' as the search string.
  47. </p>
  48. <p>
  49. When 'form value' search type is selected, then enter the search string in 'field label=value' format.
  50. <br/>For example, when searching for all samples whose 'Volume' field is 1.3mL, then the search string
  51. should be 'Volume=1.3mL' (without qoutes).
  52. </p>
  53. </div>
  54. </div>
  55. %if results:
  56. <div class="form-row">
  57. <label><i>${results}</i></label>
  58. %if samples:
  59. <div class="toolParamHelp" style="clear: both;">
  60. The search results are sorted by the date the samples where created.
  61. </div>
  62. %endif
  63. </div>
  64. %endif
  65. <div class="form-row">
  66. %if samples:
  67. %for sample in samples:
  68. <div class="form-row">
  69. Sample: <b>${sample.name}</b> | Barcode: ${sample.bar_code}<br/>
  70. %if sample.request.is_new or not sample.state:
  71. State: Unsubmitted<br/>
  72. %else:
  73. State: ${sample.state.name}<br/>
  74. %endif
  75. Datasets: <a href="${h.url_for( controller='requests_common', action='view_sample_datasets', cntrller=cntrller, sample_id=trans.security.encode_id( sample.id ) )}">${len( sample.datasets )}</a><br/>
  76. %if is_admin:
  77. <i>User: ${sample.request.user.email}</i>
  78. %endif
  79. <div class="toolParamHelp" style="clear: both;">
  80. <a href="${h.url_for( controller='requests_common', action='view_request', cntrller=cntrller, id=trans.security.encode_id( sample.request.id ) )}">Sequencing request: ${sample.request.name} | Type: ${sample.request.type.name} | State: ${sample.request.state}</a>
  81. </div>
  82. </div>
  83. <br/>
  84. %endfor
  85. %endif
  86. </div>
  87. </form>
  88. </div>
  89. </div>