File tree 4 files changed +29
-9
lines changed
4 files changed +29
-9
lines changed Original file line number Diff line number Diff line change 1
1
const _ = require ( 'lodash' ) ;
2
2
3
3
module . exports = function ( req , res , next ) {
4
- _ . forEach ( req . session , function ( value , key ) {
5
- res . locals [ key ] = value ;
6
- } )
4
+ res . locals . login = req . session . login ;
5
+ res . locals . username = req . session . username ;
6
+ res . locals . status = req . session . status ;
7
+ res . locals . totalPageLimit = req . session . totalPageLimit ;
8
+ res . locals . pagePrinted = req . session . pagePrinted ;
7
9
next ( ) ;
8
10
}
Original file line number Diff line number Diff line change 1
1
extends ../layout.pug
2
2
3
3
block content
4
+ .text-center
5
+ h2 Add User
6
+ .row.mx-0
7
+ .col.alert-info
8
+ b Informations
9
+ ul
10
+ li All "users" will be removed from database before adding new users.
11
+ li Admins will not be removed.
12
+ li Everyone will be logged off, except you.
13
+ li You need to maintain the following csv format: username, password, printer_number
14
+ li Spaces will be trimmed
4
15
.row #fill-view
5
16
.col
6
17
form( action ='/admin/dashboard/addUser' , method ='post' )
@@ -9,12 +20,8 @@ block content
9
20
.form-group
10
21
label( for ='usercsv' )
11
22
textarea#usercsv .form-control ( name ='usercsv' , style ="height:500px;" ) .
12
- All "users" will be removed from database before adding new users. Admins will not be removed.
13
-
14
- Everyone will be logged off.
15
-
16
- samiul, 12345, 0
17
- islam, 54321, 1
23
+ hello, 12345, 0
24
+ world, 54321, 1
18
25
.row
19
26
.col.text-center
20
27
input.btn.btn-primary.mr-1.disableOnClick ( type ='submit' , value ='Add Users' )
Original file line number Diff line number Diff line change 1
1
extends layout.pug
2
2
3
3
block content
4
+ .row.mx-0
5
+ .col.alert-info
6
+ b Informations
7
+ ul
8
+ li Paste your code in the text below and press "Print" button to send a print request.
9
+ li You can print at most 10 pages with a single print request.
10
+ li You can send multiple print request.
11
+ li You cannot print more than 50 pages in total.
12
+ li You can view the number of pages you have printed at top left corner.
4
13
.row #fill-view
5
14
.col
6
15
form( action ='/printCode' , method ='post' )
Original file line number Diff line number Diff line change 8
8
if login == true
9
9
.col.text-right
10
10
if status == " admin"
11
+ a( href ="/" ) Home
12
+ span
11
13
a( href ="/admin/dashboard" ) Dashboard
12
14
span
13
15
a( href ="/user/logout" ) Logout
You can’t perform that action at this time.
0 commit comments