[2] | 1 | ## |
---|
| 2 | ## Base template for sharing an item with an individual user. Template expects the following parameters: |
---|
| 3 | ## (a) item - item to be shared. |
---|
| 4 | ## |
---|
| 5 | <%! |
---|
| 6 | def inherit(context): |
---|
| 7 | if context.get('use_panels'): |
---|
| 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 | |
---|
| 20 | ## |
---|
| 21 | ## Page methods. |
---|
| 22 | ## |
---|
| 23 | |
---|
| 24 | <%def name="init()"> |
---|
| 25 | <% |
---|
| 26 | self.has_left_panel=False |
---|
| 27 | self.has_right_panel=False |
---|
| 28 | self.message_box_visible=False |
---|
| 29 | self.overlay_visible=False |
---|
| 30 | self.message_box_class="" |
---|
| 31 | self.active_view="" |
---|
| 32 | self.body_class="" |
---|
| 33 | %> |
---|
| 34 | </%def> |
---|
| 35 | |
---|
| 36 | <%def name="stylesheets()"> |
---|
| 37 | ${parent.stylesheets()} |
---|
| 38 | <style> |
---|
| 39 | ## If page is displayed in panels, pad from edges for readabilit. |
---|
| 40 | %if context.get('use_panels'): |
---|
| 41 | div#center |
---|
| 42 | { |
---|
| 43 | padding: 10px; |
---|
| 44 | } |
---|
| 45 | %endif |
---|
| 46 | </style> |
---|
| 47 | </%def> |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | <%def name="center_panel()"> |
---|
| 51 | ${self.body()} |
---|
| 52 | </%def> |
---|
| 53 | |
---|
| 54 | <%def name="body()"> |
---|
| 55 | %if message: |
---|
| 56 | <% |
---|
| 57 | if messagetype is UNDEFINED: |
---|
| 58 | mt = "done" |
---|
| 59 | else: |
---|
| 60 | mt = messagetype |
---|
| 61 | %> |
---|
| 62 | <p /> |
---|
| 63 | <div class="${mt}message"> |
---|
| 64 | ${message} |
---|
| 65 | </div> |
---|
| 66 | <p /> |
---|
| 67 | %endif |
---|
| 68 | |
---|
| 69 | <% |
---|
| 70 | # |
---|
| 71 | # Setup and variables needed for page. |
---|
| 72 | # |
---|
| 73 | |
---|
| 74 | # Get class name strings. |
---|
| 75 | item_class_name = get_class_display_name( item.__class__ ) |
---|
| 76 | item_class_name_lc = item_class_name.lower() |
---|
| 77 | item_class_plural_name = get_class_plural_display_name( item.__class__ ) |
---|
| 78 | item_class_plural_name_lc = item_class_plural_name.lower() |
---|
| 79 | |
---|
| 80 | # Get item name. |
---|
| 81 | item_name = get_item_name(item) |
---|
| 82 | %> |
---|
| 83 | |
---|
| 84 | <div class="toolForm"> |
---|
| 85 | <div class="toolFormTitle">Share ${item_class_name} '${item_name}' with Another User</div> |
---|
| 86 | <div class="toolFormBody"> |
---|
| 87 | <form action="${h.url_for( action='share', id=trans.security.encode_id( item.id ) )}" method="POST"> |
---|
| 88 | <div class="form-row"> |
---|
| 89 | <label> |
---|
| 90 | Email address of user to share with |
---|
| 91 | </label> |
---|
| 92 | <div style="float: left; width: 250px; margin-right: 10px;"> |
---|
| 93 | <input type="text" name="email" value="${email}" size="40"> |
---|
| 94 | </div> |
---|
| 95 | <div style="clear: both"></div> |
---|
| 96 | </div> |
---|
| 97 | <div class="form-row"> |
---|
| 98 | <input type="submit" value="Share"></input> |
---|
| 99 | </div> |
---|
| 100 | <div class="form-row"> |
---|
| 101 | <a href="${h.url_for( action="sharing", id=trans.security.encode_id( item.id ) )}">Back to ${item_class_name}'s Sharing Home</a> |
---|
| 102 | </div> |
---|
| 103 | |
---|
| 104 | </form> |
---|
| 105 | </div> |
---|
| 106 | </div> |
---|
| 107 | </div> |
---|
| 108 | </%def> |
---|