diff --git a/assets/css/pretendo-common.css b/assets/css/pretendo-common.css index f90d053..ab2165f 100644 --- a/assets/css/pretendo-common.css +++ b/assets/css/pretendo-common.css @@ -189,7 +189,7 @@ section.bigCardWrapper .bigCard.bigCardPartWrapper { } /* components - buttons */ -button { +button, .btn, .btn-alt { margin: 0; padding: 0; border: 0; @@ -198,14 +198,14 @@ button { font-size: 1em; cursor: pointer; } -button.btn { +.btn, button { background: #673db6; color: white; padding: 12px 80px; border-radius: 10px; box-shadow: 0 3px 12px rgba(0, 0, 0, 0.17); } -button.btn-alt { +.btn-alt { background: white; padding: 10px 45px; color: #673db6; @@ -213,8 +213,9 @@ button.btn-alt { box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07); border-radius: 5px; } -button.btn:hover, button.btn-alt:hover { +.btn:hover, button:hover, .btn-alt:hover { background: #553099; + color: white; } /* components - inputs */ diff --git a/assets/css/pretendo-home.css b/assets/css/pretendo-home.css index e6bca23..ba16187 100644 --- a/assets/css/pretendo-home.css +++ b/assets/css/pretendo-home.css @@ -72,7 +72,7 @@ header h3 { margin-left: 3em; } .smallCard h3 { - font-size: 1.5em !important; + font-size: 1.5em; margin: 0; } diff --git a/assets/css/pretendo-news.css b/assets/css/pretendo-news.css new file mode 100644 index 0000000..15ea167 --- /dev/null +++ b/assets/css/pretendo-news.css @@ -0,0 +1,16 @@ +/* news cards */ +.smallCard { + padding: 20px; + border: 1px solid rgb(165, 165, 165); + border-radius: 10px; + box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07); + position: relative; + margin: .5em; + width: calc(50% - 1em ); + box-sizing: border-box; + display: inline-block; +} +.smallCard h3 { + font-size: 1.5em; + margin: 0; +} \ No newline at end of file diff --git a/routes/admin.js b/routes/admin.js index 5332ca9..0db4da8 100644 --- a/routes/admin.js +++ b/routes/admin.js @@ -81,10 +81,10 @@ router.post('/admin/api/v1/register', adminUserMiddleware.adminAuthNeeded, (req, }); // saving to database - newUser.save().then(() => { + newUser.save().then((user) => { apiHelper.sendReturn(res, { - username: req.user.username, - role: req.user.role ? req.user.role : undefined + username: user.username, + role: user.role ? user.role : undefined }); return; }).catch((rejection) => { diff --git a/setupAdminUser.js b/setupAdminUser.js index 3b4fe24..6a8066c 100644 --- a/setupAdminUser.js +++ b/setupAdminUser.js @@ -1,8 +1,18 @@ +const mongoose = require('mongoose'); +// fix database deprecation warnings +mongoose.set('useCreateIndex', true); +mongoose.set('useNewUrlParser', true); +// setup database connection +mongoose.connect(require('./config.json').database.url); +const connection = mongoose.connection; +connection.on('error', console.error.bind(console, 'connection error:')); + const adminUser = require('./models/admin-user'); + const newUser = new adminUser.adminUserModel({ username: 'admin', - password: 'root' + password: 'rootroot' }); newUser.save().then(() => { diff --git a/views/admin.hbs b/views/admin.hbs index c328c18..ea8fa7f 100644 --- a/views/admin.hbs +++ b/views/admin.hbs @@ -1,10 +1,10 @@
- {{> head }} + {{> head-common }} - {{> navbar }} - + {{> nav-default }} +