Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed checkboxes for accessibility #13469

Merged
merged 3 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/View/Label.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function render(callable $callback = null)

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);
}
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/en/admin/settings/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@
'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',
Expand Down
31 changes: 19 additions & 12 deletions resources/views/settings/labels.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')) }}

<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>

Expand Down Expand Up @@ -118,15 +123,17 @@ class="table table-striped snipe-table"
</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>

Expand Down