FEATURE #1435: small changes in layout

This commit is contained in:
Michal Kváček
2016-08-18 13:21:05 +02:00
parent fc1141184c
commit 7889548a7e
20 changed files with 1058 additions and 104 deletions
@@ -0,0 +1,14 @@
@extends('admin.layoutWithNavigation')
@section('pageHeading', @trans('admin/contents.edit', ['name' => e($page->title)]))
@section('content')
<div class="row">
<h2>@lang('admin/contents.edit', ['name' => e($page->title)])</h2>
</div>
<div class="row">
@include('admin.content.editForm')
</div>
@stop
@@ -0,0 +1,21 @@
<form method="POST" enctype="multipart/form-data" action="{{route('content.editPost', ['pageId' => $page->id])}}">
{!! csrf_field() !!}
@include('admin.content.formInputs')
<div class="row">
<div class="columns large-6">
<button type="submit" class="button success">@lang('admin/contents.edit', ['name' => $page->title])</button>
</div>
@if ($historySize > 0)
<div class="columns text-right large-6">
<a class="button warning" href="{{route('content.history', ['id' => $page->id])}}">@lang('admin/contents.showHistory', ['count' => $historySize])</a>
</div>
@endif
</div>
</form>
@section('javascripts')
@include('admin.snippets.ckEditor', ['textareaId' => 'pageContent'])
@stop
@@ -0,0 +1,50 @@
<ul class="nav nav-tabs with-tabs" role="tablist">
@foreach($formSectionNames as $section => $sectionName)
<li class="nav-item">
<a href="#{{$section}}" role="tab" data-toggle="tab"
class="nav-link @if($sectionName == reset($formSectionNames)) active @endif">
{{trans($sectionName)}}
</a>
</li>
@endforeach
</ul>
<div class="tab-content">
@foreach($formSections as $section => $view)
<div role="tabpanel" class="tabs-pane @if($view == reset($formSections)) in active @endif"
id="{{$section}}">
@include($view)
</div>
@endforeach
</div>
{{--<ul class='tabs'>--}}
{{--<li><a href='#tab1'>Tab 1</a></li>--}}
{{--<li><a href='#tab2'>Tab 2</a></li>--}}
{{--<li><a href='#tab3'>Tab 3</a></li>--}}
{{--</ul>--}}
{{--<div id='tab1'>--}}
{{--<p>Hi, this is the first tab.</p>--}}
{{--</div>--}}
{{--<div id='tab2'>--}}
{{--<p>This is the 2nd tab.</p>--}}
{{--</div>--}}
{{--<div id='tab3'>--}}
{{--<p>And this is the 3rd tab.</p>--}}
{{--</div>--}}
{{--<ul class="nav nav-tabs">--}}
{{--<li class="active"><a data-toggle="tab" href="#home">Home</a></li>--}}
{{--<li><a data-toggle="tab" href="#menu1">Menu 1</a></li>--}}
{{--</ul>--}}
{{--<div class="tab-content">--}}
{{--<div id="home" class="tab-pane fade in active">--}}
{{--<h3>HOME</h3>--}}
{{--<p>Some content.</p>--}}
{{--</div>--}}
{{--<div id="menu1" class="tab-pane fade">--}}
{{--<h3>Menu 1</h3>--}}
{{--<p>Some content in menu 1.</p>--}}
{{--</div>--}}
{{--</div>--}}
@@ -0,0 +1,50 @@
@if($page->title_photo)
<div class="row">
<div class="col-lg-12 title-photo text-center">
<img src="{{config('app.upload_url')}}/{{$page->title_photo}}" alt="" />
</div>
</div>
@endif
<div class="row">
<div class="col-lg-12">
<label>
@lang('admin/contents.uploadTitleImage')
<input type="file" id="titlePhoto" name="titlePhoto" />
</label>
@if (isset($errors) && $errors->has('titlePhoto'))
<div class="callout alert">
{{ $errors->first('titlePhoto') }}
</div>
@endif
</div>
</div>
<div class="row">
<div class="col-lg-12">
<label>
@lang('admin/contents.template')
<select name="template">
@foreach($templates as $template)
<option value="{{$template->template_name}}"
@if(old('template', $page->template) == $template->template_name) selected @endif>
{{$template->name}}
@if($template->description != '')
- {{str_limit($template->description, 60)}}
@endif
</option>
@endforeach
</select>
@if (isset($errors) && $errors->has('template'))
<div class="callout alert">
{{ $errors->first('template') }}
</div>
@endif
</label>
</div>
</div>
@@ -0,0 +1,106 @@
<div class="row">
<div class="col-lg-6">
<label class="control-label">
@lang('admin/contents.field_title')
</label>
<input type="text" name="title" class="form-control underlined slug-source"
placeholder="@lang('admin/contents.field_title')"
value="{{old('title', $page->title)}}" />
</div>
<div class="col-lg-4">
<label class="control-label">
@lang('admin/contents.field_url')
</label>
<input type="text" name="url" class="form-control underlined slug-target"
placeholder="@lang('admin/contents.field_url')"
value="{{old('url', $page->url)}}" />
@if (isset($errors) && $errors->has('url'))
<div class="callout alert">
{{ $errors->first('url') }}
</div>
@endif
</div>
<div class="col-lg-2 text-center">
<div>
<label>
<input class="checkbox" value="1" id="lockUrl"
@if(old('lockUrl') || ($page->id > 0 && \Illuminate\Support\Str::slug($page->title) != $page->url)) checked
@endif name="lockUrl" type="checkbox">
<span>@lang('admin/contents.lockUrl')</span>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<select class="form-control" name="status">
@foreach($contentStatuses as $status => $translation)
<option value="{{$status}}" @if(old('status', $page->status) == $status) selected @endif>
{{$translation}}
</option>
@endforeach
</select>
@if (isset($errors) && $errors->has('status'))
<div class="callout alert">
{{ $errors->first('status') }}
</div>
@endif
</div>
<div class="col-lg-6">
<label>
<select class="form-control" name="parentPage">
<option value="">@lang('admin/contents.noParentPage')</option>
@foreach($rootPages as $rootPage)
<option value="{{$rootPage->id}}"
@if(old('parent_page', $page->parent_id) == $rootPage->id) selected @endif>
{{$rootPage->title}}
</option>
@endforeach
</select>
</label>
@if (isset($errors) && $errors->has('parentPage'))
<div class="callout alert">
{{ $errors->first('parentPage') }}
</div>
@endif
</div>
@if($module->support_categories && count($categories))
<div class="col-lg-12">
<label>
@lang('admin/contents.category')
<select name="category">
<option value=""> ---</option>
@foreach($categories as $category)
<option value="{{$category->id}}"
@if($category->id == old('category', $page->category_id)) selected @endif>
{{str_repeat(' - ', $category->real_depth)}} {{$category->name}}
</option>
@endforeach
</select>
</label>
</div>
@endif
</div>
<div class="row">
<div class="col-lg-12">
<label>
<textarea name="pageContent" id="pageContent" class="wysiwyg-editor">
{{old('pageContent', $page->content)}}
</textarea>
</label>
</div>
</div>
@@ -0,0 +1,20 @@
<div class="row">
@if(count($page->files))
<div class="col-lg-6">
<ul>
@foreach($page->files as $file)
<li><label><input type="checkbox" name="keepAssigned[{{$file->id}}]" checked /> {{$file->original_filename}}</label></li>
@endforeach
</ul>
</div>
@endif
<div class="col-lg-6">
<label>
@lang('admin/contents.files')
<input type="file" name="files[]" multiple />
</label>
</div>
</div>
@@ -0,0 +1,18 @@
<div class="row">
<div class="col-lg-12">
<label>
@lang('admin/contents.field_meta_keywords')
<input type="text" name="metaKeywords" value="{{old('meta_keywords', $page->meta_keywords)}}" placeholder="@lang('admin/contents.field_meta_keywords')" />
</label>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<label>
@lang('admin/contents.field_meta_description')
<textarea name="metaDescription" placeholder="@lang('admin/contents.field_meta_description')" rows="5">{{old('meta_description', $page->meta_description)}}</textarea>
</label>
</div>
</div>
@@ -0,0 +1,31 @@
<div class="row">
<div class="col-lg-6">
<label>
@lang('admin/contents.field_published_from')
<input type="datetime" name="published_from" value="{{old('published_from', $page->published_from)}}"
placeholder="@lang('admin/contents.field_published_from')" />
@if (isset($errors) && $errors->has('published_from'))
<div class="callout alert">
{{ $errors->first('published_from') }}
</div>
@endif
</label>
</div>
<div class="col-lg-6">
<label>
@lang('admin/contents.field_published_to')
<input type="datetime" name="published_to" value="{{old('published_to', $page->published_to)}}"
placeholder="@lang('admin/contents.field_published_to')" />
@if (isset($errors) && $errors->has('published_to'))
<div class="callout alert">
{{ $errors->first('published_to') }}
</div>
@endif
</label>
</div>
</div>
@@ -0,0 +1,7 @@
@extends('admin.layoutWithNavigation')
@section('pageHeading', @trans('admin/contents.new', ['name' => $moduleName]))
@section('content')
@include('admin.content.newForm')
@stop
@@ -0,0 +1,15 @@
<form method="POST" enctype="multipart/form-data" action="{{route('content.newPost', ['moduleId' => $moduleId])}}">
{!! csrf_field() !!}
@include('admin.content.formInputs')
<div class="row">
<div class="columns large-12">
<button type="submit" class="button success">@lang('admin/contents.save')</button>
</div>
</div>
</form>
@section('javascripts')
@include('admin.snippets.ckEditor', ['textareaId' => 'pageContent'])
@stop
+7 -4
View File
@@ -4,13 +4,13 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>{{isset($pageName) ? $pageName : ''}}</title>
<title>@yield('pageHeading') {{isset($pageName) ? ' | '.$pageName: ''}}</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{asset('resources/assets/css/font-awesome.min.css')}}" />
<link rel="stylesheet" href="{{asset('resources/assets/admin/css/vendor.css')}}">
@yield('stylesheets')
<script>
window.assetsPath = "{{asset('resources/assets/admin')}}";
var themeSettings = (localStorage.getItem ('themeSettings')) ? JSON.parse (localStorage.getItem ('themeSettings')) :
@@ -27,13 +27,15 @@
<body>
@if (session('success'))
<div data-alert class="callout success">
<div class="notification alert alert-success">
<i class="fa fw fa-check"></i>
<strong>{{ session('success') }}</strong>
</div>
@endif
@if (session('error'))
<div data-alert class="callout alert">
<div data-alert class="notification alert alert-danger">
<i class="fa fw fa-remove"></i>
<strong>{{ session('error') }}</strong>
</div>
@endif
@@ -49,6 +51,7 @@
</div>
<script src="{{asset('resources/assets/admin/js')}}/vendor.js"></script>
<script src="{{asset('resources/assets/admin/js')}}/app.js"></script>
@yield('javascripts')
</body>
</html>
@@ -73,98 +73,6 @@
</div>
<nav class="menu">
{!! Menu::render('mainMenu', 'metismenu') !!}
{{--<ul class="nav metismenu" id="sidebar-menu">--}}
{{--<li>--}}
{{--<a href="index.html"> <i class="fa fa-home"></i> Dashboard </a>--}}
{{--</li>--}}
{{--<li>--}}
{{--<a href=""> <i class="fa fa-th-large"></i> Items Manager <i class="fa arrow"></i> </a>--}}
{{--<ul>--}}
{{--<li><a href="items-list.html">--}}
{{--Items List--}}
{{--</a></li>--}}
{{--<li><a href="item-editor.html">--}}
{{--Item Editor--}}
{{--</a></li>--}}
{{--</ul>--}}
{{--</li>--}}
{{--<li class="active open">--}}
{{--<a href=""> <i class="fa fa-bar-chart"></i> Charts <i class="fa arrow"></i> </a>--}}
{{--<ul>--}}
{{--<li class="active"><a href="charts-flot.html">--}}
{{--Flot Charts--}}
{{--</a></li>--}}
{{--<li><a href="charts-morris.html">--}}
{{--Morris Charts--}}
{{--</a></li>--}}
{{--</ul>--}}
{{--</li>--}}
{{--<li>--}}
{{--<a href=""> <i class="fa fa-table"></i> Tables <i class="fa arrow"></i> </a>--}}
{{--<ul>--}}
{{--<li><a href="static-tables.html">--}}
{{--Static Tables--}}
{{--</a></li>--}}
{{--<li><a href="responsive-tables.html">--}}
{{--Responsive Tables--}}
{{--</a></li>--}}
{{--</ul>--}}
{{--</li>--}}
{{--<li>--}}
{{--<a href="forms.html"> <i class="fa fa-pencil-square-o"></i> Forms </a>--}}
{{--</li>--}}
{{--<li>--}}
{{--<a href=""> <i class="fa fa-desktop"></i> UI Elements <i class="fa arrow"></i> </a>--}}
{{--<ul>--}}
{{--<li><a href="buttons.html">--}}
{{--Buttons--}}
{{--</a></li>--}}
{{--<li><a href="cards.html">--}}
{{--Cards--}}
{{--</a></li>--}}
{{--<li><a href="typography.html">--}}
{{--Typography--}}
{{--</a></li>--}}
{{--<li><a href="icons.html">--}}
{{--Icons--}}
{{--</a></li>--}}
{{--<li><a href="grid.html">--}}
{{--Grid--}}
{{--</a></li>--}}
{{--</ul>--}}
{{--</li>--}}
{{--<li>--}}
{{--<a href=""> <i class="fa fa-file-text-o"></i> Pages <i class="fa arrow"></i> </a>--}}
{{--<ul>--}}
{{--<li><a href="login.html">--}}
{{--Login--}}
{{--</a></li>--}}
{{--<li><a href="signup.html">--}}
{{--Sign Up--}}
{{--</a></li>--}}
{{--<li><a href="reset.html">--}}
{{--Reset--}}
{{--</a></li>--}}
{{--<li><a href="error-404.html">--}}
{{--Error 404 App--}}
{{--</a></li>--}}
{{--<li><a href="error-404-alt.html">--}}
{{--Error 404 Global--}}
{{--</a></li>--}}
{{--<li><a href="error-500.html">--}}
{{--Error 500 App--}}
{{--</a></li>--}}
{{--<li><a href="error-500-alt.html">--}}
{{--Error 500 Global--}}
{{--</a></li>--}}
{{--</ul>--}}
{{--</li>--}}
{{--<li>--}}
{{--<a href="https://github.com/modularcode/modular-admin-html"> <i--}}
{{--class="fa fa-github-alt"></i> Theme Docs </a>--}}
{{--</li>--}}
{{--</ul>--}}
</nav>
</div>
<footer class="sidebar-footer">
@@ -235,18 +143,27 @@
</aside>
<div class="sidebar-overlay" id="sidebar-overlay"></div>
@yield('content')
<article class="content charts-flot-page">
<div class="title-block">
<h3 class="title">
@yield('pageHeading')
</h3>
<p class="title-description">@yield('pageDescription')</p>
</div>
<section class="section">
@yield('content')
</section>
</article>
<footer class="footer">
<div class="footer-block buttons">
<iframe class="footer-github-btn"
src="https://ghbtns.com/github-btn.html?user=modularcode&repo=modular-admin-html&type=star&count=true"
frameborder="0" scrolling="0" width="140px" height="20px"></iframe>
</div>
<div class="footer-block author">
<ul>
<li> created by <a href="https://github.com/modularcode">ModularCode</a></li>
<li><a href="https://github.com/modularcode/modular-admin-html#get-in-touch">get in touch</a>
<li>
<a href="https://binarity.cz">binarity s.r.o.</a>
</li>
<li>
<a href="https://github.com/modularcode">ModularCode</a>
</li>
</ul>
</div>
@@ -0,0 +1,21 @@
<div class="ace-editor-container large">
<textarea class="ace-editor-textarea" name="{{$name}}" id="{{$name}}">{{$value}}</textarea>
<div class="ace-editor" id="{{$name}}Editor">{{$value}}</div>
</div>
@section('javascripts')
<script src="{{asset('resources/assets/js/vendor/ace/ace.js')}}"></script>
<script type="application/javascript">
var editor = ace.edit("{{$name}}Editor");
editor.setTheme("ace/theme/{{$theme}}");
editor.getSession().setMode("ace/mode/{{$mode}}");
var textarea = $('#{{$name}}');//.hide();
editor.getSession().setValue(textarea.val());
editor.getSession().on('change', function(){
textarea.val(editor.getSession().getValue());
});
</script>
@endsection
@@ -0,0 +1,26 @@
<script src="{{asset('/resources/assets/js/vendor/ckeditor/ckeditor.js')}}"></script>
<script type="application/javascript">
CKEDITOR.replace ('{{$textareaId}}', {
uiColor: "#F5F5F5",
forcePasteAsPlainText: true,
entities: false,
basicEntities: false,
entities_greek: false,
entities_latin: false,
removePlugins: 'elementspath,about,scayt',
extraPlugins: 'justify',
toolbarGroups: [
{name: 'undo', groups: ['undo']},
{name: 'styles'},
{name: 'basicstyles', groups: ['basicstyles', 'cleanup']},
{name: 'paragraph', groups: ['list', 'indent', 'align', 'blocks']},
{name: 'links'},
{name: 'editing', groups: ['find', 'selection']},
{name: 'insert'},
{name: 'forms'},
{name: 'document', groups: ['mode', 'document', 'doctools']},
{name: 'tools'}
]
});
</script>