Skip to content

Commit dafc9e7

Browse files
committed
Add information on top of text box
1 parent a3c28ee commit dafc9e7

File tree

4 files changed

+29
-9
lines changed

4 files changed

+29
-9
lines changed

middlewares/passSession.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
const _ = require('lodash');
22

33
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;
79
next();
810
}

views/admin/addUser.pug

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
extends ../layout.pug
22

33
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
415
.row#fill-view
516
.col
617
form(action='/admin/dashboard/addUser', method='post')
@@ -9,12 +20,8 @@ block content
920
.form-group
1021
label(for='usercsv')
1122
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
1825
.row
1926
.col.text-center
2027
input.btn.btn-primary.mr-1.disableOnClick(type='submit', value='Add Users')

views/home.pug

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
extends layout.pug
22

33
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.
413
.row#fill-view
514
.col
615
form(action='/printCode', method='post')

views/partials/header.pug

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
if login == true
99
.col.text-right
1010
if status == "admin"
11+
a(href="/") Home
12+
span    
1113
a(href="/admin/dashboard") Dashboard
1214
span    
1315
a(href="/user/logout") Logout

0 commit comments

Comments
 (0)