/templates/webapps/reports/workflows_per_user.mako

https://bitbucket.org/cistrome/cistrome-harvard/ · Mako · 42 lines · 40 code · 2 blank · 0 comment · 2 complexity · c7ab724f63e4c4244154baca8a12a6c2 MD5 · raw file

  1. <%inherit file="/base.mako"/>
  2. <%namespace file="/message.mako" import="render_msg" />
  3. %if message:
  4. ${render_msg( message, 'done' )}
  5. %endif
  6. <div class="toolForm">
  7. <div class="toolFormBody">
  8. <h3 align="center">Workflows Per User</h3>
  9. <table align="center" width="60%" class="colored">
  10. %if len( workflows ) == 0:
  11. <tr><td colspan="2">There are no workflows</td></tr>
  12. %else:
  13. <tr class="header">
  14. <td>User</td>
  15. <td>Total Workflows</td>
  16. </tr>
  17. <% ctr = 0 %>
  18. %for workflow in workflows:
  19. <%
  20. from galaxy import util
  21. email = workflow[0]
  22. total = workflow[1]
  23. user = trans.sa_session.query( trans.model.User ) \
  24. .filter_by( email=email ) \
  25. .one()
  26. %>
  27. %if ctr % 2 == 1:
  28. <tr class="odd_row">
  29. %else:
  30. <tr class="tr">
  31. %endif
  32. <td><a href="${h.url_for( controller='workflows', action='user_per_month', id=trans.security.encode_id( user.id ), email=util.sanitize_text( user.email ) )}">${email}</a></td>
  33. <td>${total}</td>
  34. </tr>
  35. <% ctr += 1 %>
  36. %endfor
  37. %endif
  38. </table>
  39. </div>
  40. </div>