edit static pages in backend
This commit is contained in:
parent
e771c4921f
commit
783ac823ba
59 changed files with 1644 additions and 761 deletions
|
@ -42,6 +42,7 @@
|
|||
@endsection
|
||||
|
||||
@section('after-scripts')
|
||||
<!-- <script src="bower_components/chart.js/dist/Chart.min.js"></script> -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.2.1/Chart.min.js"></script>
|
||||
<script>
|
||||
var ctx = document.getElementById("myChart");
|
||||
|
|
|
@ -8,16 +8,13 @@
|
|||
<link rel="shortcut icon" type="image/x-icon" href="{{ asset('favicon.ico') }}">
|
||||
|
||||
<link rel='stylesheet' href="{{ asset('css/pure-min.css') }}" />
|
||||
<link rel='stylesheet' href="{{ asset('css/grids-responsive-min.css') }}" />
|
||||
|
||||
<!-- <script src="bower_components/chart.js/dist/Chart.min.js"></script> -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.2.1/Chart.min.js"></script>
|
||||
<link rel='stylesheet' href="{{ asset('css/grids-responsive-min.css') }}" />
|
||||
<!--<link rel="stylesheet" type="text/css" href="bower_components/font-awesome/css/font-awesome.min.css">-->
|
||||
<link rel='stylesheet' href="{{ asset('css/font-awesome.css') }}" />
|
||||
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{{ asset('/assets/style.css') }}">
|
||||
<link rel="stylesheet" type="text/css" href="{{ asset('/assets/pagination.css') }}">
|
||||
<link rel="stylesheet" type="text/css" href="{{ asset('/backend/style.css') }}">
|
||||
<link rel="stylesheet" type="text/css" href="{{ asset('/backend/pagination.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -84,9 +81,26 @@
|
|||
</li>
|
||||
@endpermission
|
||||
|
||||
@permission('page')
|
||||
<li class="{{ active_class(Active::checkUriPattern('settings/page*')) }}">
|
||||
<a class="pure-menu-link" href="{{ route('settings.page.index') }}">
|
||||
<i class="fa fa-file-text"></i>
|
||||
<span>{{ trans('labels.backend.pages.title') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endpermission
|
||||
|
||||
|
||||
<li class="treeview">
|
||||
<h2 class="pure-menu-heading">Access Management <span class="fa fa-angle-down"></h2>
|
||||
<h2 class="pure-menu-heading">
|
||||
<span>{{ trans('menus.backend.access.title') }}</span>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</h2>
|
||||
{{-- <a href="#">
|
||||
<i class="fa fa-users"></i>
|
||||
<span>{{ trans('menus.backend.access.title') }}</span>
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</a> --}}
|
||||
<ul class="pure-menu-list treeview-menu {{ active_class(Route::is('access.*'), 'menu-open') }}" style="display: none; {{ active_class(Route::is('access.*'), 'display: block;') }}">
|
||||
@if (Auth::guest())
|
||||
<li class="pure-menu-item {{ Route::currentRouteName() == 'login' ? 'active' : '' }}">
|
||||
|
@ -108,16 +122,6 @@
|
|||
<a class="pure-menu-link" href="{{ route('logout') }}"><i class="fa fa-sign-out"></i>Logout</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
{{-- @if (Auth::guest())
|
||||
<li class="pure-menu-item {{ Route::currentRouteName() == 'login' ? 'active' : '' }}">
|
||||
<a class="pure-menu-link" href="{{ route('login') }}">LOGIN</a>
|
||||
</li>
|
||||
@else
|
||||
<li class="pure-menu-item"><a class="pure-menu-link" href="{{ route('logout') }}"><i class="fa fa-sign-out"></i>Logout</a></li>
|
||||
@endif --}}
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
@ -144,18 +148,23 @@
|
|||
</div>
|
||||
|
||||
<div class="content">
|
||||
{{-- <div class="breadcrumb">
|
||||
<i class="fa fa-home"></i><a href="#" rel="Dashboard">Dashboard</a>
|
||||
<i class="fa fa-angle-right"></i><a href="#" rel="Dashboard">Sales</a>
|
||||
</div> --}}
|
||||
{{-- @yield('breadcrumbs') --}}
|
||||
@if(Breadcrumbs::exists())
|
||||
{!! Breadcrumbs::render() !!}
|
||||
@endif
|
||||
<div class="l-box">
|
||||
@include('partials.flash')
|
||||
@yield('content')
|
||||
</div>
|
||||
<section class="content-header">
|
||||
@yield('page-header')
|
||||
{{-- <div class="breadcrumb">
|
||||
<i class="fa fa-home"></i><a href="#" rel="Dashboard">Dashboard</a>
|
||||
<i class="fa fa-angle-right"></i><a href="#" rel="Dashboard">Sales</a>
|
||||
</div> --}}
|
||||
{{-- @yield('breadcrumbs') --}}
|
||||
<!-- Breadcrumbs would render from routes/breadcrumb.php -->
|
||||
@if(Breadcrumbs::exists())
|
||||
{!! Breadcrumbs::render() !!}
|
||||
@endif
|
||||
</section>
|
||||
|
||||
<section class="l-box">
|
||||
@include('partials.flash')
|
||||
@yield('content')
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -166,7 +175,7 @@
|
|||
<script type="text/javascript">
|
||||
$('div.alert').not('alert-important');//.delay(3000).slideUp(300);
|
||||
</script>
|
||||
<script type="text/javascript" src="{{ asset('assets/functions.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('backend/functions.js') }}"></script>
|
||||
@yield('after-scripts')
|
||||
</div>
|
||||
|
||||
|
|
98
resources/views/settings/page/edit.blade.php
Normal file
98
resources/views/settings/page/edit.blade.php
Normal file
|
@ -0,0 +1,98 @@
|
|||
@extends ('settings.layouts.app')
|
||||
|
||||
@section ('title', trans('labels.backend.pages.management') . ' | ' . trans('labels.backend.pages.edit'))
|
||||
|
||||
{{-- @section('page-header')
|
||||
<h1>
|
||||
{{ trans('labels.backend.pages.management') }}
|
||||
<small>{{ trans('labels.backend.pages.edit') }}</small>
|
||||
</h1>
|
||||
@endsection --}}
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::model($page, ['method' => 'PATCH', 'route' => ['settings.page.update', $page], 'class' => 'pure-form pure-form-aligned', 'id' => 'edit-role', 'enctype' => 'multipart/form-data']) }}
|
||||
|
||||
<div class="box box-info">
|
||||
|
||||
<div class="header">
|
||||
<h3 class="header-title">{{ trans('labels.backend.pages.edit') }}
|
||||
</h3>
|
||||
<div class="box-tools pull-right">
|
||||
{{-- @include('backend.pages.partials.pages-header-buttons') --}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body box-content">
|
||||
|
||||
<div class="pure-control-group">
|
||||
{{ Form::label('title', trans('validation.attributes.backend.pages.title'), ['class' => 'col-lg-2 control-label required']) }}
|
||||
<div class="col-lg-10">
|
||||
{{ Form::text('title', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.pages.title'), 'required' => 'required']) }}
|
||||
</div><!--col-lg-10-->
|
||||
</div><!--form control-->
|
||||
|
||||
<div class="pure-control-group">
|
||||
{{ Form::label('description', trans('validation.attributes.backend.pages.description'), ['class' => 'col-lg-2 control-label required']) }}
|
||||
<div class="col-lg-10">
|
||||
{{ Form::textarea('description', null,['class' => 'form-control', 'placeholder' => trans('validation.attributes.backend.pages.description')]) }}
|
||||
</div><!--col-lg-3-->
|
||||
</div><!--form control-->
|
||||
|
||||
<div class="pure-control-group">
|
||||
{{ Form::label('cannonical_link', trans('validation.attributes.backend.pages.cannonical_link'), ['class' => 'col-lg-2 control-label']) }}
|
||||
<div class="col-lg-10">
|
||||
{{ Form::text('cannonical_link', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.pages.cannonical_link')]) }}
|
||||
</div><!--col-lg-10-->
|
||||
</div><!--form control-->
|
||||
|
||||
<div class="pure-control-group">
|
||||
{{ Form::label('seo_title', trans('validation.attributes.backend.pages.seo_title'), ['class' => 'col-lg-2 control-label']) }}
|
||||
<div class="col-lg-10">
|
||||
{{ Form::text('seo_title', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.pages.seo_title')]) }}
|
||||
</div><!--col-lg-10-->
|
||||
</div><!--form control-->
|
||||
|
||||
<div class="pure-control-group">
|
||||
{{ Form::label('seo_keyword', trans('validation.attributes.backend.pages.seo_keyword'), ['class' => 'col-lg-2 control-label']) }}
|
||||
<div class="col-lg-10">
|
||||
{{ Form::text('seo_keyword', null, ['class' => 'form-control box-size', 'placeholder' => trans('validation.attributes.backend.pages.seo_keyword')]) }}
|
||||
</div><!--col-lg-10-->
|
||||
</div><!--form control-->
|
||||
|
||||
<div class="pure-control-group">
|
||||
{{ Form::label('seo_description', trans('validation.attributes.backend.pages.seo_description'), ['class' => 'col-lg-2 control-label']) }}
|
||||
<div class="col-lg-10">
|
||||
{{ Form::textarea('seo_description', null,['class' => 'form-control', 'placeholder' => trans('validation.attributes.backend.pages.seo_description')]) }}
|
||||
</div><!--col-lg-3-->
|
||||
</div><!--form control-->
|
||||
|
||||
<div class="pure-control-group">
|
||||
{{ Form::label('status', trans('validation.attributes.backend.pages.is_active'), ['class' => 'col-lg-2 control-label']) }}
|
||||
|
||||
<div class="col-lg-10">
|
||||
<div class="control-group">
|
||||
<label class="control control--checkbox">
|
||||
{{ Form::checkbox('status', 1, ($page->status == 1) ? true : false ) }}
|
||||
<div class="control__indicator"></div>
|
||||
</label>
|
||||
</div>
|
||||
</div><!--col-lg-3-->
|
||||
</div><!--form control-->
|
||||
|
||||
<div class="pure-controls">
|
||||
{{ link_to_route('settings.page.index', trans('buttons.general.cancel'), [], ['class' => 'pure-button button-small is-warning']) }}
|
||||
{{ Form::submit(trans('buttons.general.crud.update'), ['class' => 'pure-button button-small is-primary']) }}
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
|
||||
</div><!-- /.box-body -->
|
||||
</div><!--box-->
|
||||
{{ Form::close() }}
|
||||
@endsection
|
||||
|
||||
@section("after-scripts")
|
||||
<script type="text/javascript">
|
||||
// Backend.Pages.init();
|
||||
</script>
|
||||
@endsection
|
198
resources/views/settings/page/index.blade.php
Normal file
198
resources/views/settings/page/index.blade.php
Normal file
|
@ -0,0 +1,198 @@
|
|||
@extends ('settings.layouts.app')
|
||||
|
||||
@section ('title', trans('labels.backend.pages.management'))
|
||||
|
||||
{{-- @section('page-header')
|
||||
<h2>{{ trans('labels.backend.pages.management') }}</h1>
|
||||
@endsection --}}
|
||||
|
||||
@section('content')
|
||||
<div class="box box-info">
|
||||
|
||||
<div class="box-header with-border header">
|
||||
<h3 class="header-title">
|
||||
<i class="fa fa fa-edit"></i> {{ trans('labels.backend.pages.management') }}
|
||||
</h3>
|
||||
<div class="box-tools pull-right">
|
||||
{{-- @include('backend.pages.partials.pages-header-buttons') --}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body pure-g box-content">
|
||||
<div class="table-responsive data-table-wrapper pure-u-1 pure-u-md-1">
|
||||
<table id="pages-table" class="table table-condensed table-hover table-bordered pure-table pure-table-horizontal">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ trans('labels.backend.pages.table.title') }}</th>
|
||||
<th>{{ trans('labels.backend.pages.table.status') }}</th>
|
||||
<th>{{ trans('labels.backend.pages.table.createdat') }}</th>
|
||||
<th>{{ trans('labels.backend.pages.table.createdby') }}</th>
|
||||
<th>{{ trans('labels.general.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<thead class="transparent-bg">
|
||||
<tr>
|
||||
<th>
|
||||
{!! Form::text('first_name', null, ["class" => "search-input-text form-control", "data-column" => 0, "placeholder" => trans('labels.backend.pages.table.title')]) !!}
|
||||
<a class="reset-data" href="javascript:void(0)"><i class="fa fa-times"></i></a>
|
||||
</th>
|
||||
<th>
|
||||
{!! Form::select('status', [0 => "InActive", 1 => "Active"], null, ["class" => "search-input-select form-control", "data-column" => 1, "placeholder" => trans('labels.backend.pages.table.all')]) !!}
|
||||
</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div><!--table-responsive-->
|
||||
</div><!-- /.box-body -->
|
||||
</div><!--box-->
|
||||
@endsection
|
||||
|
||||
@section('after-scripts')
|
||||
{{-- For DataTables --}}
|
||||
{{ Html::script(mix('js/dataTable.js')) }}
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
var dataTable = $('#pages-table').dataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
headers: {
|
||||
'CSRFToken': document.head.querySelector('meta[name="csrf-token"]').content
|
||||
},
|
||||
url: '{{ route("settings.page.get") }}',
|
||||
type: 'get'
|
||||
},
|
||||
columns: [
|
||||
{data: 'title', name: 'title'},
|
||||
{data: 'status', name: 'status'},
|
||||
{data: 'created_at', name: 'created_at'},
|
||||
{data: 'created_by', name: 'first_name'},
|
||||
{data: 'actions', name: 'actions', searchable: false, sortable: false}
|
||||
],
|
||||
order: [[1, "asc"]],
|
||||
searchDelay: 500,
|
||||
dom: 'lBfrtip',
|
||||
buttons: {
|
||||
buttons: [
|
||||
{ extend: 'copy', className: 'copyButton', exportOptions: {columns: [ 0, 1, 2, 3 ] }},
|
||||
{ extend: 'csv', className: 'csvButton', exportOptions: {columns: [ 0, 1, 2, 3 ] }},
|
||||
{ extend: 'excel', className: 'excelButton', exportOptions: {columns: [ 0, 1, 2, 3 ] }},
|
||||
{ extend: 'pdf', className: 'pdfButton', exportOptions: {columns: [ 0, 1, 2, 3 ] }},
|
||||
{ extend: 'print', className: 'printButton', exportOptions: {columns: [ 0, 1, 2, 3 ] }}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
var Backend = {}; // common variable used in all the files of the backend
|
||||
Backend = {
|
||||
|
||||
DataTableSearch: { //functionalities related to datable search at all the places
|
||||
selector: {},
|
||||
|
||||
init: function (dataTable) {
|
||||
|
||||
this.setSelectors();
|
||||
this.setSelectors.divAlerts.delay(2000).fadeOut(800);
|
||||
this.addHandlers(dataTable);
|
||||
|
||||
},
|
||||
setSelectors: function () {
|
||||
this.selector.searchInput = document.querySelector("div.dataTables_filter input");
|
||||
this.selector.columnSearchInput = document.querySelectorAll(".search-input-text");
|
||||
this.selector.columnSelectInput = document.querySelectorAll(".search-input-select");
|
||||
this.selector.restButton = document.querySelectorAll('.reset-data');
|
||||
this.setSelectors.copyButton = document.getElementById("copyButton");
|
||||
this.setSelectors.csvButton = document.getElementById("csvButton");
|
||||
this.setSelectors.excelButton = document.getElementById("excelButton");
|
||||
this.setSelectors.pdfButton = document.getElementById("pdfButton");
|
||||
this.setSelectors.printButton = document.getElementById("printButton");
|
||||
this.setSelectors.divAlerts = jQuery('div.alert').not('.alert-important');
|
||||
|
||||
},
|
||||
cloneElement: function (element, callback) {
|
||||
var clone = element.cloneNode();
|
||||
while (element.firstChild) {
|
||||
clone.appendChild(element.lastChild);
|
||||
}
|
||||
element.parentNode.replaceChild(clone, element);
|
||||
Backend.DataTableSearch.setSelectors();
|
||||
callback(this.selector.searchInput);
|
||||
},
|
||||
addHandlers: function (dataTable) {
|
||||
// get the datatable search input and on its key press check if we hit enter then search with datatable
|
||||
this.cloneElement(this.selector.searchInput, function (element) { //cloning done to remove any binding of the events
|
||||
element.onkeypress = function (event) {
|
||||
if (event.keyCode == 13) {
|
||||
dataTable.fnFilter(this.value);
|
||||
}
|
||||
};
|
||||
}); // to remove all the listinerers
|
||||
|
||||
// for text boxes
|
||||
//column input search if search box on the column of the datatable given with enter then search with datatable
|
||||
if (this.selector.columnSearchInput.length > 0) {
|
||||
this.selector.columnSearchInput.forEach(function (element) {
|
||||
element.onkeypress = function (event) {
|
||||
if (event.keyCode == 13) {
|
||||
var i = element.getAttribute("data-column"); // getting column index
|
||||
var v = element.value; // getting search input value
|
||||
dataTable.api().columns(i).search(v).draw();
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Individual columns search
|
||||
if (this.selector.columnSelectInput.length >> 0) {
|
||||
this.selector.columnSelectInput.forEach(function (element) {
|
||||
element.onchange = function (event) {
|
||||
var i = element.getAttribute("data-column"); // getting column index
|
||||
var v = element.value; // getting search input value
|
||||
dataTable.api().columns(i).search(v).draw();
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
// Individual columns reset
|
||||
if (this.selector.restButton.length >> 0) {
|
||||
this.selector.restButton.forEach(function (element) {
|
||||
element.onclick = function (event) {
|
||||
var inputelement = this.previousElementSibling;
|
||||
var i = inputelement.getAttribute("data-column");
|
||||
inputelement.value = "";
|
||||
dataTable.api().columns(i).search("").draw();
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/*this.setSelectors.copyButton.onclick = function (element) {
|
||||
document.querySelector(".copyButton").click();
|
||||
};
|
||||
this.setSelectors.csvButton.onclick = function (element) {
|
||||
document.querySelector(".csvButton").click();
|
||||
};
|
||||
this.setSelectors.excelButton.onclick = function (element) {
|
||||
document.querySelector(".excelButton").click();
|
||||
};
|
||||
this.setSelectors.pdfButton.onclick = function (element) {
|
||||
document.querySelector(".pdfButton").click();
|
||||
};
|
||||
this.setSelectors.printButton.onclick = function (element) {
|
||||
document.querySelector(".printButton").click();
|
||||
};*/
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
Backend.DataTableSearch.init(dataTable);
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue