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
0ace6969
Unverified
Commit
0ace6969
authored
Sep 16, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using the vuejs translate method
parent
415138e7
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
181 additions
and
212 deletions
+181
-212
DeleteComponent.vue
Modules/Core/Assets/js/components/DeleteComponent.vue
+5
-7
PageForm.vue
Modules/Page/Assets/js/components/PageForm.vue
+22
-23
PageTableServerSide.vue
Modules/Page/Assets/js/components/PageTableServerSide.vue
+8
-10
app.js
public/js/app.js
+146
-172
No files found.
Modules/Core/Assets/js/components/DeleteComponent.vue
View file @
0ace6969
...
@@ -3,9 +3,7 @@
...
@@ -3,9 +3,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
Translate
from
'
../../../../Core/Assets/js/mixins/Translate
'
export
default
{
export
default
{
mixins
:
[
Translate
],
props
:
{
props
:
{
rows
:
{
default
:
null
},
rows
:
{
default
:
null
},
scope
:
{
default
:
null
},
scope
:
{
default
:
null
},
...
@@ -19,8 +17,8 @@
...
@@ -19,8 +17,8 @@
methods
:
{
methods
:
{
deleteRow
(
event
)
{
deleteRow
(
event
)
{
this
.
$confirm
(
this
.
deleteMessage
,
this
.
deleteTitle
,
{
this
.
$confirm
(
this
.
deleteMessage
,
this
.
deleteTitle
,
{
confirmButtonText
:
this
.
translate
(
'
core
'
,
'
button.delete
'
),
confirmButtonText
:
this
.
$t
(
'
core.
button.delete
'
),
cancelButtonText
:
this
.
translate
(
'
core
'
,
'
button.cancel
'
),
cancelButtonText
:
this
.
$t
(
'
core.
button.cancel
'
),
type
:
'
warning
'
type
:
'
warning
'
}).
then
(()
=>
{
}).
then
(()
=>
{
let
vm
=
this
;
let
vm
=
this
;
...
@@ -44,14 +42,14 @@
...
@@ -44,14 +42,14 @@
}).
catch
(()
=>
{
}).
catch
(()
=>
{
this
.
$message
({
this
.
$message
({
type
:
'
info
'
,
type
:
'
info
'
,
message
:
this
.
translate
(
'
core
'
,
'
delete
cancelled
'
)
message
:
this
.
$t
(
'
core.delete-
cancelled
'
)
});
});
});
});
}
}
},
},
mounted
()
{
mounted
()
{
this
.
deleteMessage
=
this
.
translate
(
'
core
'
,
'
modal.confirmation-message
'
);
this
.
deleteMessage
=
this
.
$t
(
'
core.
modal.confirmation-message
'
);
this
.
deleteTitle
=
this
.
translate
(
'
core
'
,
'
modal.title
'
);
this
.
deleteTitle
=
this
.
$t
(
'
core.
modal.title
'
);
}
}
}
}
</
script
>
</
script
>
Modules/Page/Assets/js/components/PageForm.vue
View file @
0ace6969
...
@@ -2,15 +2,15 @@
...
@@ -2,15 +2,15 @@
<div
class=
"div"
>
<div
class=
"div"
>
<div
class=
"content-header"
>
<div
class=
"content-header"
>
<h1>
<h1>
{{
translate
(
'
page
'
,
pageTitle
)
}}
{{
$t
(
`page.${pageTitle
}
`
)
}}
<
/h1
>
<
/h1
>
<
el
-
breadcrumb
separator
=
"
/
"
>
<
el
-
breadcrumb
separator
=
"
/
"
>
<
el
-
breadcrumb
-
item
>
<
el
-
breadcrumb
-
item
>
<
a
href
=
"
/backend
"
>
Home
<
/a
>
<
a
href
=
"
/backend
"
>
Home
<
/a
>
<
/el-breadcrumb-item
>
<
/el-breadcrumb-item
>
<el-breadcrumb-item
:to=
"
{name: 'admin.page.page.index'}">
{{
translate
(
'
page
'
,
'
pages
'
)
}}
<
el
-
breadcrumb
-
item
:
to
=
"
{name: 'admin.page.page.index'
}
"
>
{{
$t
(
'
page.
pages
'
)
}}
<
/el-breadcrumb-item
>
<
/el-breadcrumb-item
>
<el-breadcrumb-item
:to=
"
{name: 'admin.page.page.create'}">
{{
translate
(
'
page
'
,
pageTitle
)
}}
<
el
-
breadcrumb
-
item
:
to
=
"
{name: 'admin.page.page.create'
}
"
>
{{
$t
(
`page.${pageTitle
}
`
)
}}
<
/el-breadcrumb-item
>
<
/el-breadcrumb-item
>
<
/el-breadcrumb
>
<
/el-breadcrumb
>
<
/div
>
<
/div
>
...
@@ -27,14 +27,14 @@
...
@@ -27,14 +27,14 @@
:
key
=
"
localeArray.name
"
>
:
key
=
"
localeArray.name
"
>
<
span
slot
=
"
label
"
:
class
=
"
{'error' : form.errors.has(locale)
}
"
>
{{
localeArray
.
name
<
span
slot
=
"
label
"
:
class
=
"
{'error' : form.errors.has(locale)
}
"
>
{{
localeArray
.
name
}}
<
/span
>
}}
<
/span
>
<el-form-item
:label=
"
translate('page', '
title')"
<
el
-
form
-
item
:
label
=
"
$t('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
"
><
/el-input
>
<
el
-
input
v
-
model
=
"
page[locale].title
"
><
/el-input
>
<
div
class
=
"
el-form-item__error
"
v
-
if
=
"
form.errors.has(locale + '.title')
"
<
div
class
=
"
el-form-item__error
"
v
-
if
=
"
form.errors.has(locale + '.title')
"
v
-
text
=
"
form.errors.first(locale + '.title')
"
><
/div
>
v
-
text
=
"
form.errors.first(locale + '.title')
"
><
/div
>
<
/el-form-item
>
<
/el-form-item
>
<el-form-item
:label=
"
translate('page', '
slug')"
<
el
-
form
-
item
:
label
=
"
$t('page.
slug')
"
:
class
=
"
{'el-form-item is-error': form.errors.has(locale + '.slug')
}
"
>
:
class
=
"
{'el-form-item is-error': form.errors.has(locale + '.slug')
}
"
>
<
el
-
input
v
-
model
=
"
page[locale].slug
"
>
<
el
-
input
v
-
model
=
"
page[locale].slug
"
>
<
el
-
button
slot
=
"
prepend
"
@
click
=
"
generateSlug($event, locale)
"
>
Generate
<
/el-button
>
<
el
-
button
slot
=
"
prepend
"
@
click
=
"
generateSlug($event, locale)
"
>
Generate
<
/el-button
>
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
v
-
text
=
"
form.errors.first(locale + '.slug')
"
><
/div
>
v
-
text
=
"
form.errors.first(locale + '.slug')
"
><
/div
>
<
/el-form-item
>
<
/el-form-item
>
<el-form-item
:label=
"
translate('page', '
body')"
<
el
-
form
-
item
:
label
=
"
$t('page.
body')
"
:
class
=
"
{'el-form-item is-error': form.errors.has(locale + '.body')
}
"
>
:
class
=
"
{'el-form-item is-error': form.errors.has(locale + '.body')
}
"
>
<
ckeditor
v
-
model
=
"
page[locale].body
"
:
value
=
"
page[locale].body
"
>
<
ckeditor
v
-
model
=
"
page[locale].body
"
:
value
=
"
page[locale].body
"
>
<
/ckeditor
>
<
/ckeditor
>
...
@@ -56,17 +56,17 @@
...
@@ -56,17 +56,17 @@
<
h4
class
=
"
box-title
"
>
<
h4
class
=
"
box-title
"
>
<
a
class
=
"
collapsed
"
data
-
toggle
=
"
collapse
"
data
-
parent
=
"
#accordion
"
<
a
class
=
"
collapsed
"
data
-
toggle
=
"
collapse
"
data
-
parent
=
"
#accordion
"
:
href
=
"
`#collapseMeta-${locale
}
`
"
>
:
href
=
"
`#collapseMeta-${locale
}
`
"
>
{{
translate
(
'
page
'
,
'
meta_data
'
)
}}
{{
$t
(
'
page.
meta_data
'
)
}}
<
/a
>
<
/a
>
<
/h4
>
<
/h4
>
<
/div
>
<
/div
>
<
div
style
=
"
height: 0px;
"
:
id
=
"
`collapseMeta-${locale
}
`
"
<
div
style
=
"
height: 0px;
"
:
id
=
"
`collapseMeta-${locale
}
`
"
class
=
"
panel-collapse collapse
"
>
class
=
"
panel-collapse collapse
"
>
<
div
class
=
"
box-body
"
>
<
div
class
=
"
box-body
"
>
<el-form-item
:label=
"
translate('page', '
meta_title')"
>
<
el
-
form
-
item
:
label
=
"
$t('page.
meta_title')
"
>
<
el
-
input
v
-
model
=
"
page[locale].meta_title
"
><
/el-input
>
<
el
-
input
v
-
model
=
"
page[locale].meta_title
"
><
/el-input
>
<
/el-form-item
>
<
/el-form-item
>
<el-form-item
:label=
"
translate('page', '
meta_description')"
>
<
el
-
form
-
item
:
label
=
"
$t('page.
meta_description')
"
>
<
el
-
input
type
=
"
textarea
"
<
el
-
input
type
=
"
textarea
"
v
-
model
=
"
page[locale].meta_description
"
><
/el-input
>
v
-
model
=
"
page[locale].meta_description
"
><
/el-input
>
<
/el-form-item
>
<
/el-form-item
>
...
@@ -79,28 +79,28 @@
...
@@ -79,28 +79,28 @@
<
h4
class
=
"
box-title
"
>
<
h4
class
=
"
box-title
"
>
<
a
class
=
"
collapsed
"
data
-
toggle
=
"
collapse
"
data
-
parent
=
"
#accordion
"
<
a
class
=
"
collapsed
"
data
-
toggle
=
"
collapse
"
data
-
parent
=
"
#accordion
"
:
href
=
"
`#collapseFacebook-${locale
}
`
"
>
:
href
=
"
`#collapseFacebook-${locale
}
`
"
>
{{
translate
(
'
page
'
,
'
facebook_data
'
)
}}
{{
$t
(
'
page.
facebook_data
'
)
}}
<
/a
>
<
/a
>
<
/h4
>
<
/h4
>
<
/div
>
<
/div
>
<
div
style
=
"
height: 0px;
"
:
id
=
"
`collapseFacebook-${locale
}
`
"
<
div
style
=
"
height: 0px;
"
:
id
=
"
`collapseFacebook-${locale
}
`
"
class
=
"
panel-collapse collapse
"
>
class
=
"
panel-collapse collapse
"
>
<
div
class
=
"
box-body
"
>
<
div
class
=
"
box-body
"
>
<el-form-item
:label=
"
translate('page', '
og_title')"
>
<
el
-
form
-
item
:
label
=
"
$t('page.
og_title')
"
>
<
el
-
input
v
-
model
=
"
page[locale].og_title
"
><
/el-input
>
<
el
-
input
v
-
model
=
"
page[locale].og_title
"
><
/el-input
>
<
/el-form-item
>
<
/el-form-item
>
<el-form-item
:label=
"
translate('page', '
og_description')"
>
<
el
-
form
-
item
:
label
=
"
$t('page.
og_description')
"
>
<
el
-
input
type
=
"
textarea
"
<
el
-
input
type
=
"
textarea
"
v
-
model
=
"
page[locale].og_description
"
><
/el-input
>
v
-
model
=
"
page[locale].og_description
"
><
/el-input
>
<
/el-form-item
>
<
/el-form-item
>
<el-form-item
:label=
"
translate('page', '
og_type')"
>
<
el
-
form
-
item
:
label
=
"
$t('page.
og_type')
"
>
<
el
-
select
v
-
model
=
"
page[locale].og_type
"
<
el
-
select
v
-
model
=
"
page[locale].og_type
"
:placeholder=
"
translate('page', '
og_type')"
>
:
placeholder
=
"
$t('page.
og_type')
"
>
<el-option
:label=
"
translate('page', '
facebook-types.website')"
<
el
-
option
:
label
=
"
$t('page.
facebook-types.website')
"
value
=
"
website
"
><
/el-option
>
value
=
"
website
"
><
/el-option
>
<el-option
:label=
"
translate('page', '
facebook-types.product')"
<
el
-
option
:
label
=
"
$t('page.
facebook-types.product')
"
value
=
"
product
"
><
/el-option
>
value
=
"
product
"
><
/el-option
>
<el-option
:label=
"
translate('page', '
facebook-types.article')"
<
el
-
option
:
label
=
"
$t('page.
facebook-types.article')
"
value
=
"
article
"
><
/el-option
>
value
=
"
article
"
><
/el-option
>
<
/el-select
>
<
/el-select
>
<
/el-form-item
>
<
/el-form-item
>
...
@@ -110,9 +110,9 @@
...
@@ -110,9 +110,9 @@
<
el
-
form
-
item
>
<
el
-
form
-
item
>
<
el
-
button
type
=
"
primary
"
@
click
=
"
onSubmit()
"
:
loading
=
"
loading
"
>
<
el
-
button
type
=
"
primary
"
@
click
=
"
onSubmit()
"
:
loading
=
"
loading
"
>
{{
translate
(
'
core
'
,
'
save
'
)
}}
{{
$t
(
'
core.
save
'
)
}}
<
/el-button
>
<
/el-button
>
<el-button
@
click=
"onCancel()"
>
{{
translate
(
'
core
'
,
'
button.cancel
'
)
}}
<
el
-
button
@
click
=
"
onCancel()
"
>
{{
$t
(
'
core.
button.cancel
'
)
}}
<
/el-button
>
<
/el-button
>
<
/el-form-item
>
<
/el-form-item
>
...
@@ -126,9 +126,9 @@
...
@@ -126,9 +126,9 @@
<
div
class
=
"
box-body
"
>
<
div
class
=
"
box-body
"
>
<
el
-
form
-
item
label
=
""
>
<
el
-
form
-
item
label
=
""
>
<
el
-
checkbox
v
-
model
=
"
page.is_home
"
:
true
-
label
=
"
1
"
:
false
-
label
=
"
0
"
name
=
"
is_home
"
<
el
-
checkbox
v
-
model
=
"
page.is_home
"
:
true
-
label
=
"
1
"
:
false
-
label
=
"
0
"
name
=
"
is_home
"
:label=
"
translate('page', 'is
homepage')"
></el-checkbox>
:
label
=
"
$t('page.is_
homepage')
"
><
/el-checkbox
>
<
/el-form-item
>
<
/el-form-item
>
<el-form-item
:label=
"
translate('page', '
template')"
<
el
-
form
-
item
:
label
=
"
$t('page.
template')
"
:
class
=
"
{'el-form-item is-error': form.errors.has('template')
}
"
>
:
class
=
"
{'el-form-item is-error': form.errors.has('template')
}
"
>
<
el
-
select
v
-
model
=
"
page.template
"
filterable
>
<
el
-
select
v
-
model
=
"
page.template
"
filterable
>
<
el
-
option
v
-
for
=
"
(template, key) in templates
"
:
key
=
"
template
"
<
el
-
option
v
-
for
=
"
(template, key) in templates
"
:
key
=
"
template
"
...
@@ -148,12 +148,11 @@
...
@@ -148,12 +148,11 @@
<
script
>
<
script
>
import
axios
from
'
axios
'
import
axios
from
'
axios
'
import
Translate
from
'
../../../../Core/Assets/js/mixins/Translate
'
import
Slugify
from
'
../../../../Core/Assets/js/mixins/Slugify
'
import
Slugify
from
'
../../../../Core/Assets/js/mixins/Slugify
'
import
Form
from
'
form-backend-validation
'
import
Form
from
'
form-backend-validation
'
export
default
{
export
default
{
mixins
:
[
Translate
,
Slugify
],
mixins
:
[
Slugify
],
props
:
{
props
:
{
locales
:
{
default
:
null
}
,
locales
:
{
default
:
null
}
,
pageTitle
:
{
default
:
null
,
String
}
,
pageTitle
:
{
default
:
null
,
String
}
,
...
...
Modules/Page/Assets/js/components/PageTableServerSide.vue
View file @
0ace6969
...
@@ -2,13 +2,13 @@
...
@@ -2,13 +2,13 @@
<div
class=
"div"
>
<div
class=
"div"
>
<div
class=
"content-header"
>
<div
class=
"content-header"
>
<h1>
<h1>
{{
translate
(
'
page
'
,
'
pages
'
)
}}
{{
$t
(
'
page.
pages
'
)
}}
</h1>
</h1>
<el-breadcrumb
separator=
"/"
>
<el-breadcrumb
separator=
"/"
>
<el-breadcrumb-item>
<el-breadcrumb-item>
<a
href=
"/backend"
>
Home
</a>
<a
href=
"/backend"
>
Home
</a>
</el-breadcrumb-item>
</el-breadcrumb-item>
<el-breadcrumb-item
:to=
"
{name: 'admin.page.page.index'}">
{{
translate
(
'
page
'
,
'
pages
'
)
}}
</el-breadcrumb-item>
<el-breadcrumb-item
:to=
"
{name: 'admin.page.page.index'}">
{{
$t
(
'
page.
pages
'
)
}}
</el-breadcrumb-item>
</el-breadcrumb>
</el-breadcrumb>
</div>
</div>
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
<div
class=
"actions el-col el-col-5"
>
<div
class=
"actions el-col el-col-5"
>
<router-link
:to=
"
{name: 'admin.page.page.create'}">
<router-link
:to=
"
{name: 'admin.page.page.create'}">
<el-button
type=
"primary"
><i
class=
"el-icon-edit"
></i>
<el-button
type=
"primary"
><i
class=
"el-icon-edit"
></i>
{{
translate
(
'
page
'
,
'
create
page
'
)
}}
{{
$t
(
'
page.create-
page
'
)
}}
</el-button>
</el-button>
</router-link>
</router-link>
</div>
</div>
...
@@ -39,18 +39,18 @@
...
@@ -39,18 +39,18 @@
@
sort-change=
"handleSortChange"
>
@
sort-change=
"handleSortChange"
>
<el-table-column
prop=
"id"
label=
"Id"
width=
"100"
sortable=
"custom"
>
<el-table-column
prop=
"id"
label=
"Id"
width=
"100"
sortable=
"custom"
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"translations.title"
:label=
"
translate('page', '
title')"
>
<el-table-column
prop=
"translations.title"
:label=
"
$t('page.
title')"
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"translations.slug"
label=
"Slug
"
>
<el-table-column
prop=
"translations.slug"
:label=
"$t('page.slug')
"
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"created_at"
label=
"Created at
"
sortable=
"custom"
>
<el-table-column
prop=
"created_at"
:label=
"$t('core.created_at')
"
sortable=
"custom"
>
</el-table-column>
</el-table-column>
<el-table-column
fixed=
"right"
prop=
"actions"
label=
"Actions
"
>
<el-table-column
fixed=
"right"
prop=
"actions"
:label=
"$t('core.actions')
"
>
<template
scope=
"scope"
>
<template
scope=
"scope"
>
<a
class=
"btn btn-default btn-flat"
@
click
.
prevent=
"goToEdit(scope)"
><i
<a
class=
"btn btn-default btn-flat"
@
click
.
prevent=
"goToEdit(scope)"
><i
class=
"fa fa-pencil"
></i></a>
class=
"fa fa-pencil"
></i></a>
<delete-button
:scope=
"scope"
:rows=
"data"
:translations=
"translations"
>
<delete-button
:scope=
"scope"
:rows=
"data"
>
</delete-button>
</delete-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -76,13 +76,11 @@
...
@@ -76,13 +76,11 @@
<
script
>
<
script
>
import
axios
from
'
axios
'
import
axios
from
'
axios
'
import
Translate
from
'
../../../../Core/Assets/js/mixins/Translate
'
import
_
from
"
lodash
"
;
import
_
from
"
lodash
"
;
let
data
;
let
data
;
export
default
{
export
default
{
mixins
:
[
Translate
],
data
()
{
data
()
{
return
{
return
{
data
,
data
,
...
...
public/js/app.js
View file @
0ace6969
This diff is collapsed.
Click to expand it.
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