FEATURE: make adding custom fields working

This commit is contained in:
Michal Kváček
2016-01-26 22:44:15 +01:00
parent fedb5abae6
commit 271f27be0b
5 changed files with 77 additions and 28 deletions
+19 -18
View File
@@ -1,21 +1,22 @@
<?php
return [
'overview' => 'List of all custom fields',
'new' => 'New custom field',
'noFields' => 'No custom fields defined.',
'users' => 'Custom fields for user',
'content' => 'Custom fields for content page',
'name' => 'Name',
'description' => 'Description',
'type' => 'Type of custom field',
'required' => 'Is field required?',
'defaultValue' => 'Default value',
'regExp' => 'Match only this regular expression',
'minLength' => 'Minimum length',
'maxLength' => 'Maximum length',
'createNew' => 'Create new field',
'date' => 'Date',
'number' => 'Number',
'selectboxList' => 'List (selectbox)',
'string' => 'Short text'
'overview' => 'List of all custom fields',
'new' => 'New custom field',
'noFields' => 'No custom fields defined.',
'users' => 'Custom fields for user',
'content' => 'Custom fields for content page',
'name' => 'Name',
'description' => 'Description',
'type' => 'Type of custom field',
'required' => 'Is field required?',
'defaultValue' => 'Default value',
'regExp' => 'Match only this regular expression',
'minLength' => 'Minimum length',
'maxLength' => 'Maximum length',
'createNew' => 'Create new field',
'date' => 'Date',
'number' => 'Number',
'selectboxList' => 'List (selectbox)',
'string' => 'Short text',
'successfullyCreated' => 'Custom field successfully created.'
];
@@ -10,6 +10,17 @@
</div>
<div class="row">
@if (session('success'))
<div data-alert class="callout success">
<strong>{{ session('success') }}</strong>
</div>
@endif
@if (session('error'))
<div data-alert class="callout alert">
<strong>{{ session('error') }}</strong>
</div>
@endif
@include('admin.customFields.newForm')
</div>
@stop
@@ -5,7 +5,7 @@
<div class="large-6 columns">
<label>
@lang('admin/customFields.name')
<input type="text" placeholder="@lang('admin/customFields.name')" name="name">
<input type="text" placeholder="@lang('admin/customFields.name')" value="{{old('name')}}" name="name">
@if (isset($errors) && $errors->has('name'))
<div class="callout alert">
@@ -20,7 +20,7 @@
<select name="type">
@foreach($types as $type => $translation)
<option value="{{$type}}">@lang($translation)</option>
<option value="{{$type}}"@if(old('type') == $type) selected @endif>@lang($translation)</option>
@endforeach
</select>
@@ -37,7 +37,7 @@
<label>
@lang('admin/customFields.description')
<textarea rows="5" name="description" placeholder="@lang('admin/customFields.description')"></textarea>
<textarea rows="5" name="description" placeholder="@lang('admin/customFields.description')">{{old('description')}}</textarea>
</label>
</div>
@@ -45,19 +45,19 @@
<label>
@lang('admin/customFields.required')
<input type="checkbox" placeholder="@lang('admin/customFields.required')" name="required">
<input type="checkbox" placeholder="@lang('admin/customFields.required')" @if (old('required')) checked="checked" @endif name="required">
</label>
<label>
@lang('admin/customFields.defaultValue')
<input type="text" placeholder="@lang('admin/customFields.defaultValue')" name="defaultValue">
<input type="text" placeholder="@lang('admin/customFields.defaultValue')" value="{{old('defaultValue')}}" name="defaultValue">
</label>
<label>
@lang('admin/customFields.regExp')
<input type="text" placeholder="@lang('admin/customFields.regExp')" name="regExp">
<input type="text" placeholder="@lang('admin/customFields.regExp')" value="{{old('regExp')}}" name="regExp">
</label>
</div>
</div>
@@ -67,7 +67,7 @@
<label>
@lang('admin/customFields.minLength')
<input type="text" placeholder="@lang('admin/customFields.minLength')" name="minLength">
<input type="text" placeholder="@lang('admin/customFields.minLength')" value="{{old('minLength')}}" name="minLength">
@if (isset($errors) && $errors->has('minLength'))
<div class="callout alert">
@@ -80,7 +80,7 @@
<label>
@lang('admin/customFields.maxLength')
<input type="text" placeholder="@lang('admin/customFields.maxLength')" name="maxLength">
<input type="text" placeholder="@lang('admin/customFields.maxLength')" value="{{old('macLength')}}" name="maxLength">
@if (isset($errors) && $errors->has('maxLength'))
<div class="callout alert">