FEATURE #1435: few smaller UI tweaks in creating new content page

This commit is contained in:
Michal Kváček
2016-08-19 13:20:16 +02:00
parent 0d1d692c45
commit f6fd924cbd
7 changed files with 22 additions and 7 deletions
+5
View File
@@ -13033,3 +13033,8 @@ a:focus {
font-size: 13px; font-size: 13px;
display: block !important; display: block !important;
} }
.tab-with-error {
color: red !important;
font-weight: bold;
}
+2 -2
View File
@@ -1430,13 +1430,13 @@ $ (document).ready (function () {
target.val (slugify (source.val (), true)); target.val (slugify (source.val (), true));
}); });
// find if any error occured and mark tab with that error
$('.has-error').each(function () { $('.has-error').each(function () {
var error = $(this); var error = $(this);
var tabCard = error.closest('.tab-pane'); var tabCard = error.closest('.tab-pane');
$("#"+tabCard.prop('id')+"-tab").css('background-color', 'red'); $("#"+tabCard.prop('id')+"-tab").addClass('tab-with-error');
}); });
}); });
+1
View File
@@ -47,4 +47,5 @@ return [
'files' => 'Files', 'files' => 'Files',
'lockUrl' => 'Keep URL', 'lockUrl' => 'Keep URL',
'noCategory' => ' -- No category -- ', 'noCategory' => ' -- No category -- ',
'noTemplates' => 'Cannot create content page. There are no available templates for this module.'
]; ];
@@ -12,7 +12,6 @@
@lang('admin/contents.uploadTitleImage') @lang('admin/contents.uploadTitleImage')
</label> </label>
<input type="file" id="titlePhoto" name="titlePhoto" class="form-control" /> <input type="file" id="titlePhoto" name="titlePhoto" class="form-control" />
<span class="has-error">Neplatny template</span>
@include('admin.snippets.hasError', ['field' => 'titlePhoto']) @include('admin.snippets.hasError', ['field' => 'titlePhoto'])
</div> </div>
@@ -1,6 +1,6 @@
<div class="row"> <div class="row">
<div class="col-lg-6"> <div class="col-lg-6">
<input type="text" name="title" class="form-control slug-source" <input type="text" name="title" required class="form-control slug-source"
placeholder="@lang('admin/contents.field_title')" placeholder="@lang('admin/contents.field_title')"
value="{{old('title', $page->title)}}" /> value="{{old('title', $page->title)}}" />
@@ -4,7 +4,10 @@
<div class="col-lg-6"> <div class="col-lg-6">
<ul> <ul>
@foreach($page->files as $file) @foreach($page->files as $file)
<li><label><input type="checkbox" name="keepAssigned[{{$file->id}}]" checked /> {{$file->original_filename}}</label></li> <li>
<input type="checkbox" name="keepAssigned[{{$file->id}}]" checked />
{{$file->original_filename}}
</li>
@endforeach @endforeach
</ul> </ul>
</div> </div>
+8 -1
View File
@@ -3,6 +3,13 @@
@section('pageHeading', @trans('admin/contents.new', ['name' => $moduleName])) @section('pageHeading', @trans('admin/contents.new', ['name' => $moduleName]))
@section('content') @section('content')
@if(!count($templates))
<div class="alert alert-warning">
@lang('admin/contents.noTemplates')
</div>
@endif
<form method="POST" enctype="multipart/form-data" action="{{route('content.newPost', ['moduleId' => $moduleId])}}"> <form method="POST" enctype="multipart/form-data" action="{{route('content.newPost', ['moduleId' => $moduleId])}}">
{!! csrf_field() !!} {!! csrf_field() !!}
@@ -10,7 +17,7 @@
<button type="submit" class="btn btn-primary">@lang('admin/contents.save')</button> <button type="submit" class="btn btn-primary">@lang('admin/contents.save')</button>
</form> </form>
@stop @endsection
@section('javascripts') @section('javascripts')
@include('admin.snippets.ckEditor', ['textareaId' => 'pageContent']) @include('admin.snippets.ckEditor', ['textareaId' => 'pageContent'])