PageRenderTime 18ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/templates/genetrack/search.html

https://bitbucket.org/cistrome/cistrome-harvard/
HTML | 55 lines | 45 code | 10 blank | 0 comment | 0 complexity | e60bdb14f0f4ea4b065d6d40d1c3f114 MD5 | raw file
  1. ## search.html
  2. <%!
  3. from itertools import cycle
  4. colors = cycle( [ 'even', 'odd' ] )
  5. %>
  6. <%inherit file="base.html"/>
  7. <%def name="title()">
  8. Search
  9. </%def>
  10. <h1 align="center">Search</h1>
  11. <div align="center">
  12. <form action="search" method="get">
  13. Search terms <input type="text" name="word" value="${param.word}">
  14. <input type="hidden" name="dataset_id" id="dataset_id" value="${dataset_id}" />
  15. <input type="submit" name="submit" value="Search!">
  16. </form>
  17. </div>
  18. % if param.word:
  19. % if len(query)>0:
  20. <h4 align="center">Showing the best ${len(query)} matches</h4>
  21. <table align="center" class="data_table" cellpadding="6" cellspacing="0">
  22. <tr align="center">
  23. <th width="25%">Name</td>
  24. <th width="25%">Chromosome</td>
  25. <th width="25%">Start:End</td>
  26. <th width="25%">Type</td>
  27. </tr>
  28. % for color, row in zip(colors, query):
  29. ${makerow(color, row)}
  30. % endfor
  31. </table>
  32. % else:
  33. <h4 align="center">No results found</h4>
  34. % endif
  35. %endif
  36. <br>
  37. <%def name="makerow(color, row)">
  38. <tr class="${color}" align="center">
  39. <td><a href="${h.url_for(controller='genetrack', action='index', chrom=row.chrom, feature=row.start, dataset_id=dataset_id)}">${row.name}</a></td>
  40. <td>${row.chrom}</td>
  41. <td>${row.start}:${row.end}</td>
  42. <td>${row.label.name}</td>
  43. </tr>
  44. </%def>
  45. </form>