CMS implemented
This commit is contained in:
parent
b1285fa243
commit
9ca97aa594
|
|
@ -1,5 +0,0 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
];
|
||||
|
|
@ -201,7 +201,7 @@ return [
|
|||
'name' => 'admin::app.layouts.cms',
|
||||
'route' => 'admin.cms.index',
|
||||
'sort' => 6,
|
||||
'icon-class' => 'promotion-icon',
|
||||
'icon-class' => 'cms-icon',
|
||||
], [
|
||||
'key' => 'cms.pages',
|
||||
'name' => 'admin::app.cms.pages.pages',
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class CMSPageDataGrid extends DataGrid
|
|||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('cms_pages')->select('id', 'url_key', 'layout');
|
||||
$queryBuilder = DB::table('cms_pages')->select('id', 'url_key', 'page_title');
|
||||
|
||||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
|
@ -45,19 +45,12 @@ class CMSPageDataGrid extends DataGrid
|
|||
]);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'layout',
|
||||
'label' => trans('admin::app.datagrid.layout'),
|
||||
'index' => 'page_title',
|
||||
'label' => trans('admin::app.cms.pages.page-title'),
|
||||
'type' => 'string',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
'wrapper' => function($row) {
|
||||
foreach(config('cms') as $key => $value) {
|
||||
if ($row->layout == $value) {
|
||||
return $key;
|
||||
}
|
||||
}
|
||||
}
|
||||
'filterable' => true
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use Excel;
|
|||
class ExportController extends Controller
|
||||
{
|
||||
protected $exportableGrids = [
|
||||
'OrderDataGrid', 'OrderInvoicesDataGrid', 'OrderShipmentsDataGrid', 'CustomerDataGrid', 'TaxRateDataGrid', 'ProductDataGrid'
|
||||
'OrderDataGrid', 'OrderInvoicesDataGrid', 'OrderShipmentsDataGrid', 'CustomerDataGrid', 'TaxRateDataGrid', 'ProductDataGrid', 'CMSPageDataGrid'
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -37,6 +37,7 @@ class ExportController extends Controller
|
|||
public function export()
|
||||
{
|
||||
$criteria = request()->all();
|
||||
|
||||
$format = $criteria['format'];
|
||||
|
||||
$gridName = explode('\\', $criteria['gridName']);
|
||||
|
|
|
|||
|
|
@ -683,7 +683,7 @@ Route::group(['middleware' => ['web']], function () {
|
|||
'view' => 'admin::cms.index'
|
||||
])->name('admin.cms.index');
|
||||
|
||||
Route::get('preview', 'Webkul\CMS\Http\Controllers\Admin\PageController@preview')->name('admin.cms.preview');
|
||||
Route::get('preview/{url_key}', 'Webkul\CMS\Http\Controllers\Admin\PageController@preview')->name('admin.cms.preview');
|
||||
|
||||
Route::get('create', 'Webkul\CMS\Http\Controllers\Admin\PageController@create')->defaults('_config', [
|
||||
'view' => 'admin::cms.create'
|
||||
|
|
|
|||
|
|
@ -995,7 +995,11 @@ return [
|
|||
'meta_title' => 'Meta Title',
|
||||
'delete-success' => 'CMS page deleted successfully',
|
||||
'delete-failure' => 'CMS page cannot be deleted',
|
||||
'preview' => 'Preview'
|
||||
'preview' => 'Preview',
|
||||
'one-col' => '<div class="mt-10">Use class: <b>"static-container one-column"</b> for one column layout.</div>',
|
||||
'two-col' => '<div class="mt-10">Use class: <b>"static-container two-column"</b> for two column layout.</div>',
|
||||
'three-col' => '<div class="mt-10">Use class: <b>"static-container three-column"</b> for three column layout.</div>',
|
||||
'helper-classes' => 'Helper Classes'
|
||||
]
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -67,27 +67,22 @@
|
|||
<span class="control-error" v-if="errors.has('url_key')">@{{ errors.first('url_key') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('layout') ? 'has-error' : '']">
|
||||
<label for="layout" class="required">{{ __('admin::app.cms.pages.layout') }}</label>
|
||||
<div class="control-group" :class="[errors.has('html_content') ? 'has-error' : '']">
|
||||
<label for="html_content" class="required">{{ __('admin::app.cms.pages.content') }}</label>
|
||||
|
||||
@foreach(config('cms') as $key => $value)
|
||||
<span class="radio">
|
||||
<input type="radio" id="layout" name="layout" value="{{ $value }}" v-validate="'required'">
|
||||
<textarea type="text" class="control" id="content" name="html_content" v-validate="'required'" value="{{ old('html_content') }}" data-vv-as=""{{ __('admin::app.cms.pages.content') }}""></textarea>
|
||||
|
||||
<label class="radio-view" for="layout"></label>
|
||||
{{ $key }}
|
||||
</span>
|
||||
@endforeach
|
||||
{!! __('admin::app.cms.pages.one-col') !!}
|
||||
{!! __('admin::app.cms.pages.two-col') !!}
|
||||
{!! __('admin::app.cms.pages.three-col') !!}
|
||||
|
||||
<span class="control-error" v-if="errors.has('layout')">@{{ errors.first('layout') }}</span>
|
||||
</div>
|
||||
<div class="mt-10 mb-10" @submit.prevent="showModal('showHelpers')">
|
||||
<button class="btn btn-sm btn-primary">
|
||||
{{ __('admin::app.cms.pages.helper-classes') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('content') ? 'has-error' : '']">
|
||||
<label for="content" class="required">{{ __('admin::app.cms.pages.content') }}</label>
|
||||
|
||||
<textarea type="text" class="control" id="content" name="content" v-validate="'required'" value="{{ old('content') }}" data-vv-as=""{{ __('admin::app.cms.pages.content') }}""></textarea>
|
||||
|
||||
<span class="control-error" v-if="errors.has('content')">@{{ errors.first('content') }}</span>
|
||||
<span class="control-error" v-if="errors.has('html_content')">@{{ errors.first('html_content') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('page_title') ? 'has-error' : '']">
|
||||
|
|
@ -125,6 +120,14 @@
|
|||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<modal id="showHelpers" :is-open="modalIds.showHelpers">
|
||||
<h3 slot="header">{{ __('admin::app.cms.pages.helper-classes') }}</h3>
|
||||
|
||||
<div slot="body">
|
||||
@include('ui::partials.helper-classes')
|
||||
</div>
|
||||
</modal>
|
||||
@stop
|
||||
|
||||
@push('scripts')
|
||||
|
|
|
|||
|
|
@ -71,36 +71,28 @@
|
|||
<span class="control-error" v-if="errors.has('url_key')">@{{ errors.first('url_key') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('layout') ? 'has-error' : '']">
|
||||
<label for="layout" class="required">{{ __('admin::app.cms.pages.layout') }}</label>
|
||||
<div class="control-group" :class="[errors.has('html_content') ? 'has-error' : '']">
|
||||
<label for="html_content" class="required">{{ __('admin::app.cms.pages.content') }}</label>
|
||||
|
||||
@foreach(config('cms') as $key => $value)
|
||||
<span class="radio">
|
||||
<input type="radio" id="layout" name="layout" value="{{ $value }}" v-validate="'required'" @if($page->layout == $value) checked @endif>
|
||||
<textarea type="text" class="control" id="content" name="html_content" v-validate="'required'" data-vv-as=""{{ __('admin::app.cms.pages.content') }}"">{{ $page->html_content ?? old('html_content') }}</textarea>
|
||||
|
||||
<label class="radio-view" for="layout"></label>
|
||||
{{ $key }}
|
||||
</span>
|
||||
@endforeach
|
||||
{!! __('admin::app.cms.pages.one-col') !!}
|
||||
{!! __('admin::app.cms.pages.two-col') !!}
|
||||
{!! __('admin::app.cms.pages.three-col') !!}
|
||||
|
||||
<span class="control-error" v-if="errors.has('layout')">@{{ errors.first('layout') }}</span>
|
||||
</div>
|
||||
<div class="mt-10 mb-10" @submit.prevent="showModal('showHelpers')">
|
||||
<button class="btn btn-sm btn-primary">
|
||||
{{ __('admin::app.cms.pages.helper-classes') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$content = json_decode($page->content);
|
||||
@endphp
|
||||
<div class="control-group" :class="[errors.has('content') ? 'has-error' : '']">
|
||||
<label for="content" class="required">{{ __('admin::app.cms.pages.content') }}</label>
|
||||
|
||||
<textarea type="text" class="control" id="content" name="content" v-validate="'required'" data-vv-as=""{{ __('admin::app.cms.pages.content') }}"">{{ $content->html ?? old('content') }}</textarea>
|
||||
|
||||
<span class="control-error" v-if="errors.has('content')">@{{ errors.first('content') }}</span>
|
||||
<span class="control-error" v-if="errors.has('html_content')">@{{ errors.first('html_content') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('page_title') ? 'has-error' : '']">
|
||||
<label for="page_title" class="required">{{ __('admin::app.cms.pages.page-title') }}</label>
|
||||
|
||||
<input type="text" class="control" name="page_title" v-validate="'required'" value="{{ $content->page_title ?? old('page_title') }}" data-vv-as=""{{ __('admin::app.cms.pages.page-title') }}"">
|
||||
<input type="text" class="control" name="page_title" v-validate="'required'" value="{{ $page->page_title ?? old('page_title') }}" data-vv-as=""{{ __('admin::app.cms.pages.page-title') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('page_title')">@{{ errors.first('page_title') }}</span>
|
||||
</div>
|
||||
|
|
@ -108,7 +100,7 @@
|
|||
<div class="control-group" :class="[errors.has('meta_title') ? 'has-error' : '']">
|
||||
<label for="meta_title" class="required">{{ __('admin::app.cms.pages.meta_title') }}</label>
|
||||
|
||||
<input type="text" class="control" name="meta_title" v-validate="'required'" value="{{ $content->meta_title ?? old('meta_title') }}" data-vv-as=""{{ __('admin::app.cms.pages.meta_title') }}"">
|
||||
<input type="text" class="control" name="meta_title" v-validate="'required'" value="{{ $page->meta_title ?? old('meta_title') }}" data-vv-as=""{{ __('admin::app.cms.pages.meta_title') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('meta_title')">@{{ errors.first('meta_title') }}</span>
|
||||
</div>
|
||||
|
|
@ -116,7 +108,7 @@
|
|||
<div class="control-group" :class="[errors.has('meta_keywords') ? 'has-error' : '']">
|
||||
<label for="meta_keywords" class="required">{{ __('admin::app.cms.pages.meta_keywords') }}</label>
|
||||
|
||||
<textarea type="text" class="control" name="meta_keywords" v-validate="'required'" data-vv-as=""{{ __('admin::app.cms.pages.meta_keywords') }}"">{{ $content->meta_keywords ?? old('meta_keywords') }}</textarea>
|
||||
<textarea type="text" class="control" name="meta_keywords" v-validate="'required'" data-vv-as=""{{ __('admin::app.cms.pages.meta_keywords') }}"">{{ $page->meta_keywords ?? old('meta_keywords') }}</textarea>
|
||||
|
||||
<span class="control-error" v-if="errors.has('meta_keywords')">@{{ errors.first('meta_keywords') }}</span>
|
||||
</div>
|
||||
|
|
@ -124,7 +116,7 @@
|
|||
<div class="control-group" :class="[errors.has('meta_description') ? 'has-error' : '']">
|
||||
<label for="meta_description" class="required">{{ __('admin::app.cms.pages.meta_description') }}</label>
|
||||
|
||||
<textarea type="text" class="control" name="meta_description" data-vv-as=""{{ __('admin::app.cms.pages.meta_description') }}"">{{ $content->meta_description ?? old('meta_description') }}</textarea>
|
||||
<textarea type="text" class="control" name="meta_description" data-vv-as=""{{ __('admin::app.cms.pages.meta_description') }}"">{{ $page->meta_description ?? old('meta_description') }}</textarea>
|
||||
|
||||
<span class="control-error" v-if="errors.has('meta_description')">@{{ errors.first('meta_description') }}</span>
|
||||
</div>
|
||||
|
|
@ -132,6 +124,14 @@
|
|||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<modal id="showHelpers" :is-open="modalIds.showHelpers">
|
||||
<h3 slot="header">{{ __('admin::app.cms.pages.helper-classes') }}</h3>
|
||||
|
||||
<div slot="body">
|
||||
@include('ui::partials.helper-classes')
|
||||
</div>
|
||||
</modal>
|
||||
@stop
|
||||
|
||||
@push('scripts')
|
||||
|
|
@ -141,7 +141,8 @@
|
|||
$(document).ready(function () {
|
||||
$('#preview').on('click', function(e) {
|
||||
var form = $('#page-form').serialize();
|
||||
var url = '{{ route('admin.cms.preview') }}' + '?' + form;
|
||||
// var url = '{{ route('admin.cms.preview', $page->id) }}' + '?' + form;
|
||||
var url = '{{ route('admin.cms.preview', $page->url_key) }}';
|
||||
|
||||
window.open(url, '_blank').focus();
|
||||
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@
|
|||
<h1>{{ __('admin::app.cms.pages.pages') }}</h1>
|
||||
</div>
|
||||
<div class="page-action">
|
||||
{{-- <div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<div class="export-import" @click="showModal('downloadDataGrid')">
|
||||
<i class="export-icon"></i>
|
||||
<span >
|
||||
{{ __('admin::app.export.export') }}
|
||||
</span>
|
||||
</div> --}}
|
||||
</div>
|
||||
|
||||
<a href="{{ route('admin.cms.create') }}" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.cms.pages.add-title') }}
|
||||
|
|
@ -26,9 +26,9 @@
|
|||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
@inject('customerGrid', 'Webkul\Admin\DataGrids\CMSPageDataGrid')
|
||||
@inject('cmsGrid', 'Webkul\Admin\DataGrids\CMSPageDataGrid')
|
||||
|
||||
{!! $customerGrid->render() !!}
|
||||
{!! $cmsGrid->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -38,10 +38,9 @@
|
|||
<export-form></export-form>
|
||||
</div>
|
||||
</modal>
|
||||
|
||||
@stop
|
||||
|
||||
@push('scripts')
|
||||
@include('admin::export.export', ['gridName' => $customerGrid])
|
||||
@include('admin::export.export', ['gridName' => $cmsGrid])
|
||||
@endpush
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'one-column' => 'shop::cms.onecol',
|
||||
'two-column' => 'shop::cms.twocol',
|
||||
'three-column' => 'shop::cms.threecol'
|
||||
];
|
||||
|
|
@ -15,8 +15,13 @@ class CreateCmsPagesTable extends Migration
|
|||
{
|
||||
Schema::create('cms_pages', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('url_key')->unique();
|
||||
$table->longtext('html_content');
|
||||
$table->string('page_title');
|
||||
$table->string('meta_title');
|
||||
$table->text('meta_description')->nullable();
|
||||
$table->text('meta_keywords')->nullable();
|
||||
$table->json('content')->nullable();
|
||||
$table->string('url_key');
|
||||
$table->string('layout')->nullable();
|
||||
$table->integer('channel_id')->unsigned();
|
||||
$table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade');
|
||||
|
|
|
|||
|
|
@ -37,6 +37,11 @@ use Webkul\Core\Repositories\LocaleRepository as Locale;
|
|||
|
||||
public function __construct(Channel $channel, Locale $locale, CMS $cms)
|
||||
{
|
||||
/**
|
||||
* Pass the class instance through admin middleware
|
||||
*/
|
||||
$this->middleware('auth:admin');
|
||||
|
||||
/**
|
||||
* Channel repository instance
|
||||
*/
|
||||
|
|
@ -84,8 +89,7 @@ use Webkul\Core\Repositories\LocaleRepository as Locale;
|
|||
'channel' => 'required|string',
|
||||
'locale' => 'required|string',
|
||||
'url_key' => 'required|unique:cms_pages,url_key',
|
||||
'layout' => 'required|string',
|
||||
'content' => 'required|string',
|
||||
'html_content' => 'required|string',
|
||||
'page_title' => 'required|string',
|
||||
'meta_title' => 'required|string',
|
||||
'meta_description' => 'string',
|
||||
|
|
@ -94,14 +98,8 @@ use Webkul\Core\Repositories\LocaleRepository as Locale;
|
|||
|
||||
$data = request()->all();
|
||||
|
||||
$content = $data['content'];
|
||||
$pageTitle = $data['page_title'];
|
||||
|
||||
unset($data['content']);
|
||||
unset($data['page_title']);
|
||||
|
||||
$data['content']['html'] = $content;
|
||||
$data['content']['page_title'] = $pageTitle;
|
||||
$data['content']['html'] = $data['html_content'];
|
||||
$data['content']['page_title'] = $data['page_title'];
|
||||
$data['content']['meta_keywords'] = $data['meta_keywords'];
|
||||
$data['content']['meta_title'] = $data['meta_title'];
|
||||
$data['content']['meta_description'] = $data['meta_description'];
|
||||
|
|
@ -144,8 +142,7 @@ use Webkul\Core\Repositories\LocaleRepository as Locale;
|
|||
'channel' => 'required|string',
|
||||
'locale' => 'required|string',
|
||||
'url_key' => 'required|unique:cms_pages,url_key,'.$id,
|
||||
'layout' => 'required|string',
|
||||
'content' => 'required|string',
|
||||
'html_content' => 'required|string',
|
||||
'page_title' => 'required|string',
|
||||
'meta_title' => 'required|string',
|
||||
'meta_description' => 'string',
|
||||
|
|
@ -154,14 +151,8 @@ use Webkul\Core\Repositories\LocaleRepository as Locale;
|
|||
|
||||
$data = request()->all();
|
||||
|
||||
$content = $data['content'];
|
||||
$pageTitle = $data['page_title'];
|
||||
|
||||
unset($data['content']);
|
||||
unset($data['page_title']);
|
||||
|
||||
$data['content']['html'] = $content;
|
||||
$data['content']['page_title'] = $pageTitle;
|
||||
$data['content']['html'] = $data['html_content'];
|
||||
$data['content']['page_title'] = $data['page_title'];
|
||||
$data['content']['meta_keywords'] = $data['meta_keywords'];
|
||||
$data['content']['meta_title'] = $data['meta_title'];
|
||||
$data['content']['meta_description'] = $data['meta_description'];
|
||||
|
|
@ -184,16 +175,13 @@ use Webkul\Core\Repositories\LocaleRepository as Locale;
|
|||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function preview()
|
||||
public function preview($urlKey)
|
||||
{
|
||||
$page = request()->all();
|
||||
|
||||
if (isset($page['layout'])) {
|
||||
return view($page['layout'])->with('data', $page);
|
||||
} else {
|
||||
abort(404);
|
||||
}
|
||||
$page = $this->cms->findOneWhere([
|
||||
'url_key' => $urlKey
|
||||
]);
|
||||
|
||||
return view('shop::cms.page')->with('page', $page);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -229,6 +217,6 @@ use Webkul\Core\Repositories\LocaleRepository as Locale;
|
|||
|
||||
$layout = $page->layout;
|
||||
|
||||
return view($layout)->with('data', $page);
|
||||
return view('shop::cms.page')->with('data', $page);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\CMS\Http\Controllers\Shop;
|
||||
|
||||
use Webkul\CMS\Http\Controllers\Controller;
|
||||
use Webkul\CMS\Repositories\CMSRepository as CMS;
|
||||
use Webkul\Core\Repositories\ChannelRepository as Channel;
|
||||
use Webkul\Core\Repositories\LocaleRepository as Locale;
|
||||
|
||||
/**
|
||||
* PagePresenter controller
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class PagePresenterController extends Controller
|
||||
{
|
||||
/**
|
||||
* To hold the request variables from route file
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
/**
|
||||
* To hold the channel reposotry instance
|
||||
*/
|
||||
protected $channel;
|
||||
|
||||
/**
|
||||
* To hold the locale reposotry instance
|
||||
*/
|
||||
protected $locale;
|
||||
|
||||
/**
|
||||
* To hold the CMSRepository instance
|
||||
*/
|
||||
protected $cms;
|
||||
|
||||
public function __construct(Channel $channel, Locale $locale, CMS $cms)
|
||||
{
|
||||
/**
|
||||
* Channel repository instance
|
||||
*/
|
||||
$this->channel = $channel;
|
||||
|
||||
/**
|
||||
* Locale repository instance
|
||||
*/
|
||||
$this->locale = $locale;
|
||||
|
||||
/**
|
||||
* CMS repository instance
|
||||
*/
|
||||
$this->cms = $cms;
|
||||
|
||||
$this->_config = request('_config');
|
||||
}
|
||||
|
||||
/**
|
||||
* To extract the page content and load it in the respective view file\
|
||||
*
|
||||
* @return view
|
||||
*/
|
||||
public function presenter($slug)
|
||||
{
|
||||
$currentChannel = core()->getCurrentChannel();
|
||||
$currentLocale = app()->getLocale();
|
||||
|
||||
$currentLocale = $this->locale->findOneWhere([
|
||||
'code' => $currentLocale
|
||||
]);
|
||||
|
||||
$page = $this->cms->findOneWhere([
|
||||
'url_key' => $slug,
|
||||
'locale_id' => $currentLocale->id,
|
||||
'channel_id' => $currentChannel->id
|
||||
]);
|
||||
|
||||
return view('shop::cms.page')->with('page', $page);
|
||||
}
|
||||
}
|
||||
|
|
@ -9,5 +9,5 @@ class CMS extends Model implements CMSContract
|
|||
{
|
||||
protected $table = 'cms_pages';
|
||||
|
||||
protected $fillable = ['content', 'url_key', 'layout', 'channel_id', 'locale_id'];
|
||||
protected $fillable = ['content', 'meta_description', 'meta_title', 'page_title', 'meta_keywords', 'html_content', 'url_key', 'layout', 'channel_id', 'locale_id'];
|
||||
}
|
||||
|
|
@ -14,24 +14,4 @@ class CMSServiceProvider extends ServiceProvider
|
|||
|
||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->registerConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
* To register the configuration with application's configuration
|
||||
*/
|
||||
protected function registerConfig()
|
||||
{
|
||||
$this->mergeConfigFrom(
|
||||
dirname(__DIR__) . '/Config/cms-config.php', 'cms'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -287,7 +287,7 @@ Route::group(['middleware' => ['web', 'locale', 'theme', 'currency']], function
|
|||
});
|
||||
//customer routes end here
|
||||
|
||||
Route::get('pages/{slug}', 'Webkul\CMS\Http\Controllers\Admin\PageController@presenter')->name('shop.cms.page');
|
||||
Route::get('pages/{slug}', 'Webkul\CMS\Http\Controllers\Shop\PagePresenterController@presenter')->name('shop.cms.page');
|
||||
|
||||
Route::view('onecol', 'shop::cms.onecol');
|
||||
Route::view('twocol', 'shop::cms.twocol');
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
@extends('shop::layouts.master')
|
||||
|
||||
@section('content-wrapper')
|
||||
<div class="static-container one-column">
|
||||
<h1>One Column Layout</h1>
|
||||
|
||||
{{ $data['content'] }}
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
@extends('shop::layouts.master')
|
||||
|
||||
@section('page_title')
|
||||
{{ $page->page_title }}
|
||||
@endsection
|
||||
|
||||
@section('head')
|
||||
@isset($page->meta_title)
|
||||
<meta name="title" content="{{ $page->meta_title }}" />
|
||||
@endisset
|
||||
|
||||
@isset($page->meta_description)
|
||||
<meta name="description" content="{{ $page->meta_description }}" />
|
||||
@endisset
|
||||
|
||||
@isset($page->meta_keywords)
|
||||
<meta name="keywords" content="{{ $page->meta_keywords }}" />
|
||||
@endisset
|
||||
|
||||
<link href="{{ asset('themes/default/assets/css/shop.css') }}" rel="stylesheet" />
|
||||
@endsection
|
||||
|
||||
@section('content-wrapper')
|
||||
{!! DbView::make($page)->field('html_content')->render() !!}
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('themes/default/assets/js/shop.js') }}" type="text/javascript"></script>
|
||||
@endpush
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
@extends('shop::layouts.master')
|
||||
|
||||
@section('content-wrapper')
|
||||
<div class="static-container three-column">
|
||||
<h1>First Column</h1>
|
||||
|
||||
<h1>Second Column</h1>
|
||||
|
||||
<h1>Third Column</h1>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
@extends('shop::layouts.master')
|
||||
|
||||
@section('content-wrapper')
|
||||
<div class="static-container two-column">
|
||||
<h1>First Column</h1>
|
||||
|
||||
<h1>Second Column</h1>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<title>@yield('page_title')</title>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="48px" height="48px" viewBox="0 0 48 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 51.1 (57501) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Icon-CMS-Active</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Icon-CMS-Active" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<rect id="Rectangle" stroke="#0041FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x="9" y="10" width="31" height="24"></rect>
|
||||
<circle id="Oval" fill="#0041FF" fill-rule="nonzero" cx="25" cy="13" r="1"></circle>
|
||||
<path d="M13,33.9210526 L13,29.0789474 L16.3772216,29.0789474 C16.5449412,28.5154007 16.7697085,27.9764233 17.0448264,27.4687119 L14.6563293,25.0802147 L18.0802147,21.6563293 L20.4687119,24.0448264 C20.9764233,23.7697085 21.5154007,23.5449412 22.0789474,23.3772216 L22.0789474,20 L26.9210526,20 L26.9210526,23.3772216 C27.4845993,23.5449412 28.0235767,23.7697085 28.5312881,24.0448264 L30.9197853,21.6563293 L34.3436707,25.0802147 L31.9551736,27.4687119 C32.2302915,27.9764233 32.4550588,28.5154007 32.6227784,29.0789474 L36,29.0789474 L36,33.9210526" id="Combined-Shape" stroke="#0041FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
<path d="M27.0855784,33.8590133 C27.6535802,33.2368113 28,32.408861 28,31.5 C28,29.5670034 26.4329966,28 24.5,28 C22.5670034,28 21,29.5670034 21,31.5 C21,32.4467397 21.3758971,33.3056839 21.9865853,33.9357268" id="Oval-6" stroke="#0041FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
<path d="M15,38 L33,38" id="Path-35" stroke="#0041FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
<path d="M24.5,34.5 L24.5,37.5" id="Path-36" stroke="#0041FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="48px" height="48px" viewBox="0 0 48 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 51.1 (57501) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Icon-CMS</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Icon-CMS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<rect id="Rectangle" stroke="#8E8E8E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x="9" y="10" width="31" height="24"></rect>
|
||||
<circle id="Oval" fill="#8E8E8E" fill-rule="nonzero" cx="25" cy="13" r="1"></circle>
|
||||
<path d="M13,33.9210526 L13,29.0789474 L16.3772216,29.0789474 C16.5449412,28.5154007 16.7697085,27.9764233 17.0448264,27.4687119 L14.6563293,25.0802147 L18.0802147,21.6563293 L20.4687119,24.0448264 C20.9764233,23.7697085 21.5154007,23.5449412 22.0789474,23.3772216 L22.0789474,20 L26.9210526,20 L26.9210526,23.3772216 C27.4845993,23.5449412 28.0235767,23.7697085 28.5312881,24.0448264 L30.9197853,21.6563293 L34.3436707,25.0802147 L31.9551736,27.4687119 C32.2302915,27.9764233 32.4550588,28.5154007 32.6227784,29.0789474 L36,29.0789474 L36,33.9210526" id="Combined-Shape" stroke="#8E8E8E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
<path d="M27.0855784,33.8590133 C27.6535802,33.2368113 28,32.408861 28,31.5 C28,29.5670034 26.4329966,28 24.5,28 C22.5670034,28 21,29.5670034 21,31.5 C21,32.4467397 21.3758971,33.3056839 21.9865853,33.9357268" id="Oval-6" stroke="#8E8E8E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
<path d="M15,38 L33,38" id="Path-35" stroke="#8E8E8E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/ui.js": "/js/ui.js?id=a651d73740d3e8fb70aa",
|
||||
"/css/ui.css": "/css/ui.css?id=230a9d54cabb3e277639"
|
||||
"/js/ui.js": "/js/ui.js?id=7db236c965e423a0f307",
|
||||
"/css/ui.css": "/css/ui.css?id=6520763c9aa81f1fc2e0"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="48px" height="48px" viewBox="0 0 48 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 51.1 (57501) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Icon-CMS-Active</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Icon-CMS-Active" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<rect id="Rectangle" stroke="#0041FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x="9" y="10" width="31" height="24"></rect>
|
||||
<circle id="Oval" fill="#0041FF" fill-rule="nonzero" cx="25" cy="13" r="1"></circle>
|
||||
<path d="M13,33.9210526 L13,29.0789474 L16.3772216,29.0789474 C16.5449412,28.5154007 16.7697085,27.9764233 17.0448264,27.4687119 L14.6563293,25.0802147 L18.0802147,21.6563293 L20.4687119,24.0448264 C20.9764233,23.7697085 21.5154007,23.5449412 22.0789474,23.3772216 L22.0789474,20 L26.9210526,20 L26.9210526,23.3772216 C27.4845993,23.5449412 28.0235767,23.7697085 28.5312881,24.0448264 L30.9197853,21.6563293 L34.3436707,25.0802147 L31.9551736,27.4687119 C32.2302915,27.9764233 32.4550588,28.5154007 32.6227784,29.0789474 L36,29.0789474 L36,33.9210526" id="Combined-Shape" stroke="#0041FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
<path d="M27.0855784,33.8590133 C27.6535802,33.2368113 28,32.408861 28,31.5 C28,29.5670034 26.4329966,28 24.5,28 C22.5670034,28 21,29.5670034 21,31.5 C21,32.4467397 21.3758971,33.3056839 21.9865853,33.9357268" id="Oval-6" stroke="#0041FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
<path d="M15,38 L33,38" id="Path-35" stroke="#0041FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
<path d="M24.5,34.5 L24.5,37.5" id="Path-36" stroke="#0041FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="48px" height="48px" viewBox="0 0 48 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 51.1 (57501) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Icon-CMS</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Icon-CMS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<rect id="Rectangle" stroke="#8E8E8E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x="9" y="10" width="31" height="24"></rect>
|
||||
<circle id="Oval" fill="#8E8E8E" fill-rule="nonzero" cx="25" cy="13" r="1"></circle>
|
||||
<path d="M13,33.9210526 L13,29.0789474 L16.3772216,29.0789474 C16.5449412,28.5154007 16.7697085,27.9764233 17.0448264,27.4687119 L14.6563293,25.0802147 L18.0802147,21.6563293 L20.4687119,24.0448264 C20.9764233,23.7697085 21.5154007,23.5449412 22.0789474,23.3772216 L22.0789474,20 L26.9210526,20 L26.9210526,23.3772216 C27.4845993,23.5449412 28.0235767,23.7697085 28.5312881,24.0448264 L30.9197853,21.6563293 L34.3436707,25.0802147 L31.9551736,27.4687119 C32.2302915,27.9764233 32.4550588,28.5154007 32.6227784,29.0789474 L36,29.0789474 L36,33.9210526" id="Combined-Shape" stroke="#8E8E8E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
<path d="M27.0855784,33.8590133 C27.6535802,33.2368113 28,32.408861 28,31.5 C28,29.5670034 26.4329966,28 24.5,28 C22.5670034,28 21,29.5670034 21,31.5 C21,32.4467397 21.3758971,33.3056839 21.9865853,33.9357268" id="Oval-6" stroke="#8E8E8E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
<path d="M15,38 L33,38" id="Path-35" stroke="#8E8E8E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
|
|
@ -1095,3 +1095,14 @@ modal {
|
|||
.vue-swatches__trigger {
|
||||
border: 1px solid #d3d3d3;
|
||||
}
|
||||
|
||||
|
||||
.helper-container {
|
||||
display: block;
|
||||
|
||||
.group {
|
||||
code {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -39,6 +39,11 @@
|
|||
background-image: url("../images/icon-promotion.svg");
|
||||
}
|
||||
|
||||
.cms-icon {
|
||||
@extend %menu-properties;
|
||||
background-image: url('../images/Icon-CMS.svg');
|
||||
}
|
||||
|
||||
.angle-right-icon {
|
||||
background-image: url("../images/Angle-Right.svg");
|
||||
width: 17px;
|
||||
|
|
@ -260,6 +265,11 @@
|
|||
background-image: url("../images/icon-promotion-active.svg");
|
||||
}
|
||||
|
||||
.cms-icon {
|
||||
@extend %menu-properties;
|
||||
background-image: url('../images/Icon-CMS-Active.svg');
|
||||
}
|
||||
|
||||
> .arrow-down-icon {
|
||||
background-image: url("../images/Arrow-Down.svg");
|
||||
width: 14px;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
<?php
|
||||
return [
|
||||
'one-col' => '<div class="mt-10">Use class: <b>"static-container one-column"</b> for one column layout.</div>',
|
||||
'two-col' => '<div class="mt-10">Use class: <b>"static-container two-column"</b> for two column layout.</div>',
|
||||
'three-col' => '<div class="mt-10">Use class: <b>"static-container three-column"</b> for three column layout.</div>',
|
||||
'helper-classes' => 'Helper Classes',
|
||||
'datagrid' => [
|
||||
'actions' => 'Actions',
|
||||
'id' => 'Index columns have value greater than zero only',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,148 @@
|
|||
<div class="helper-container" style="">
|
||||
|
||||
<div class="row">
|
||||
<div class="column-1">
|
||||
<div class="group mb-5">
|
||||
<code>".mb-5"</code>
|
||||
<label>margin bottom by "5px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mb-10"</code>
|
||||
<label>margin bottom by "10px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mb-15"</code>
|
||||
<label>margin bottom by "15px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mb-20"</code>
|
||||
<label>margin bottom by "20px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mb-25"</code>
|
||||
<label>margin bottom by "25px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mb-30"</code>
|
||||
<label>margin bottom by "30px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mb-35"</code>
|
||||
<label>margin bottom by "35px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mb-40"</code>
|
||||
<label>margin bottom by "40px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mb-45"</code>
|
||||
<label>margin bottom by "45px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mb-50"</code>
|
||||
<label>margin bottom by "50px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mb-60"</code>
|
||||
<label>margin bottom by "60px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mb-70"</code>
|
||||
<label>margin bottom by "70px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mb-80"</code>
|
||||
<label>margin bottom by "80px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mb-90"</code>
|
||||
<label>margin bottom by "90px"</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="column-2">
|
||||
<div class="group mb-5">
|
||||
<code>".mt-5"</code>
|
||||
<label>margin top by "5px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mt-10"</code>
|
||||
<label>margin top by "10px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mt-15"</code>
|
||||
<label>margin top by "15px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mt-20"</code>
|
||||
<label>margin top by "20px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mt-25"</code>
|
||||
<label>margin top by "25px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mt-30"</code>
|
||||
<label>margin top by "30px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mt-35"</code>
|
||||
<label>margin top by "35px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mt-40"</code>
|
||||
<label>margin top by "40px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mt-45"</code>
|
||||
<label>margin top by "45px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mt-50"</code>
|
||||
<label>margin top by "50px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mt-60"</code>
|
||||
<label>margin top by "60px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mt-70"</code>
|
||||
<label>margin top by "70px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mt-80"</code>
|
||||
<label>margin top by "80px"</label>
|
||||
</div>
|
||||
|
||||
<div class="group mb-5">
|
||||
<code>".mt-90"</code>
|
||||
<label>margin top by "90px"</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue