PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/ind_share_base.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 109 lines | 89 code | 12 blank | 8 comment | 6 complexity | 8fed6b69c607b719b067f513dceab21b MD5 | raw file
  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        item_controller = get_controller_name(item)
 80        
 81        # Get item name.
 82        item_name = get_item_name(item)
 83    %>
 84    
 85    <div class="toolForm">
 86        <div class="toolFormTitle">Share ${item_class_name} '${item_name}' with Another User</div>
 87            <div class="toolFormBody">
 88                <form action="${h.url_for(controller=item_controller, action='share', id=trans.security.encode_id( item.id ) )}" method="POST">
 89                    <div class="form-row">
 90                        <label>
 91                            Email address of user to share with
 92                        </label>
 93                        <div style="float: left; width: 250px; margin-right: 10px;">
 94                            <input type="text" name="email" value="${email}" size="40">
 95                        </div>
 96                        <div style="clear: both"></div>
 97                    </div>
 98                    <div class="form-row">
 99                        <input type="submit" value="Share"></input>
100                    </div>
101                    <div class="form-row">
102                        <a href="${h.url_for(controller=item_controller, action="sharing", id=trans.security.encode_id( item.id ) )}">Back to ${item_class_name}'s Sharing Home</a>
103                    </div>
104                    
105                </form>
106            </div>
107        </div>
108    </div>
109</%def>