refactor: Migrate to Vue components
This commit is contained in:
@@ -9,26 +9,11 @@
|
||||
= appconfig.title
|
||||
.nav-center
|
||||
block rootNavCenter
|
||||
.nav-item
|
||||
p.control(v-bind:class='{ "is-loading": searchload > 0 }')
|
||||
input.input#search-input(type='text', v-model='searchq', @keyup.esc='closeSearch', @keyup.down='moveDownSearch', @keyup.up='moveUpSearch', @keyup.enter='moveSelectSearch', debounce='400', placeholder=t('search.placeholder'))
|
||||
search
|
||||
span.nav-toggle
|
||||
span
|
||||
span
|
||||
span
|
||||
.nav-right
|
||||
block rootNavRight
|
||||
i.nav-item#notifload
|
||||
|
||||
transition(name='searchresults-anim', enter-active-class='slideInDown', leave-active-class='fadeOutUp')
|
||||
.searchresults.animated(v-show='searchactive', v-cloak, style={'display':'none'})
|
||||
p.searchresults-label= t('search.results')
|
||||
ul.searchresults-list
|
||||
li(v-if='searchres.length === 0')
|
||||
a: em= t('search.nomatch')
|
||||
li(v-for='sres in searchres', v-bind:class='{ "is-active": searchmovekey === "res." + sres.entryPath }')
|
||||
a(v-bind:href='"/" + sres.entryPath') {{ sres.title }}
|
||||
p.searchresults-label(v-if='searchsuggest.length > 0')= t('search.didyoumean')
|
||||
ul.searchresults-list(v-if='searchsuggest.length > 0')
|
||||
li(v-for='sug in searchsuggest', v-bind:class='{ "is-active": searchmovekey === "sug." + sug }')
|
||||
a(v-on:click='useSuggestion(sug)') {{ sug }}
|
||||
loading-spinner
|
||||
|
@@ -9,7 +9,7 @@ html
|
||||
meta(name='msapplication-TileImage', content='/favicons/ms-icon-144x144.png')
|
||||
title= appconfig.title
|
||||
|
||||
// Favicon
|
||||
//- Favicon
|
||||
each favsize in [57, 60, 72, 76, 114, 120, 144, 152, 180]
|
||||
link(rel='apple-touch-icon', sizes=favsize + 'x' + favsize, href='/favicons/apple-icon-' + favsize + 'x' + favsize + '.png')
|
||||
link(rel='icon', type='image/png', sizes='192x192', href='/favicons/android-icon-192x192.png')
|
||||
@@ -17,7 +17,10 @@ html
|
||||
link(rel='icon', type='image/png', sizes=favsize + 'x' + favsize, href='/favicons/favicon-' + favsize + 'x' + favsize + '.png')
|
||||
link(rel='manifest', href='/manifest.json')
|
||||
|
||||
// JS / CSS
|
||||
//- Site Lang
|
||||
script var siteLang = '!{appconfig.lang}';
|
||||
|
||||
//- JS / CSS
|
||||
script(type='text/javascript', src='/js/libs.min.js')
|
||||
script(type='text/javascript', src='/js/app.min.js')
|
||||
|
||||
@@ -26,7 +29,7 @@ html
|
||||
body
|
||||
#root.has-stickynav
|
||||
include ./common/header.pug
|
||||
include ./common/alerts.pug
|
||||
//-include ./common/alerts.pug
|
||||
main
|
||||
block content
|
||||
include ./common/footer.pug
|
||||
|
@@ -4,7 +4,7 @@ block rootNavCenter
|
||||
h2.nav-item= t('nav.account')
|
||||
|
||||
block rootNavRight
|
||||
i.nav-item#notifload
|
||||
loading-spinner
|
||||
.nav-item
|
||||
a.button.btn-edit-discard(href='/')
|
||||
i.icon-home
|
||||
@@ -48,6 +48,10 @@ block content
|
||||
a(href='/admin/settings')
|
||||
i.icon-cog
|
||||
span= t('nav.syssettings')
|
||||
li
|
||||
a(href='/admin/theme')
|
||||
i.icon-drop
|
||||
span= t('nav.theme')
|
||||
li
|
||||
a(href='/logout')
|
||||
i.icon-delete2
|
||||
|
@@ -1,53 +1,51 @@
|
||||
extends ./_layout.pug
|
||||
|
||||
block adminContent
|
||||
#page-type-admin-profile
|
||||
.hero
|
||||
h1.title#title= t('nav.myprofile')
|
||||
h2.subtitle= t('admin:profile.subtitle')
|
||||
.form-sections
|
||||
.columns.is-gapless
|
||||
.column.is-two-thirds
|
||||
section
|
||||
label.label= t('admin:profile.email')
|
||||
p.control.is-fullwidth
|
||||
input.input(type='text', placeholder=t('admin:profile.email'), value=user.email, disabled)
|
||||
if user.provider === 'local'
|
||||
.hero
|
||||
h1.title#title= t('nav.myprofile')
|
||||
h2.subtitle= t('admin:profile.subtitle')
|
||||
.form-sections
|
||||
.columns.is-gapless
|
||||
.column.is-two-thirds
|
||||
admin-profile(inline-template, email=user.email, name=user.name, provider=user.provider)
|
||||
div
|
||||
section
|
||||
label.label= t('admin:profile.password')
|
||||
label.label= t('admin:profile.email')
|
||||
p.control.is-fullwidth
|
||||
input.input(type='password', placeholder=t('admin:profile.password'), value='********', v-model='password')
|
||||
input.input(type='text', placeholder=t('admin:profile.email'), value=user.email, disabled)
|
||||
if user.provider === 'local'
|
||||
section
|
||||
label.label= t('admin:profile.password')
|
||||
p.control.is-fullwidth
|
||||
input.input(type='password', placeholder=t('admin:profile.password'), value='********', v-model='password')
|
||||
section
|
||||
label.label= t('admin:profile.passwordverify')
|
||||
p.control.is-fullwidth
|
||||
input.input(type='password', placeholder=t('admin:profile.password'), value='********', v-model='passwordVerify')
|
||||
section
|
||||
label.label= t('admin:profile.passwordverify')
|
||||
label.label= t('admin:profile.displayname')
|
||||
p.control.is-fullwidth
|
||||
input.input(type='password', placeholder=t('admin:profile.password'), value='********', v-model='passwordVerify')
|
||||
section
|
||||
label.label= t('admin:profile.displayname')
|
||||
p.control.is-fullwidth
|
||||
input.input(type='text', placeholder=t('admin:profile.displaynameexample'), v-model='name')
|
||||
section
|
||||
button.button.is-green(v-on:click='saveUser')
|
||||
i.icon-check
|
||||
span= t('admin:profile.savechanges')
|
||||
.column
|
||||
.panel-aside
|
||||
label.label= t('admin:profile.provider')
|
||||
p.control.account-profile-provider
|
||||
case user.provider
|
||||
when 'local': i.icon-server
|
||||
when 'windowslive': i.icon-windows2.is-blue
|
||||
when 'azure': i.icon-windows2.is-blue
|
||||
when 'google': i.icon-google.is-blue
|
||||
when 'facebook': i.icon-facebook.is-indigo
|
||||
when 'github': i.icon-github.is-grey
|
||||
when 'slack': i.icon-slack.is-purple
|
||||
when 'ldap': i.icon-arrow-repeat-outline
|
||||
default: i.icon-warning
|
||||
= t('auth:providers.' + user.provider)
|
||||
label.label= t('admin:profile.membersince')
|
||||
p.control= moment(user.createdAt).format('LL')
|
||||
label.label= t('admin:profile.lastprofileupdate')
|
||||
p.control= moment(user.updatedAt).format('LL')
|
||||
|
||||
script(type='text/javascript').
|
||||
var usrDataName = "!{user.name}";
|
||||
input.input(type='text', placeholder=t('admin:profile.displaynameexample'), v-model='name')
|
||||
section
|
||||
button.button.is-green(v-on:click='saveUser')
|
||||
i.icon-check
|
||||
span= t('admin:profile.savechanges')
|
||||
.column
|
||||
.panel-aside
|
||||
label.label= t('admin:profile.provider')
|
||||
p.control.account-profile-provider
|
||||
case user.provider
|
||||
when 'local': i.icon-server
|
||||
when 'windowslive': i.icon-windows2.is-blue
|
||||
when 'azure': i.icon-windows2.is-blue
|
||||
when 'google': i.icon-google.is-blue
|
||||
when 'facebook': i.icon-facebook.is-indigo
|
||||
when 'github': i.icon-github.is-grey
|
||||
when 'slack': i.icon-slack.is-purple
|
||||
when 'ldap': i.icon-arrow-repeat-outline
|
||||
default: i.icon-warning
|
||||
= t('auth:providers.' + user.provider)
|
||||
label.label= t('admin:profile.membersince')
|
||||
p.control= moment(user.createdAt).format('LL')
|
||||
label.label= t('admin:profile.lastprofileupdate')
|
||||
p.control= moment(user.updatedAt).format('LL')
|
||||
|
@@ -1,10 +1,10 @@
|
||||
extends ./_layout.pug
|
||||
|
||||
block adminContent
|
||||
#page-type-admin-settings
|
||||
.hero
|
||||
h1.title#title= t('nav.syssettings')
|
||||
h2.subtitle= t('admin:settings.subtitle')
|
||||
.hero
|
||||
h1.title#title= t('nav.syssettings')
|
||||
h2.subtitle= t('admin:settings.subtitle')
|
||||
admin-settings(inline-template)
|
||||
.form-sections
|
||||
section
|
||||
img(src='/images/logo.png', style={width:'200px', float:'right'})
|
||||
@@ -34,4 +34,4 @@ block adminContent
|
||||
p.is-small= t('admin:settings.flushsessionstext')
|
||||
p: button.button.is-teal.is-outlined(v-on:click='flushsessions')= t('admin:settings.flushsessionsbtn')
|
||||
|
||||
include ../../modals/admin-upgrade.pug
|
||||
include ../../modals/admin-upgrade.pug
|
||||
|
11
server/views/pages/admin/theme.pug
Normal file
11
server/views/pages/admin/theme.pug
Normal file
@@ -0,0 +1,11 @@
|
||||
extends ./_layout.pug
|
||||
|
||||
block adminContent
|
||||
#page-type-admin-settings
|
||||
.hero
|
||||
h1.title#title= t('nav.theme')
|
||||
h2.subtitle= t('admin:theme.subtitle')
|
||||
.form-sections
|
||||
section
|
||||
label.label= t('admin:theme.primarycolor')
|
||||
color-picker
|
@@ -57,8 +57,8 @@ block content
|
||||
if !isGuest
|
||||
li
|
||||
a(href='/admin')
|
||||
i.icon-head
|
||||
span= t('nav.account')
|
||||
i.icon-cog
|
||||
span= t('nav.settings')
|
||||
else
|
||||
li
|
||||
a(href='/login')
|
||||
|
Reference in New Issue
Block a user