Commit 3c916d13fd4787224dd07a621eb56a8dc4b4230c
1 parent
7508a279
Exists in
master
and in
1 other branch
updated datatables version, changed table visual to bootstrap4.
Showing
4 changed files
with
25 additions
and
43 deletions
Show diff stats
static/css/datatables.min.css
... | ... | @@ -1,15 +0,0 @@ |
1 | -/* | |
2 | - * This combined file was created by the DataTables downloader builder: | |
3 | - * https://datatables.net/download | |
4 | - * | |
5 | - * To rebuild or modify this file with the latest versions of the included | |
6 | - * software please visit: | |
7 | - * https://datatables.net/download/#bs4/dt-1.10.16 | |
8 | - * | |
9 | - * Included libraries: | |
10 | - * DataTables 1.10.16 | |
11 | - */ | |
12 | - | |
13 | -table.dataTable{clear:both;margin-top:6px !important;margin-bottom:6px !important;max-width:none !important;border-collapse:separate !important}table.dataTable td,table.dataTable th{-webkit-box-sizing:content-box;box-sizing:content-box}table.dataTable td.dataTables_empty,table.dataTable th.dataTables_empty{text-align:center}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}div.dataTables_wrapper div.dataTables_length label{font-weight:normal;text-align:left;white-space:nowrap}div.dataTables_wrapper div.dataTables_length select{width:75px;display:inline-block}div.dataTables_wrapper div.dataTables_filter{text-align:right}div.dataTables_wrapper div.dataTables_filter label{font-weight:normal;white-space:nowrap;text-align:left}div.dataTables_wrapper div.dataTables_filter input{margin-left:0.5em;display:inline-block;width:auto}div.dataTables_wrapper div.dataTables_info{padding-top:0.85em;white-space:nowrap}div.dataTables_wrapper div.dataTables_paginate{margin:0;white-space:nowrap;text-align:right}div.dataTables_wrapper div.dataTables_paginate ul.pagination{margin:2px 0;white-space:nowrap;justify-content:flex-end}div.dataTables_wrapper div.dataTables_processing{position:absolute;top:50%;left:50%;width:200px;margin-left:-100px;margin-top:-26px;text-align:center;padding:1em 0}table.dataTable thead>tr>th.sorting_asc,table.dataTable thead>tr>th.sorting_desc,table.dataTable thead>tr>th.sorting,table.dataTable thead>tr>td.sorting_asc,table.dataTable thead>tr>td.sorting_desc,table.dataTable thead>tr>td.sorting{padding-right:30px}table.dataTable thead>tr>th:active,table.dataTable thead>tr>td:active{outline:none}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{cursor:pointer;position:relative}table.dataTable thead .sorting:before,table.dataTable thead .sorting:after,table.dataTable thead .sorting_asc:before,table.dataTable thead .sorting_asc:after,table.dataTable thead .sorting_desc:before,table.dataTable thead .sorting_desc:after,table.dataTable thead .sorting_asc_disabled:before,table.dataTable thead .sorting_asc_disabled:after,table.dataTable thead .sorting_desc_disabled:before,table.dataTable thead .sorting_desc_disabled:after{position:absolute;bottom:0.9em;display:block;opacity:0.3}table.dataTable thead .sorting:before,table.dataTable thead .sorting_asc:before,table.dataTable thead .sorting_desc:before,table.dataTable thead .sorting_asc_disabled:before,table.dataTable thead .sorting_desc_disabled:before{right:1em;content:"\2191"}table.dataTable thead .sorting:after,table.dataTable thead .sorting_asc:after,table.dataTable thead .sorting_desc:after,table.dataTable thead .sorting_asc_disabled:after,table.dataTable thead .sorting_desc_disabled:after{right:0.5em;content:"\2193"}table.dataTable thead .sorting_asc:before,table.dataTable thead .sorting_desc:after{opacity:1}table.dataTable thead .sorting_asc_disabled:before,table.dataTable thead .sorting_desc_disabled:after{opacity:0}div.dataTables_scrollHead table.dataTable{margin-bottom:0 !important}div.dataTables_scrollBody table{border-top:none;margin-top:0 !important;margin-bottom:0 !important}div.dataTables_scrollBody table thead .sorting:after,div.dataTables_scrollBody table thead .sorting_asc:after,div.dataTables_scrollBody table thead .sorting_desc:after{display:none}div.dataTables_scrollBody table tbody tr:first-child th,div.dataTables_scrollBody table tbody tr:first-child td{border-top:none}div.dataTables_scrollFoot>.dataTables_scrollFootInner{box-sizing:content-box}div.dataTables_scrollFoot>.dataTables_scrollFootInner>table{margin-top:0 !important;border-top:none}@media screen and (max-width: 767px){div.dataTables_wrapper div.dataTables_length,div.dataTables_wrapper div.dataTables_filter,div.dataTables_wrapper div.dataTables_info,div.dataTables_wrapper div.dataTables_paginate{text-align:center}}table.dataTable.table-sm>thead>tr>th{padding-right:20px}table.dataTable.table-sm .sorting:before,table.dataTable.table-sm .sorting_asc:before,table.dataTable.table-sm .sorting_desc:before{top:5px;right:0.85em}table.dataTable.table-sm .sorting:after,table.dataTable.table-sm .sorting_asc:after,table.dataTable.table-sm .sorting_desc:after{top:5px}table.table-bordered.dataTable th,table.table-bordered.dataTable td{border-left-width:0}table.table-bordered.dataTable th:last-child,table.table-bordered.dataTable th:last-child,table.table-bordered.dataTable td:last-child,table.table-bordered.dataTable td:last-child{border-right-width:0}table.table-bordered.dataTable tbody th,table.table-bordered.dataTable tbody td{border-bottom-width:0}div.dataTables_scrollHead table.table-bordered{border-bottom-width:0}div.table-responsive>div.dataTables_wrapper>div.row{margin:0}div.table-responsive>div.dataTables_wrapper>div.row>div[class^="col-"]:first-child{padding-left:0}div.table-responsive>div.dataTables_wrapper>div.row>div[class^="col-"]:last-child{padding-right:0} | |
14 | - | |
15 | - |
static/js/admin.js
... | ... | @@ -117,7 +117,7 @@ $(document).ready(function() { |
117 | 117 | dataType: "json", |
118 | 118 | dataSrc: function ( json ) { |
119 | 119 | var t = []; |
120 | - for ( var i=0; i<json.data.length ; i++ ) { | |
120 | + for ( var i=0; i < json.data.length ; i++ ) { | |
121 | 121 | d = json.data[i]; |
122 | 122 | var uid = d['uid']; |
123 | 123 | var checked = d['allowed'] ? 'checked' : ''; |
... | ... | @@ -126,14 +126,16 @@ $(document).ready(function() { |
126 | 126 | var g = d['grades']; |
127 | 127 | |
128 | 128 | t[i] = []; |
129 | - t[i][0] = '<input type="checkbox" name="' + uid + '" value="true"' + checked + '> ' + uid; | |
130 | - t[i][1] = d['name']; | |
131 | - t[i][2] = password_defined + hora_inicio; | |
129 | + t[i][0] = i+1; | |
130 | + t[i][1] = '<input type="checkbox" name="' + uid + '" value="true"' + checked + '> '; | |
131 | + t[i][2] = uid; | |
132 | + t[i][3] = d['name']; | |
133 | + t[i][4] = password_defined + hora_inicio; | |
132 | 134 | |
133 | 135 | var gbar = ''; |
134 | 136 | for (var j=0; j < g.length; j++) |
135 | 137 | gbar += '<div data-toggle="tooltip" data-placement="top" title="' + g[j][1].slice(0,19) + '"><a href="review?test_id=' + g[j][2] + '">' + generate_grade_bar(g[j][0]) + '</a></div>'; |
136 | - t[i][3] = gbar; | |
138 | + t[i][5] = gbar; | |
137 | 139 | } |
138 | 140 | return t; |
139 | 141 | } | ... | ... |
templates/admin.html
... | ... | @@ -7,10 +7,8 @@ |
7 | 7 | <link rel="icon" href="/static/favicon.ico"> |
8 | 8 | |
9 | 9 | <!-- styles --> |
10 | - <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css"> | |
11 | - <link rel="stylesheet" href="/static/font-awesome/css/font-awesome.min.css"> | |
12 | - <link rel="stylesheet" type="text/css" href="/static/css/datatables.min.css"/> | |
13 | - | |
10 | + <link rel="stylesheet" type="text/css" href="/static/bootstrap/css/bootstrap.min.css"> | |
11 | + <link rel="stylesheet" type="text/css" href="/static/DataTables/css/dataTables.bootstrap4.min.css"/> | |
14 | 12 | <style> |
15 | 13 | html { |
16 | 14 | font-size: 13px; |
... | ... | @@ -19,6 +17,17 @@ |
19 | 17 | padding-top: 100px; |
20 | 18 | } |
21 | 19 | </style> |
20 | + | |
21 | + <!-- Scripts --> | |
22 | + <script defer src="/static/fontawesome.min.js"></script> | |
23 | + <script defer src="/static/js/jquery.min.js"></script> | |
24 | + <script defer src="/static/popper/umd/popper.min.js"></script> | |
25 | + <script defer src="/static/bootstrap/js/bootstrap.min.js"></script> | |
26 | + <script defer src="/static/DataTables/DataTables-1.10.16/js/jquery.dataTables.min.js"></script> | |
27 | + <script defer src="/static/DataTables/DataTables-1.10.16/js/dataTables.bootstrap4.min.js"></script> | |
28 | + | |
29 | + <script defer src="/static/js/admin.js"></script> | |
30 | + <script defer src="/static/js/clock.js"></script> | |
22 | 31 | </head> |
23 | 32 | <!-- ===================================================================== --> |
24 | 33 | <body> |
... | ... | @@ -57,7 +66,7 @@ |
57 | 66 | </nav> |
58 | 67 | <!-- ===================================================================== --> |
59 | 68 | <div class="container-fluid"> |
60 | -<!-- ===================================================================== --> | |
69 | + | |
61 | 70 | <div class="jumbotron"> |
62 | 71 | <h3 id="title"></h3> |
63 | 72 | Ref: <span id="ref"></span><br> |
... | ... | @@ -66,10 +75,11 @@ |
66 | 75 | Testes submetidos: <span id="answers_dir"></span> |
67 | 76 | </div> <!-- jumbotron --> |
68 | 77 | |
69 | -<!-- ===================================================================== --> | |
70 | - <table class="table table-sm" id="students_table"> | |
78 | + <table class="table table-sm table-striped table-bordered" style="width:100%" id="students_table"> | |
71 | 79 | <thead class="thead thead-light"> |
72 | 80 | <tr> |
81 | + <th>#</th> | |
82 | + <th>Ok</th> | |
73 | 83 | <th>Número</th> |
74 | 84 | <th>Nome</th> |
75 | 85 | <th>Estado</th> |
... | ... | @@ -78,7 +88,6 @@ |
78 | 88 | </thead> |
79 | 89 | </table> |
80 | 90 | |
81 | -<!-- ===================================================================== --> | |
82 | 91 | </div> <!-- container --> |
83 | 92 | <!-- ===================================================================== --> |
84 | 93 | |
... | ... | @@ -142,21 +151,6 @@ |
142 | 151 | </div> |
143 | 152 | </div> <!-- modal --> |
144 | 153 | </div> |
145 | - | |
146 | - | |
147 | 154 | <!-- ===================================================================== --> |
148 | - | |
149 | - | |
150 | - | |
151 | -<!-- Scripts --> | |
152 | - <script src="/static/js/jquery.min.js"></script> | |
153 | - <script src="/static/js/jquery.dataTables.min.js"></script> | |
154 | - <script src="/static/popper/umd/popper.min.js"></script> | |
155 | - <script src="/static/bootstrap/js/bootstrap.min.js"></script> | |
156 | - | |
157 | - | |
158 | -<!-- My scripts --> | |
159 | - <script src="/static/js/admin.js"></script> | |
160 | - <script src="/static/js/clock.js"></script> | |
161 | 155 | </body> |
162 | 156 | </html> | ... | ... |