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
366a8352
Commit
366a8352
authored
Dec 09, 2018
by
Nicolas Giard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: editor flow
parent
461f4a7e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
37 deletions
+40
-37
editor.vue
client/components/editor.vue
+15
-16
editor-modal-properties.vue
client/components/editor/editor-modal-properties.vue
+22
-18
_new.scss
client/scss/pages/_new.scss
+1
-1
_welcome.scss
client/scss/pages/_welcome.scss
+1
-1
common.js
server/controllers/common.js
+1
-1
No files found.
client/components/editor.vue
View file @
366a8352
...
@@ -10,15 +10,16 @@
...
@@ -10,15 +10,16 @@
)
)
v-icon(color='green', :left='$vuetify.breakpoint.lgAndUp') check
v-icon(color='green', :left='$vuetify.breakpoint.lgAndUp') check
span.white--text(v-if='$vuetify.breakpoint.lgAndUp')
{{
mode
===
'create'
?
$t
(
'common:actions.create'
)
:
$t
(
'common:actions.save'
)
}}
span.white--text(v-if='$vuetify.breakpoint.lgAndUp')
{{
mode
===
'create'
?
$t
(
'common:actions.create'
)
:
$t
(
'common:actions.save'
)
}}
v-btn
.mx-0
(
v-btn(
outline
outline
color='blue'
color='blue'
@click.native.stop='open
Modal(`properties`)
'
@click.native.stop='open
PropsModal
'
:class='{ "is-icon": $vuetify.breakpoint.mdAndDown }'
:class='{ "is-icon": $vuetify.breakpoint.mdAndDown
, "mx-0": mode === `create`, "ml-0": mode !== `create`
}'
)
)
v-icon(color='blue', :left='$vuetify.breakpoint.lgAndUp') sort_by_alpha
v-icon(color='blue', :left='$vuetify.breakpoint.lgAndUp') sort_by_alpha
span.white--text(v-if='$vuetify.breakpoint.lgAndUp')
{{
$t
(
'editor:page'
)
}}
span.white--text(v-if='$vuetify.breakpoint.lgAndUp')
{{
$t
(
'editor:page'
)
}}
v-btn(
v-btn(
v-if='mode === `create`'
outline
outline
color='red'
color='red'
:class='{ "is-icon": $vuetify.breakpoint.mdAndDown }'
:class='{ "is-icon": $vuetify.breakpoint.mdAndDown }'
...
@@ -28,7 +29,7 @@
...
@@ -28,7 +29,7 @@
span.white--text(v-if='$vuetify.breakpoint.lgAndUp')
{{
$t
(
'common:actions.discard'
)
}}
span.white--text(v-if='$vuetify.breakpoint.lgAndUp')
{{
$t
(
'common:actions.discard'
)
}}
v-content
v-content
component(:is='currentEditor')
component(:is='currentEditor')
component(:is='currentModal
')
editor-modal-properties(v-model='dialogProps
')
v-dialog(v-model='dialogProgress', persistent, max-width='350')
v-dialog(v-model='dialogProgress', persistent, max-width='350')
v-card(color='blue darken-3', dark)
v-card(color='blue darken-3', dark)
v-card-text.text-xs-center.py-4
v-card-text.text-xs-center.py-4
...
@@ -54,6 +55,7 @@
...
@@ -54,6 +55,7 @@
v-card-text.text-xs-center(@click='selectEditor("code")')
v-card-text.text-xs-center(@click='selectEditor("code")')
v-icon(large, color='primary') code
v-icon(large, color='primary') code
.body-2.mt-2 Code
.body-2.mt-2 Code
.caption.grey--text Raw HTML
v-flex(xs4)
v-flex(xs4)
v-card.radius-7(
v-card.radius-7(
hover
hover
...
@@ -63,6 +65,7 @@
...
@@ -63,6 +65,7 @@
v-card-text.text-xs-center(@click='selectEditor("markdown")')
v-card-text.text-xs-center(@click='selectEditor("markdown")')
v-icon(large, color='primary') list_alt
v-icon(large, color='primary') list_alt
.body-2.mt-2 Markdown
.body-2.mt-2 Markdown
.caption.grey--text Default
v-flex(xs4)
v-flex(xs4)
v-card.radius-7.grey(
v-card.radius-7.grey(
hover
hover
...
@@ -72,7 +75,8 @@
...
@@ -72,7 +75,8 @@
v-card-text.text-xs-center(@click='selectEditor("wysiwyg")')
v-card-text.text-xs-center(@click='selectEditor("wysiwyg")')
v-icon(large, color='grey darken-1') web
v-icon(large, color='grey darken-1') web
.body-2.mt-2.grey--text.text--darken-2 Visual Builder
.body-2.mt-2.grey--text.text--darken-2 Visual Builder
.caption.blue--text.text--lighten-2 This cannot be changed later.
.caption.grey--text.text--darken-1 Drag-n-drop
.caption.blue--text.text--lighten-2 This cannot be changed once the page is created.
v-snackbar(
v-snackbar(
:color='notification.style'
:color='notification.style'
...
@@ -131,7 +135,7 @@ export default {
...
@@ -131,7 +135,7 @@ export default {
},
},
isPublished
:
{
isPublished
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
fals
e
default
:
tru
e
},
},
initEditor
:
{
initEditor
:
{
type
:
String
,
type
:
String
,
...
@@ -152,8 +156,8 @@ export default {
...
@@ -152,8 +156,8 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
currentModal
:
''
,
currentEditor
:
''
,
currentEditor
:
''
,
dialogProps
:
false
,
dialogProgress
:
false
,
dialogProgress
:
false
,
dialogEditorSelector
:
false
dialogEditorSelector
:
false
}
}
...
@@ -192,17 +196,12 @@ export default {
...
@@ -192,17 +196,12 @@ export default {
this
.
dialogEditorSelector
=
false
this
.
dialogEditorSelector
=
false
if
(
this
.
mode
===
'create'
)
{
if
(
this
.
mode
===
'create'
)
{
_
.
delay
(()
=>
{
_
.
delay
(()
=>
{
this
.
openModal
(
'properties'
)
this
.
dialogProps
=
true
},
500
)
},
500
)
}
}
},
},
openModal
(
name
)
{
openPropsModal
(
name
)
{
this
.
currentModal
=
`editorModal
${
_
.
startCase
(
name
)}
`
this
.
dialogProps
=
true
},
closeModal
()
{
_
.
delay
(()
=>
{
this
.
currentModal
=
``
},
500
)
},
},
showProgressDialog
(
textKey
)
{
showProgressDialog
(
textKey
)
{
this
.
dialogProgress
=
true
this
.
dialogProgress
=
true
...
@@ -298,7 +297,7 @@ export default {
...
@@ -298,7 +297,7 @@ export default {
<
style
lang=
'scss'
>
<
style
lang=
'scss'
>
.editor
{
.editor
{
background-color
:
mc
(
'grey'
,
'900'
);
background-color
:
mc
(
'grey'
,
'900'
)
!
important
;
min-height
:
100vh
;
min-height
:
100vh
;
}
}
...
...
client/components/editor/editor-modal-properties.vue
View file @
366a8352
<
template
lang=
'pug'
>
<
template
lang=
'pug'
>
v-
bottom-sheet
(
v-
dialog
(
v-model='isShown'
v-model='isShown'
inset
persistent
lazy
width='1100'
)
)
.dialog-header
.dialog-header
v-icon(color='white') sort_by_alpha
v-icon(color='white') sort_by_alpha
...
@@ -14,17 +16,6 @@
...
@@ -14,17 +16,6 @@
)
)
v-icon(left) check
v-icon(left) check
span
{{
$t
(
'common:actions.ok'
)
}}
span
{{
$t
(
'common:actions.ok'
)
}}
v-menu
v-btn.is-icon(
slot='activator'
outline
dark
)
v-icon more_horiz
v-list
v-list-tile
v-list-tile-avatar: v-icon delete
v-list-tile-title Delete Page
v-card.wiki-form(tile)
v-card.wiki-form(tile)
v-card-text
v-card-text
v-subheader.pl-0 Page Info
v-subheader.pl-0 Page Info
...
@@ -42,6 +33,8 @@
...
@@ -42,6 +33,8 @@
label='Short Description'
label='Short Description'
counter='255'
counter='255'
v-model='description'
v-model='description'
persistent-hint
hint='Shown below the title'
)
)
v-divider
v-divider
v-card-text.grey(:class='darkMode ? `darken-3-d3` : `lighten-5`')
v-card-text.grey(:class='darkMode ? `darken-3-d3` : `lighten-5`')
...
@@ -93,7 +86,7 @@
...
@@ -93,7 +86,7 @@
label='Published'
label='Published'
v-model='isPublished'
v-model='isPublished'
color='primary'
color='primary'
hint='Unpublished pages can still be seen by users having write permissions.'
hint='Unpublished pages can still be seen by users having write permissions
on this page
.'
persistent-hint
persistent-hint
)
)
v-flex(xs12, md4)
v-flex(xs12, md4)
...
@@ -191,9 +184,14 @@ import _ from 'lodash'
...
@@ -191,9 +184,14 @@ import _ from 'lodash'
import
{
sync
,
get
}
from
'vuex-pathify'
import
{
sync
,
get
}
from
'vuex-pathify'
export
default
{
export
default
{
props
:
{
value
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
data
()
{
return
{
return
{
isShown
:
false
,
isPublishStartShown
:
false
,
isPublishStartShown
:
false
,
isPublishEndShown
:
false
,
isPublishEndShown
:
false
,
namespaces
:
[
'en'
],
namespaces
:
[
'en'
],
...
@@ -206,6 +204,10 @@ export default {
...
@@ -206,6 +204,10 @@ export default {
}
}
},
},
computed
:
{
computed
:
{
isShown
:
{
get
()
{
return
this
.
value
},
set
(
val
)
{
this
.
$emit
(
'input'
,
val
)
}
},
darkMode
:
get
(
'site/dark'
),
darkMode
:
get
(
'site/dark'
),
mode
:
get
(
'editor/mode'
),
mode
:
get
(
'editor/mode'
),
title
:
sync
(
'page/title'
),
title
:
sync
(
'page/title'
),
...
@@ -217,17 +219,19 @@ export default {
...
@@ -217,17 +219,19 @@ export default {
publishStartDate
:
sync
(
'page/publishStartDate'
),
publishStartDate
:
sync
(
'page/publishStartDate'
),
publishEndDate
:
sync
(
'page/publishEndDate'
)
publishEndDate
:
sync
(
'page/publishEndDate'
)
},
},
mounted
()
{
watch
:
{
this
.
isShown
=
true
value
(
newValue
,
oldValue
)
{
if
(
newValue
)
{
_
.
delay
(()
=>
{
_
.
delay
(()
=>
{
this
.
$refs
.
iptTitle
.
focus
()
this
.
$refs
.
iptTitle
.
focus
()
// this.$tours['editorPropertiesTour'].start()
// this.$tours['editorPropertiesTour'].start()
},
500
)
},
500
)
}
}
},
},
methods
:
{
methods
:
{
close
()
{
close
()
{
this
.
isShown
=
false
this
.
isShown
=
false
this
.
$parent
.
$parent
.
closeModal
()
},
},
showPathSelector
()
{
showPathSelector
()
{
this
.
$store
.
commit
(
'showNotification'
,
{
this
.
$store
.
commit
(
'showNotification'
,
{
...
...
client/scss/pages/_new.scss
View file @
366a8352
.newpage
{
.newpage
{
background
:
linear-gradient
(
to
bottom
,
mc
(
'blue'
,
'900'
)
0%
,
mc
(
'blue'
,
'
8
00'
)
100%
);
background
:
linear-gradient
(
to
bottom
,
mc
(
'blue'
,
'900'
)
0%
,
mc
(
'blue'
,
'
5
00'
)
100%
);
height
:
100%
;
height
:
100%
;
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
...
...
client/scss/pages/_welcome.scss
View file @
366a8352
.onboarding
{
.onboarding
{
background
:
linear-gradient
(
to
bottom
,
mc
(
'grey'
,
'900'
)
0%
,
mc
(
'grey'
,
'
8
00'
)
100%
);
background
:
linear-gradient
(
to
bottom
,
mc
(
'grey'
,
'900'
)
0%
,
mc
(
'grey'
,
'
7
00'
)
100%
);
height
:
100%
;
height
:
100%
;
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
...
...
server/controllers/common.js
View file @
366a8352
...
@@ -98,7 +98,7 @@ router.get('/*', async (req, res, next) => {
...
@@ -98,7 +98,7 @@ router.get('/*', async (req, res, next) => {
}
else
if
(
pageArgs
.
path
===
'home'
)
{
}
else
if
(
pageArgs
.
path
===
'home'
)
{
res
.
render
(
'welcome'
)
res
.
render
(
'welcome'
)
}
else
{
}
else
{
res
.
render
(
'new'
,
{
pagePath
:
req
.
path
})
res
.
status
(
404
).
render
(
'new'
,
{
pagePath
:
req
.
path
})
}
}
})
})
...
...
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