1 {% extends "base.html" %}
11 grid-template-columns: 30% 5% 65%;
24 border: 1px solid #cccccc;
31 border-bottom: 1px solid #cccccc;
34 background-color: #ffffff;
39 background-color: #f3f3f3;
43 box-shadow: 0px 0 5px 2px #cccccc;
56 background-color: #efefef;
63 <div class="container-fluid d-flex flex-grow-1 flex-column">
64 <div class="row mt-3 mb-2">
65 <div class="col-2 px-0">
66 <div class="btn-group w-100" id="filterGroup">
67 <button class="btn btn-secondary active" data-read="-1">All</button>
68 <button class="btn btn-secondary" data-read="0">Unread</button>
69 <button class="btn btn-secondary" data-read="1">Read</button>
73 <div class="row flex-grow-1" id="fixHeight">
74 <!-- Notification list && Controls -->
75 <div class="mb-2 mb-lg-0 col-lg-2 px-0 mh-100">
76 <div class="list-group rounded-0 rounded-left scrollable mh-100 notifications" id="unreadNotifications" data-read="0">
77 {% for notification in unread_notifications %}
80 onclick="showmessage({{notification.id}}); setactive(this);"
81 class="list-group-item list-group-item-action notification">
86 <div class="list-group rounded-0 rounded-left scrollable mh-100 notifications" id="readNotifications" data-read="1">
87 {% for notification in read_notifications %}
90 onclick="showmessage({{notification.id}}); setactive(this);"
91 class="list-group-item list-group-item-action list-group-item-secondary notification">
98 <div class="col ml-lg-2 border mh-100 p-4">
99 <iframe class="w-100 h-100" id="inbox-iframe" frameBorder="0" scrolling="yes">Please select a notification</iframe>
104 <script type="text/javascript">
105 function showmessage(msg_id) {
106 iframe = document.getElementById("inbox-iframe");
107 iframe.src = "notification/" + msg_id;
110 function setactive(obj) {
111 $(".notification").removeClass("active");
112 $(obj).addClass("active");
115 $(document).ready(function(){
116 // For all / unread / read
117 $("#filterGroup button").click(function(){
118 let read = $(this).attr("data-read");
119 $(this).siblings().removeClass("active");
120 $(".notifications").addClass("d-none");
121 $(this).addClass("active");
123 return $(".notifications").removeClass("d-none");
125 $(`.notifications[data-read="${read}"]`).removeClass("d-none");