Use the `pages` key for page module instead of singular page.

This brings the plural used in permissions.php and everything else in sync.
parent 5a48554d
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<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'}">{{ trans('page.pages') }} <el-breadcrumb-item :to="{name: 'admin.page.page.index'}">{{ trans('pages.pages') }}
</el-breadcrumb-item> </el-breadcrumb-item>
<el-breadcrumb-item :to="{name: 'admin.page.page.create'}">{{ trans(`page.${pageTitle}`) }} <el-breadcrumb-item :to="{name: 'admin.page.page.create'}">{{ trans(`page.${pageTitle}`) }}
</el-breadcrumb-item> </el-breadcrumb-item>
...@@ -27,14 +27,14 @@ ...@@ -27,14 +27,14 @@
:key="localeArray.name" :name="locale"> :key="localeArray.name" :name="locale">
<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="trans('page.title')" <el-form-item :label="trans('pages.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="trans('page.slug')" <el-form-item :label="trans('pages.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="trans('page.body')" <el-form-item :label="trans('pages.body')"
:class="{'el-form-item is-error': form.errors.has(locale + '.body') }"> :class="{'el-form-item is-error': form.errors.has(locale + '.body') }">
<component :is="getCurrentEditor()" v-model="page[locale].body" :value="page[locale].body"> <component :is="getCurrentEditor()" v-model="page[locale].body" :value="page[locale].body">
</component> </component>
...@@ -52,9 +52,9 @@ ...@@ -52,9 +52,9 @@
v-text="form.errors.first(locale + '.body')"></div> v-text="form.errors.first(locale + '.body')"></div>
</el-form-item> </el-form-item>
<el-form-item :label="trans('page.status')" <el-form-item :label="trans('pages.status')"
:class="{'el-form-item is-error': form.errors.has(locale + '.status') }"> :class="{'el-form-item is-error': form.errors.has(locale + '.status') }">
<el-checkbox v-model="page[locale].status">{{ trans('page.status') }}</el-checkbox> <el-checkbox v-model="page[locale].status">{{ trans('pages.status') }}</el-checkbox>
<div class="el-form-item__error" v-if="form.errors.has(locale + '.status')" <div class="el-form-item__error" v-if="form.errors.has(locale + '.status')"
v-text="form.errors.first(locale + '.status')"></div> v-text="form.errors.first(locale + '.status')"></div>
</el-form-item> </el-form-item>
...@@ -64,17 +64,17 @@ ...@@ -64,17 +64,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}`">
{{ trans('page.meta_data') }} {{ trans('pages.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="trans('page.meta_title')"> <el-form-item :label="trans('pages.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="trans('page.meta_description')"> <el-form-item :label="trans('pages.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>
...@@ -87,28 +87,28 @@ ...@@ -87,28 +87,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}`">
{{ trans('page.facebook_data') }} {{ trans('pages.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="trans('page.og_title')"> <el-form-item :label="trans('pages.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="trans('page.og_description')"> <el-form-item :label="trans('pages.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="trans('page.og_type')"> <el-form-item :label="trans('pages.og_type')">
<el-select v-model="page[locale].og_type" <el-select v-model="page[locale].og_type"
:placeholder="trans('page.og_type')"> :placeholder="trans('pages.og_type')">
<el-option :label="trans('page.facebook-types.website')" <el-option :label="trans('pages.facebook-types.website')"
value="website"></el-option> value="website"></el-option>
<el-option :label="trans('page.facebook-types.product')" <el-option :label="trans('pages.facebook-types.product')"
value="product"></el-option> value="product"></el-option>
<el-option :label="trans('page.facebook-types.article')" <el-option :label="trans('pages.facebook-types.article')"
value="article"></el-option> value="article"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -134,9 +134,9 @@ ...@@ -134,9 +134,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="trans('page.is homepage')"></el-checkbox> :label="trans('pages.is homepage')"></el-checkbox>
</el-form-item> </el-form-item>
<el-form-item :label="trans('page.template')" <el-form-item :label="trans('pages.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"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<data-tables :data="data" :actions-def="actionsDef"> <data-tables :data="data" :actions-def="actionsDef">
<el-table-column prop="id" label="Id" width="100"> <el-table-column prop="id" label="Id" width="100">
</el-table-column> </el-table-column>
<el-table-column prop="title" :label="trans('page.title')"> <el-table-column prop="title" :label="trans('pages.title')">
</el-table-column> </el-table-column>
<el-table-column prop="slug" label="Slug"> <el-table-column prop="slug" label="Slug">
</el-table-column> </el-table-column>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</template> </template>
<script> <script>
import axios from 'axios' import axios from 'axios';
let data; let data;
...@@ -42,30 +42,30 @@ ...@@ -42,30 +42,30 @@
links: {}, links: {},
actionsDef: { actionsDef: {
def: [{ def: [{
name: this.trans('page.create-page'), name: this.trans('pages.create-page'),
icon: 'edit', icon: 'edit',
handler: () => { handler: () => {
this.$router.push({name: 'admin.page.page.create'}) this.$router.push({ name: 'admin.page.page.create' });
} },
}] }],
} },
} };
}, },
methods: { methods: {
fetchData() { fetchData() {
axios.get(route('api.page.page.index')) axios.get(route('api.page.page.index'))
.then(response => { .then((response) => {
this.data = response.data.data; this.data = response.data.data;
this.meta = response.data.meta; this.meta = response.data.meta;
this.links = response.data.links; this.links = response.data.links;
}); });
}, },
goToEdit(scope) { goToEdit(scope) {
this.$router.push({name: 'admin.page.page.edit', params: {pageId: scope.row.id}}) this.$router.push({ name: 'admin.page.page.edit', params: { pageId: scope.row.id } });
}, },
}, },
mounted() { mounted() {
this.fetchData(); this.fetchData();
} },
} };
</script> </script>
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
<div class="div"> <div class="div">
<div class="content-header"> <div class="content-header">
<h1> <h1>
{{ trans('page.pages') }} {{ trans('pages.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'}">{{ trans('page.pages') }}</el-breadcrumb-item> <el-breadcrumb-item :to="{name: 'admin.page.page.index'}">{{ trans('pages.pages') }}</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</div> </div>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</el-dropdown> </el-dropdown>
<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>
{{ trans('page.create page') }} {{ trans('pages.create page') }}
</el-button> </el-button>
</router-link> </router-link>
</div> </div>
...@@ -52,21 +52,21 @@ ...@@ -52,21 +52,21 @@
type="selection" type="selection"
width="55"> width="55">
</el-table-column> </el-table-column>
<el-table-column :label="trans('page.status')" width="100"> <el-table-column :label="trans('pages.status')" width="100">
<template scope="scope"> <template scope="scope">
<i class="el-icon-fa-circle" :class="(scope.row.translations.status === true) ? 'text-success':'text-danger'"></i> <i class="el-icon-fa-circle" :class="(scope.row.translations.status === true) ? 'text-success':'text-danger'"></i>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="id" label="Id" width="75" sortable="custom"> <el-table-column prop="id" label="Id" width="75" sortable="custom">
</el-table-column> </el-table-column>
<el-table-column prop="translations.title" :label="trans('page.title')"> <el-table-column prop="translations.title" :label="trans('pages.title')">
<template scope="scope"> <template scope="scope">
<a @click.prevent="goToEdit(scope)" href="#"> <a @click.prevent="goToEdit(scope)" href="#">
{{ scope.row.translations.title }} {{ scope.row.translations.title }}
</a> </a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="translations.slug" :label="trans('page.slug')"> <el-table-column prop="translations.slug" :label="trans('pages.slug')">
<template scope="scope"> <template scope="scope">
<a @click.prevent="goToEdit(scope)" href="#"> <a @click.prevent="goToEdit(scope)" href="#">
{{ scope.row.translations.slug }} {{ scope.row.translations.slug }}
......
...@@ -6,6 +6,7 @@ use Illuminate\Support\Facades\Config; ...@@ -6,6 +6,7 @@ use Illuminate\Support\Facades\Config;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use Modules\Core\Events\BuildingSidebar; use Modules\Core\Events\BuildingSidebar;
use Modules\Core\Events\CollectingAssets; use Modules\Core\Events\CollectingAssets;
use Modules\Core\Events\LoadingBackendTranslations;
use Modules\Core\Traits\CanGetSidebarClassForModule; use Modules\Core\Traits\CanGetSidebarClassForModule;
use Modules\Core\Traits\CanPublishConfiguration; use Modules\Core\Traits\CanPublishConfiguration;
use Modules\Page\Console\CreatePagesCommand; use Modules\Page\Console\CreatePagesCommand;
...@@ -40,6 +41,10 @@ class PageServiceProvider extends ServiceProvider ...@@ -40,6 +41,10 @@ class PageServiceProvider extends ServiceProvider
BuildingSidebar::class, BuildingSidebar::class,
$this->getSidebarClassForModule('page', RegisterPageSidebar::class) $this->getSidebarClassForModule('page', RegisterPageSidebar::class)
); );
$this->app['events']->listen(LoadingBackendTranslations::class, function (LoadingBackendTranslations $event) {
$event->load('pages', array_dot(trans('page::pages')));
});
} }
public function boot() public function boot()
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment