add nick
[laas.git] / src / templates / base / notifier / notification.html
1 {% extends "layout.html" %}
2 {% block extrahead %}
3 <base target="_parent">
4 {% endblock %}
5
6 {% block basecontent %}
7 <script>
8     function send_request(post_data){
9         var form = $("#notification_action_form");
10         var formData = form.serialize() + '&' + post_data + '=true';
11         var req = new XMLHttpRequest();
12         req.open("POST", ".", false);
13         req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
14         req.onerror = function() { alert("problem occurred while trying to cancel current workflow"); }
15         req.onreadystatechange = function() { if(req.readyState === 4){
16             window.top.location.href += '';
17         }};
18         req.send(formData);
19     }
20     function delete_notification()
21     {
22         send_request("delete");
23     }
24     function mark_unread()
25     {
26         send_request("unread");
27     }
28 </script>
29
30 <div class="d-flex justify-content-between border-bottom">
31   <span class="h3">{{notification.title}}</span>
32   <div class="btn_group">
33       <button class="btn btn-primary inbox-btn" onclick="mark_unread()">Mark Unread</button>
34       <button class="btn btn-danger inbox-btn" onclick="delete_notification()">Delete</button>
35   </div>
36 </div>
37
38 <p class="content-divider"></p>
39
40 {% if not notification.is_html %}
41 <pre>
42 {% endif %}
43     {{notification.content|safe}}
44 {% if not notification.is_html %}
45 </pre>
46 {% endif %}
47 <form id="notification_action_form" action="." method="post">
48     {% csrf_token %}
49 </form>
50 {% endblock %}