-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.html
205 lines (180 loc) · 9.11 KB
/
base.html
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{% block title %}Cavil Card{% endblock %}</title>
{% load static %}
<link rel="stylesheet" type="text/css" href="{% static 'comportal/style.css' %}">
<link rel="shortcut icon" type="image/png" href="{% static 'favicon.ico' %}"/>
<link rel="stylesheet" href="{% static 'comportal/bootstrap-3.3.7-dist/css/bootstrap.min.css' %}">
<link rel="icon" type="image/jpg" href="/static/comportal/favicon.jpg">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="{% static 'comportal/bootstrap-3.3.7-dist/js/bootstrap.min.js' %}"></script>
</head>
<body>
<header>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<!-- Header -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#topNavBar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{% url 'comportal:index' %}">Cavil Card</a>
</div>
<!-- Items -->
<div class="collapse navbar-collapse" id="topNavBar">
<ul class="nav navbar-nav">
<li><a href="{% url 'comportal:index' %}"><span class="glyphicon glyphicon-modal-window" aria-hidden="true"></span> Complaints</a></li>
<!-- {% comment %} <li class="0{% block songs_active %}{% endblock %}"><a href="{% url 'music:songs' 'all' %}"><span class="glyphicon glyphicon-music" aria-hidden="true"></span> Songs</a></li> {% endcomment %} -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Sort By <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
<div class="panel panel-default">
<!-- <div class="panel-heading">Area</div> -->
<div class="panel-body">
<a href="{% url "comportal:index-hostel" %}">Hostel</a><br>
<a href="{% url "comportal:index-academics" %}">Academics</a><br>
<!-- <a href="{% url "comportal:index-colony" %}">Colony</a><br> -->
</div>
</div>
</li>
<!-- <li>
<div class="panel panel-default">
<div class="panel-heading">Type</div>
<div class="panel-body">
<a href="{% url "comportal:index-green" %}">Ramanujam Hostel</a><br>
<a href="{% url "comportal:index-electrical" %}">Old Vs Hostel</a><br>
<a href="{% url "comportal:index-civil" %}">Raman Hostel</a><br>
</div>
</div>
</li> -->
</ul>
</li>
</ul>
<!-- <form class="navbar-form navbar-left" role="search" method="get" action="{% url 'comportal:index' %}">
<div class="form-group">
<input type="text" class="form-control" size ="40" name="q" value="{{ request.GET.q }}">
</div>
<button type="submit" class="btn btn-default">Search</button>
</form> -->
{% if user.is_authenticated%}
<ul class="nav navbar-nav navbar-right">
<li>
<a data-toggle="modal" href="#myModal" class="button">
<span class="glyphicon glyphicon-bell" aria-hidden="true"></span>
{% if user.notifications%}
<span class="badge">{{user.notifications}}</span>
{% endif %}
</a>
</li>
<li>
<a href="{% url 'users_auth:user-profile' %}">
<span class="glyphicon glyphicon-user" aria-hidden="true"></span> Hello {{user.get_username}}
</a>
</li>
<li>
{% if user.admin == 'N'%}
<a href=admin>
<span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span> Admin Section
</a>
{% else %}
{% endif %}
</li>
<li>
<a href="{% url 'comportal:newcomplain' %}">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add Complaint
</a>
</li>
<li>
<a href="{% url 'logout' %}">
<span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> Logout
</a>
</li>
</ul>
{% else %}
<ul class="nav navbar-nav navbar-right">
<li>
<a href="{% url 'users_auth:register' %}">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Signup
</a>
</li>
<li>
<a href="{% url 'login' %}">
<span class="glyphicon glyphicon-log-in" aria-hidden="true"></span> Login
</a>
</li>
{% comment %} <li><a data-toggle="modal" data-target="#myModal" ><Notifications</a></li> {% endcomment %}
</ul>
{% endif %}
</div>
</div>
</nav>
</header>
<main role="main" class="container">
<div class="row">
{% if messages %}
{% for message in messages %}
<div class="alert alert-{{ message.tags }} alert-dismissible fade in">
{{ message }}
</div>
{% endfor %}
{% endif %}
{% block content %}{% endblock %}
</div>
<hr>
<hr>
{% if is_paginated %}
{% if page_obj.has_previous %}
<a class="btn btn-outline-info mb-4" href="?page=1">First</a>
<a class="btn btn-outline-info mb-4" href="?page={{ page_obj.previous_page_number }}">Previous</a>
{% endif %}
{% for num in page_obj.paginator.page_range %}
{% if page_obj.number == num %}
<a class="btn btn-info mb-4" href="?page={{ num }}">{{ num }}</a>
{% elif num > page_obj.number|add:'-3' and num < page_obj.number|add:'3' %}
<a class="btn btn-outline-info mb-4" href="?page={{ num }}">{{ num }}</a>
{% endif %}
{% endfor %}
{% if page_obj.has_next %}
<a class="btn btn-outline-info mb-4" href="?page={{ page_obj.next_page_number }}">Next</a>
<a class="btn btn-outline-info mb-4" href="?page={{ page_obj.paginator.num_pages }}">Last</a>
{% endif %}
{% endif %}
</main>
<hr>
<hr>
{% if user.is_authenticated%}
<!--Modal-->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Notifications</h4>
</div>
<div class="modal-body">
<ul>
{% comment %} {% with request.user.noti_messages|split : "$" as notifications %}
{% for noti in notifications%}
<li>
{{noti}}
</li>
{% endfor %}
{% endwith %} {% endcomment %}
{{request.user.noti_messages|safe }}
</ul>
</div>
<div class="modal-footer">
<a class="btn btn-primary" href="{% url 'users_auth:clear-noti' request.user.id %}">Clear All Notifications</a>
</div>
</div>
</div>
</div>
{% endif %}
</body>
</html>