/templates/admin/reload_tool.mako

https://bitbucket.org/cistrome/cistrome-harvard/ · Mako · 53 lines · 50 code · 3 blank · 0 comment · 2 complexity · 59e3fab3f40401e936eb35ddbb9d7af8 MD5 · raw file

  1. <%inherit file="/base.mako"/>
  2. <%namespace file="/message.mako" import="render_msg" />
  3. <% from galaxy.tools import Tool, ToolSection %>
  4. <script type="text/javascript">
  5. $().ready(function() {
  6. %if tool_id:
  7. var focus_el = $("input[name=reload_tool_button]");
  8. %else:
  9. var focus_el = $("select[name=tool_id]");
  10. %endif
  11. focus_el.focus();
  12. });
  13. </script>
  14. %if message:
  15. ${render_msg( message, status )}
  16. %endif
  17. <div class="toolForm">
  18. <div class="toolFormTitle">Reload Tool</div>
  19. <div class="toolFormBody">
  20. <form name="reload_tool" id="reload_tool" action="${h.url_for( controller='admin', action='reload_tool' )}" method="post" >
  21. <div class="form-row">
  22. <label>
  23. Tool to reload:
  24. </label>
  25. <select name="tool_id">
  26. %for key, val in toolbox.tool_panel.items():
  27. %if isinstance( val, Tool ):
  28. <option value="${val.id}">${val.name}</option>
  29. %elif isinstance( val, ToolSection ):
  30. <optgroup label="${val.name}">
  31. <% section = val %>
  32. %for section_key, section_val in section.elems.items():
  33. %if isinstance( section_val, Tool ):
  34. <% selected_str = "" %>
  35. %if section_val.id == tool_id:
  36. <% selected_str = " selected=\"selected\"" %>
  37. %endif
  38. <option value="${section_val.id}"${selected_str}>${section_val.name}</option>
  39. %endif
  40. %endfor
  41. %endif
  42. %endfor
  43. </select>
  44. </div>
  45. <div class="form-row">
  46. <input type="submit" name="reload_tool_button" value="Reload"/>
  47. </div>
  48. </form>
  49. </div>
  50. </div>