Fixed aria labels on dropdowns

This commit is contained in:
snipe 2020-03-31 21:53:26 -07:00
parent bde45cbb34
commit 99c4c73c09
3 changed files with 40 additions and 18 deletions

View file

@ -16,25 +16,26 @@
@section('header_right') @section('header_right')
@can('manage', \App\Models\Accessory::class) @can('manage', \App\Models\Accessory::class)
<div class="dropdown pull-right"> <div class="dropdown pull-right">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }} <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
{{ trans('button.actions') }}
<span class="caret"></span> <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dropdownMenu1"> <ul class="dropdown-menu pull-right" role="menu">
@if ($accessory->assigned_to != '') @if ($accessory->assigned_to != '')
@can('checkin', \App\Models\Accessory::class) @can('checkin', \App\Models\Accessory::class)
<li role="presentation"> <li role="menuitem">
<a href="{{ route('checkin/accessory', $accessory->id) }}">{{ trans('admin/accessories/general.checkin') }}</a> <a href="{{ route('checkin/accessory', $accessory->id) }}">{{ trans('admin/accessories/general.checkin') }}</a>
</li> </li>
@endcan @endcan
@else @else
@can('checkout', \App\Models\Accessory::class) @can('checkout', \App\Models\Accessory::class)
<li role="presentation"> <li role="menuitem">
<a href="{{ route('checkout/accessory', $accessory->id) }}">{{ trans('admin/accessories/general.checkout') }}</a> <a href="{{ route('checkout/accessory', $accessory->id) }}">{{ trans('admin/accessories/general.checkout') }}</a>
</li> </li>
@endcan @endcan
@endif @endif
@can('update', \App\Models\Accessory::class) @can('update', \App\Models\Accessory::class)
<li role="presentation"> <li role="menuitem">
<a href="{{ route('accessories.edit', $accessory->id) }}">{{ trans('admin/accessories/general.edit') }}</a> <a href="{{ route('accessories.edit', $accessory->id) }}">{{ trans('admin/accessories/general.edit') }}</a>
</li> </li>
@endcan @endcan
@ -96,7 +97,7 @@
<div class="text-center"> <div class="text-center">
@can('checkout', \App\Models\Accessory::class) @can('checkout', \App\Models\Accessory::class)
<a href="{{ route('checkout/accessory', $accessory->id) }}" style="margin-right:5px;" class="btn btn-success btn-sm" {{ (($accessory->numRemaining() > 0 ) ? '' : ' disabled') }}>{{ trans('general.checkout') }}</a> <a href="{{ route('checkout/accessory', $accessory->id) }}" style="margin-right:5px;" class="btn btn-primary btn-sm" {{ (($accessory->numRemaining() > 0 ) ? '' : ' disabled') }}>{{ trans('general.checkout') }}</a>
@endcan @endcan
</div> </div>

View file

@ -12,22 +12,35 @@
@section('header_right') @section('header_right')
@can('manage', $component) @can('manage', $component)
<div class="dropdown pull-right"> <div class="dropdown pull-right">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }} <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
{{ trans('button.actions') }}
<span class="caret"></span> <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dropdownMenu1"> <ul class="dropdown-menu pull-right" role="menu22">
@if ($component->assigned_to != '') @if ($component->assigned_to != '')
@can('checkin', $component) @can('checkin', $component)
<li role="presentation"><a href="{{ route('checkin/component', $component->id) }}">{{ trans('admin/components/general.checkin') }}</a></li> <li role="menuitem">
<a href="{{ route('checkin/component', $component->id) }}">
{{ trans('admin/components/general.checkin') }}
</a>
</li>
@endcan @endcan
@else @else
@can('checkout', $component) @can('checkout', $component)
<li role="presentation"><a href="{{ route('checkout/component', $component->id) }}">{{ trans('admin/components/general.checkout') }}</a></li> <li role="menuitem">
<a href="{{ route('checkout/component', $component->id) }}">
{{ trans('admin/components/general.checkout') }}
</a>
</li>
@endcan @endcan
@endif @endif
@can('update', $component) @can('update', $component)
<li role="presentation"><a href="{{ route('components.edit', $component->id) }}">{{ trans('admin/components/general.edit') }}</a></li> <li role="menuitem">
<a href="{{ route('components.edit', $component->id) }}">
{{ trans('admin/components/general.edit') }}
</a>
</li>
@endcan @endcan
</ul> </ul>
</div> </div>
@ -67,10 +80,18 @@
}'> }'>
<thead> <thead>
<tr> <tr>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="name" data-formatter="hardwareLinkFormatter">{{ trans('general.asset') }}</th> <th data-searchable="false" data-sortable="false" data-field="name" data-formatter="hardwareLinkFormatter">
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="qty">{{ trans('general.qty') }}</th> {{ trans('general.asset') }}
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th> </th>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="checkincheckout" data-formatter="componentsInOutFormatter">{{ trans('general.checkin') }}/{{ trans('general.checkout') }}</th> <th data-searchable="false" data-sortable="false" data-field="qty">
{{ trans('general.qty') }}
</th>
<th data-searchable="false" data-sortable="false" data-field="created_at" data-formatter="dateDisplayFormatter">
{{ trans('general.date') }}
</th>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="checkincheckout" data-formatter="componentsInOutFormatter">
{{ trans('general.checkin') }}/{{ trans('general.checkout') }}
</th>
</tr> </tr>
</thead> </thead>
</table> </table>

View file

@ -14,9 +14,9 @@
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }} <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }}
<span class="caret"></span> <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu" role="menu">
<li><a href="{{ route('licenses.edit', ['license' => $license->id]) }}">{{ trans('admin/licenses/general.edit') }}</a></li> <li role="menuitem"><a href="{{ route('licenses.edit', ['license' => $license->id]) }}">{{ trans('admin/licenses/general.edit') }}</a></li>
<li><a href="{{ route('clone/license', $license->id) }}">{{ trans('admin/licenses/general.clone') }}</a></li> <li role="menuitem"><a href="{{ route('clone/license', $license->id) }}">{{ trans('admin/licenses/general.clone') }}</a></li>
</ul> </ul>
@endcan @endcan
</div> </div>