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
1dfb55e8
You need to sign in or sign up before continuing.
Commit
1dfb55e8
authored
Jun 21, 2019
by
Nick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: default locale with namespacing
parent
28cf67cd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
56 additions
and
50 deletions
+56
-50
nav-header.vue
client/components/common/nav-header.vue
+7
-6
page-selector.vue
client/components/common/page-selector.vue
+41
-39
editor-modal-properties.vue
client/components/editor/editor-modal-properties.vue
+3
-1
page.vue
client/themes/default/components/page.vue
+1
-1
data.yml
server/app/data.yml
+2
-1
localization.js
server/graph/resolvers/localization.js
+1
-1
page.js
server/helpers/page.js
+1
-1
No files found.
client/components/common/nav-header.vue
View file @
1dfb55e8
...
@@ -145,7 +145,7 @@
...
@@ -145,7 +145,7 @@
v-list.py-0
v-list.py-0
template(v-for='(lc, idx) of locales')
template(v-for='(lc, idx) of locales')
v-list-tile(@click='changeLocale(lc)')
v-list-tile(@click='changeLocale(lc)')
v-list-tile-action: v-chip(:color='lc.code ===
$i18n.i18next.languag
e ? `blue` : `grey`', small, label, dark)
{{
lc
.
code
.
toUpperCase
()
}}
v-list-tile-action: v-chip(:color='lc.code ===
local
e ? `blue` : `grey`', small, label, dark)
{{
lc
.
code
.
toUpperCase
()
}}
v-list-tile-title
{{
lc
.
name
}}
v-list-tile-title
{{
lc
.
name
}}
v-divider.my-0(v-if='idx < locales.length - 1')
v-divider.my-0(v-if='idx < locales.length - 1')
v-tooltip(bottom, v-if='isAuthenticated && isAdmin')
v-tooltip(bottom, v-if='isAuthenticated && isAdmin')
...
@@ -231,6 +231,7 @@ export default {
...
@@ -231,6 +231,7 @@ export default {
isLoading
:
get
(
'isLoading'
),
isLoading
:
get
(
'isLoading'
),
title
:
get
(
'site/title'
),
title
:
get
(
'site/title'
),
path
:
get
(
'page/path'
),
path
:
get
(
'page/path'
),
locale
:
get
(
'page/locale'
),
mode
:
get
(
'page/mode'
),
mode
:
get
(
'page/mode'
),
name
:
get
(
'user/name'
),
name
:
get
(
'user/name'
),
email
:
get
(
'user/email'
),
email
:
get
(
'user/email'
),
...
@@ -293,19 +294,19 @@ export default {
...
@@ -293,19 +294,19 @@ export default {
this
.
newPageModal
=
true
this
.
newPageModal
=
true
},
},
pageNewCreate
({
path
,
locale
})
{
pageNewCreate
({
path
,
locale
})
{
window
.
location
.
assign
(
`/e/
${
path
}
`
)
window
.
location
.
assign
(
`/e/
${
locale
}
/
${
path
}
`
)
},
},
pageView
()
{
pageView
()
{
window
.
location
.
assign
(
`/
${
this
.
path
}
`
)
window
.
location
.
assign
(
`/
${
this
.
locale
}
/
${
this
.
path
}
`
)
},
},
pageEdit
()
{
pageEdit
()
{
window
.
location
.
assign
(
`/e/
${
this
.
path
}
`
)
window
.
location
.
assign
(
`/e/
${
this
.
locale
}
/
${
this
.
path
}
`
)
},
},
pageHistory
()
{
pageHistory
()
{
window
.
location
.
assign
(
`/h/
${
this
.
path
}
`
)
window
.
location
.
assign
(
`/h/
${
this
.
locale
}
/
${
this
.
path
}
`
)
},
},
pageSource
()
{
pageSource
()
{
window
.
location
.
assign
(
`/s/
${
this
.
path
}
`
)
window
.
location
.
assign
(
`/s/
${
this
.
locale
}
/
${
this
.
path
}
`
)
},
},
pageMove
()
{
pageMove
()
{
this
.
$store
.
commit
(
'showNotification'
,
{
this
.
$store
.
commit
(
'showNotification'
,
{
...
...
client/components/common/page-selector.vue
View file @
1dfb55e8
...
@@ -12,44 +12,44 @@
...
@@ -12,44 +12,44 @@
:width='2'
:width='2'
v-show='searchLoading'
v-show='searchLoading'
)
)
.d-flex(style='min-height:400px;')
//-
.d-flex(style='min-height:400px;')
v-flex(xs4).grey(:class='darkMode ? `darken-4` : `lighten-3`')
//-
v-flex(xs4).grey(:class='darkMode ? `darken-4` : `lighten-3`')
v-toolbar(color='grey darken-3', dark, dense, flat)
//-
v-toolbar(color='grey darken-3', dark, dense, flat)
.body-2 Folders
//-
.body-2 Folders
v-spacer
//-
v-spacer
v-btn(icon): v-icon create_new_folder
//-
v-btn(icon): v-icon create_new_folder
v-treeview(
//-
v-treeview(
v-model='tree'
//-
v-model='tree'
:items='treeFolders'
//-
:items='treeFolders'
:load-children='fetchFolders'
//-
:load-children='fetchFolders'
activatable
//-
activatable
open-on-click
//-
open-on-click
hoverable
//-
hoverable
)
//-
)
template(slot='prepend', slot-scope='{ item, open, leaf }')
//-
template(slot='prepend', slot-scope='{ item, open, leaf }')
v-icon
{{
open
?
'folder_open'
:
'folder'
}}
//-
v-icon
{{
open
?
'folder_open'
:
'folder'
}}
v-flex(xs8)
//-
v-flex(xs8)
v-toolbar(color='grey darken-2', dark, dense, flat)
//-
v-toolbar(color='grey darken-2', dark, dense, flat)
.body-2 Pages
//-
.body-2 Pages
v-spacer
//-
v-spacer
v-btn(icon): v-icon forward
//-
v-btn(icon): v-icon forward
v-btn(icon): v-icon delete
//-
v-btn(icon): v-icon delete
v-list(dense)
//-
v-list(dense)
v-list-tile
//-
v-list-tile
v-list-tile-avatar: v-icon insert_drive_file
//-
v-list-tile-avatar: v-icon insert_drive_file
v-list-tile-title File A
//-
v-list-tile-title File A
v-divider
//-
v-divider
v-list-tile
//-
v-list-tile
v-list-tile-avatar: v-icon insert_drive_file
//-
v-list-tile-avatar: v-icon insert_drive_file
v-list-tile-title File B
//-
v-list-tile-title File B
v-divider
//-
v-divider
v-list-tile
//-
v-list-tile
v-list-tile-avatar: v-icon insert_drive_file
//-
v-list-tile-avatar: v-icon insert_drive_file
v-list-tile-title File C
//-
v-list-tile-title File C
v-divider
//-
v-divider
v-list-tile
//-
v-list-tile
v-list-tile-avatar: v-icon insert_drive_file
//-
v-list-tile-avatar: v-icon insert_drive_file
v-list-tile-title File D
//-
v-list-tile-title File D
v-card-actions.grey.pa-2(:class='darkMode ? `darken-3-d5` : `lighten-1`')
v-card-actions.grey.pa-2(:class='darkMode ? `darken-3-d5` : `lighten-1`')
v-select(
v-select(
solo
solo
...
@@ -80,6 +80,8 @@
...
@@ -80,6 +80,8 @@
<
script
>
<
script
>
import
{
get
}
from
'vuex-pathify'
import
{
get
}
from
'vuex-pathify'
/* global siteLangs, siteConfig */
export
default
{
export
default
{
props
:
{
props
:
{
value
:
{
value
:
{
...
@@ -110,7 +112,7 @@ export default {
...
@@ -110,7 +112,7 @@ export default {
currentPath
:
'new-page'
,
currentPath
:
'new-page'
,
tree
:
[],
tree
:
[],
treeChildren
:
[],
treeChildren
:
[],
namespaces
:
[
'en'
]
namespaces
:
siteLangs
.
length
?
siteLangs
.
map
(
ns
=>
ns
.
code
)
:
[
siteConfig
.
lang
]
}
}
},
},
computed
:
{
computed
:
{
...
...
client/components/editor/editor-modal-properties.vue
View file @
1dfb55e8
...
@@ -185,6 +185,8 @@
...
@@ -185,6 +185,8 @@
import
_
from
'lodash'
import
_
from
'lodash'
import
{
sync
,
get
}
from
'vuex-pathify'
import
{
sync
,
get
}
from
'vuex-pathify'
/* global siteLangs, siteConfig */
export
default
{
export
default
{
props
:
{
props
:
{
value
:
{
value
:
{
...
@@ -197,7 +199,7 @@ export default {
...
@@ -197,7 +199,7 @@ export default {
isPublishStartShown
:
false
,
isPublishStartShown
:
false
,
isPublishEndShown
:
false
,
isPublishEndShown
:
false
,
pageSelectorShown
:
false
,
pageSelectorShown
:
false
,
namespaces
:
[
'en'
],
namespaces
:
siteLangs
.
length
?
siteLangs
.
map
(
ns
=>
ns
.
code
)
:
[
siteConfig
.
lang
],
tourSteps
:
[
tourSteps
:
[
{
{
target
:
'.dialog-header'
,
target
:
'.dialog-header'
,
...
...
client/themes/default/components/page.vue
View file @
1dfb55e8
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
.caption.grey--text.text--darken-1
{{
updatedAt
|
moment
(
'calendar'
)
}}
.caption.grey--text.text--darken-1
{{
updatedAt
|
moment
(
'calendar'
)
}}
v-spacer
v-spacer
v-tooltip(left)
v-tooltip(left)
v-btn.btn-animate-edit(icon, slot='activator', :href='"/e/" + path')
v-btn.btn-animate-edit(icon, slot='activator', :href='"/e/" +
locale + "/" +
path')
v-icon(color='grey') edit
v-icon(color='grey') edit
span
{{
$t
(
'common:page.editPage'
)
}}
span
{{
$t
(
'common:page.editPage'
)
}}
v-divider
v-divider
...
...
server/app/data.yml
View file @
1dfb55e8
...
@@ -18,7 +18,8 @@ defaults:
...
@@ -18,7 +18,8 @@ defaults:
storage
:
./db.sqlite
storage
:
./db.sqlite
ssl
:
ssl
:
enabled
:
false
enabled
:
false
pool
:
{}
pool
:
min
:
0
bindIP
:
0.0.0.0
bindIP
:
0.0.0.0
logLevel
:
info
logLevel
:
info
uploads
:
uploads
:
...
...
server/graph/resolvers/localization.js
View file @
1dfb55e8
...
@@ -56,7 +56,7 @@ module.exports = {
...
@@ -56,7 +56,7 @@ module.exports = {
WIKI
.
config
.
lang
.
code
=
args
.
locale
WIKI
.
config
.
lang
.
code
=
args
.
locale
WIKI
.
config
.
lang
.
autoUpdate
=
args
.
autoUpdate
WIKI
.
config
.
lang
.
autoUpdate
=
args
.
autoUpdate
WIKI
.
config
.
lang
.
namespacing
=
args
.
namespacing
WIKI
.
config
.
lang
.
namespacing
=
args
.
namespacing
WIKI
.
config
.
lang
.
namespaces
=
args
.
namespaces
WIKI
.
config
.
lang
.
namespaces
=
_
.
union
(
args
.
namespaces
,
[
args
.
locale
])
const
newLocale
=
await
WIKI
.
models
.
locales
.
query
().
select
(
'isRTL'
).
where
(
'code'
,
args
.
locale
).
first
()
const
newLocale
=
await
WIKI
.
models
.
locales
.
query
().
select
(
'isRTL'
).
where
(
'code'
,
args
.
locale
).
first
()
WIKI
.
config
.
lang
.
rtl
=
newLocale
.
isRTL
WIKI
.
config
.
lang
.
rtl
=
newLocale
.
isRTL
...
...
server/helpers/page.js
View file @
1dfb55e8
...
@@ -13,7 +13,7 @@ module.exports = {
...
@@ -13,7 +13,7 @@ module.exports = {
*/
*/
parsePath
(
rawPath
,
opts
=
{})
{
parsePath
(
rawPath
,
opts
=
{})
{
let
pathObj
=
{
let
pathObj
=
{
locale
:
'en'
,
locale
:
WIKI
.
config
.
lang
.
code
,
path
:
'home'
,
path
:
'home'
,
private
:
false
,
private
:
false
,
privateNS
:
''
privateNS
:
''
...
...
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