Merge branch 'develop'

This commit is contained in:
snipe 2017-11-06 17:18:18 -08:00
commit 143071fa0c
4 changed files with 29 additions and 6 deletions

View file

@ -3,6 +3,7 @@
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Request;
class CustomFieldRequest extends FormRequest
{
@ -21,11 +22,26 @@ class CustomFieldRequest extends FormRequest
*
* @return array
*/
public function rules()
public function rules(Request $request)
{
return [
"name" => "required|unique:custom_fields",
"custom_format" => "valid_regex",
];
$rules = [];
switch($this->method())
{
// Brand new
case 'POST':
{
$rules['name'] = "required|unique:custom_fields";
break;
}
default:break;
}
$rules['custom_format'] = 'valid_regex';
return $rules;
}
}

View file

@ -19,5 +19,9 @@
</rule>
</rules>
</rewrite>
<staticContent>
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff2" />
</staticContent>
</system.webServer>
</configuration>

View file

@ -82,7 +82,7 @@
{{ trans('admin/custom_fields/general.field_custom_format') }}
</label>
<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>
{!! $errors->first('custom_format', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}

View file

@ -771,6 +771,7 @@
<script nonce="{{ csrf_token() }}">
$(function () {
$('[data-toggle="tooltip"]').tooltip();
$('.select2 span').addClass('needsclick');
// This javascript handles saving the state of the menu (expanded or not)
$('body').bind('expanded.pushMenu', function() {
@ -798,6 +799,8 @@
$(this).ekkoLightbox();
});
</script>
@if ((Session::get('topsearch')=='true') || (Request::is('/')))