Statistics
| Branch: | Tag: | Revision:

root / djnro / templates / overview / index.html @ 4772922a

History | View | Annotate | Download (7.6 kB)

1
{% extends "base.html"%}
2
{% load i18n %}
3
{% load tolocale %}
4
{% load staticfiles %}
5
{% load i18n %}
6
{% load tolocale %}
7

    
8

    
9
{% block content %}
10
<div class="row">
11
        <div class="col-md-12">
12
                <div class="col-md-2">
13
                        <div class="push-top"></div>
14
                        <div class="well sidebar-nav">
15
                                <ul class="nav nav-list">
16
                                        <li {% block  %}class="active"{% endblock %}>
17
                                                <a href="{% url overview %}">{% trans "Overview" %}</a>
18
                                        </li>
19
                                        <li>
20
                                                <a href="{% url logout %}">{% trans "Logout" %}</a>
21
                                        </li>
22
                                </ul>
23
                        </div><!--/.well -->
24
                </div><!--/span-->
25
                <div class="col-md-10">
26
                        <div class="row">
27
                                <!--/span-->
28
                                <div class="col-md-12">
29
                                {% if violation %}
30
                                  <table class="table table-condensed">
31
                                            <tr class="error"><td>You have no rights to access this area. Please contact your administrator<td></tr>
32
                                        </table>
33
                                {% else %}
34
              <h4>{% trans "Users - Institutions" %}</h4>
35
              <hr>
36
                <ul class="nav nav-tabs">
37
                                    <li class="active"><a href="#users" data-toggle="tab">{% trans "Users" %}</a></li>
38
                                    <li><a href="#institutions" data-toggle="tab">{% trans "Institutions" %}</a></li>
39
                            </ul>
40

    
41
                            <div class="tab-content" style="margin-top: 20px;">
42
                              <div class="tab-pane active" id="users">
43
                              {% if users %}
44
                                       <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="usertable">
45
                                               <thead>
46
                                                                <tr>
47
                                                                        <th>{% trans "Username" %}</th>
48
                                                                        <th>{% trans "Email" %}</th>
49
                                                                        <th>{% trans "Name" %}</th>
50
                                                                        <th>{% trans "Status" %}</th>
51
                                                                        <th>{% trans "Institution" %}</th>
52
                                                                </tr>
53
                                                        </thead>
54
                                                        <tbody>
55
                                                {% for user in users %}
56
                                                      <tr class="GradeC">
57
                                                        <td>{{user.username}}</td>
58
                                                        <td>{{user.email}}</td>
59
                                                        <td>{{user.first_name}} {{user.last_name}}</td>
60
                                                        <td>
61
                                                                {% if user.registrationprofile_set.all %}
62
                                                                        {% if user.registrationprofile_set.all.0.activation_key == "ALREADY_ACTIVATED" %}
63
                                                                                {% trans "Active" %}
64
                                                                        {% else %}
65
                                                                                {% trans "Inactive" %} or {% trans "Key Expired" %}
66
                                                                        {% endif %}
67
                                                                {% else %}-{% endif %}
68
                                                        </td>
69
                                                        <td>{% if user.get_profile.institution %}{% tolocale user.get_profile.institution LANGUAGE_CODE %}{% endif %}</td>
70
                                                </tr>
71
                                                      {% endfor %}
72
                                              </tbody>
73
                                      </table>
74
                                      {% endif %}
75
                                          </div>
76
                                          <div class="tab-pane" id="institutions">
77
                                      {% if institutions %}
78
                                       <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="insttable">
79
                                               <thead>
80
                                                                <tr>
81
                                                                        <th>{% trans "Name" %}</th>
82
                                                                        <th>{% trans "Type" %}</th>
83
                                                                        <th>{% trans "Contacts" %}</th>
84
                                                                        <th>{% trans "Address" %}</th>
85
                                                                        <th>{% trans "Admin Users" %}</th>
86
                                                                </tr>
87
                                                        </thead>
88
                                                        <tbody>
89
                                                {% for institution in institutions %}
90
                                                      <tr class="GradeC">
91
                                                        <td>{% tolocale institution LANGUAGE_CODE %}</td>
92
                                                        <td>{{institution.get_ertype_display}}</td>
93
                                                        <td>{% if institution.institutiondetails.contact.all %}{% for contact in institution.institutiondetails.contact.all %}{{contact}}<br>{% endfor %}{% endif %}</td>
94
                                                <td>{{institution.institutiondetails.address_street}}<br>{{institution.institutiondetails.address_city}}</td>
95
                                                        <td>{% if institution.userprofile_set.all %}{% for admuser in institution.userprofile_set.all %}{{admuser.user}}<br>{% endfor %}{% endif %}</td>
96

    
97
                                                </tr>
98
                                                      {% endfor %}
99
                                              </tbody>
100
                                      </table>
101
                                      {% endif %}
102
                              </div>
103
                     </div>
104
                                {% endif %}
105
                                </div>
106
                        </div>
107
                </div><!--/span-->
108
        </div><!--/row-->
109
</div><!--/.fluid-container-->
110
{% endblock %}
111

    
112

    
113

    
114

    
115
{% block extrajs %}
116
<script type="text/javascript" src="//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script>
117
<script type="text/javascript" src="//cdn.datatables.net/plug-ins/505bef35b56/integration/bootstrap/1/dataTables.bootstrap.js"></script>
118
<script type="text/javascript">
119
$(document).ready(function(){
120

121
var oTableU = $('#usertable').dataTable({
122
        "sPaginationType": "bootstrap",
123
        "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
124
        "aoColumns": [{
125
        "bSearchable": true,
126
        "bSortable": true
127
    }, {
128
        "bSearchable": true,
129
        "bSortable": true
130
    }, {
131
        "bSearchable": true,
132
        "bSortable": true
133
    }, {
134
        "bSearchable": true,
135
        "bSortable": true
136
    }, {
137
        "bSearchable": true,
138
        "bSortable": true
139
    }],
140
    "aaSorting": [[0, 'desc']],
141
    "iDisplayLength": 25,
142
    "oSearch": {"bSmart": false, "bRegex":true},
143
    "oLanguage": {
144
            "sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> {% trans "users" %}',
145
        "sProcessing":   "Processing...",
146
        "sZeroRecords": '{% trans "No records to display" %}',
147
        "sInfo":         "Showing _START_ to _END_ of _TOTAL_ entries",
148
        "sInfoEmpty":    "{% trans "Showing 0 to 0 of 0 entries" %}",
149
        "sInfoFiltered": "(filtered from _MAX_ total entries)",
150
        "sInfoPostFix":  "",
151
        "sSearch":       '{% trans "Search:" %}',
152
        "sUrl":          "",
153
        "oPaginate": {
154
            "sFirst":    '{% trans "First" %}',
155
            "sPrevious": '{% trans "Previous" %}',
156
            "sNext":     '{% trans "Next" %}',
157
            "sLast":     '{% trans "Last" %}'
158
        }
159
    }
160
});
161

162
oTableU.fnDraw();
163

164

165
var oTableI = $('#insttable')
166
        .on( 'init.dt', function () {
167
                       $('.pagination ul').addClass('pagination');
168
            })
169
        .dataTable({
170
                "sPaginationType": "bootstrap",
171
                "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
172
                "aoColumns": [{
173
                "bSearchable": true,
174
                "bSortable": true
175
            }, {
176
                "bSearchable": true,
177
                "bSortable": true
178
            }, {
179
                "bSearchable": true,
180
                "bSortable": true
181
            }, {
182
                "bSearchable": true,
183
                "bSortable": true
184
            }, {
185
                "bSearchable": true,
186
                "bSortable": true
187
            }],
188
            "aaSorting": [[0, 'desc']],
189
            "iDisplayLength": 25,
190
            "oSearch": {"bSmart": false, "bRegex":true},
191
            "oLanguage": {
192
                    "sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> {% trans "institutions" %}',
193
                "sProcessing":   "Processing...",
194
                "sZeroRecords": '{% trans "No records to display" %}',
195
                "sInfo":         "Showing _START_ to _END_ of _TOTAL_ entries",
196
                "sInfoEmpty":    "{% trans "Showing 0 to 0 of 0 entries" %}",
197
                "sInfoFiltered": "(filtered from _MAX_ total entries)",
198
                "sInfoPostFix":  "",
199
                "sSearch":       '{% trans "Search:" %}',
200
                "sUrl":          "",
201
                "oPaginate": {
202
                    "sFirst":    '{% trans "First" %}',
203
                    "sPrevious": '{% trans "Previous" %}',
204
                    "sNext":     '{% trans "Next" %}',
205
                    "sLast":     '{% trans "Last" %}'
206
                }
207
            }
208
        });
209

210
oTableI.fnDraw();
211

212
});
213
</script>
214
{% endblock %}