forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessage.mako
58 lines (49 loc) · 1.31 KB
/
message.mako
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<%!
from galaxy.util.sanitize_html import sanitize_html
def inherit(context):
return '/base.mako'
%>
<%inherit file="${inherit(context)}"/>
<%namespace file="/refresh_frames.mako" import="handle_refresh_frames" />
<% _=n_ %>
<%def name="init()">
<%
self.has_left_panel=False
self.has_right_panel=False
self.active_view=active_view
self.message_box_visible=False
%>
</%def>
<%def name="javascript_app()">
<!-- message.mako javascript_app() -->
${parent.javascript_app()}
${handle_refresh_frames()}
<script type="text/javascript">
config.addInitialization(function() {
if (parent.handle_minwidth_hint) {
parent.handle_minwidth_hint(-1);
}
});
</script>
</%def>
##
## Override methods from base.mako
##
<%def name="center_panel()">
${render_msg( message, status )}
</%def>
<%def name="body()">
${render_msg( message, status )}
</%def>
## Render a message
<%def name="render_msg( msg, status='done' )">
<%
if status == "done":
status = "success"
elif status == "error":
status = "danger"
if status not in ("danger", "info", "success", "warning"):
status = "info"
%>
<div class="message mt-2 alert alert-${status}">${sanitize_html(msg)}</div>
</%def>