Merge pull request #13469 from snipe/fixes/missed_one_checkbox_in_label

Fixed checkboxes for accessibility
This commit is contained in:
snipe 2023-08-15 20:30:39 +01:00 committed by GitHub
commit bc4a47421a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 15 deletions

View file

@ -88,7 +88,7 @@ class Label implements View
if ($template->getSupportTitle()) {
$title = !empty($settings->label2_title) ?
str_ireplace(':company', $asset->company->name, $settings->label2_title) :
str_ireplace('{COMPANY}', $asset->company->name, $settings->label2_title) :
$settings->qr_text;
if (!empty($title)) $assetData->put('title', $title);
}

View file

@ -336,7 +336,7 @@ return [
'label2_template_help' => 'Select which template to use for label generation',
'label2_title' => 'Title',
'label2_title_help' => 'The title to show on labels that support it',
'label2_title_help_phold' => 'The placeholder <code>&colon;company</code> will be replaced with the asset&apos;s company name',
'label2_title_help_phold' => 'The placeholder <code>{COMPANY}</code> will be replaced with the asset&apos;s company name',
'label2_asset_logo' => 'Use Asset Logo',
'label2_asset_logo_help' => 'Use the logo of the asset&apos;s assigned company, rather than the value at <code>:setting_name</code>',
'label2_1d_type' => '1D Barcode Type',

View file

@ -41,17 +41,22 @@
<!-- New Label Engine -->
<div class="form-group" {{ $errors->has('label2_enable') ? 'error' : '' }}">
<div class="col-md-7 col-md-offset-3">
<label for="label2_enable" class="form-control">
<input type="checkbox" value="1" name="label2_enable" {{ (old('label2_enable', $setting->label2_enable)) == '1' ? ' checked="checked"' : '' }} aria-label="label2_enable">
{{ Form::label('label2_enable', trans('admin/settings/general.label2_enable')) }}
<div class="col-md-7 col-md-offset-3">
<label class="form-control">
<input type="checkbox" value="1" name="label2_enable"{{ ((old('label2_enable') == '1') || ($setting->label2_enable) == '1') ? ' checked="checked"' : '' }} aria-label="label2_enable">
{{ Form::label('label2_enable', trans('admin/settings/general.label2_enable')) }}
</label>
{!! $errors->first('label2_enable', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
<p class="help-block">
{!! trans('admin/settings/general.label2_enable_help') !!}
</p>
</div>
</div>
@ -118,15 +123,17 @@
</div>
<!-- Use Asset Logo -->
<div class="form-group{{ $errors->has('label2_asset_logo') ? ' has-error' : '' }}">
<div class="col-md-3 text-right">
{{ Form::label('label2_asset_logo', trans('admin/settings/general.label2_asset_logo'), ['class'=>'control-label']) }}
</div>
<div class="col-md-9">
{{ Form::checkbox('label2_asset_logo', '1', old('label2_asset_logo', $setting->label2_asset_logo, [ 'class'=>'minimal', 'aria-label'=>'label2_asset_logo' ])) }}
{{ trans('general.yes') }}
{!! $errors->first('label2_asset_logo', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
<p class="help-block">{!! trans('admin/settings/general.label2_asset_logo_help', ['setting_name' => trans('admin/settings/general.brand').' &gt; '.trans('admin/settings/general.label_logo')]) !!}</p>
<div class="form-group" {{ $errors->has('label2_asset_logo') ? 'error' : '' }}">
<div class="col-md-7 col-md-offset-3">
<label class="form-control">
<input type="checkbox" value="1" name="label2_asset_logo"{{ ((old('label2_asset_logo') == '1') || ($setting->label2_asset_logo) == '1') ? ' checked="checked"' : '' }} aria-label="label2_asset_logo">
{{ trans('general.yes') }}
</label>
<p class="help-block">
{!! trans('admin/settings/general.label2_asset_logo_help', ['setting_name' => trans('admin/settings/general.brand').' &gt; '.trans('admin/settings/general.label_logo')]) !!}
</p>
</div>
</div>