Statistics
| Branch: | Tag: | Revision:

root / templates / overview / index.html @ 861e8360

History | View | Annotate | Download (10.4 kB)

1
{% extends "base.html"%}
2
{% load i18n %}
3
                        
4
{% load i18n %}
5
{% block extrahead %}
6

    
7

    
8

    
9
<script type="text/javascript" src="/fodstatic/js/jquery.dataTables.js"></script>
10
<script type="text/javascript" src="/fodstatic/js/datatables_bootstrap.js"></script>
11

    
12
<style>
13
.tab-content {
14
    overflow: visible;
15
}
16
</style>
17
<script type="text/javascript">
18
$(document).ready(function(){
19
{% if users %}
20
var oTableU = $('#usertable').dataTable({
21
        "sPaginationType": "bootstrap",
22
        "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
23
        "aoColumns": [{
24
        "bSearchable": true,
25
        "bSortable": true
26
    }, {
27
        "bSearchable": true,
28
        "bSortable": true
29
    }, {
30
        "bSearchable": true,
31
        "bSortable": true
32
    }, {
33
        "bSearchable": true,
34
        "bSortable": true
35
    }, {
36
        "bSearchable": true,
37
        "bSortable": true
38
    }],
39
    "aaSorting": [[0, 'desc']],
40
    "iDisplayLength": 25,
41
    "oSearch": {"bSmart": false, "bRegex":true},
42
    "oLanguage": {
43
            "sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> {% trans "users" %}',
44
        "sProcessing":   "Processing...",
45
        "sZeroRecords": '{% trans "No records to display" %}',
46
        "sInfo":         "Showing _START_ to _END_ of _TOTAL_ entries",
47
        "sInfoEmpty":    "{% trans "Showing 0 to 0 of 0 entries" %}",
48
        "sInfoFiltered": "(filtered from _MAX_ total entries)",
49
        "sInfoPostFix":  "",
50
        "sSearch":       '{% trans "Search:" %}',
51
        "sUrl":          "",
52
        "oPaginate": {
53
            "sFirst":    '{% trans "First" %}',
54
            "sPrevious": '{% trans "Previous" %}',
55
            "sNext":     '{% trans "Next" %}',
56
            "sLast":     '{% trans "Last" %}'
57
        }
58
    }
59
});
60

61
oTableU.fnDraw();
62
{% endif %}
63
{% if routes %}
64
var oTableI =  $('#routes_table').dataTable({
65
        "sPaginationType": "bootstrap",
66
        "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
67
        "aoColumns": [{
68
            "bVisible": false,
69
            "bSearchable": false,
70
            "bSortable": false
71
        }, {
72
            "bSearchable": true,
73
            "bSortable": true
74
        }, {
75
            "bSearchable": true,
76
            "bSortable": true
77
        }, {
78
            "bSearchable": true,
79
            "bSortable": true
80
        }, {
81
            "bSearchable": true,
82
            "bSortable": true
83
        }, {
84
            "bSearchable": true,
85
            "bSortable": true
86
        }, {
87
            "bSearchable": true,
88
            "bSortable": true
89
        }, {
90
            "bSearchable": true,
91
            "bSortable": true
92
        }],
93
        "aaSorting": [[0, 'desc']],
94
        "iDisplayLength": 25,
95
        "oSearch": {"bSmart": false, "bRegex":true},
96
        "oLanguage": {
97
            "sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> {% trans "rules" %}',
98
            "sProcessing":   "Processing...",
99
            "sZeroRecords": '{% trans "No records to display" %}',
100
            "sInfo":         "Showing _START_ to _END_ of _TOTAL_ entries",
101
            "sInfoEmpty":    "{% trans "Showing 0 to 0 of 0 entries" %}",
102
            "sInfoFiltered": "(filtered from _MAX_ total entries)",
103
            "sInfoPostFix":  "",
104
            "sSearch":       '{% trans "Search:" %}',
105
            "sUrl":          "",
106
            "oPaginate": {
107
                "sFirst":    '{% trans "First" %}',
108
                "sPrevious": '{% trans "Previous" %}',
109
                "sNext":     '{% trans "Next" %}',
110
                "sLast":     '{% trans "Last" %}'
111
            }
112
        }
113
    });
114

115
oTableI.fnDraw();
116
{% endif %}
117
});
118
</script>
119
{% endblock %}
120
{% block brcrmb_container %}
121
<ul class="breadcrumb"><li><a href="{% url overview %}">{% trans "Overview" %}</a></li>
122
                </ul>
123
{% endblock %}
124
{% block content %}
125
<div class="container-fluid">
126
        <div class="row-fluid">
127

    
128
        </div>
129
        <div class="row-fluid">
130
                <div class="span12">
131
                        <div class="row-fluid">
132
                                <!--/span-->
133
                                <div class="span12">
134
                                {% if violation %}
135
                                  <table class="table table-condensed">
136
                                            <tr class="error"><td>You have no rights to access this area. Please contact your administrator<td></tr>
137
                                        </table>
138
                                {% else %}
139
                                   {% block subcontent %}
140
              <h4>{% trans "Users - Rules" %}</h4>
141
              <hr>
142
              
143
              
144
                <ul class="nav nav-tabs">
145
                                    <li class="active"><a href="#users" data-toggle="tab">{% trans "Users" %}</a></li>
146
                                    <li><a href="#routes" data-toggle="tab">{% trans "Rules" %}</a></li>
147
                            </ul>
148
    
149
    <div class="tab-content">
150
             
151
              <div class="tab-pane active" id="users">
152
              {% if users %}
153
               <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="usertable">
154
                       <thead>
155
                                        <tr>
156
                                        <th>{% trans "Username" %}</th>
157
                                        <th>{% trans "Email" %}</th>
158
                                        <th>{% trans "Name" %}</th>
159
                                        <th>{% trans "Status" %}</th>
160
                                        <th>{% trans "Peer" %}</th>
161
                                        </tr>
162
                                        </thead>
163
                                        <tbody>
164
                        {% for user in users %}
165
                              <tr class="GradeC">
166
                                <td>{{user.username}}</td>
167
                                <td>{{user.email}}</td>
168
                                <td>{{user.first_name}} {{user.last_name}}</td>
169
                                <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>
170
                                <td>{% if user.get_profile.peer %}{{user.get_profile.peer}}{% endif %}</td>
171
                        </tr>
172
                              {% endfor %}
173
                              </tbody>
174
                      </table>
175
                      {% endif %}
176
                                  </div>
177
                                  <div class="tab-pane" id="routes">
178
                      {% if routes %}
179
               <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="routes_table">
180
                       <thead>
181
<tr>
182
    <th>Id</th>
183
    <th>{% trans "Name" %}</th>
184
    <th>{% trans "Match" %}</th>
185
    <th style="text-align: center;">{% trans "Then" %}</th>
186
    <th style="text-align: center; ">{% trans "Status" %}</th>
187
    {% comment %}<th style="text-align: center;">{% trans "Details" %}</th>{% endcomment %}
188
    <th style="text-align: center;">{% trans "Applier" %}</th>
189
    <th style="text-align: center;">{% trans "Expires" %}</th>
190
    <th style="text-align: center;">{% trans "Response" %}</th>
191
</tr>
192
</thead>
193

    
194
<tbody>
195
{% for route in routes %}
196

    
197
<tr class="GradeC" >
198
    <td>{{ route.pk }}</td>
199
    
200
    <td {% if  %}style="color: #0088CC;"{% endif %}>{% if route.comments %}<span rel="tooltip" data-placement="top" title="{{route.comments}}">{{ route.name }}</span>{% else %}{{ route.name }}{% endif %}</td>
201
    
202
    <td>{{ route.get_match|safe|escape }}</td>
203
    
204
    <td style="text-align: center;">{{route.get_then|safe|escape}}</td>
205
    
206
        <td style="text-align: center; ">{% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' or route.status == 'OUTOFSYNC'%}
207
                {% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' %}<span class="label">DEACTIVATED</span>{% else %}{% if route.status == 'OUTOFSYNC' %}<span class="label label-important">ERROR</span>{% else %}{{route.status}}{% endif %}{% endif %}{% else %}{% if route.status == 'ACTIVE' %}<span class="label label-success">{{route.status}}</span>{% else %}{% if route.status == 'PENDING' %}<span class="label label-info">{{route.status}}</span>{% else %}<span class="label label-important">{{route.status}}</span>{% endif %}{% endif %}{% endif %}</td>
208

    
209
    {% comment %}<td style="text-align: center;">{{ route.response }}</td>{% endcomment %}
210
    
211
    <td style="text-align: center;">{{ route.applier }}</td>
212
    
213
    <td style="text-align: center;" nowrap
214
        <span {% if  == 'EXPIRED' or  == 'ADMININACTIVE' or  == 'INACTIVE' or  == 'OUTOFSYNC'%}{% else %}{% if  %}
215
        data-placement="top"
216
        rel = 'tooltip'
217
        style="border-bottom:1px dashed red;" 
218
        title="Expires {% ifequal route.days_to_expire '0' %}today{% else%}in {{route.days_to_expire}} day{{ route.days_to_expire|pluralize }}{% endifequal %}"
219
        {% endif %}{% endif %}>{{ route.expires|date:"d M y" }}</span></td>
220
        
221
    <td style="text-align: center; {% if route.status == 'EXPIRED' %} color: #0088CC; {% endif %}">
222
        {% if route.status == 'EXPIRED' %}
223
        <span rel="tooltip"  {% if  == 'EXPIRED' or  == 'ADMININACTIVE' or  == 'INACTIVE' or  == 'OUTOFSYNC'%}  
224
            data-placement="top" 
225
            title = "{% ifequal route.status 'INACTIVE' %}
226
                        {% trans 'Suspended by user' %}
227
                     {% else %}
228
                        {% ifequal route.status 'ADMININACTIVE' %}
229
                            {% trans 'Suspended by administrator' %}
230
                        {% else %}
231
                            {% ifequal route.status 'EXPIRED' %}
232
                                {% trans 'Suspended due to expiration' %}
233
                            {% else %}
234
                                {% ifequal route.status 'OUTOFSYNC' %}
235
                                    {% trans 'Syncronization error. Configuration in device deffers from rule' %}
236
                                {% endifequal %}
237
                            {% endifequal %}
238
                        {% endifequal %}
239
                     {% endifequal %}"
240
            {% endif %}>{% trans "Rule expired" %}</span>{% else %}{% if route.status == 'ADMININACTIVE' %}{% trans "Suspended by administrator" %}{% else %}{% if route.status == 'INACTIVE' %}{% trans "Suspended by user" %}{% else %}{{ route.response }}{% if route.status == 'PENDING' %}<img src="/fodstatic/dots.gif">{% endif %}{% endif %}{% endif %}{% endif %}
241
            </td>
242

    
243
</tr>
244

    
245
{% endfor %}
246
</tbody>
247
                      </table>
248
                      {% endif %}
249
                      </div>
250
                     </div>
251
              
252
                {% endblock %}
253
                                  {% endif %}
254
                                  
255
                                </div><!--/span-->
256
                                <!--/span-->
257
                        </div><!--/row-->
258
                </div><!--/span-->
259
        </div><!--/row-->
260
</div><!--/.fluid-container-->
261
{% endblock %}
262

    
263

    
264