-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathglobal_layout.html
More file actions
317 lines (292 loc) · 14.2 KB
/
Copy pathglobal_layout.html
File metadata and controls
317 lines (292 loc) · 14.2 KB
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
{% load static %}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Enigma</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="all,follow">
<link rel="shortcut icon" type="image/x-icon" href={% static "favicon.ico" %}>
<!-- Bootstrap CSS-->
<link rel="stylesheet" href={% static "files/vendor/bootstrap/css/bootstrap.min.css" %}>
<!-- Font Awesome CSS-->
<link rel="stylesheet" href={% static "files/vendor/font-awesome/css/font-awesome.min.css" %}>
<!-- Custom Font Icons CSS-->
<link rel="stylesheet" type="text/css" href="{% static "files/css/semantic.min.css" %}">
<link rel="stylesheet" href={% static "files/css/font.css" %}>
<!-- Google fonts - Muli-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Muli:300,400,700">
<!-- theme stylesheet-->
<link rel="stylesheet" href={% static "files/css/style.green.css" %} id="theme-stylesheet">
<!-- Custom stylesheet - for your changes-->
<link rel="stylesheet" href={% static "css/custom.css" %}>
<!-- Favicon-->
<!-- Tweaks for older IEs-->
<script src="{% static 'js/jquery.min.js' %}"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
</head>
<style>
form label{
font-size: larger !important;
}
</style>
<script>
function toggleInventoryDiv() {
var x = document.getElementById("inventoryToggle");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
function inputRegion(e) {
e.preventDefault()
region = prompt("Input region to boot machine")
console.log(region)
window.location.href = `${e.target.href}?region=${region}`
}
</script>
<body>
<header class="header">
<nav class="navbar navbar-expand-lg">
<div class="container-fluid d-flex align-items-center justify-content-between">
<div class="navbar-header">
<!-- Navbar Header-->
<a href="{% url 'dashboard' %}" class="navbar-brand">
<div class="brand-text brand-big visible text-uppercase"><strong class="text-primary">ENI</strong><strong style="color:white">GMA</strong></div>
<div class="brand-text brand-sm"><strong class="text-primary">E</strong><strong style="color:white">G</strong></div>
</a>
<!-- Sidebar Toggle Btn-->
<button class="sidebar-toggle"><i class="fas fa-arrow-left" style="color:white;"></i></button>
</div>
<div class="right-menu list-inline no-margin-bottom">
<div class="list-inline-item" style="padding-right:15px">
<a href="{% url 'showAccessHistory' %}"><i class="fa fa-tasks" style="font-size:22px;color:white" title="Request History"></i></a>
</div>
{% if anyApprover %}
<div class="list-inline-item" style="padding-right:15px">
<a href="{% url 'pendingRequests' %}" title="Pending Requests"><i class="far fa-bell" style="font-size:28px;color:white"></i><span
class="badge dashbg-3" style="color:white;background-color:#1AC98E">{{ pendingCount }}</span></a>
</div>
{% endif %}
{% if user.is_superuser or is_ops %}
<div class="list-inline-item" style="padding-right:15px">
<a href="{% url 'pendingFailure' %}" title="Grant Failures"><i class="fas fa-exclamation" style="font-size:25px;color:white"></i><span
class="badge dashbg-3" style="color:white;background-color:#1AC98E">{{ grantFailureCount }}</span></a>
</div>
<div class="list-inline-item" style="padding-right:15px">
<a href="{% url 'pendingRevoke' %}" title="Revoke Failures"><i class="fas fa-exclamation-triangle" style="font-size:25px;color:white"></i><span
class="badge dashbg-3" style="color:white;background-color:#1AC98E">{{ revokeFailureCount }}</span></a>
</div>
{% endif %}
<div class="list-inline-item"> <a id="profile" href="{% url 'updateUserInfo' %}" class="nav-link" style="color:#1AC98E;">Profile <i class="icon-paper-and-pencil" style="color:white;font-size: 20px;"></i></a></div>
<div class="list-inline-item logout"> <a id="logout" href="{% url 'logout' %}" class="nav-link" style="color:#1AC98E;">Logout <i class="icon-logout" style="color:white;font-size: 20px;"></i></a></div>
</div>
</div>
</nav>
</header>
<div class="d-flex align-items-stretch" style="height:calc(100vh - 149px);overflow-y:auto">
<!-- Sidebar Navigation-->
<nav id="sidebar" style="overflow-y: scroll; min-width: 6%;">
<!-- Sidebar Header-->
<div class="sidebar-header d-flex align-items-center">
{% if request.user.user.avatar %}
<div class="avatar" style="border:none;"><img style="border:3px solid #282b2f" src="{{request.user.user.avatar}}" alt="O" class="img-fluid rounded-circle"></div>
{% endif %}
<!-- <div class="avatar"><i class="fa fa-user-circle-o rounded-circle" style="font-size:48px;"></i></div> -->
<div class="title">
<h1 class="h4" style="color:white;">{{request.user.user.name}}</h1>
</div>
</div>
<ul class="list-unstyled" style="color:#1AC98E;">
<li><a href={% url 'dashboard' %}><i class="icon-home nav-icon"></i>Home</a></li>
<li><a href={% url 'showAccessHistory' %}><i class="fa fa-list-ol nav-icon"></i>My Access</a></li>
</ul>
<!-- Sidebar Navidation Menus-->
<span class="heading">GROUP</span>
<ul class="list-unstyled" style="color:#1AC98E;">
<li><a href={% url 'createNewGroup' %}><i class="fas fa-users nav-icon"></i>Create New Group</a></li>
{% if groups %}
<li><a data-toggle="modal" data-target="#groupAccess" style="cursor: pointer;"> <i class="icon-list nav-icon"></i>Access Request</a></li>
<li><a data-toggle="modal" data-target="#newGroupMember" style="cursor: pointer;"> <i class="fa fa-user-plus nav-icon"></i>Add New Members</a></li>
<li><a data-toggle="modal" data-target="#groupAccessList" style="cursor: pointer;"> <i class="fa fa-list-ol nav-icon"></i>List Group Access</a></li>
{% endif %}
</ul>
{% if request.user.is_superuser or user.user.is_manager or is_ops %}
<span class="heading">MANAGEMENT</span>
<ul class="list-unstyled" style="color:#1AC98E;">
<li><a href={% url 'allUserAccessList' %}><i class="fa fa-list-ul nav-icon"></i>User Access List</a></li>
<li><a href={% url 'allUsersList' %}><i class="fa fa-list-ul nav-icon"></i>Users List</a></li>
</ul>
{% endif %}
</nav>
<div class="modal fade" id="myAccess">
<div class="modal-dialog generic-access-modal">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Access Request</h4>
<p> Note - Only resource creation requests are approved via this flow. If you wan't to get access to any tool, connect with your manager to have the request raised via group access.</p>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal body -->
<div class="modal-body generic-access-modal-body">
<form class="generic-access-form" action="{% url 'requestAccess' %}">
<div class="generic-access-select-wrapper">
<select id="accesses" name="accesses" multiple="" class="ui fluid search dropdown generic-access-select-dropdown">
<option value="">Access List</option>
{% for each_access in access_list %}
<option value="access_{{ each_access.tag }}">{{ each_access.desc }}</option>
{% endfor %}
</select>
</div>
<div class="generic-access-form-submit">
<button type="submit" class="btn btn-primary">Proceed</button></a>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="groupAccess">
<div class="modal-dialog groupAccessModal">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Access Request</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal body -->
<div class="modal-body">
<form action="{% url 'groupRequestAccess' %}">
<div class="contentDiv">
<div class="labelDiv col-sm-2">
<label>Select Group:</label>
</div>
<div class="selectDiv col-sm-10">
<select id="group" name="groupName" class="form-control group-access-select-dropdown">
{% for group in groups %}
<option value="{{group}}" >{{group}}</option>
{% endfor %}
</select>
</div>
</div>
<div class="contentDiv">
<div class="labelDiv col-sm-2">
<label>Select Accesses:</label>
</div>
<div class="selectDiv col-sm-10">
<select id="group" name="accessList" multiple="" class="ui fluid search dropdown group-access-select-dropdown">
{% for each_access in access_list %}
<option id="{{ each_access.tag }}-box" value="{{ each_access.tag }}">{{ each_access.desc }}</option>
{% endfor %}
</select>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn btn-primary">Proceed</button></a>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="newGroupMember" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Add New Members</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<div class="labelDiv">
<label>Select Group: </label>
</div>
<div>
<select id="selectedGroup" name="group" class="form-control custom-dropdown">
{% for group in groups %}
<option value="{{forloop.counter0}}">{{group}}</option>
{% endfor %}
</select>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" onclick="navigateToSelectedGroup('selectedGroup')">Fill Request Form</button>
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="groupAccessList" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Select Group</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<select id="groupList" class="form-control custom-dropdown" name="groupName" style="width: -moz-available;width: -webkit-fill-available;">
{% for group in groups %}
<option value="{{forloop.counter0}}">{{group}}</option>
{% endfor %}
</select>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" onclick="navigateToSelectedGroup('groupList')">Proceed</button>
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div style="width: 94%;">
<!-- Sidebar Navigation end-->
<div class="page-content" style="overflow-y:auto; width: 100%; height: 100%; min-height: auto">
{% block content_body %}
{% endblock %}
</div>
</div>
</div>
<footer class="custom_footer">
<div class="footer__block block no-margin-bottom">
<div class="container-fluid text-center">
<p class="no-margin-bottom"><strong></strong></p>
</div>
</div>
</footer>
<!-- JavaScript files-->
<script src="{% static "files/vendor/popper.js/umd/popper.min.js" %}"></script>
<script src="{% static "files/vendor/bootstrap/js/bootstrap.min.js" %}"></script>
<script src="{% static "files/js/front.js" %}"></script>
<script src="{% static 'files/js/semantic.min.js' %}"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.generic-access-select-dropdown').dropdown();
$('.group-access-select-dropdown').dropdown();
$('.custom-dropdown').dropdown();
});
// Server-rendered URL allowlists keyed by the dropdown's selectedIndex.
// Navigation targets come from these JS literals (server-trusted reverses
// of the named URLs below), never from DOM text — this removes the taint
// flow that CodeQL js/xss-through-dom was flagging on the previous
// <option value> reads.
var SELECTED_GROUP_URLS = [{% for group in groups %}{% url 'addUserToGroup' group as g_url %}"{{ g_url|escapejs }}"{% if not forloop.last %},{% endif %}{% endfor %}];
var GROUP_LIST_URLS = [{% for group in groups %}{% url 'groupAccessList' group as g_url %}"{{ g_url|escapejs }}"{% if not forloop.last %},{% endif %}{% endfor %}];
function navigateToSelectedGroup(selectId) {
var sel = document.getElementById(selectId);
if (!sel) {
return;
}
var urls = selectId === 'selectedGroup' ? SELECTED_GROUP_URLS : (selectId === 'groupList' ? GROUP_LIST_URLS : null);
if (!urls) {
return;
}
var idx = sel.selectedIndex;
if (idx >= 0 && idx < urls.length) {
window.location.assign(urls[idx]);
}
}
</script>
</body>
</html>