Skip to content

Commit

Permalink
Merge pull request #15573 from snipe/fixed_requiredness_indicator
Browse files Browse the repository at this point in the history
Fixes for requiredness indicator in UI
  • Loading branch information
snipe authored Sep 28, 2024
2 parents 36b27fc + 05d74f7 commit 260b153
Show file tree
Hide file tree
Showing 39 changed files with 130 additions and 112 deletions.
7 changes: 4 additions & 3 deletions public/css/build/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -689,10 +689,11 @@ a.logo.no-hover a:hover {
}
input:required,
select:required {
border-right: 4px solid orange;
border-right: 5px solid orange;
}
select:required + .select2-container .select2-selection {
border-right: 4px solid orange;
select:required + .select2-container .select2-selection,
select:required + .select2-container .select2-selection .select2-selection--multiple {
border-right: 5px solid orange !important;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
Expand Down
7 changes: 4 additions & 3 deletions public/css/build/overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,11 @@ a.logo.no-hover a:hover {
}
input:required,
select:required {
border-right: 4px solid orange;
border-right: 5px solid orange;
}
select:required + .select2-container .select2-selection {
border-right: 4px solid orange;
select:required + .select2-container .select2-selection,
select:required + .select2-container .select2-selection .select2-selection--multiple {
border-right: 5px solid orange !important;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
Expand Down
14 changes: 8 additions & 6 deletions public/css/dist/all.css
Original file line number Diff line number Diff line change
Expand Up @@ -21661,10 +21661,11 @@ a.logo.no-hover a:hover {
}
input:required,
select:required {
border-right: 4px solid orange;
border-right: 5px solid orange;
}
select:required + .select2-container .select2-selection {
border-right: 4px solid orange;
select:required + .select2-container .select2-selection,
select:required + .select2-container .select2-selection .select2-selection--multiple {
border-right: 5px solid orange !important;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
Expand Down Expand Up @@ -23135,10 +23136,11 @@ a.logo.no-hover a:hover {
}
input:required,
select:required {
border-right: 4px solid orange;
border-right: 5px solid orange;
}
select:required + .select2-container .select2-selection {
border-right: 4px solid orange;
select:required + .select2-container .select2-selection,
select:required + .select2-container .select2-selection .select2-selection--multiple {
border-right: 5px solid orange !important;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
Expand Down
6 changes: 3 additions & 3 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"/js/build/app.js": "/js/build/app.js?id=5e9ac5c1a7e089f056fb1dba566193a6",
"/css/dist/skins/skin-black-dark.css": "/css/dist/skins/skin-black-dark.css?id=f0b08873a06bb54daeee176a9459f4a9",
"/css/dist/skins/_all-skins.css": "/css/dist/skins/_all-skins.css?id=f4397c717b99fce41a633ca6edd5d1f4",
"/css/build/overrides.css": "/css/build/overrides.css?id=c9a07471f306075f2d5d5726119712dc",
"/css/build/app.css": "/css/build/app.css?id=6a514869e025840d60113c282b97d25f",
"/css/build/overrides.css": "/css/build/overrides.css?id=efd9f439cb0586512d03172bcd9a5752",
"/css/build/app.css": "/css/build/app.css?id=2f45befb40b9d7f038eeae9569c33a5f",
"/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=4ea0068716c1bb2434d87a16d51b98c9",
"/css/dist/skins/skin-yellow.css": "/css/dist/skins/skin-yellow.css?id=7b315b9612b8fde8f9c5b0ddb6bba690",
"/css/dist/skins/skin-yellow-dark.css": "/css/dist/skins/skin-yellow-dark.css?id=393aaa7b368b0670fc42434c8cca7dc7",
Expand All @@ -19,7 +19,7 @@
"/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=f677207c6cf9678eb539abecb408c374",
"/css/dist/skins/skin-blue-dark.css": "/css/dist/skins/skin-blue-dark.css?id=0640e45bad692dcf62873c6e85904899",
"/css/dist/skins/skin-black.css": "/css/dist/skins/skin-black.css?id=76482123f6c70e866d6b971ba91de7bb",
"/css/dist/all.css": "/css/dist/all.css?id=8b0098987597c40f9e27a48c5dd2af9d",
"/css/dist/all.css": "/css/dist/all.css?id=e9509d7591637153f667461642e47e30",
"/css/dist/signature-pad.css": "/css/dist/signature-pad.css?id=6a89d3cd901305e66ced1cf5f13147f7",
"/css/dist/signature-pad.min.css": "/css/dist/signature-pad.min.css?id=6a89d3cd901305e66ced1cf5f13147f7",
"/js/select2/i18n/af.js": "/js/select2/i18n/af.js?id=4f6fcd73488ce79fae1b7a90aceaecde",
Expand Down
6 changes: 3 additions & 3 deletions resources/assets/less/overrides.less
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,10 @@ a.logo.no-hover a:hover {


input:required, select:required {
border-right: 4px solid orange;
border-right: 5px solid orange;
}
select:required + .select2-container .select2-selection {
border-right: 4px solid orange;
select:required + .select2-container .select2-selection, select:required + .select2-container .select2-selection .select2-selection--multiple {
border-right: 5px solid orange !important;
}

body {
Expand Down
26 changes: 16 additions & 10 deletions resources/views/asset_maintenances/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,32 @@
</div><!-- /.box-header -->

<div class="box-body">
@include ('partials.forms.edit.asset-select', ['translated_name' => trans('admin/hardware/table.asset_tag'), 'fieldname' => 'asset_id', 'required' => 'true'])
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id', 'required' => 'true'])
@include ('partials.forms.edit.maintenance_type')

<!-- Title -->
<div class="form-group {{ $errors->has('title') ? ' has-error' : '' }}">
<label for="title" class="col-md-3 control-label">
{{ trans('admin/asset_maintenances/form.title') }}
</label>
<div class="col-md-7{{ (Helper::checkIfRequired($item, 'title')) ? ' required' : '' }}">
<input class="form-control" type="text" name="title" id="title" value="{{ old('title', $item->title) }}" />
<div class="col-md-7">
<input class="form-control" type="text" name="title" id="title" value="{{ old('title', $item->title) }}"{{ (Helper::checkIfRequired($item, 'title')) ? ' required' : '' }} />
{!! $errors->first('title', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>


@include ('partials.forms.edit.asset-select', ['translated_name' => trans('general.asset'), 'fieldname' => 'asset_id', 'required' => 'true'])
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id', 'required' => 'true'])
@include ('partials.forms.edit.maintenance_type')



<!-- Start Date -->
<div class="form-group {{ $errors->has('start_date') ? ' has-error' : '' }}">
<label for="start_date" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/form.start_date') }}</label>

<div class="input-group col-md-3{{ (Helper::checkIfRequired($item, 'start_date')) ? ' required' : '' }}">
<div class="input-group col-md-3">
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true" data-date-clear-btn="true">
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="start_date" id="start_date" value="{{ old('start_date', $item->start_date) }}">
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="start_date" id="start_date" value="{{ old('start_date', $item->start_date) }}"{{ (Helper::checkIfRequired($item, 'start_date')) ? ' required' : '' }}>
<span class="input-group-addon"><x-icon type="calendar" /></span>
</div>
{!! $errors->first('start_date', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
Expand All @@ -75,10 +79,12 @@
<div class="form-group {{ $errors->has('completion_date') ? ' has-error' : '' }}">
<label for="start_date" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/form.completion_date') }}</label>

<div class="input-group col-md-3{{ (Helper::checkIfRequired($item, 'completion_date')) ? ' required' : '' }}">
<div class="input-group col-md-3">
<div class="input-group date" data-date-clear-btn="true" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true">
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="completion_date" id="completion_date" value="{{ old('completion_date', $item->completion_date) }}">
<span class="input-group-addon"><x-icon type="calendar" /></span>
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="completion_date" id="completion_date" value="{{ old('completion_date', $item->completion_date) }}"{{ (Helper::checkIfRequired($item, 'completion_date')) ? ' required' : '' }}>
<span class="input-group-addon">
<x-icon type="calendar" />
</span>
</div>
{!! $errors->first('completion_date', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/depreciations/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<label for="months" class="col-md-3 control-label">
{{ trans('admin/depreciations/general.number_of_months') }}
</label>
<div class="col-md-7 col-sm-12 {{ (Helper::checkIfRequired($item, 'months')) ? ' required' : '' }}">
<div class="col-md-7 col-sm-12">
<div class="col-md-7" style="padding-left:0px">
<input class="form-control" type="text" name="months" id="months" value="{{ old('months', $item->months) }}" style="width: 80px;"{!! (\App\Helpers\Helper::checkIfRequired($item, 'months')) ? ' required' : '' !!} />
{!! $errors->first('months', '<span class="alert-msg" aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i> :message</span>') !!}
Expand Down
20 changes: 12 additions & 8 deletions resources/views/hardware/bulk-checkout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,18 @@
<form class="form-horizontal" method="post" action="" autocomplete="off">
{{ csrf_field() }}

<!-- Checkout selector -->
@include ('partials.forms.edit.asset-select', [
'translated_name' => trans('general.assets'),
'fieldname' => 'selected_assets[]',
'multiple' => true,
'required' => true,
'asset_status_type' => 'RTD',
'select_id' => 'assigned_assets_select',
])



<!-- Checkout selector -->
@include ('partials.forms.checkout-selector', ['user_select' => 'true','asset_select' => 'true', 'location_select' => 'true'])

@include ('partials.forms.edit.user-select', ['translated_name' => trans('general.user'), 'fieldname' => 'assigned_user', 'required'=>'true'])
Expand Down Expand Up @@ -74,13 +85,6 @@
</div>
</div>

@include ('partials.forms.edit.asset-select', [
'translated_name' => trans('general.assets'),
'fieldname' => 'selected_assets[]',
'multiple' => true,
'asset_status_type' => 'RTD',
'select_id' => 'assigned_assets_select',
])


</div> <!--./box-body-->
Expand Down
5 changes: 2 additions & 3 deletions resources/views/hardware/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@

@if ($item->id)
<!-- we are editing an existing asset, there will be only one asset tag -->
<div class="col-md-7 col-sm-12{{ (Helper::checkIfRequired($item, 'asset_tag')) ? ' required' : '' }}">

<div class="col-md-7 col-sm-12">

<input class="form-control" type="text" name="asset_tags[1]" id="asset_tag" value="{{ old('asset_tag', $item->asset_tag) }}" required>
{!! $errors->first('asset_tags', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
{!! $errors->first('asset_tag', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
</div>
@else
<!-- we are creating a new asset - let people use more than one asset tag -->
<div class="col-md-7 col-sm-12{{ (Helper::checkIfRequired($item, 'asset_tag')) ? ' required' : '' }}">
<div class="col-md-7 col-sm-12">
<input class="form-control" type="text" name="asset_tags[1]" id="asset_tag" value="{{ old('asset_tags.1', \App\Models\Asset::autoincrement_asset()) }}" required>
{!! $errors->first('asset_tags', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
{!! $errors->first('asset_tag', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
Expand Down
4 changes: 2 additions & 2 deletions resources/views/licenses/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
@can('viewKeys', $item)
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
<label for="serial" class="col-md-3 control-label">{{ trans('admin/licenses/form.license_key') }}</label>
<div class="col-md-7{{ (Helper::checkIfRequired($item, 'serial')) ? ' required' : '' }}">
<textarea class="form-control" type="text" name="serial" id="serial">{{ old('serial', $item->serial) }}</textarea>
<div class="col-md-7">
<textarea class="form-control" type="text" name="serial" id="serial"{{ (Helper::checkIfRequired($item, 'serial')) ? ' required' : '' }}>{{ old('serial', $item->serial) }}</textarea>
{!! $errors->first('serial', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions resources/views/locations/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<label for="currency" class="col-md-3 control-label">
{{ trans('admin/locations/table.currency') }}
</label>
<div class="col-md-9{{ (Helper::checkIfRequired($item, 'currency')) ? ' required' : '' }}">
{{ Form::text('currency', old('currency', $item->currency), array('class' => 'form-control','placeholder' => 'USD', 'maxlength'=>'3', 'style'=>'width: 60px;', 'aria-label'=>'currency')) }}
<div class="col-md-9">
{{ Form::text('currency', old('currency', $item->currency), array('class' => 'form-control','placeholder' => 'USD', 'maxlength'=>'3', 'style'=>'width: 60px;', 'aria-label'=>'currency', 'required' => (Helper::checkIfRequired($item, 'currency')) ? true : '')) }}
{!! $errors->first('currency', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div>
Expand All @@ -39,8 +39,8 @@
<label for="ldap_ou" class="col-md-3 control-label">
{{ trans('admin/locations/table.ldap_ou') }}
</label>
<div class="col-md-7{{ (Helper::checkIfRequired($item, 'ldap_ou')) ? ' required' : '' }}">
{{ Form::text('ldap_ou', old('ldap_ou', $item->ldap_ou), array('class' => 'form-control')) }}
<div class="col-md-7">
{{ Form::text('ldap_ou', old('ldap_ou', $item->ldap_ou), array('class' => 'form-control', 'required' => (Helper::checkIfRequired($item, 'ldap_ou')) ? true : '')) }}
{!! $errors->first('ldap_ou', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Accessory -->
<div id="assigned_accessory" class="form-group{{ $errors->has($fieldname) ? ' has-error' : '' }}"{!! (isset($style)) ? ' style="'.e($style).'"' : '' !!}>
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
<div class="col-md-7{{ ((isset($required) && ($required =='true'))) ? ' required' : '' }}">
<select class="js-data-ajax select2" data-endpoint="accessories" data-placeholder="{{ trans('general.select_accessory') }}" name="{{ $fieldname }}" style="width: 100%" id="{{ (isset($select_id)) ? $select_id : 'assigned_accessory_select' }}"{{ (isset($multiple)) ? ' multiple' : '' }}>
<div class="col-md-7">
<select class="js-data-ajax select2" data-endpoint="accessories" data-placeholder="{{ trans('general.select_accessory') }}" name="{{ $fieldname }}" style="width: 100%" id="{{ (isset($select_id)) ? $select_id : 'assigned_accessory_select' }}"{{ (isset($multiple)) ? ' multiple' : '' }}{{ ((isset($required) && ($required =='true'))) ? ' required' : '' }}>

@if ((!isset($unselect)) && ($accessory_id = old($fieldname, (isset($accessory) ? $accessory->id : (isset($item) ? $item->{$fieldname} : '')))))
<option value="{{ $accessory_id }}" selected="selected">
Expand Down
4 changes: 2 additions & 2 deletions resources/views/partials/forms/edit/asset-select.blade.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Asset -->
<div id="assigned_asset" class="form-group{{ $errors->has($fieldname) ? ' has-error' : '' }}"{!! (isset($style)) ? ' style="'.e($style).'"' : '' !!}>
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
<div class="col-md-8{{ ((isset($required) && ($required =='true'))) ? ' required' : '' }}">
<select class="js-data-ajax select2" data-endpoint="hardware" data-placeholder="{{ trans('general.select_asset') }}" aria-label="{{ $fieldname }}" name="{{ $fieldname }}" style="width: 100%" id="{{ (isset($select_id)) ? $select_id : 'assigned_asset_select' }}"{{ (isset($multiple)) ? ' multiple' : '' }}{!! (!empty($asset_status_type)) ? ' data-asset-status-type="' . $asset_status_type . '"' : '' !!}>
<div class="col-md-7">
<select class="js-data-ajax select2" data-endpoint="hardware" data-placeholder="{{ trans('general.select_asset') }}" aria-label="{{ $fieldname }}" name="{{ $fieldname }}" style="width: 100%" id="{{ (isset($select_id)) ? $select_id : 'assigned_asset_select' }}"{{ (isset($multiple)) ? ' multiple' : '' }}{!! (!empty($asset_status_type)) ? ' data-asset-status-type="' . $asset_status_type . '"' : '' !!}{{ ((isset($required) && ($required =='true'))) ? ' required' : '' }}>

@if ((!isset($unselect)) && ($asset_id = old($fieldname, (isset($asset) ? $asset->id : (isset($item) ? $item->{$fieldname} : '')))))
<option value="{{ $asset_id }}" selected="selected" role="option" aria-selected="true" role="option">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}

<div class="col-md-7{{ (isset($item) && (Helper::checkIfRequired($item, $fieldname))) ? ' required' : '' }}">
<div class="col-md-7">
<select class="js-data-ajax" data-endpoint="categories/{{ (isset($category_type)) ? $category_type : 'assets' }}" data-placeholder="{{ trans('general.select_category') }}" name="{{ $fieldname }}" style="width: 100%" id="category_select_id" aria-label="{{ $fieldname }}" {!! ((isset($item)) && (Helper::checkIfRequired($item, $fieldname))) ? ' required ' : '' !!}{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
@if ($category_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
<option value="{{ $category_id }}" selected="selected" role="option" aria-selected="true" role="option">
Expand Down
4 changes: 2 additions & 2 deletions resources/views/partials/forms/edit/category.blade.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Category -->
<div class="form-group {{ $errors->has('category_id') ? ' has-error' : '' }}">
<label for="category_id" class="col-md-3 control-label">{{ trans('general.category') }}</label>
<div class="col-md-7 col-sm-12{{ (Helper::checkIfRequired($item, 'category_id')) ? ' required' : '' }}">
{{ Form::select('category_id', $category_list , old('category_id', $item->category_id), array('class'=>'select2', 'style'=>'width:100%')) }}
<div class="col-md-7 col-sm-12">
{{ Form::select('category_id', $category_list , old('category_id', $item->category_id), array('class'=>'select2', 'style'=>'width:100%', 'required' => Helper::checkIfRequired($item, 'category_id') ? true : '')) }}
{!! $errors->first('category_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
Loading

0 comments on commit 260b153

Please sign in to comment.