[2] | 1 | ## |
---|
| 2 | ## Base template for exporting an item. Template expects the following parameters: |
---|
| 3 | ## (a) item - item to be exported. |
---|
| 4 | ## |
---|
| 5 | <%! |
---|
| 6 | def inherit(context): |
---|
| 7 | if context.get('use_panels', False) == True: |
---|
| 8 | if context.get('webapp'): |
---|
| 9 | webapp = context.get('webapp') |
---|
| 10 | else: |
---|
| 11 | webapp = 'galaxy' |
---|
| 12 | return '/webapps/%s/base_panels.mako' % webapp |
---|
| 13 | else: |
---|
| 14 | return '/base.mako' |
---|
| 15 | %> |
---|
| 16 | <%inherit file="${inherit(context)}"/> |
---|
| 17 | |
---|
| 18 | <%namespace file="./display_common.mako" import="*" /> |
---|
| 19 | <%namespace file="/message.mako" import="render_msg" /> |
---|
| 20 | |
---|
| 21 | ## |
---|
| 22 | ## Page methods. |
---|
| 23 | ## |
---|
| 24 | |
---|
| 25 | <%def name="init()"> |
---|
| 26 | <% |
---|
| 27 | self.has_left_panel=False |
---|
| 28 | self.has_right_panel=False |
---|
| 29 | self.message_box_visible=False |
---|
| 30 | self.overlay_visible=False |
---|
| 31 | self.message_box_class="" |
---|
| 32 | self.active_view="" |
---|
| 33 | self.body_class="" |
---|
| 34 | |
---|
| 35 | # Get class name strings. |
---|
| 36 | self.item_class_name = get_class_display_name( item.__class__ ) |
---|
| 37 | self.item_class_name_lc = self.item_class_name.lower() |
---|
| 38 | self.item_class_plural_name = get_class_plural_display_name( item.__class__ ) |
---|
| 39 | self.item_class_plural_name_lc = self.item_class_plural_name.lower() |
---|
| 40 | %> |
---|
| 41 | </%def> |
---|
| 42 | |
---|
| 43 | <%def name="title()"> |
---|
| 44 | Export ${get_class_display_name( item.__class__ )} '${get_item_name( item )}' |
---|
| 45 | </%def> |
---|
| 46 | |
---|
| 47 | <%def name="stylesheets()"> |
---|
| 48 | ${parent.stylesheets()} |
---|
| 49 | <style> |
---|
| 50 | ## Put some whitespace before each section header. |
---|
| 51 | h3 |
---|
| 52 | { |
---|
| 53 | margin-top: 2em; |
---|
| 54 | } |
---|
| 55 | input.action-button |
---|
| 56 | { |
---|
| 57 | margin-left: 0; |
---|
| 58 | } |
---|
| 59 | ## If page is displayed in panels, pad from edges for readability. |
---|
| 60 | %if context.get('use_panels'): |
---|
| 61 | div#center |
---|
| 62 | { |
---|
| 63 | padding: 10px; |
---|
| 64 | } |
---|
| 65 | %endif |
---|
| 66 | </style> |
---|
| 67 | </%def> |
---|
| 68 | |
---|
| 69 | <%def name="center_panel()"> |
---|
| 70 | ${self.body()} |
---|
| 71 | </%def> |
---|
| 72 | |
---|
| 73 | <%def name="render_download_to_file(item)"> |
---|
| 74 | <h3>Download to File</h3> |
---|
| 75 | |
---|
| 76 | <a href="${h.url_for( action='export_to_file', id=trans.security.encode_id( item.id ) )}"> |
---|
| 77 | Download ${get_class_display_name( item.__class__ ).lower()} to file so that it can be saved or imported into another Galaxy server.</a> |
---|
| 78 | </%def> |
---|
| 79 | |
---|
| 80 | <%def name="render_more(item)"> |
---|
| 81 | ## Override. |
---|
| 82 | </%def> |
---|
| 83 | |
---|
| 84 | <%def name="render_footer()"> |
---|
| 85 | <p><br><br> |
---|
| 86 | <a href=${h.url_for( action="list" )}>Back to ${self.item_class_plural_name} List</a> |
---|
| 87 | </%def> |
---|
| 88 | |
---|
| 89 | <%def name="body()"> |
---|
| 90 | <% |
---|
| 91 | item_name = get_item_name(item) |
---|
| 92 | %> |
---|
| 93 | <h2>Download or Export ${self.item_class_name} '${item_name}'</h2> |
---|
| 94 | |
---|
| 95 | ${self.render_download_to_file(item)} |
---|
| 96 | |
---|
| 97 | ${self.render_more(item)} |
---|
| 98 | |
---|
| 99 | ${self.render_footer()} |
---|
| 100 | </%def> |
---|