Display the form errors correctly

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-10-31 15:30:49 +00:00
parent 57372fc82a
commit aa2a25dc19

View file

@ -137,7 +137,7 @@
@csrf
<div class="form-group {{ $errors->has((isset($fieldname) ? $fieldname : 'image')) ? 'has-error' : '' }}" style="margin-bottom: 0px;">
<div class="form-group {{ $errors->has((isset($fieldname) ? $fieldname : 'file')) ? 'has-error' : '' }}" style="margin-bottom: 0px;">
<div class="col-md-8 col-xs-8">
@ -145,25 +145,17 @@
<label class="btn btn-default col-md-12 col-xs-12" aria-hidden="true">
<i class="fas fa-paperclip" aria-hidden="true"></i>
{{ trans('button.select_file') }}
<input type="file" name="file" class="js-uploadFile" id="uploadFile" data-maxsize="{{ Helper::file_upload_max_size() }}" accept="application/zip" style="display:none;" aria-label="file" aria-hidden="true">
</label>
</div>
<div class="col-md-4 col-xs-4">
<button class="btn btn-primary col-md-12 col-xs-12" id="uploadButton" disabled>{{ trans('button.upload') }} <span id="uploadIcon"></span></button>
</div>
<div class="col-md-12">
<p class="label label-default col-md-12" style="font-size: 120%!important; margin-top: 10px; margin-bottom: 10px;" id="uploadFile-info"></p>
<p class="help-block" style="margin-top: 10px;" id="uploadFile-status">{{ trans_choice('general.filetypes_accepted_help', 1, ['size' => Helper::file_upload_max_size_readable(), 'types' => '.zip']) }}</p>
{!! $errors->first('image', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
{!! $errors->first('file', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>