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 @@
<el-breadcrumb-item>
<a href="/backend">Home</a>
</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 :to="{name: 'admin.page.page.create'}">{{ trans(`page.${pageTitle}`) }}
</el-breadcrumb-item>
......@@ -27,14 +27,14 @@
:key="localeArray.name" :name="locale">
<span slot="label" :class="{'error' : form.errors.has(locale)}">{{ localeArray.name
}}</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') }">
<el-input v-model="page[locale].title"></el-input>
<div class="el-form-item__error" v-if="form.errors.has(locale + '.title')"
v-text="form.errors.first(locale + '.title')"></div>
</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') }">
<el-input v-model="page[locale].slug">
<el-button slot="prepend" @click="generateSlug($event, locale)">Generate</el-button>
......@@ -43,7 +43,7 @@
v-text="form.errors.first(locale + '.slug')"></div>
</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') }">
<component :is="getCurrentEditor()" v-model="page[locale].body" :value="page[locale].body">
</component>
......@@ -52,9 +52,9 @@
v-text="form.errors.first(locale + '.body')"></div>
</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') }">
<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')"
v-text="form.errors.first(locale + '.status')"></div>
</el-form-item>
......@@ -64,17 +64,17 @@
<h4 class="box-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion"
:href="`#collapseMeta-${locale}`">
{{ trans('page.meta_data') }}
{{ trans('pages.meta_data') }}
</a>
</h4>
</div>
<div style="height: 0px;" :id="`collapseMeta-${locale}`"
class="panel-collapse collapse">
<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-form-item>
<el-form-item :label="trans('page.meta_description')">
<el-form-item :label="trans('pages.meta_description')">
<el-input type="textarea"
v-model="page[locale].meta_description"></el-input>
</el-form-item>
......@@ -87,28 +87,28 @@
<h4 class="box-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion"
:href="`#collapseFacebook-${locale}`">
{{ trans('page.facebook_data') }}
{{ trans('pages.facebook_data') }}
</a>
</h4>
</div>
<div style="height: 0px;" :id="`collapseFacebook-${locale}`"
class="panel-collapse collapse">
<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-form-item>
<el-form-item :label="trans('page.og_description')">
<el-form-item :label="trans('pages.og_description')">
<el-input type="textarea"
v-model="page[locale].og_description"></el-input>
</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"
:placeholder="trans('page.og_type')">
<el-option :label="trans('page.facebook-types.website')"
:placeholder="trans('pages.og_type')">
<el-option :label="trans('pages.facebook-types.website')"
value="website"></el-option>
<el-option :label="trans('page.facebook-types.product')"
<el-option :label="trans('pages.facebook-types.product')"
value="product"></el-option>
<el-option :label="trans('page.facebook-types.article')"
<el-option :label="trans('pages.facebook-types.article')"
value="article"></el-option>
</el-select>
</el-form-item>
......@@ -134,9 +134,9 @@
<div class="box-body">
<el-form-item label="">
<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 :label="trans('page.template')"
<el-form-item :label="trans('pages.template')"
:class="{'el-form-item is-error': form.errors.has('template') }">
<el-select v-model="page.template" filterable>
<el-option v-for="(template, key) in templates" :key="template"
......
......@@ -6,7 +6,7 @@
<data-tables :data="data" :actions-def="actionsDef">
<el-table-column prop="id" label="Id" width="100">
</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 prop="slug" label="Slug">
</el-table-column>
......@@ -29,7 +29,7 @@
</template>
<script>
import axios from 'axios'
import axios from 'axios';
let data;
......@@ -42,30 +42,30 @@
links: {},
actionsDef: {
def: [{
name: this.trans('page.create-page'),
name: this.trans('pages.create-page'),
icon: 'edit',
handler: () => {
this.$router.push({name: 'admin.page.page.create'})
}
}]
}
}
this.$router.push({ name: 'admin.page.page.create' });
},
}],
},
};
},
methods: {
fetchData() {
axios.get(route('api.page.page.index'))
.then(response => {
.then((response) => {
this.data = response.data.data;
this.meta = response.data.meta;
this.links = response.data.links;
});
},
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() {
this.fetchData();
}
}
},
};
</script>
......@@ -2,13 +2,13 @@
<div class="div">
<div class="content-header">
<h1>
{{ trans('page.pages') }}
{{ trans('pages.pages') }}
</h1>
<el-breadcrumb separator="/">
<el-breadcrumb-item>
<a href="/backend">Home</a>
</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>
</div>
......@@ -30,7 +30,7 @@
</el-dropdown>
<router-link :to="{name: 'admin.page.page.create'}">
<el-button type="primary"><i class="el-icon-edit"></i>
{{ trans('page.create page') }}
{{ trans('pages.create page') }}
</el-button>
</router-link>
</div>
......@@ -52,21 +52,21 @@
type="selection"
width="55">
</el-table-column>
<el-table-column :label="trans('page.status')" width="100">
<el-table-column :label="trans('pages.status')" width="100">
<template scope="scope">
<i class="el-icon-fa-circle" :class="(scope.row.translations.status === true) ? 'text-success':'text-danger'"></i>
</template>
</el-table-column>
<el-table-column prop="id" label="Id" width="75" sortable="custom">
</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">
<a @click.prevent="goToEdit(scope)" href="#">
{{ scope.row.translations.title }}
</a>
</template>
</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">
<a @click.prevent="goToEdit(scope)" href="#">
{{ scope.row.translations.slug }}
......
......@@ -6,6 +6,7 @@ use Illuminate\Support\Facades\Config;
use Illuminate\Support\ServiceProvider;
use Modules\Core\Events\BuildingSidebar;
use Modules\Core\Events\CollectingAssets;
use Modules\Core\Events\LoadingBackendTranslations;
use Modules\Core\Traits\CanGetSidebarClassForModule;
use Modules\Core\Traits\CanPublishConfiguration;
use Modules\Page\Console\CreatePagesCommand;
......@@ -40,6 +41,10 @@ class PageServiceProvider extends ServiceProvider
BuildingSidebar::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()
......
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