PageRenderTime 26ms CodeModel.GetById 18ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

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