|
51 | 51 | // Replace URL with URL text. |
52 | 52 | $('#item-url').hide(); |
53 | 53 | $('#item-url-text').show(); |
54 | | - |
| 54 | +
|
55 | 55 | // Allow only lowercase alphanumeric and '-' characters in slug. |
56 | 56 | text_elt.keyup(function(){ |
57 | 57 | text_elt.val( $(this).val().replace(/\s+/g,'-').replace(/[^a-zA-Z0-9\-]/g,'').toLowerCase() ) |
58 | 58 | }); |
59 | 59 | }; |
60 | | - |
| 60 | +
|
61 | 61 | var on_finish = function( text_elt ) { |
62 | 62 | // Replace URL text with URL. |
63 | 63 | $('#item-url-text').hide(); |
64 | 64 | $('#item-url').show(); |
65 | | - |
| 65 | +
|
66 | 66 | // Set URL to new value. |
67 | 67 | var new_url = $('#item-url-text').text(); |
68 | 68 | var item_url_obj = $('#item-url'); |
69 | 69 | item_url_obj.attr( "href", new_url ); |
70 | 70 | item_url_obj.text( new_url ); |
71 | 71 | }; |
72 | | - |
| 72 | +
|
73 | 73 | <% 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); |
75 | 75 | }); |
76 | 76 | </script> |
77 | 77 | </%def> |
|
113 | 113 | # |
114 | 114 | # Setup and variables needed for page. |
115 | 115 | # |
116 | | - |
| 116 | +
|
117 | 117 | # Get class name strings. |
118 | | - item_class_name = get_class_display_name( item.__class__ ) |
| 118 | + item_class_name = get_class_display_name( item.__class__ ) |
119 | 119 | item_class_name_lc = item_class_name.lower() |
120 | 120 | item_class_plural_name = get_class_plural_display_name( item.__class__ ) |
121 | 121 | item_class_plural_name_lc = item_class_plural_name.lower() |
122 | | - |
| 122 | +
|
123 | 123 | # Get item name. |
124 | 124 | item_name = get_item_name(item) |
125 | 125 | %> |
|
129 | 129 | ## Require that user have a public username before sharing or publishing an item. |
130 | 130 | %if trans.get_user().username is None or trans.get_user().username is "": |
131 | 131 | <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 ) )}" |
134 | 134 | method="POST"> |
135 | 135 | <div class="form-row"> |
136 | 136 | <label>Public Username:</label> |
|
146 | 146 | %else: |
147 | 147 | ## User has a public username, so private sharing and publishing options. |
148 | 148 | <h3>Make ${item_class_name} Accessible via Link and Publish It</h3> |
149 | | - |
| 149 | +
|
150 | 150 | <div> |
151 | 151 | %if item.importable: |
152 | | - <% |
153 | | - item_status = "accessible via link" |
| 152 | + <% |
| 153 | + item_status = "accessible via link" |
154 | 154 | if item.published: |
155 | | - item_status = item_status + " and published" |
| 155 | + item_status = item_status + " and published" |
156 | 156 | %> |
157 | | - This ${item_class_name_lc} is currently <strong>${item_status}</strong>. |
| 157 | + This ${item_class_name_lc} is currently <strong>${item_status}</strong>. |
158 | 158 | <div> |
159 | 159 | <p>Anyone can view and import this ${item_class_name_lc} by visiting the following URL: |
160 | 160 |
|
161 | 161 | <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 ) |
164 | 164 | url_parts = url.split("/") |
165 | 165 | %> |
166 | 166 | <a id="item-url" href="${url}" target="_top">${url}</a> |
167 | 167 | <span id="item-url-text" style="display: none"> |
168 | 168 | ${"/".join( url_parts[:-1] )}/<span id='item-identifier'>${url_parts[-1]}</span> |
169 | 169 | </span> |
170 | | - |
| 170 | +
|
171 | 171 | <a href="#" id="edit-identifier"><img src="${h.url_for('/static/images/fugue/pencil.png')}"/></a> |
172 | 172 | </blockquote> |
173 | | - |
| 173 | +
|
174 | 174 | %if item.published: |
175 | 175 | 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. |
176 | 176 | %endif |
177 | 177 | </div> |
178 | | - |
| 178 | +
|
179 | 179 | <p>You can: |
180 | 180 | <div> |
181 | 181 | <form action="${h.url_for( controller=controller_name, action='sharing', id=trans.security.encode_id( item.id ) )}" method="POST"> |
|
198 | 198 | %endif |
199 | 199 | </form> |
200 | 200 | </div> |
201 | | - |
| 201 | +
|
202 | 202 | %else: |
203 | | - |
| 203 | +
|
204 | 204 | <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 | +
|
206 | 206 | <form action="${h.url_for(controller=controller_name, action='sharing', id=trans.security.encode_id(item.id) )}" method="POST"> |
207 | 207 | <input class="action-button" type="submit" name="make_accessible_via_link" value="Make ${item_class_name} Accessible via Link"> |
208 | 208 | <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 | +
|
210 | 210 | <br /> |
211 | 211 | <input class="action-button" type="submit" name="make_accessible_and_publish" value="Make ${item_class_name} Accessible and Publish" method="POST"> |
212 | 212 | <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> |
213 | 213 | </form> |
214 | | - |
| 214 | +
|
215 | 215 | %endif |
216 | 216 |
|
217 | 217 | ## |
|
226 | 226 | The following users will see this ${item_class_name_lc} in their ${item_class_name_lc} list and will be |
227 | 227 | able to view, import, and run it. |
228 | 228 | </p> |
229 | | - |
| 229 | +
|
230 | 230 | <table class="colored" border="0" cellspacing="0" cellpadding="0" width="100%"> |
231 | 231 | <tr class="header"> |
232 | 232 | <th>Email</th> |
|
243 | 243 | <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> |
244 | 244 | </div> |
245 | 245 | </td> |
246 | | - </tr> |
| 246 | + </tr> |
247 | 247 | %endfor |
248 | 248 | </table> |
249 | | - |
| 249 | +
|
250 | 250 | <p> |
251 | | - <a class="action-button" |
| 251 | + <a class="action-button" |
252 | 252 | href="${h.url_for(controller=controller_name, action='share', id=trans.security.encode_id(item.id), use_panels=use_panels )}"> |
253 | 253 | <span>Share with another user</span> |
254 | 254 | </a> |
255 | 255 |
|
256 | 256 | %else: |
257 | 257 |
|
258 | 258 | <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" |
261 | 261 | href="${h.url_for(controller=controller_name, action='share', id=trans.security.encode_id(item.id), use_panels=use_panels )}"> |
262 | 262 | <span>Share with a user</span> |
263 | 263 | </a> |
264 | 264 | <br /> |
265 | | - |
| 265 | +
|
266 | 266 | %endif |
267 | 267 | </div> |
268 | 268 | </div> |
|
0 commit comments