PageRenderTime 64ms CodeModel.GetById 62ms app.highlight 0ms RepoModel.GetById 2ms app.codeStats 0ms

/templates/message.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 60 lines | 45 code | 10 blank | 5 comment | 8 complexity | e10121a10bd6c84d545bb519e64f418a MD5 | raw file
 1<%!
 2    def inherit(context):
 3        if context.get('use_panels'):
 4            if context.get('webapp'):
 5                webapp = context.get('webapp')
 6            else:
 7                webapp = 'galaxy'
 8            return '/webapps/%s/base_panels.mako' % webapp
 9        else:
10            return '/base.mako'
11%>
12<%inherit file="${inherit(context)}"/>
13
14<%namespace file="/refresh_frames.mako" import="handle_refresh_frames" />
15
16<% _=n_ %>
17
18<%def name="init()">
19<%
20    self.has_left_panel=False
21    self.has_right_panel=False
22    self.active_view=active_view
23    self.message_box_visible=False
24%>
25</%def>
26
27<%def name="javascripts()">
28    ${parent.javascripts()}
29    ${handle_refresh_frames()}
30    <script type="text/javascript">
31        if ( parent.handle_minwidth_hint )
32        {
33            parent.handle_minwidth_hint( -1 );
34        }
35    </script>
36</%def>
37
38##
39## Override methods from base.mako and base_panels.mako
40##
41
42<%def name="center_panel()">
43    ${render_large_message( message, status )}
44</%def>
45
46<%def name="body()">
47    ${render_large_message( message, status )}
48</%def>
49
50## Render large message.
51<%def name="render_large_message( message, status )">
52    <div class="${status}messagelarge" style="margin: 1em">${_(message)}</div>
53</%def>
54
55## Render a message
56<%def name="render_msg( msg, status='done' )">
57    <div class="${status}message">${_(msg)}</div>
58    <br/>
59</%def>
60