Skip to content

Commit d402df6

Browse files
committed
more changes in sharing.mako
1 parent 20ef047 commit d402df6

3 files changed

Lines changed: 100 additions & 146 deletions

File tree

templates/sharing_base.mako

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -51,27 +51,27 @@
5151
// Replace URL with URL text.
5252
$('#item-url').hide();
5353
$('#item-url-text').show();
54-
54+
5555
// Allow only lowercase alphanumeric and '-' characters in slug.
5656
text_elt.keyup(function(){
5757
text_elt.val( $(this).val().replace(/\s+/g,'-').replace(/[^a-zA-Z0-9\-]/g,'').toLowerCase() )
5858
});
5959
};
60-
60+
6161
var on_finish = function( text_elt ) {
6262
// Replace URL text with URL.
6363
$('#item-url-text').hide();
6464
$('#item-url').show();
65-
65+
6666
// Set URL to new value.
6767
var new_url = $('#item-url-text').text();
6868
var item_url_obj = $('#item-url');
6969
item_url_obj.attr( "href", new_url );
7070
item_url_obj.text( new_url );
7171
};
72-
72+
7373
<% controller_name = get_controller_name( item ) %>
74-
async_save_text("edit-identifier", "item-identifier", "${h.url_for( controller=controller_name, action='set_slug_async', id=trans.security.encode_id( item.id ) )}", "new_slug", null, false, 0, on_start, on_finish);
74+
async_save_text("edit-identifier", "item-identifier", "${h.url_for( controller=controller_name, action='set_slug_async', id=trans.security.encode_id( item.id ) )}", "new_slug", null, false, 0, on_start, on_finish);
7575
});
7676
</script>
7777
</%def>
@@ -113,13 +113,13 @@
113113
#
114114
# Setup and variables needed for page.
115115
#
116-
116+
117117
# Get class name strings.
118-
item_class_name = get_class_display_name( item.__class__ )
118+
item_class_name = get_class_display_name( item.__class__ )
119119
item_class_name_lc = item_class_name.lower()
120120
item_class_plural_name = get_class_plural_display_name( item.__class__ )
121121
item_class_plural_name_lc = item_class_plural_name.lower()
122-
122+
123123
# Get item name.
124124
item_name = get_item_name(item)
125125
%>
@@ -129,8 +129,8 @@
129129
## Require that user have a public username before sharing or publishing an item.
130130
%if trans.get_user().username is None or trans.get_user().username is "":
131131
<p>To make a ${item_class_name_lc} accessible via link or publish it, you must create a public username:</p>
132-
133-
<form action="${h.url_for( controller=controller_name, action='set_public_username', id=trans.security.encode_id( item.id ) )}"
132+
133+
<form action="${h.url_for( controller=controller_name, action='set_public_username', id=trans.security.encode_id( item.id ) )}"
134134
method="POST">
135135
<div class="form-row">
136136
<label>Public Username:</label>
@@ -146,36 +146,36 @@
146146
%else:
147147
## User has a public username, so private sharing and publishing options.
148148
<h3>Make ${item_class_name} Accessible via Link and Publish It</h3>
149-
149+
150150
<div>
151151
%if item.importable:
152-
<%
153-
item_status = "accessible via link"
152+
<%
153+
item_status = "accessible via link"
154154
if item.published:
155-
item_status = item_status + " and published"
155+
item_status = item_status + " and published"
156156
%>
157-
This ${item_class_name_lc} is currently <strong>${item_status}</strong>.
157+
This ${item_class_name_lc} is currently <strong>${item_status}</strong>.
158158
<div>
159159
<p>Anyone can view and import this ${item_class_name_lc} by visiting the following URL:
160160
161161
<blockquote>
162-
<%
163-
url = h.url_for( controller=controller_name, action='display_by_username_and_slug', username=trans.get_user().username, slug=item.slug, qualified=True )
162+
<%
163+
url = h.url_for( controller=controller_name, action='display_by_username_and_slug', username=trans.get_user().username, slug=item.slug, qualified=True )
164164
url_parts = url.split("/")
165165
%>
166166
<a id="item-url" href="${url}" target="_top">${url}</a>
167167
<span id="item-url-text" style="display: none">
168168
${"/".join( url_parts[:-1] )}/<span id='item-identifier'>${url_parts[-1]}</span>
169169
</span>
170-
170+
171171
<a href="#" id="edit-identifier"><img src="${h.url_for('/static/images/fugue/pencil.png')}"/></a>
172172
</blockquote>
173-
173+
174174
%if item.published:
175175
This ${item_class_name_lc} is publicly listed and searchable in Galaxy's <a href='${h.url_for( controller=controller_name, action='list_published' )}' target="_top">Published ${item_class_plural_name}</a> section.
176176
%endif
177177
</div>
178-
178+
179179
<p>You can:
180180
<div>
181181
<form action="${h.url_for( controller=controller_name, action='sharing', id=trans.security.encode_id( item.id ) )}" method="POST">
@@ -198,20 +198,20 @@
198198
%endif
199199
</form>
200200
</div>
201-
201+
202202
%else:
203-
203+
204204
<p>This ${item_class_name_lc} is currently restricted so that only you and the users listed below can access it. You can:</p>
205-
205+
206206
<form action="${h.url_for(controller=controller_name, action='sharing', id=trans.security.encode_id(item.id) )}" method="POST">
207207
<input class="action-button" type="submit" name="make_accessible_via_link" value="Make ${item_class_name} Accessible via Link">
208208
<div class="toolParamHelp">Generates a web link that you can share with other people so that they can view and import the ${item_class_name_lc}.</div>
209-
209+
210210
<br />
211211
<input class="action-button" type="submit" name="make_accessible_and_publish" value="Make ${item_class_name} Accessible and Publish" method="POST">
212212
<div class="toolParamHelp">Makes the ${item_class_name_lc} accessible via link (see above) and publishes the ${item_class_name_lc} to Galaxy's <a href='${h.url_for(controller=controller_name, action='list_published' )}' target='_top'>Published ${item_class_plural_name}</a> section, where it is publicly listed and searchable.</div>
213213
</form>
214-
214+
215215
%endif
216216
217217
##
@@ -226,7 +226,7 @@
226226
The following users will see this ${item_class_name_lc} in their ${item_class_name_lc} list and will be
227227
able to view, import, and run it.
228228
</p>
229-
229+
230230
<table class="colored" border="0" cellspacing="0" cellpadding="0" width="100%">
231231
<tr class="header">
232232
<th>Email</th>
@@ -243,26 +243,26 @@
243243
<a class="action-button" href="${h.url_for(controller=controller_name, action='sharing', id=trans.security.encode_id( item.id ), unshare_user=trans.security.encode_id( user.id ), use_panels=use_panels )}">Unshare</a>
244244
</div>
245245
</td>
246-
</tr>
246+
</tr>
247247
%endfor
248248
</table>
249-
249+
250250
<p>
251-
<a class="action-button"
251+
<a class="action-button"
252252
href="${h.url_for(controller=controller_name, action='share', id=trans.security.encode_id(item.id), use_panels=use_panels )}">
253253
<span>Share with another user</span>
254254
</a>
255255
256256
%else:
257257
258258
<p>You have not shared this ${item_class_name_lc} with any users.</p>
259-
260-
<a class="action-button"
259+
260+
<a class="action-button"
261261
href="${h.url_for(controller=controller_name, action='share', id=trans.security.encode_id(item.id), use_panels=use_panels )}">
262262
<span>Share with a user</span>
263263
</a>
264264
<br />
265-
265+
266266
%endif
267267
</div>
268268
</div>
Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
1-
<%inherit file="/export_base.mako"/>
2-
3-
<%namespace file="/display_common.mako" import="*" />
4-
5-
<%def name="init()">
6-
<%
7-
parent.init()
8-
self.active_view="workflow"
9-
%>
10-
</%def>
11-
12-
<%def name="stylesheets()">
13-
${parent.stylesheets()}
14-
<style>
15-
.toolForm {
16-
max-width: 350px;
17-
}
18-
</style>
19-
</%def>
20-
21-
<%def name="render_export_to_myexp(item)">
22-
##
23-
## Renders form for exporting workflow to myExperiment.
24-
##
25-
<h3>Export to myExperiment</h3>
26-
27-
<div class="toolForm">
28-
<form action="${h.url_for(controller='workflow', action='export_to_myexp', id=trans.security.encode_id( item.id ) )}"
29-
method="POST">
30-
<div class="form-row">
31-
<label>myExperiment username:</label>
32-
<input type="text" name="myexp_username" value="" size="40"/>
33-
</div>
34-
<div class="form-row">
35-
<label>myExperiment password:</label>
36-
<input type="password" name="myexp_password" value="" size="40"/>
37-
</div>
38-
<div class="form-row">
39-
<input type="submit" value="Export"/>
40-
</div>
41-
</form>
42-
</div>
43-
</%def>
44-
45-
<%def name="render_more(item)">
46-
## Add form to export to myExperiment.
47-
${self.render_export_to_myexp(item)}
48-
49-
## Add link to render as SVG image.
50-
<h3>Create Image</h3>
51-
52-
<a href="${h.url_for(controller='workflow', action='gen_image', id=trans.security.encode_id( item.id ) )}">
53-
Create image of ${get_class_display_name( item.__class__ ).lower()} in SVG format
54-
</a>
55-
</%def>
56-
57-
<%def name="center_panel()">
58-
${parent.body()}
59-
</%def>
1+
## <%inherit file="/export_base.mako"/>
2+
3+
## <%namespace file="/display_common.mako" import="*" />
4+
5+
## <%def name="init()">
6+
## <%
7+
## parent.init()
8+
## self.active_view="workflow"
9+
## %>
10+
## </%def>
11+
12+
## <%def name="stylesheets()">
13+
## ${parent.stylesheets()}
14+
## <style>
15+
## .toolForm {
16+
## max-width: 350px;
17+
## }
18+
## </style>
19+
## </%def>
20+
21+
## <%def name="render_export_to_myexp(item)">
22+
## ##
23+
## ## Renders form for exporting workflow to myExperiment.
24+
## ##
25+
## <h3>Export to myExperiment</h3>
26+
27+
## <div class="toolForm">
28+
## <form action="${h.url_for(controller='workflow', action='export_to_myexp', id=trans.security.encode_id( item.id ) )}"
29+
## method="POST">
30+
## <div class="form-row">
31+
## <label>myExperiment username:</label>
32+
## <input type="text" name="myexp_username" value="" size="40"/>
33+
## </div>
34+
## <div class="form-row">
35+
## <label>myExperiment password:</label>
36+
## <input type="password" name="myexp_password" value="" size="40"/>
37+
## </div>
38+
## <div class="form-row">
39+
## <input type="submit" value="Export"/>
40+
## </div>
41+
## </form>
42+
## </div>
43+
## </%def>
44+
45+
## <%def name="render_more(item)">
46+
## ## Add form to export to myExperiment.
47+
## ${self.render_export_to_myexp(item)}
48+
49+
## ## Add link to render as SVG image.
50+
## <h3>Create Image</h3>
51+
52+
## <a href="${h.url_for(controller='workflow', action='gen_image', id=trans.security.encode_id( item.id ) )}">
53+
## Create image of ${get_class_display_name( item.__class__ ).lower()} in SVG format
54+
## </a>
55+
## </%def>
56+
57+
## <%def name="center_panel()">
58+
## ${parent.body()}
59+
## </%def>

templates/webapps/galaxy/workflow/sharing.mako

Lines changed: 9 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
self.item_class_plural_name = get_class_plural_display_name( item.__class__ )
4242
self.item_class_plural_name_lc = self.item_class_plural_name.lower()
4343
self.controller = get_controller_name(item)
44+
self.active_view="workflow"
4445
%>
4546
</%def>
4647

@@ -226,63 +227,14 @@
226227
href="${h.url_for(controller=controller_name, action='share', id=trans.security.encode_id(item.id), use_panels=use_panels )}">
227228
<span>Share with a user</span>
228229
</a>
229-
<br />
230+
## <br />
230231
231232
%endif
232233
</div>
233234
</div>
234235
%endif
235236
</%def>
236237

237-
## ##
238-
## ## Share workflow with indiviual Galaxy users
239-
## ##
240-
241-
## <%def name="render_sharing_for_users(item)">
242-
## <h3>Share workflow with Individual Users</h3>
243-
## <div>
244-
## %if item.users_shared_with:
245-
## <p>
246-
## The following users will see this ${item_class_name_lc} in their ${item_class_name_lc} list and will be
247-
## able to view, import, and run it.
248-
## </p>
249-
250-
## <table class="colored" border="0" cellspacing="0" cellpadding="0" width="100%">
251-
## <tr class="header">
252-
## <th>Email</th>
253-
## <th></th>
254-
## </tr>
255-
## %for i, association in enumerate( item.users_shared_with ):
256-
## <% user = association.user %>
257-
## <tr>
258-
## <td>
259-
## <div class="menubutton popup" id="user-${i}-popup">${user.email}</div>
260-
## </td>
261-
## <td>
262-
## <div popupmenu="user-${i}-popup">
263-
## <a class="action-button" href="${h.url_for(controller=controller_name, action='sharing', id=trans.security.encode_id( item.id ), unshare_user=trans.security.encode_id( user.id ), use_panels=use_panels )}">Unshare</a>
264-
## </div>
265-
## </td>
266-
## </tr>
267-
## %endfor
268-
## </table>
269-
## <p>
270-
## <a class="action-button"
271-
## href="${h.url_for(controller=controller_name, action='share', id=trans.security.encode_id(item.id), use_panels=use_panels )}">
272-
## <span>Share with another user</span>
273-
## </a>
274-
## </p>
275-
## %else:
276-
## <p>You have not shared this ${item_class_name_lc} with any users.</p>
277-
278-
## <a class="action-button"
279-
## href="${h.url_for(controller=controller_name, action='share', id=trans.security.encode_id(item.id), use_panels=use_panels )}">
280-
## <span>Share with a user</span>
281-
## </a>
282-
## <br />
283-
## %endif
284-
## </div>
285-
## </%def>
286238

287239

288240
## Download and Export section
@@ -311,7 +263,8 @@
311263
</%def>
312264

313265
<%def name="render_footer()">
314-
<p><br><br>
266+
ASDKSNAD
267+
<br><br>
315268
<a href="${h.url_for(controller=self.controller, action="list" )}">Back to ${self.item_class_plural_name} List</a>
316269
</%def>
317270

@@ -362,9 +315,10 @@
362315
363316
${self.render_download_to_file(item)}
364317
365-
${self.render_url_for_importing(item)}
318+
${self.render_url_for_importing(item)}
366319
367-
${self.render_more(item)}
320+
${self.render_more(item)}
368321
369-
${self.render_footer()}
370-
</%def>
322+
${self.render_footer()}
323+
324+
</%def>

0 commit comments

Comments
 (0)