Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
96c2fcf2
Unverified
Commit
96c2fcf2
authored
Sep 13, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding tge tags component
parent
a0328ddb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
PageForm.vue
Modules/Page/Assets/js/components/PageForm.vue
+16
-7
No files found.
Modules/Page/Assets/js/components/PageForm.vue
View file @
96c2fcf2
<
template
>
<
template
>
<el-form
ref=
"form"
:model=
"page"
label-width=
"120px"
label-position=
"top"
>
<el-form
ref=
"form"
:model=
"page"
label-width=
"120px"
label-position=
"top"
@
keydown=
"form.errors.clear($event.target.name);"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-10"
>
<div
class=
"col-md-10"
>
<div
class=
"box box-primary"
>
<div
class=
"box box-primary"
>
<div
class=
"box-body"
>
<div
class=
"box-body"
>
<el-tabs
type=
"card"
>
<el-tabs
type=
"card"
>
<el-tab-pane
:label=
"localeArray.name"
v-for=
"(localeArray, locale) in locales"
:key=
"localeArray.name"
class=
"asd"
<el-tab-pane
:label=
"localeArray.name"
v-for=
"(localeArray, locale) in locales"
:key=
"localeArray.name"
>
:class=
"
{'has-error' : form.errors.has(locale)}"
>
<span
slot=
"label"
:class=
"
{'error' : form.errors.has(locale)}">
{{
localeArray
.
name
}}
</span
>
<el-form-item
:label=
"translate('page', 'title')"
<el-form-item
:label=
"translate('page', 'title')"
:class=
"
{'el-form-item is-error': form.errors.has(locale + '.title') }">
:class=
"
{'el-form-item is-error': form.errors.has(locale + '.title') }">
<el-input
v-model=
"page[locale].title"
@
change=
"slugifyTitle($event, locale)"
></el-input>
<el-input
v-model=
"page[locale].title"
@
change=
"slugifyTitle($event, locale)"
></el-input>
...
@@ -69,7 +69,6 @@
...
@@ -69,7 +69,6 @@
<el-option
:label=
"translate('page', 'facebook-types.article')"
value=
"article"
></el-option>
<el-option
:label=
"translate('page', 'facebook-types.article')"
value=
"article"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<tags-input
namespace=
"asgardcms/page"
></tags-input>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -97,6 +96,7 @@
...
@@ -97,6 +96,7 @@
</el-select>
</el-select>
<div
class=
"el-form-item__error"
v-if=
"form.errors.has('template')"
v-text=
"form.errors.first('template')"
></div>
<div
class=
"el-form-item__error"
v-if=
"form.errors.has('template')"
v-text=
"form.errors.first('template')"
></div>
</el-form-item>
</el-form-item>
<tags-input
namespace=
"asgardcms/page"
@
input=
"setTags"
></tags-input>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -139,16 +139,22 @@
...
@@ -139,16 +139,22 @@
},
},
form
:
new
Form
(),
form
:
new
Form
(),
loading
:
false
,
loading
:
false
,
tags
:
{},
}
}
},
},
methods
:
{
methods
:
{
onSubmit
()
{
onSubmit
()
{
this
.
form
=
new
Form
(
this
.
page
);
this
.
form
=
new
Form
(
_
.
merge
(
this
.
page
,
{
tags
:
this
.
tags
})
);
let
vm
=
this
;
let
vm
=
this
;
this
.
loading
=
true
;
this
.
loading
=
true
;
this
.
form
.
post
(
route
(
'
api.page.page.store
'
))
this
.
form
.
post
(
route
(
'
api.page.page.store
'
))
.
then
(
response
=>
{
.
then
(
response
=>
{
this
.
loading
=
false
;
this
.
loading
=
false
;
vm
.
$message
({
type
:
'
success
'
,
message
:
response
.
data
.
message
});
window
.
location
=
route
(
'
admin.page.page.index
'
);
})
})
.
catch
(
error
=>
{
.
catch
(
error
=>
{
this
.
loading
=
false
;
this
.
loading
=
false
;
...
@@ -158,7 +164,7 @@
...
@@ -158,7 +164,7 @@
});
});
});
});
},
},
setPageTyp
es
()
{
fetchTemplat
es
()
{
axios
.
get
(
route
(
'
api.page.page-templates.index
'
))
axios
.
get
(
route
(
'
api.page.page-templates.index
'
))
.
then
(
response
=>
{
.
then
(
response
=>
{
this
.
templates
=
response
.
data
;
this
.
templates
=
response
.
data
;
...
@@ -166,10 +172,13 @@
...
@@ -166,10 +172,13 @@
},
},
slugifyTitle
(
event
,
locale
)
{
slugifyTitle
(
event
,
locale
)
{
this
.
page
[
locale
].
slug
=
this
.
slugify
(
event
);
this
.
page
[
locale
].
slug
=
this
.
slugify
(
event
);
},
setTags
(
tags
)
{
this
.
tags
=
tags
;
}
}
},
},
mounted
()
{
mounted
()
{
this
.
setPageTyp
es
();
this
.
fetchTemplat
es
();
}
}
}
}
</
script
>
</
script
>
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