root / djnro / templates / overview / index.html @ d3ea44a4
History | View | Annotate | Download (7.7 kB)
1 |
{% extends "base.html"%} |
---|---|
2 |
{% load i18n %} |
3 |
{% load tolocale %} |
4 |
|
5 |
|
6 |
{% load i18n %} |
7 |
{% block extrahead %} |
8 |
|
9 |
<script type="text/javascript" src="/static/js/jquery.dataTables.min.js"></script> |
10 |
<script type="text/javascript" src="/static/js/datatables_bootstrap.js"></script> |
11 |
<style>
|
12 |
.tab-content { |
13 |
overflow: visible; |
14 |
} |
15 |
</style>
|
16 |
<script type="text/javascript"> |
17 |
$(document).ready(function(){
|
18 |
|
19 |
var oTableU = $('#usertable').dataTable({
|
20 |
"sPaginationType": "bootstrap",
|
21 |
"sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
|
22 |
"aoColumns": [{
|
23 |
"bSearchable": true,
|
24 |
"bSortable": true
|
25 |
}, {
|
26 |
"bSearchable": true,
|
27 |
"bSortable": true
|
28 |
}, {
|
29 |
"bSearchable": true,
|
30 |
"bSortable": true
|
31 |
}, {
|
32 |
"bSearchable": true,
|
33 |
"bSortable": true
|
34 |
}, {
|
35 |
"bSearchable": true,
|
36 |
"bSortable": true
|
37 |
}],
|
38 |
"aaSorting": [[0, 'desc']],
|
39 |
"iDisplayLength": 25,
|
40 |
"oSearch": {"bSmart": false, "bRegex":true},
|
41 |
"oLanguage": {
|
42 |
"sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> {% trans "users" %}',
|
43 |
"sProcessing": "Processing...",
|
44 |
"sZeroRecords": '{% trans "No records to display" %}',
|
45 |
"sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
|
46 |
"sInfoEmpty": "{% trans "Showing 0 to 0 of 0 entries" %}",
|
47 |
"sInfoFiltered": "(filtered from _MAX_ total entries)",
|
48 |
"sInfoPostFix": "",
|
49 |
"sSearch": '{% trans "Search:" %}',
|
50 |
"sUrl": "",
|
51 |
"oPaginate": {
|
52 |
"sFirst": '{% trans "First" %}',
|
53 |
"sPrevious": '{% trans "Previous" %}',
|
54 |
"sNext": '{% trans "Next" %}',
|
55 |
"sLast": '{% trans "Last" %}'
|
56 |
}
|
57 |
}
|
58 |
});
|
59 |
|
60 |
oTableU.fnDraw();
|
61 |
|
62 |
|
63 |
var oTableI = $('#insttable').dataTable({
|
64 |
"sPaginationType": "bootstrap",
|
65 |
"sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
|
66 |
"aoColumns": [{
|
67 |
"bSearchable": true,
|
68 |
"bSortable": true
|
69 |
}, {
|
70 |
"bSearchable": true,
|
71 |
"bSortable": true
|
72 |
}, {
|
73 |
"bSearchable": true,
|
74 |
"bSortable": true
|
75 |
}, {
|
76 |
"bSearchable": true,
|
77 |
"bSortable": true
|
78 |
}, {
|
79 |
"bSearchable": true,
|
80 |
"bSortable": true
|
81 |
}],
|
82 |
"aaSorting": [[0, 'desc']],
|
83 |
"iDisplayLength": 25,
|
84 |
"oSearch": {"bSmart": false, "bRegex":true},
|
85 |
"oLanguage": {
|
86 |
"sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> {% trans "institutions" %}',
|
87 |
"sProcessing": "Processing...",
|
88 |
"sZeroRecords": '{% trans "No records to display" %}',
|
89 |
"sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
|
90 |
"sInfoEmpty": "{% trans "Showing 0 to 0 of 0 entries" %}",
|
91 |
"sInfoFiltered": "(filtered from _MAX_ total entries)",
|
92 |
"sInfoPostFix": "",
|
93 |
"sSearch": '{% trans "Search:" %}',
|
94 |
"sUrl": "",
|
95 |
"oPaginate": {
|
96 |
"sFirst": '{% trans "First" %}',
|
97 |
"sPrevious": '{% trans "Previous" %}',
|
98 |
"sNext": '{% trans "Next" %}',
|
99 |
"sLast": '{% trans "Last" %}'
|
100 |
}
|
101 |
}
|
102 |
});
|
103 |
|
104 |
oTableI.fnDraw();
|
105 |
|
106 |
});
|
107 |
</script>
|
108 |
{% endblock %} |
109 |
|
110 |
{% block content %} |
111 |
<div class="container-fluid"> |
112 |
<div class="row-fluid"> |
113 |
<div class="span2"></div> |
114 |
<div class="span10"> |
115 |
<div class="row-fluid"> |
116 |
<div class="span12"> |
117 |
<ul class="breadcrumb" style="display: inline-table; padding: 0"> |
118 |
{% block crumbs %} |
119 |
<li class="active">{% trans "Overview" %}</li> |
120 |
{% endblock %} |
121 |
</ul>
|
122 |
<p class="pull-right"><strong>{{user}}</strong> (<a href="{% url logout %}">{% trans "Logout" %}</a>)</p> |
123 |
</div></div> |
124 |
</div>
|
125 |
</div>
|
126 |
<div class="row-fluid"> |
127 |
<div class="span2"> |
128 |
<div class="well sidebar-nav"> |
129 |
<ul class="nav nav-list"> |
130 |
<li {% block %}class="active"{% endblock %}> |
131 |
<a href="{% url overview %}">{% trans "Overview" %}</a> |
132 |
</li>
|
133 |
<li>
|
134 |
<a href="{% url logout %}">{% trans "Logout" %}</a> |
135 |
</li>
|
136 |
|
137 |
</ul>
|
138 |
</div><!--/.well --> |
139 |
</div><!--/span--> |
140 |
<div class="span10"> |
141 |
<div class="row-fluid"> |
142 |
<!--/span-->
|
143 |
<div class="span12"> |
144 |
{% if violation %} |
145 |
<table class="table table-condensed"> |
146 |
<tr class="error"><td>You have no rights to access this area. Please contact your administrator<td></tr> |
147 |
</table>
|
148 |
{% else %} |
149 |
{% block subcontent %} |
150 |
<h4>{% trans "Users - Institutions" %}</h4> |
151 |
<hr>
|
152 |
|
153 |
{% load tolocale %} |
154 |
|
155 |
|
156 |
<ul class="nav nav-tabs"> |
157 |
<li class="active"><a href="#users" data-toggle="tab">{% trans "Users" %}</a></li> |
158 |
<li><a href="#institutions" data-toggle="tab">{% trans "Institutions" %}</a></li> |
159 |
</ul>
|
160 |
|
161 |
<div class="tab-content"> |
162 |
|
163 |
<div class="tab-pane active" id="users"> |
164 |
{% if users %} |
165 |
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="usertable"> |
166 |
<thead>
|
167 |
<tr>
|
168 |
<th>{% trans "Username" %}</th> |
169 |
<th>{% trans "Email" %}</th> |
170 |
<th>{% trans "Name" %}</th> |
171 |
<th>{% trans "Status" %}</th> |
172 |
<th>{% trans "Institution" %}</th> |
173 |
</tr>
|
174 |
</thead>
|
175 |
<tbody>
|
176 |
{% for user in users %} |
177 |
<tr class="GradeC"> |
178 |
<td>{{user.username}}</td> |
179 |
<td>{{user.email}}</td> |
180 |
<td>{{user.first_name}} {{user.last_name}}</td> |
181 |
<td>{% if user.registrationprofile_set.all %}{% if user.registrationprofile_set.all.0.activation_key == "ALREADY_ACTIVATED" %}{% trans "Active" %}{% else %}{% trans "Inactive" %} or {% trans "Key Expired" %}{% endif %}{% else %}-{% endif %}</td> |
182 |
<td>{% if user.get_profile.institution %}{% tolocale user.get_profile.institution LANGUAGE_CODE %}{% endif %}</td> |
183 |
</tr>
|
184 |
{% endfor %} |
185 |
</tbody>
|
186 |
</table>
|
187 |
{% endif %} |
188 |
</div>
|
189 |
<div class="tab-pane" id="institutions"> |
190 |
{% if institutions %} |
191 |
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="insttable"> |
192 |
<thead>
|
193 |
<tr>
|
194 |
<th>{% trans "Name" %}</th> |
195 |
<th>{% trans "Type" %}</th> |
196 |
<th>{% trans "Contacts" %}</th> |
197 |
<th>{% trans "Address" %}</th> |
198 |
<th>{% trans "Admin Users" %}</th> |
199 |
|
200 |
</tr>
|
201 |
</thead>
|
202 |
<tbody>
|
203 |
{% for institution in institutions %} |
204 |
<tr class="GradeC"> |
205 |
<td>{% tolocale institution LANGUAGE_CODE %}</td> |
206 |
<td>{{institution.get_ertype_display}}</td> |
207 |
<td>{% if institution.institutiondetails.contact.all %}{% for contact in institution.institutiondetails.contact.all %}{{contact}}<br>{% endfor %}{% endif %}</td> |
208 |
<td>{{institution.institutiondetails.address_street}}<br>{{institution.institutiondetails.address_city}}</td> |
209 |
<td>{% if institution.userprofile_set.all %}{% for admuser in institution.userprofile_set.all %}{{admuser.user}}<br>{% endfor %}{% endif %}</td> |
210 |
|
211 |
</tr>
|
212 |
{% endfor %} |
213 |
</tbody>
|
214 |
</table>
|
215 |
{% endif %} |
216 |
</div>
|
217 |
</div>
|
218 |
|
219 |
{% endblock %} |
220 |
{% endif %} |
221 |
|
222 |
</div><!--/span--> |
223 |
<!--/span-->
|
224 |
</div><!--/row--> |
225 |
</div><!--/span--> |
226 |
</div><!--/row--> |
227 |
</div><!--/.fluid-container--> |
228 |
{% endblock %} |
229 |
|
230 |
|
231 |
|