Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
f3133a72
Unverified
Commit
f3133a72
authored
Dec 10, 2022
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: toc sidebar position
parent
9ac80c1a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
48 additions
and
15 deletions
+48
-15
admin-theme.vue
client/components/admin/admin-theme.vue
+11
-6
theme-mutation-save.gql
client/graph/admin/theme/theme-mutation-save.gql
+2
-2
theme-query-config.gql
client/graph/admin/theme/theme-query-config.gql
+1
-0
site.js
client/store/site.js
+1
-0
page.vue
client/themes/default/components/page.vue
+27
-7
data.yml
server/app/data.yml
+1
-0
theming.js
server/graph/resolvers/theming.js
+2
-0
theming.graphql
server/graph/schemas/theming.graphql
+2
-0
master.js
server/master.js
+1
-0
No files found.
client/components/admin/admin-theme.vue
View file @
f3133a72
...
@@ -55,20 +55,16 @@
...
@@ -55,20 +55,16 @@
v-card.mt-3.animated.fadeInUp.wait-p1s
v-card.mt-3.animated.fadeInUp.wait-p1s
v-toolbar(color='primary', dark, dense, flat)
v-toolbar(color='primary', dark, dense, flat)
v-toolbar-title.subtitle-1
{{
$t
(
`admin:theme.options`
)
}}
v-toolbar-title.subtitle-1
{{
$t
(
`admin:theme.options`
)
}}
v-spacer
v-chip(label, color='white', small).primary--text coming soon
v-card-text
v-card-text
v-select(
v-select(
:items='
[]
'
:items='
tocPositions
'
outlined
outlined
prepend-icon='mdi-border-vertical'
prepend-icon='mdi-border-vertical'
v-model='config.
iconset
'
v-model='config.
tocPosition
'
label='Table of Contents Position'
label='Table of Contents Position'
persistent-hint
persistent-hint
hint='Select whether the table of contents is shown on the left, right or not at all.'
hint='Select whether the table of contents is shown on the left, right or not at all.'
disabled
)
)
v-flex(lg6 xs12)
v-flex(lg6 xs12)
//- v-card.animated.fadeInUp.wait-p2s
//- v-card.animated.fadeInUp.wait-p2s
//- v-toolbar(color='teal', dark, dense, flat)
//- v-toolbar(color='teal', dark, dense, flat)
...
@@ -155,6 +151,7 @@ export default {
...
@@ -155,6 +151,7 @@ export default {
theme
:
'default'
,
theme
:
'default'
,
darkMode
:
false
,
darkMode
:
false
,
iconset
:
''
,
iconset
:
''
,
tocPosition
:
'left'
,
injectCSS
:
''
,
injectCSS
:
''
,
injectHead
:
''
,
injectHead
:
''
,
injectBody
:
''
injectBody
:
''
...
@@ -184,6 +181,13 @@ export default {
...
@@ -184,6 +181,13 @@ export default {
width
:
100
width
:
100
}
}
]
]
},
tocPositions
()
{
return
[
{
text
:
'Left (default)'
,
value
:
'left'
},
{
text
:
'Right'
,
value
:
'right'
},
{
text
:
'Hidden'
,
value
:
'off'
}
]
}
}
},
},
watch
:
{
watch
:
{
...
@@ -209,6 +213,7 @@ export default {
...
@@ -209,6 +213,7 @@ export default {
theme
:
this
.
config
.
theme
,
theme
:
this
.
config
.
theme
,
iconset
:
this
.
config
.
iconset
,
iconset
:
this
.
config
.
iconset
,
darkMode
:
this
.
darkMode
,
darkMode
:
this
.
darkMode
,
tocPosition
:
this
.
config
.
tocPosition
,
injectCSS
:
this
.
config
.
injectCSS
,
injectCSS
:
this
.
config
.
injectCSS
,
injectHead
:
this
.
config
.
injectHead
,
injectHead
:
this
.
config
.
injectHead
,
injectBody
:
this
.
config
.
injectBody
injectBody
:
this
.
config
.
injectBody
...
...
client/graph/admin/theme/theme-mutation-save.gql
View file @
f3133a72
mutation
(
$theme
:
String
!,
$iconset
:
String
!,
$darkMode
:
Boolean
!,
$injectCSS
:
String
,
$injectHead
:
String
,
$injectBody
:
String
)
{
mutation
(
$theme
:
String
!,
$iconset
:
String
!,
$darkMode
:
Boolean
!,
$
tocPosition
:
String
,
$
injectCSS
:
String
,
$injectHead
:
String
,
$injectBody
:
String
)
{
theming
{
theming
{
setConfig
(
theme
:
$theme
,
iconset
:
$iconset
,
darkMode
:
$darkMode
,
injectCSS
:
$injectCSS
,
injectHead
:
$injectHead
,
injectBody
:
$injectBody
)
{
setConfig
(
theme
:
$theme
,
iconset
:
$iconset
,
darkMode
:
$darkMode
,
tocPosition
:
$tocPosition
,
injectCSS
:
$injectCSS
,
injectHead
:
$injectHead
,
injectBody
:
$injectBody
)
{
responseResult
{
responseResult
{
succeeded
succeeded
errorCode
errorCode
...
...
client/graph/admin/theme/theme-query-config.gql
View file @
f3133a72
...
@@ -4,6 +4,7 @@ query {
...
@@ -4,6 +4,7 @@ query {
theme
theme
iconset
iconset
darkMode
darkMode
tocPosition
injectCSS
injectCSS
injectHead
injectHead
injectBody
injectBody
...
...
client/store/site.js
View file @
f3133a72
...
@@ -6,6 +6,7 @@ const state = {
...
@@ -6,6 +6,7 @@ const state = {
company
:
siteConfig
.
company
,
company
:
siteConfig
.
company
,
contentLicense
:
siteConfig
.
contentLicense
,
contentLicense
:
siteConfig
.
contentLicense
,
dark
:
siteConfig
.
darkMode
,
dark
:
siteConfig
.
darkMode
,
tocPosition
:
siteConfig
.
tocPosition
,
mascot
:
true
,
mascot
:
true
,
title
:
siteConfig
.
title
,
title
:
siteConfig
.
title
,
logoUrl
:
siteConfig
.
logoUrl
,
logoUrl
:
siteConfig
.
logoUrl
,
...
...
client/themes/default/components/page.vue
View file @
f3133a72
...
@@ -50,7 +50,14 @@
...
@@ -50,7 +50,14 @@
v-divider
v-divider
v-container.grey.pa-0(fluid, :class='$vuetify.theme.dark ? `darken-4-l3` : `lighten-4`')
v-container.grey.pa-0(fluid, :class='$vuetify.theme.dark ? `darken-4-l3` : `lighten-4`')
v-row.page-header-section(no-gutters, align-content='center', style='height: 90px;')
v-row.page-header-section(no-gutters, align-content='center', style='height: 90px;')
v-col.page-col-content.is-page-header(offset-xl='2', offset-lg='3', style='margin-top: auto; margin-bottom: auto;', :class='$vuetify.rtl ? `pr-4` : `pl-4`')
v-col.page-col-content.is-page-header(
:offset-xl='tocPosition === `left` ? 2 : 0'
:offset-lg='tocPosition === `left` ? 3 : 0'
:xl10='tocPosition === `right`'
:lg9='tocPosition === `right`'
style='margin-top: auto; margin-bottom: auto;'
:class='$vuetify.rtl ? `pr-4` : `pl-4`'
)
.headline.grey--text(:class='$vuetify.theme.dark ? `text--lighten-2` : `text--darken-3`')
{{
title
}}
.headline.grey--text(:class='$vuetify.theme.dark ? `text--lighten-2` : `text--darken-3`')
{{
title
}}
.caption.grey--text.text--darken-1
{{
description
}}
.caption.grey--text.text--darken-1
{{
description
}}
.page-edit-shortcuts(v-if='editShortcutsObj.editMenuBar')
.page-edit-shortcuts(v-if='editShortcutsObj.editMenuBar')
...
@@ -74,7 +81,13 @@
...
@@ -74,7 +81,13 @@
v
-
divider
v
-
divider
v
-
container
.
pl
-
5
.
pt
-
4
(
fluid
,
grid
-
list
-
xl
)
v
-
container
.
pl
-
5
.
pt
-
4
(
fluid
,
grid
-
list
-
xl
)
v
-
layout
(
row
)
v
-
layout
(
row
)
v
-
flex
.
page
-
col
-
sd
(
lg3
,
xl2
,
v
-
if
=
'$vuetify.breakpoint.lgAndUp'
)
v
-
flex
.
page
-
col
-
sd
(
v
-
if
=
'tocPosition !== `off` && $vuetify.breakpoint.lgAndUp'
:
order
-
xs1
=
'tocPosition !== `right`'
:
order
-
xs2
=
'tocPosition === `right`'
lg3
xl2
)
v
-
card
.
page
-
toc
-
card
.
mb
-
5
(
v
-
if
=
'tocDecoded.length'
)
v
-
card
.
page
-
toc
-
card
.
mb
-
5
(
v
-
if
=
'tocDecoded.length'
)
.
overline
.
pa
-
5
.
pb
-
0
(:
class
=
'$vuetify.theme.dark ? `blue--text text--lighten-2` : `primary--text`'
)
{{
$t
(
'common:page.toc'
)
}}
.
overline
.
pa
-
5
.
pb
-
0
(:
class
=
'$vuetify.theme.dark ? `blue--text text--lighten-2` : `primary--text`'
)
{{
$t
(
'common:page.toc'
)
}}
v
-
list
.
pb
-
3
(
dense
,
nav
,
:
class
=
'$vuetify.theme.dark ? `darken-3-d3` : ``'
)
v
-
list
.
pb
-
3
(
dense
,
nav
,
:
class
=
'$vuetify.theme.dark ? `darken-3-d3` : ``'
)
...
@@ -181,10 +194,10 @@
...
@@ -181,10 +194,10 @@
v
-
card
.
page
-
shortcuts
-
card
(
flat
)
v
-
card
.
page
-
shortcuts
-
card
(
flat
)
v
-
toolbar
(:
color
=
'$vuetify.theme.dark ? `grey darken-4-d3` : `grey lighten-3`'
,
flat
,
dense
)
v
-
toolbar
(:
color
=
'$vuetify.theme.dark ? `grey darken-4-d3` : `grey lighten-3`'
,
flat
,
dense
)
v
-
spacer
v
-
spacer
v
-
tooltip
(
bottom
)
//-
v-tooltip(bottom)
template
(
v
-
slot
:
activator
=
'{ on
}
'
)
//-
template(v-slot:activator='
{
on
}
')
v
-
btn
(
icon
,
tile
,
v
-
on
=
'on'
,
:
aria
-
label
=
'$t(`common:page.bookmark`)'
):
v
-
icon
(
color
=
'grey'
)
mdi
-
bookmark
//-
v-btn(icon, tile, v-on='
on
', :aria-label='
$t
(
`common:page.bookmark`
)
'): v-icon(color='
grey
') mdi-bookmark
span
{{
$t
(
'common:page.bookmark'
)
}}
//-
span {{$t('
common
:
page
.
bookmark
')
}}
v-menu(offset-y, bottom, min-width='
300
')
v-menu(offset-y, bottom, min-width='
300
')
template(v-slot:activator='
{
on
:
menu
}
')
template(v-slot:activator='
{
on
:
menu
}
')
v-tooltip(bottom)
v-tooltip(bottom)
...
@@ -203,7 +216,13 @@
...
@@ -203,7 +216,13 @@
span {{$t('
common
:
page
.
printFormat
')
}}
span {{$t('
common
:
page
.
printFormat
')
}}
v-spacer
v-spacer
v
-
flex
.
page
-
col
-
content
(
xs12
,
lg9
,
xl10
)
v-flex.page-col-content(
xs12
:lg9='
tocPosition
!==
`off`
'
:xl10='
tocPosition
!==
`off`
'
:order-xs1='
tocPosition
===
`right`
'
:order-xs2='
tocPosition
!==
`right`
'
)
v-tooltip(:right='
$vuetify
.
rtl
', :left='
!
$vuetify
.
rtl
', v-if='
hasAnyPagePermissions
&&
editShortcutsObj
.
editFab
')
v-tooltip(:right='
$vuetify
.
rtl
', :left='
!
$vuetify
.
rtl
', v-if='
hasAnyPagePermissions
&&
editShortcutsObj
.
editFab
')
template(v-slot:activator='
{
on
:
onEditActivator
}
')
template(v-slot:activator='
{
on
:
onEditActivator
}
')
v-speed-dial(
v-speed-dial(
...
@@ -536,6 +555,7 @@ export default {
...
@@ -536,6 +555,7 @@ export default {
tocDecoded () {
tocDecoded () {
return JSON.parse(Buffer.from(this.toc, '
base64
').toString())
return JSON.parse(Buffer.from(this.toc, '
base64
').toString())
}
,
}
,
tocPosition: get('
site
/
tocPosition
'),
hasAdminPermission: get('
page
/
effectivePermissions
@
system
.
manage
'),
hasAdminPermission: get('
page
/
effectivePermissions
@
system
.
manage
'),
hasWritePagesPermission: get('
page
/
effectivePermissions
@
pages
.
write
'),
hasWritePagesPermission: get('
page
/
effectivePermissions
@
pages
.
write
'),
hasManagePagesPermission: get('
page
/
effectivePermissions
@
pages
.
manage
'),
hasManagePagesPermission: get('
page
/
effectivePermissions
@
pages
.
manage
'),
...
...
server/app/data.yml
View file @
f3133a72
...
@@ -59,6 +59,7 @@ defaults:
...
@@ -59,6 +59,7 @@ defaults:
theme
:
'
default'
theme
:
'
default'
iconset
:
'
md'
iconset
:
'
md'
darkMode
:
false
darkMode
:
false
tocPosition
:
'
left'
auth
:
auth
:
autoLogin
:
false
autoLogin
:
false
enforce2FA
:
false
enforce2FA
:
false
...
...
server/graph/resolvers/theming.js
View file @
f3133a72
...
@@ -24,6 +24,7 @@ module.exports = {
...
@@ -24,6 +24,7 @@ module.exports = {
theme
:
WIKI
.
config
.
theming
.
theme
,
theme
:
WIKI
.
config
.
theming
.
theme
,
iconset
:
WIKI
.
config
.
theming
.
iconset
,
iconset
:
WIKI
.
config
.
theming
.
iconset
,
darkMode
:
WIKI
.
config
.
theming
.
darkMode
,
darkMode
:
WIKI
.
config
.
theming
.
darkMode
,
tocPosition
:
WIKI
.
config
.
theming
.
tocPosition
||
'left'
,
injectCSS
:
new
CleanCSS
({
format
:
'beautify'
}).
minify
(
WIKI
.
config
.
theming
.
injectCSS
).
styles
,
injectCSS
:
new
CleanCSS
({
format
:
'beautify'
}).
minify
(
WIKI
.
config
.
theming
.
injectCSS
).
styles
,
injectHead
:
WIKI
.
config
.
theming
.
injectHead
,
injectHead
:
WIKI
.
config
.
theming
.
injectHead
,
injectBody
:
WIKI
.
config
.
theming
.
injectBody
injectBody
:
WIKI
.
config
.
theming
.
injectBody
...
@@ -44,6 +45,7 @@ module.exports = {
...
@@ -44,6 +45,7 @@ module.exports = {
theme
:
args
.
theme
,
theme
:
args
.
theme
,
iconset
:
args
.
iconset
,
iconset
:
args
.
iconset
,
darkMode
:
args
.
darkMode
,
darkMode
:
args
.
darkMode
,
tocPosition
:
args
.
tocPosition
||
'left'
,
injectCSS
:
args
.
injectCSS
||
''
,
injectCSS
:
args
.
injectCSS
||
''
,
injectHead
:
args
.
injectHead
||
''
,
injectHead
:
args
.
injectHead
||
''
,
injectBody
:
args
.
injectBody
||
''
injectBody
:
args
.
injectBody
||
''
...
...
server/graph/schemas/theming.graphql
View file @
f3133a72
...
@@ -28,6 +28,7 @@ type ThemingMutation {
...
@@ -28,6 +28,7 @@ type ThemingMutation {
theme
:
String
!
theme
:
String
!
iconset
:
String
!
iconset
:
String
!
darkMode
:
Boolean
!
darkMode
:
Boolean
!
tocPosition
:
String
injectCSS
:
String
injectCSS
:
String
injectHead
:
String
injectHead
:
String
injectBody
:
String
injectBody
:
String
...
@@ -42,6 +43,7 @@ type ThemingConfig {
...
@@ -42,6 +43,7 @@ type ThemingConfig {
theme
:
String
!
theme
:
String
!
iconset
:
String
!
iconset
:
String
!
darkMode
:
Boolean
!
darkMode
:
Boolean
!
tocPosition
:
String
injectCSS
:
String
injectCSS
:
String
injectHead
:
String
injectHead
:
String
injectBody
:
String
injectBody
:
String
...
...
server/master.js
View file @
f3133a72
...
@@ -149,6 +149,7 @@ module.exports = async () => {
...
@@ -149,6 +149,7 @@ module.exports = async () => {
title
:
WIKI
.
config
.
title
,
title
:
WIKI
.
config
.
title
,
theme
:
WIKI
.
config
.
theming
.
theme
,
theme
:
WIKI
.
config
.
theming
.
theme
,
darkMode
:
WIKI
.
config
.
theming
.
darkMode
,
darkMode
:
WIKI
.
config
.
theming
.
darkMode
,
tocPosition
:
WIKI
.
config
.
theming
.
tocPosition
,
lang
:
WIKI
.
config
.
lang
.
code
,
lang
:
WIKI
.
config
.
lang
.
code
,
rtl
:
WIKI
.
config
.
lang
.
rtl
,
rtl
:
WIKI
.
config
.
lang
.
rtl
,
company
:
WIKI
.
config
.
company
,
company
:
WIKI
.
config
.
company
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment