1 | <%inherit file="/base.mako"/> |
---|
2 | <%namespace file="/message.mako" import="render_msg" /> |
---|
3 | |
---|
4 | <% |
---|
5 | from galaxy.web.framework.helpers import time_ago |
---|
6 | %> |
---|
7 | |
---|
8 | <%! |
---|
9 | def inherit(context): |
---|
10 | if context.get('use_panels'): |
---|
11 | return '/webapps/community/base_panels.mako' |
---|
12 | else: |
---|
13 | return '/base.mako' |
---|
14 | %> |
---|
15 | <%inherit file="${inherit(context)}"/> |
---|
16 | |
---|
17 | <%def name="javascripts()"> |
---|
18 | ${parent.javascripts()} |
---|
19 | <script type="text/javascript"> |
---|
20 | $(function(){ |
---|
21 | $("input:text:first").focus(); |
---|
22 | }) |
---|
23 | function confirmSubmit() { |
---|
24 | if ( confirm( "Make sure you have filled in the User Description field. After you have submitted your tool to be published, you will no longer be able to modify it. Click OK to submit it." ) ) { |
---|
25 | return true; |
---|
26 | } else { |
---|
27 | return false; |
---|
28 | } |
---|
29 | } |
---|
30 | </script> |
---|
31 | </%def> |
---|
32 | |
---|
33 | <%def name="render_select( name, options )"> |
---|
34 | <select name="${name}" id="${name}" style="min-width: 250px; height: 150px;" multiple> |
---|
35 | %for option in options: |
---|
36 | <option value="${option[0]}">${option[1]}</option> |
---|
37 | %endfor |
---|
38 | </select> |
---|
39 | </%def> |
---|
40 | |
---|
41 | <script type="text/javascript"> |
---|
42 | $().ready(function() { |
---|
43 | $('#categories_add_button').click(function() { |
---|
44 | return !$('#out_categories option:selected').remove().appendTo('#in_categories'); |
---|
45 | }); |
---|
46 | $('#categories_remove_button').click(function() { |
---|
47 | return !$('#in_categories option:selected').remove().appendTo('#out_categories'); |
---|
48 | }); |
---|
49 | $('form#edit_tool').submit(function() { |
---|
50 | $('#in_categories option').each(function(i) { |
---|
51 | $(this).attr("selected", "selected"); |
---|
52 | }); |
---|
53 | }); |
---|
54 | }); |
---|
55 | </script> |
---|
56 | |
---|
57 | <%def name="title()">Edit Tool</%def> |
---|
58 | |
---|
59 | <h2>Edit Tool</h2> |
---|
60 | |
---|
61 | ${tool.get_state_message()} |
---|
62 | <p/> |
---|
63 | |
---|
64 | <ul class="manage-table-actions"> |
---|
65 | %if can_approve_or_reject: |
---|
66 | <li><a class="action-button" href="${h.url_for( controller='admin', action='set_tool_state', state=trans.model.Tool.states.APPROVED, id=trans.security.encode_id( tool.id ), cntrller=cntrller )}">Approve</a></li> |
---|
67 | <li><a class="action-button" href="${h.url_for( controller='admin', action='set_tool_state', state=trans.model.Tool.states.REJECTED, id=trans.security.encode_id( tool.id ), cntrller=cntrller )}">Reject</a></li> |
---|
68 | %endif |
---|
69 | <li><a class="action-button" id="tool-${tool.id}-popup" class="menubutton">Tool Actions</a></li> |
---|
70 | <div popupmenu="tool-${tool.id}-popup"> |
---|
71 | %if can_view: |
---|
72 | <a class="action-button" href="${h.url_for( controller='common', action='view_tool_history', id=trans.app.security.encode_id( tool.id ), cntrller=cntrller )}">Tool history</a> |
---|
73 | <a class="action-button" href="${h.url_for( controller='common', action='view_tool', id=trans.app.security.encode_id( tool.id ), cntrller=cntrller )}">View tool</a> |
---|
74 | %endif |
---|
75 | %if can_download: |
---|
76 | <a class="action-button" href="${h.url_for( controller='common', action='download_tool', id=trans.app.security.encode_id( tool.id ), cntrller=cntrller )}">Download tool</a> |
---|
77 | %endif |
---|
78 | %if can_delete: |
---|
79 | <a class="action-button" href="${h.url_for( controller='common', action='delete_tool', id=trans.app.security.encode_id( tool.id ), cntrller=cntrller )}" confirm="Are you sure you want to delete this tool?">Delete tool</a> |
---|
80 | %endif |
---|
81 | %if can_upload_new_version: |
---|
82 | <a class="action-button" href="${h.url_for( controller='common', action='upload_new_tool_version', id=trans.app.security.encode_id( tool.id ), cntrller=cntrller )}">Upload a new version</a> |
---|
83 | %endif |
---|
84 | %if can_purge: |
---|
85 | <li><a class="action-button" href="${h.url_for( controller='admin', action='purge_tool', id=trans.security.encode_id( tool.id ), cntrller=cntrller )}" confirm="Purging removes records from the database, are you sure you want to purge this tool?">Purge tool</a></li> |
---|
86 | %endif |
---|
87 | </div> |
---|
88 | </ul> |
---|
89 | |
---|
90 | %if message: |
---|
91 | ${render_msg( message, status )} |
---|
92 | %endif |
---|
93 | |
---|
94 | %if can_edit: |
---|
95 | <form id="edit_tool" name="edit_tool" action="${h.url_for( controller='common', action='edit_tool' )}" method="post"> |
---|
96 | %if tool.is_rejected: |
---|
97 | <div class="toolForm"> |
---|
98 | <div class="toolFormTitle">Reason for rejection</div> |
---|
99 | <div class="toolFormBody"> |
---|
100 | <div class="form-row"> |
---|
101 | ${reason_for_rejection} |
---|
102 | <div style="clear: both"></div> |
---|
103 | </div> |
---|
104 | </div> |
---|
105 | </div> |
---|
106 | <p/> |
---|
107 | %endif |
---|
108 | <div class="toolForm"> |
---|
109 | <div class="toolFormTitle">${tool.name}</div> |
---|
110 | <div class="toolFormBody"> |
---|
111 | <input type="hidden" name="id" value="${trans.app.security.encode_id( tool.id )}"/> |
---|
112 | <input type="hidden" name="cntrller" value="${cntrller}"/> |
---|
113 | <div class="form-row"> |
---|
114 | <label>Tool Id:</label> |
---|
115 | ${tool.tool_id} |
---|
116 | <div style="clear: both"></div> |
---|
117 | </div> |
---|
118 | <div class="form-row"> |
---|
119 | <label>Version:</label> |
---|
120 | ${tool.version} |
---|
121 | <div style="clear: both"></div> |
---|
122 | </div> |
---|
123 | <div class="form-row"> |
---|
124 | <label>Description:</label> |
---|
125 | ${tool.description} |
---|
126 | <div style="clear: both"></div> |
---|
127 | </div> |
---|
128 | <div class="form-row"> |
---|
129 | <label>User Description:</label> |
---|
130 | %if tool.user_description: |
---|
131 | <div class="form-row-input"><pre><textarea name="user_description" rows="5" cols="35">${tool.user_description}</textarea></pre></div> |
---|
132 | %else: |
---|
133 | <div class="form-row-input"><textarea name="user_description" rows="5" cols="35"></textarea></div> |
---|
134 | %endif |
---|
135 | <div class="toolParamHelp" style="clear: both;">Required when submitting for approval</div> |
---|
136 | <div style="clear: both"></div> |
---|
137 | </div> |
---|
138 | <div class="form-row"> |
---|
139 | <label>Uploaded by:</label> |
---|
140 | ${tool.user.username} |
---|
141 | <div style="clear: both"></div> |
---|
142 | </div> |
---|
143 | <div class="form-row"> |
---|
144 | <label>Date uploaded:</label> |
---|
145 | ${time_ago( tool.create_time )} |
---|
146 | <div style="clear: both"></div> |
---|
147 | </div> |
---|
148 | </div> |
---|
149 | </div> |
---|
150 | <p/> |
---|
151 | <div class="toolForm"> |
---|
152 | <div class="toolFormTitle">Manage categories</div> |
---|
153 | <div class="toolFormBody"> |
---|
154 | <div class="form-row"> |
---|
155 | <div style="float: left; margin-right: 10px;"> |
---|
156 | <label>Categories associated with '${tool.name}'</label> |
---|
157 | ${render_select( "in_categories", in_categories )}<br/> |
---|
158 | <input type="submit" id="categories_remove_button" value=">>"/> |
---|
159 | </div> |
---|
160 | <div> |
---|
161 | <label>Categories not associated with '${tool.name}'</label> |
---|
162 | ${render_select( "out_categories", out_categories )}<br/> |
---|
163 | <input type="submit" id="categories_add_button" value="<<"/> |
---|
164 | </div> |
---|
165 | </div> |
---|
166 | <div class="form-row"> |
---|
167 | <input type="submit" id="edit_tool_button" name="edit_tool_button" value="Save"/> |
---|
168 | </div> |
---|
169 | </div> |
---|
170 | </div> |
---|
171 | <p/> |
---|
172 | %if tool.is_new or tool.is_rejected: |
---|
173 | <div class="toolForm"> |
---|
174 | <div class="toolFormTitle">Get approval for publishing</div> |
---|
175 | <div class="toolFormBody"> |
---|
176 | <div class="form-row"> |
---|
177 | <input type="submit" name="approval_button" id="approval_button" value="Submit for approval" onClick="return confirmSubmit()" /> |
---|
178 | </div> |
---|
179 | <div class="form-row"> |
---|
180 | <div class="toolParamHelp" style="clear: both;"> |
---|
181 | Tools must be approved before they are made available to others in the community. After you have submitted |
---|
182 | your tool to be published, you will no longer be able to modify it, so make sure the information above is |
---|
183 | correct before submitting for approval. |
---|
184 | </div> |
---|
185 | </div> |
---|
186 | </div> |
---|
187 | </div> |
---|
188 | %endif |
---|
189 | </form> |
---|
190 | %else: |
---|
191 | ${render_msg( "You are not allowed to edit this tool", "error" )} |
---|
192 | %endif |
---|