1 | from mako import runtime, filters, cache |
---|
2 | UNDEFINED = runtime.UNDEFINED |
---|
3 | __M_dict_builtin = dict |
---|
4 | __M_locals_builtin = locals |
---|
5 | _magic_number = 5 |
---|
6 | _modified_time = 1287725818.302273 |
---|
7 | _template_filename='templates/dataset/edit_attributes.mako' |
---|
8 | _template_uri='/dataset/edit_attributes.mako' |
---|
9 | _template_cache=cache.Cache(__name__, _modified_time) |
---|
10 | _source_encoding=None |
---|
11 | _exports = ['stylesheets', 'datatype', 'javascripts', 'title'] |
---|
12 | |
---|
13 | |
---|
14 | def _mako_get_namespace(context, name): |
---|
15 | try: |
---|
16 | return context.namespaces[(__name__, name)] |
---|
17 | except KeyError: |
---|
18 | _mako_generate_namespaces(context) |
---|
19 | return context.namespaces[(__name__, name)] |
---|
20 | def _mako_generate_namespaces(context): |
---|
21 | # SOURCE LINE 163 |
---|
22 | ns = runtime.Namespace('__anon_0x10ab4e150', context._clean_inheritance_tokens(), templateuri=u'/dataset/security_common.mako', callables=None, calling_uri=_template_uri, module=None) |
---|
23 | context.namespaces[(__name__, '__anon_0x10ab4e150')] = ns |
---|
24 | |
---|
25 | # SOURCE LINE 2 |
---|
26 | ns = runtime.Namespace('__anon_0x10aad7dd0', context._clean_inheritance_tokens(), templateuri=u'/message.mako', callables=None, calling_uri=_template_uri, module=None) |
---|
27 | context.namespaces[(__name__, '__anon_0x10aad7dd0')] = ns |
---|
28 | |
---|
29 | def _mako_inherit(template, context): |
---|
30 | _mako_generate_namespaces(context) |
---|
31 | return runtime._inherit_from(context, u'/base.mako', _template_uri) |
---|
32 | def render_body(context,**pageargs): |
---|
33 | context.caller_stack._push_frame() |
---|
34 | try: |
---|
35 | __M_locals = __M_dict_builtin(pageargs=pageargs) |
---|
36 | _import_ns = {} |
---|
37 | _mako_get_namespace(context, '__anon_0x10ab4e150')._populate(_import_ns, [u'render_permission_form']) |
---|
38 | _mako_get_namespace(context, '__anon_0x10aad7dd0')._populate(_import_ns, [u'render_msg']) |
---|
39 | status = _import_ns.get('status', context.get('status', UNDEFINED)) |
---|
40 | render_permission_form = _import_ns.get('render_permission_form', context.get('render_permission_form', UNDEFINED)) |
---|
41 | render_msg = _import_ns.get('render_msg', context.get('render_msg', UNDEFINED)) |
---|
42 | all_roles = _import_ns.get('all_roles', context.get('all_roles', UNDEFINED)) |
---|
43 | data_annotation = _import_ns.get('data_annotation', context.get('data_annotation', UNDEFINED)) |
---|
44 | def datatype(dataset,datatypes): |
---|
45 | return render_datatype(context.locals_(__M_locals),dataset,datatypes) |
---|
46 | h = _import_ns.get('h', context.get('h', UNDEFINED)) |
---|
47 | current_user_roles = _import_ns.get('current_user_roles', context.get('current_user_roles', UNDEFINED)) |
---|
48 | len = _import_ns.get('len', context.get('len', UNDEFINED)) |
---|
49 | message = _import_ns.get('message', context.get('message', UNDEFINED)) |
---|
50 | trans = _import_ns.get('trans', context.get('trans', UNDEFINED)) |
---|
51 | data = _import_ns.get('data', context.get('data', UNDEFINED)) |
---|
52 | datatypes = _import_ns.get('datatypes', context.get('datatypes', UNDEFINED)) |
---|
53 | _ = _import_ns.get('_', context.get('_', UNDEFINED)) |
---|
54 | __M_writer = context.writer() |
---|
55 | # SOURCE LINE 1 |
---|
56 | __M_writer(u'\n') |
---|
57 | # SOURCE LINE 2 |
---|
58 | __M_writer(u'\n\n') |
---|
59 | # SOURCE LINE 4 |
---|
60 | __M_writer(u'\n\n') |
---|
61 | # SOURCE LINE 8 |
---|
62 | __M_writer(u'\n\n') |
---|
63 | # SOURCE LINE 13 |
---|
64 | __M_writer(u'\n\n') |
---|
65 | # SOURCE LINE 25 |
---|
66 | __M_writer(u'\n\n') |
---|
67 | # SOURCE LINE 27 |
---|
68 | if message: |
---|
69 | # SOURCE LINE 28 |
---|
70 | __M_writer(u' ') |
---|
71 | __M_writer(unicode(render_msg( message, status ))) |
---|
72 | __M_writer(u'\n') |
---|
73 | # SOURCE LINE 30 |
---|
74 | __M_writer(u'\n<div class="toolForm">\n <div class="toolFormTitle">') |
---|
75 | # SOURCE LINE 32 |
---|
76 | __M_writer(unicode(_('Edit Attributes'))) |
---|
77 | __M_writer(u'</div>\n <div class="toolFormBody">\n <form name="edit_attributes" action="') |
---|
78 | # SOURCE LINE 34 |
---|
79 | __M_writer(unicode(h.url_for( controller='root', action='edit' ))) |
---|
80 | __M_writer(u'" method="post">\n <input type="hidden" name="id" value="') |
---|
81 | # SOURCE LINE 35 |
---|
82 | __M_writer(unicode(data.id)) |
---|
83 | __M_writer(u'"/>\n <div class="form-row">\n <label>\n Name:\n </label>\n <div style="float: left; width: 250px; margin-right: 10px;">\n <input type="text" name="name" value="') |
---|
84 | # SOURCE LINE 41 |
---|
85 | __M_writer(unicode(data.get_display_name())) |
---|
86 | __M_writer(u'" size="40"/>\n </div>\n <div style="clear: both"></div>\n </div>\n <div class="form-row">\n <label>\n Info:\n </label>\n <div style="float: left; width: 250px; margin-right: 10px;">\n <input type="text" name="info" value="') |
---|
87 | # SOURCE LINE 50 |
---|
88 | __M_writer(unicode(data.info)) |
---|
89 | __M_writer(u'" size="40"/>\n </div>\n <div style="clear: both"></div>\n </div>\n') |
---|
90 | # SOURCE LINE 54 |
---|
91 | if trans.get_user() is not None: |
---|
92 | # SOURCE LINE 55 |
---|
93 | __M_writer(u' <div class="form-row"> \n <label>\n Annotation / Notes:\n </label>\n <div style="float: left; width: 250px; margin-right: 10px;">\n <textarea name="annotation" cols="40" rows="2">') |
---|
94 | # SOURCE LINE 60 |
---|
95 | __M_writer(unicode(data_annotation)) |
---|
96 | __M_writer(u'</textarea>\n </div>\n <div style="clear: both"></div>\n <div class="toolParamHelp">Add an annotation or notes to a dataset; annotations are available when a history is viewed.</div>\n </div>\n') |
---|
97 | # SOURCE LINE 66 |
---|
98 | for name, spec in data.metadata.spec.items(): |
---|
99 | # SOURCE LINE 67 |
---|
100 | if spec.visible: |
---|
101 | # SOURCE LINE 68 |
---|
102 | __M_writer(u' <div class="form-row">\n <label>\n ') |
---|
103 | # SOURCE LINE 70 |
---|
104 | __M_writer(unicode(spec.desc)) |
---|
105 | __M_writer(u':\n </label>\n <div style="float: left; width: 250px; margin-right: 10px;">\n ') |
---|
106 | # SOURCE LINE 73 |
---|
107 | __M_writer(unicode(data.metadata.get_html_by_name( name, trans=trans ))) |
---|
108 | __M_writer(u'\n </div>\n <div style="clear: both"></div>\n </div>\n') |
---|
109 | # SOURCE LINE 79 |
---|
110 | __M_writer(u' <div class="form-row">\n <input type="submit" name="save" value="') |
---|
111 | # SOURCE LINE 80 |
---|
112 | __M_writer(unicode(_('Save'))) |
---|
113 | __M_writer(u'"/>\n </div>\n </form>\n <form name="auto_detect" action="') |
---|
114 | # SOURCE LINE 83 |
---|
115 | __M_writer(unicode(h.url_for( controller='root', action='edit' ))) |
---|
116 | __M_writer(u'" method="post">\n <input type="hidden" name="id" value="') |
---|
117 | # SOURCE LINE 84 |
---|
118 | __M_writer(unicode(data.id)) |
---|
119 | __M_writer(u'"/>\n <div class="form-row">\n <div style="float: left; width: 250px; margin-right: 10px;">\n <input type="submit" name="detect" value="') |
---|
120 | # SOURCE LINE 87 |
---|
121 | __M_writer(unicode(_('Auto-detect'))) |
---|
122 | __M_writer(u'"/>\n </div>\n <div class="toolParamHelp" style="clear: both;">\n This will inspect the dataset and attempt to correct the above column values if they are not accurate.\n </div>\n </div>\n </form>\n') |
---|
123 | # SOURCE LINE 94 |
---|
124 | if data.missing_meta(): |
---|
125 | # SOURCE LINE 95 |
---|
126 | __M_writer(u' <div class="form-row">\n <div class="errormessagesmall">') |
---|
127 | # SOURCE LINE 96 |
---|
128 | __M_writer(unicode(_('Required metadata values are missing. Some of these values may not be editable by the user. Selecting "Auto-detect" will attempt to fix these values.'))) |
---|
129 | __M_writer(u'</div>\n </div>\n') |
---|
130 | # SOURCE LINE 99 |
---|
131 | __M_writer(u' </div>\n</div>\n<p />\n') |
---|
132 | # SOURCE LINE 102 |
---|
133 | converters = data.get_converter_types() |
---|
134 | |
---|
135 | __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin()[__M_key]) for __M_key in ['converters'] if __M_key in __M_locals_builtin()])) |
---|
136 | __M_writer(u'\n') |
---|
137 | # SOURCE LINE 103 |
---|
138 | if len( converters ) > 0: |
---|
139 | # SOURCE LINE 104 |
---|
140 | __M_writer(u' <div class="toolForm">\n <div class="toolFormTitle">') |
---|
141 | # SOURCE LINE 105 |
---|
142 | __M_writer(unicode(_('Convert to new format'))) |
---|
143 | __M_writer(u'</div>\n <div class="toolFormBody">\n <form name="convert_data" action="') |
---|
144 | # SOURCE LINE 107 |
---|
145 | __M_writer(unicode(h.url_for( controller='root', action='edit' ))) |
---|
146 | __M_writer(u'" method="post">\n <input type="hidden" name="id" value="') |
---|
147 | # SOURCE LINE 108 |
---|
148 | __M_writer(unicode(data.id)) |
---|
149 | __M_writer(u'"/>\n <div class="form-row">\n <div style="float: left; width: 250px; margin-right: 10px;">\n <select name="target_type">\n') |
---|
150 | # SOURCE LINE 112 |
---|
151 | for key, value in converters.items(): |
---|
152 | # SOURCE LINE 113 |
---|
153 | __M_writer(u' <option value="') |
---|
154 | __M_writer(unicode(key)) |
---|
155 | __M_writer(u'">') |
---|
156 | __M_writer(unicode(value.name)) |
---|
157 | __M_writer(u'</option>\n') |
---|
158 | # SOURCE LINE 115 |
---|
159 | __M_writer(u' </select>\n </div>\n <div class="toolParamHelp" style="clear: both;">\n This will create a new dataset with the contents of this dataset converted to a new format. \n </div>\n <div style="clear: both"></div>\n </div>\n <div class="form-row">\n <input type="submit" name="convert_data" value="') |
---|
160 | # SOURCE LINE 123 |
---|
161 | __M_writer(unicode(_('Convert'))) |
---|
162 | __M_writer(u'"/>\n </div>\n </form>\n </div>\n </div>\n <p />\n') |
---|
163 | # SOURCE LINE 130 |
---|
164 | __M_writer(u'\n<div class="toolForm">\n <div class="toolFormTitle">') |
---|
165 | # SOURCE LINE 132 |
---|
166 | __M_writer(unicode(_('Change data type'))) |
---|
167 | __M_writer(u'</div>\n <div class="toolFormBody">\n') |
---|
168 | # SOURCE LINE 134 |
---|
169 | if data.datatype.allow_datatype_change: |
---|
170 | # SOURCE LINE 135 |
---|
171 | __M_writer(u' <form name="change_datatype" action="') |
---|
172 | __M_writer(unicode(h.url_for( controller='root', action='edit' ))) |
---|
173 | __M_writer(u'" method="post">\n <input type="hidden" name="id" value="') |
---|
174 | # SOURCE LINE 136 |
---|
175 | __M_writer(unicode(data.id)) |
---|
176 | __M_writer(u'"/>\n <div class="form-row">\n <label>\n ') |
---|
177 | # SOURCE LINE 139 |
---|
178 | __M_writer(unicode(_('New Type'))) |
---|
179 | __M_writer(u':\n </label>\n <div style="float: left; width: 250px; margin-right: 10px;">\n ') |
---|
180 | # SOURCE LINE 142 |
---|
181 | __M_writer(unicode(datatype( data, datatypes ))) |
---|
182 | __M_writer(u'\n </div>\n <div class="toolParamHelp" style="clear: both;">\n ') |
---|
183 | # SOURCE LINE 145 |
---|
184 | __M_writer(unicode(_('This will change the datatype of the existing dataset but <i>not</i> modify its contents. Use this if Galaxy has incorrectly guessed the type of your dataset.'))) |
---|
185 | __M_writer(u'\n </div>\n <div style="clear: both"></div>\n </div>\n <div class="form-row">\n <input type="submit" name="change" value="') |
---|
186 | # SOURCE LINE 150 |
---|
187 | __M_writer(unicode(_('Save'))) |
---|
188 | __M_writer(u'"/>\n </div>\n </form>\n') |
---|
189 | # SOURCE LINE 153 |
---|
190 | else: |
---|
191 | # SOURCE LINE 154 |
---|
192 | __M_writer(u' <div class="form-row">\n <div class="warningmessagesmall">') |
---|
193 | # SOURCE LINE 155 |
---|
194 | __M_writer(unicode(_('Changing the datatype of this dataset is not allowed.'))) |
---|
195 | __M_writer(u'</div>\n </div>\n') |
---|
196 | # SOURCE LINE 158 |
---|
197 | __M_writer(u' </div>\n</div>\n<p />\n\n') |
---|
198 | # SOURCE LINE 162 |
---|
199 | if trans.app.security_agent.can_manage_dataset( current_user_roles, data.dataset ): |
---|
200 | # SOURCE LINE 163 |
---|
201 | __M_writer(u' ') |
---|
202 | __M_writer(u'\n ') |
---|
203 | # SOURCE LINE 164 |
---|
204 | __M_writer(unicode(render_permission_form( data.dataset, data.get_display_name(), h.url_for( controller='root', action='edit', id=data.id ), all_roles ))) |
---|
205 | __M_writer(u'\n') |
---|
206 | # SOURCE LINE 165 |
---|
207 | elif trans.user: |
---|
208 | # SOURCE LINE 166 |
---|
209 | __M_writer(u' <div class="toolForm">\n <div class="toolFormTitle">View Permissions</div>\n <div class="toolFormBody">\n <div class="form-row">\n') |
---|
210 | # SOURCE LINE 170 |
---|
211 | if data.dataset.actions: |
---|
212 | # SOURCE LINE 171 |
---|
213 | __M_writer(u' <ul>\n') |
---|
214 | # SOURCE LINE 172 |
---|
215 | for action, roles in trans.app.security_agent.get_permissions( data.dataset ).items(): |
---|
216 | # SOURCE LINE 173 |
---|
217 | if roles: |
---|
218 | # SOURCE LINE 174 |
---|
219 | __M_writer(u' <li>') |
---|
220 | __M_writer(unicode(action.description)) |
---|
221 | __M_writer(u'</li>\n <ul>\n') |
---|
222 | # SOURCE LINE 176 |
---|
223 | for role in roles: |
---|
224 | # SOURCE LINE 177 |
---|
225 | __M_writer(u' <li>') |
---|
226 | __M_writer(unicode(role.name)) |
---|
227 | __M_writer(u'</li>\n') |
---|
228 | # SOURCE LINE 179 |
---|
229 | __M_writer(u' </ul>\n') |
---|
230 | # SOURCE LINE 182 |
---|
231 | __M_writer(u' </ul>\n') |
---|
232 | # SOURCE LINE 183 |
---|
233 | else: |
---|
234 | # SOURCE LINE 184 |
---|
235 | __M_writer(u' <p>This dataset is accessible by everyone (it is public).</p>\n') |
---|
236 | # SOURCE LINE 186 |
---|
237 | __M_writer(u' </div>\n </div>\n </div>\n') |
---|
238 | # SOURCE LINE 190 |
---|
239 | __M_writer(u'<p/>\n<div class="toolForm">\n <div class="toolFormTitle">Copy History Item</div>\n <div class="toolFormBody">\n <form name="copy_hda" action="') |
---|
240 | # SOURCE LINE 194 |
---|
241 | __M_writer(unicode(h.url_for( controller='dataset', action='copy_datasets', source_dataset_ids=data.id, target_history_ids=data.history_id ))) |
---|
242 | __M_writer(u'" method="post">\n <div class="form-row">\n <input type="submit" name="change" value="Copy history item"/>\n <div class="toolParamHelp" style="clear: both;">\n Make a copy of this history item in your current history or any of your active histories.\n </div>\n </div>\n </form>\n </div>\n </div>\n</div>\n') |
---|
243 | return '' |
---|
244 | finally: |
---|
245 | context.caller_stack._pop_frame() |
---|
246 | |
---|
247 | |
---|
248 | def render_stylesheets(context): |
---|
249 | context.caller_stack._push_frame() |
---|
250 | try: |
---|
251 | _import_ns = {} |
---|
252 | _mako_get_namespace(context, '__anon_0x10ab4e150')._populate(_import_ns, [u'render_permission_form']) |
---|
253 | _mako_get_namespace(context, '__anon_0x10aad7dd0')._populate(_import_ns, [u'render_msg']) |
---|
254 | h = _import_ns.get('h', context.get('h', UNDEFINED)) |
---|
255 | __M_writer = context.writer() |
---|
256 | # SOURCE LINE 6 |
---|
257 | __M_writer(u'\n ') |
---|
258 | # SOURCE LINE 7 |
---|
259 | __M_writer(unicode(h.css( "base", "autocomplete_tagging" ))) |
---|
260 | __M_writer(u'\n') |
---|
261 | return '' |
---|
262 | finally: |
---|
263 | context.caller_stack._pop_frame() |
---|
264 | |
---|
265 | |
---|
266 | def render_datatype(context,dataset,datatypes): |
---|
267 | context.caller_stack._push_frame() |
---|
268 | try: |
---|
269 | _import_ns = {} |
---|
270 | _mako_get_namespace(context, '__anon_0x10ab4e150')._populate(_import_ns, [u'render_permission_form']) |
---|
271 | _mako_get_namespace(context, '__anon_0x10aad7dd0')._populate(_import_ns, [u'render_msg']) |
---|
272 | _ = _import_ns.get('_', context.get('_', UNDEFINED)) |
---|
273 | __M_writer = context.writer() |
---|
274 | # SOURCE LINE 15 |
---|
275 | __M_writer(u'\n <select name="datatype">\n') |
---|
276 | # SOURCE LINE 17 |
---|
277 | for ext in datatypes: |
---|
278 | # SOURCE LINE 18 |
---|
279 | if dataset.ext == ext: |
---|
280 | # SOURCE LINE 19 |
---|
281 | __M_writer(u' <option value="') |
---|
282 | __M_writer(unicode(ext)) |
---|
283 | __M_writer(u'" selected="yes">') |
---|
284 | __M_writer(unicode(_(ext))) |
---|
285 | __M_writer(u'</option>\n') |
---|
286 | # SOURCE LINE 20 |
---|
287 | else: |
---|
288 | # SOURCE LINE 21 |
---|
289 | __M_writer(u' <option value="') |
---|
290 | __M_writer(unicode(ext)) |
---|
291 | __M_writer(u'">') |
---|
292 | __M_writer(unicode(_(ext))) |
---|
293 | __M_writer(u'</option>\n') |
---|
294 | # SOURCE LINE 24 |
---|
295 | __M_writer(u' </select>\n') |
---|
296 | return '' |
---|
297 | finally: |
---|
298 | context.caller_stack._pop_frame() |
---|
299 | |
---|
300 | |
---|
301 | def render_javascripts(context): |
---|
302 | context.caller_stack._push_frame() |
---|
303 | try: |
---|
304 | _import_ns = {} |
---|
305 | _mako_get_namespace(context, '__anon_0x10ab4e150')._populate(_import_ns, [u'render_permission_form']) |
---|
306 | _mako_get_namespace(context, '__anon_0x10aad7dd0')._populate(_import_ns, [u'render_msg']) |
---|
307 | h = _import_ns.get('h', context.get('h', UNDEFINED)) |
---|
308 | parent = _import_ns.get('parent', context.get('parent', UNDEFINED)) |
---|
309 | __M_writer = context.writer() |
---|
310 | # SOURCE LINE 10 |
---|
311 | __M_writer(u'\n ') |
---|
312 | # SOURCE LINE 11 |
---|
313 | __M_writer(unicode(parent.javascripts())) |
---|
314 | __M_writer(u'\n ') |
---|
315 | # SOURCE LINE 12 |
---|
316 | __M_writer(unicode(h.js( "galaxy.base", "jquery.autocomplete", "autocomplete_tagging" ))) |
---|
317 | __M_writer(u'\n') |
---|
318 | return '' |
---|
319 | finally: |
---|
320 | context.caller_stack._pop_frame() |
---|
321 | |
---|
322 | |
---|
323 | def render_title(context): |
---|
324 | context.caller_stack._push_frame() |
---|
325 | try: |
---|
326 | _import_ns = {} |
---|
327 | _mako_get_namespace(context, '__anon_0x10ab4e150')._populate(_import_ns, [u'render_permission_form']) |
---|
328 | _mako_get_namespace(context, '__anon_0x10aad7dd0')._populate(_import_ns, [u'render_msg']) |
---|
329 | _ = _import_ns.get('_', context.get('_', UNDEFINED)) |
---|
330 | __M_writer = context.writer() |
---|
331 | # SOURCE LINE 4 |
---|
332 | __M_writer(unicode(_('Edit Dataset Attributes'))) |
---|
333 | return '' |
---|
334 | finally: |
---|
335 | context.caller_stack._pop_frame() |
---|
336 | |
---|
337 | |
---|