snipe-it/resources/views/partials/forms/edit/uploadLogo.blade.php
Steffen e1907e30b1 Allow multiple upload fields and add logo option to labels (#6736)
* Change upload js to work with multiple upload elements on a single page

* Change uploadFile in upload modal and form partial

* Change uploadFile to js-uploadFile to avoid potential issues in the future

* Remove duplicate style attribute causing webpack to fail

* Missed a css class in rename to js- prefix

* - Move logo uploads to partial for eaiser usage
- Add label logo
- Add css classes to label elements
- Change label prefix text (M: S: ...) to css::before content for easy removal in config

* Add more css classes to labels

* Allow unescaped " (quot) in css ouput

* Add max size param to partial, set defaults for allowedType and size
2019-03-01 15:25:42 -08:00

29 lines
1.3 KiB
PHP

<div class="form-group {{ $errors->has($logoVariable) ? 'has-error' : '' }}">
<label class="col-md-3" for="{{ $logoVariable }}">
{{ Form::label($logoVariable, $logoLabel) }}</label>
<div class="col-md-9">
<label class="btn btn-default">
{{ trans('button.select_file') }}
<input type="file" name="{{ $logoVariable }}" class="js-uploadFile" id="{{ $logoId }}"
data-maxsize="{{ $maxSize ?? \App\Helpers\Helper::file_upload_max_size() }}"
accept="{{ $allowedTypes ?? 'image/gif,image/jpeg,image/png,image/svg'}}" style="display:none; max-width: 90%">
</label>
<span class='label label-default' id="{{ $logoId }}-info"></span>
<p class="help-block" id="{{ $logoId }}-status">
{{ $helpBlock }}
</p>
{!! $errors->first($logoVariable, '<span class="alert-msg">:message</span>') !!}
</div>
<div class="col-md-9 col-md-offset-3">
<img id="{{ $logoId }}-imagePreview" style="max-width: 500px; max-height: 50px">
</div>
@if ($setting->$logoVariable!='')
<div class="col-md-9 col-md-offset-3">
{{ Form::checkbox($logoClearVariable, '1', Input::old($logoClearVariable),array('class' => 'minimal')) }} Remove current image
</div>
@endif
</div>