From c863059a53bb1e84bfa4a3aff0104810d82360e5 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Mon, 26 Jun 2017 11:03:16 -0400 Subject: [PATCH] feat: admin page icons + Color Theme footer field --- client/scss/components/color-picker.scss | 10 ++++++++++ client/scss/components/hero.scss | 8 ++++++++ server/locales/en/admin.json | 3 ++- server/models/setting.js | 22 ++++++++++++++++++++++ server/models/user.js | 2 +- server/views/pages/admin/_layout.pug | 2 +- server/views/pages/admin/profile.pug | 1 + server/views/pages/admin/settings.pug | 1 + server/views/pages/admin/stats.pug | 1 + server/views/pages/admin/system.pug | 1 + server/views/pages/admin/theme.pug | 8 ++++++++ server/views/pages/admin/users-edit.pug | 1 + server/views/pages/admin/users.pug | 1 + 13 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 server/models/setting.js diff --git a/client/scss/components/color-picker.scss b/client/scss/components/color-picker.scss index 28f2e958..2efab795 100644 --- a/client/scss/components/color-picker.scss +++ b/client/scss/components/color-picker.scss @@ -9,13 +9,23 @@ border: 1px solid #FFF; transition: all .2s ease; cursor: pointer; + display: flex; + justify-content: center; + align-items: center; &.is-active, &:hover { border-width: 5px; + border-radius: 3px; width: 60px; height: 60px; } + &.is-active::before { + content: 'X'; + font-weight: 700; + color: rgba(255,255,255,.5); + } + @each $color, $colorvalue in $material-colors { &.is-#{$color} { background-color: mc($color, '500'); diff --git a/client/scss/components/hero.scss b/client/scss/components/hero.scss index 63460aa4..31031937 100644 --- a/client/scss/components/hero.scss +++ b/client/scss/components/hero.scss @@ -16,6 +16,14 @@ font-weight: 400; } + .pageicon { + position:absolute; + right: 20px; + top: 28px; + font-size: 48px; + color: mc('blue-grey', '500'); + } + .hero-menu { position: absolute; right: 20px; diff --git a/server/locales/en/admin.json b/server/locales/en/admin.json index 7268974a..e997ead5 100644 --- a/server/locales/en/admin.json +++ b/server/locales/en/admin.json @@ -46,7 +46,8 @@ "subtitle": "Customize the appearance of your wiki", "primarycolor": "Primary Color", "altcolor": "Secondary Color", - "codeblock": "Code Blocks" + "codeblock": "Code Blocks", + "footercolor": "Footer Color" }, "users": { "createauthorize": "Create / Authorize User", diff --git a/server/models/setting.js b/server/models/setting.js new file mode 100644 index 00000000..73686af2 --- /dev/null +++ b/server/models/setting.js @@ -0,0 +1,22 @@ +'use strict' + +const Mongoose = require('mongoose') + +/** + * Settings schema + * + * @type {} + */ +var settingSchema = Mongoose.Schema({ + key: { + type: String, + required: true, + index: true + }, + value: { + type: String, + required: true + } +}, { timestamps: {} }) + +module.exports = Mongoose.model('Setting', settingSchema) diff --git a/server/models/user.js b/server/models/user.js index 1c32f694..be3ab360 100644 --- a/server/models/user.js +++ b/server/models/user.js @@ -8,7 +8,7 @@ const bcrypt = require('bcryptjs-then') const _ = require('lodash') /** - * Region schema + * Users schema * * @type {} */ diff --git a/server/views/pages/admin/_layout.pug b/server/views/pages/admin/_layout.pug index 75ddc554..d2fe6190 100644 --- a/server/views/pages/admin/_layout.pug +++ b/server/views/pages/admin/_layout.pug @@ -46,7 +46,7 @@ block content span= t('nav.users') li a(href='/admin/theme') - i.icon-drop + i.nc-icon-outline.design_paint-37 span= t('nav.theme') li a(href='/admin/settings') diff --git a/server/views/pages/admin/profile.pug b/server/views/pages/admin/profile.pug index 4750fba9..8e198d6b 100644 --- a/server/views/pages/admin/profile.pug +++ b/server/views/pages/admin/profile.pug @@ -4,6 +4,7 @@ block adminContent .hero h1.title#title= t('nav.myprofile') h2.subtitle= t('admin:profile.subtitle') + i.pageicon.nc-icon-outline.business_business-contact-86 .form-sections .columns.is-gapless .column.is-two-thirds diff --git a/server/views/pages/admin/settings.pug b/server/views/pages/admin/settings.pug index 51182339..d86d966a 100644 --- a/server/views/pages/admin/settings.pug +++ b/server/views/pages/admin/settings.pug @@ -4,3 +4,4 @@ block adminContent .hero h1.title#title= t('nav.syssettings') h2.subtitle= t('admin:settings.subtitle') + i.pageicon.nc-icon-outline.ui-1_settings-gear-63 diff --git a/server/views/pages/admin/stats.pug b/server/views/pages/admin/stats.pug index 67df36c2..8a717815 100644 --- a/server/views/pages/admin/stats.pug +++ b/server/views/pages/admin/stats.pug @@ -4,6 +4,7 @@ block adminContent .hero h1.title#title= t('nav.stats') h2.subtitle= t('admin:stats.subtitle') + i.pageicon.nc-icon-outline.ui-3_chart-bars .form-sections section label.label= t('admin:stats.entries') diff --git a/server/views/pages/admin/system.pug b/server/views/pages/admin/system.pug index d5a668e7..fe30712f 100644 --- a/server/views/pages/admin/system.pug +++ b/server/views/pages/admin/system.pug @@ -4,6 +4,7 @@ block adminContent .hero h1.title#title= t('nav.sysinfo') h2.subtitle= t('admin:system.subtitle') + i.pageicon.nc-icon-outline.objects_planet admin-settings(inline-template) .form-sections section diff --git a/server/views/pages/admin/theme.pug b/server/views/pages/admin/theme.pug index 24b356f7..c63f39ca 100644 --- a/server/views/pages/admin/theme.pug +++ b/server/views/pages/admin/theme.pug @@ -4,6 +4,7 @@ block adminContent .hero h1.title#title= t('nav.theme') h2.subtitle= t('admin:theme.subtitle') + i.pageicon.nc-icon-outline.design_paint-37 .form-sections section label.label= t('admin:theme.primarycolor') @@ -11,7 +12,14 @@ block adminContent section label.label= t('admin:theme.altcolor') color-picker(current-color='blue-grey') + section + label.label= t('admin:theme.footercolor') + color-picker(current-color='blue-grey') section label.label= t('admin:theme.codeblock') toggle(current-value='dark', desc='Use Dark Theme') toggle(current-value='dark', desc='Colorize code syntax') + section + button.button.is-green(@click='saveUser') + i.nc-icon-outline.ui-1_check + span= t('admin:profile.savechanges') diff --git a/server/views/pages/admin/users-edit.pug b/server/views/pages/admin/users-edit.pug index c2c7756d..d011f033 100644 --- a/server/views/pages/admin/users-edit.pug +++ b/server/views/pages/admin/users-edit.pug @@ -13,6 +13,7 @@ block adminContent .hero h1.title= t('admin:users.edituser') h2.subtitle= usr.email + i.pageicon.nc-icon-outline.users_single-05 table.table thead tr diff --git a/server/views/pages/admin/users.pug b/server/views/pages/admin/users.pug index e4a64c21..0e286bbd 100644 --- a/server/views/pages/admin/users.pug +++ b/server/views/pages/admin/users.pug @@ -11,6 +11,7 @@ block adminContent .hero h1.title#title= t('nav.users') h2.subtitle= t('admin:users.subtitle') + i.pageicon.nc-icon-outline.users_multiple-19 table.table thead tr