Merge branch 'develop'
This commit is contained in:
commit
143071fa0c
4 changed files with 29 additions and 6 deletions
|
@ -3,6 +3,7 @@
|
||||||
namespace App\Http\Requests;
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class CustomFieldRequest extends FormRequest
|
class CustomFieldRequest extends FormRequest
|
||||||
{
|
{
|
||||||
|
@ -21,11 +22,26 @@ class CustomFieldRequest extends FormRequest
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function rules()
|
public function rules(Request $request)
|
||||||
{
|
{
|
||||||
return [
|
|
||||||
"name" => "required|unique:custom_fields",
|
$rules = [];
|
||||||
"custom_format" => "valid_regex",
|
|
||||||
];
|
switch($this->method())
|
||||||
|
{
|
||||||
|
|
||||||
|
// Brand new
|
||||||
|
case 'POST':
|
||||||
|
{
|
||||||
|
$rules['name'] = "required|unique:custom_fields";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$rules['custom_format'] = 'valid_regex';
|
||||||
|
|
||||||
|
return $rules;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,5 +19,9 @@
|
||||||
</rule>
|
</rule>
|
||||||
</rules>
|
</rules>
|
||||||
</rewrite>
|
</rewrite>
|
||||||
|
<staticContent>
|
||||||
|
<remove fileExtension=".woff2" />
|
||||||
|
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff2" />
|
||||||
|
</staticContent>
|
||||||
</system.webServer>
|
</system.webServer>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
@ -82,7 +82,7 @@
|
||||||
{{ trans('admin/custom_fields/general.field_custom_format') }}
|
{{ trans('admin/custom_fields/general.field_custom_format') }}
|
||||||
</label>
|
</label>
|
||||||
<div class="col-md-6 required">
|
<div class="col-md-6 required">
|
||||||
{{ Form::text('custom_format', Input::old('custom_format', $field->format), array('class' => 'form-control', 'id' => 'custom_format', 'placeholder'=>'regex:/^[0-9]{15}$/')) }}
|
{{ Form::text('custom_format', Input::old('custom_format', (($field->format!='') && ($field->format!='ANY')) ? $field->format : ''), array('class' => 'form-control', 'id' => 'custom_format', 'placeholder'=>'regex:/^[0-9]{15}$/')) }}
|
||||||
<p class="help-block">{!! trans('admin/custom_fields/general.field_custom_format_help') !!}</p>
|
<p class="help-block">{!! trans('admin/custom_fields/general.field_custom_format_help') !!}</p>
|
||||||
|
|
||||||
{!! $errors->first('custom_format', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
{!! $errors->first('custom_format', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||||
|
|
|
@ -771,6 +771,7 @@
|
||||||
<script nonce="{{ csrf_token() }}">
|
<script nonce="{{ csrf_token() }}">
|
||||||
$(function () {
|
$(function () {
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
$('[data-toggle="tooltip"]').tooltip();
|
||||||
|
$('.select2 span').addClass('needsclick');
|
||||||
|
|
||||||
// This javascript handles saving the state of the menu (expanded or not)
|
// This javascript handles saving the state of the menu (expanded or not)
|
||||||
$('body').bind('expanded.pushMenu', function() {
|
$('body').bind('expanded.pushMenu', function() {
|
||||||
|
@ -798,6 +799,8 @@
|
||||||
$(this).ekkoLightbox();
|
$(this).ekkoLightbox();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@if ((Session::get('topsearch')=='true') || (Request::is('/')))
|
@if ((Session::get('topsearch')=='true') || (Request::is('/')))
|
||||||
|
|
Loading…
Add table
Reference in a new issue