mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
fixed required css, and user input lengths
This commit is contained in:
parent
96953aa2ed
commit
ef82f954e5
|
@ -9,7 +9,7 @@
|
||||||
<form action="{{ route('api.locations.store') }}" onsubmit="return false">
|
<form action="{{ route('api.locations.store') }}" onsubmit="return false">
|
||||||
<div class="alert alert-danger" id="modal_error_msg" style="display:none">
|
<div class="alert alert-danger" id="modal_error_msg" style="display:none">
|
||||||
</div>
|
</div>
|
||||||
@include('modals.partials.name')
|
@include('modals.partials.name', ['item' => new \App\Models\Location(), 'required' => 'true'])
|
||||||
|
|
||||||
<div class="dynamic-form-row">
|
<div class="dynamic-form-row">
|
||||||
<div class="col-md-4 col-xs-12"><label for="modal-city">{{ trans('general.city') }}:</label></div>
|
<div class="col-md-4 col-xs-12"><label for="modal-city">{{ trans('general.city') }}:</label></div>
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
<form action="{{ route('api.models.store') }}" onsubmit="return false">
|
<form action="{{ route('api.models.store') }}" onsubmit="return false">
|
||||||
<div class="alert alert-danger" id="modal_error_msg" style="display:none">
|
<div class="alert alert-danger" id="modal_error_msg" style="display:none">
|
||||||
</div>
|
</div>
|
||||||
@include('modals.partials.name')
|
@include('modals.partials.name', ['required' => 'true'])
|
||||||
@include('modals.partials.categories-select')
|
@include('modals.partials.categories-select', ['required' => 'true'])
|
||||||
@include('modals.partials.manufacturer-select')
|
@include('modals.partials.manufacturer-select')
|
||||||
@include('modals.partials.model-number')
|
@include('modals.partials.model-number')
|
||||||
@include('modals.partials.fieldset-select')
|
@include('modals.partials.fieldset-select')
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
<!-- modals/partials/categories-select.blade.php -->
|
<!-- modals/partials/categories-select.blade.php -->
|
||||||
|
@php
|
||||||
|
$required = $required ?? '';
|
||||||
|
@endphp
|
||||||
<div class="dynamic-form-row">
|
<div class="dynamic-form-row">
|
||||||
<div class="col-md-4 col-xs-12"><label for="modal-category_id">{{ trans('general.category') }}:</label></div>
|
<div class="col-md-4 col-xs-12"><label for="modal-category_id">{{ trans('general.category') }}:</label></div>
|
||||||
<div class="col-md-8 col-xs-12 required">
|
<div class="col-md-8 col-xs-12 required">
|
||||||
<select class="js-data-ajax" data-endpoint="categories/asset" name="category_id" style="width: 100%" id="modal-category_id"></select>
|
<select class="js-data-ajax" data-endpoint="categories/asset" name="category_id" style="width: 100%" id="modal-category_id" {{$required ? 'required' : ''}}></select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- modals/partials/categories-select.blade.php -->
|
<!-- modals/partials/categories-select.blade.php -->
|
|
@ -1,7 +1,10 @@
|
||||||
<!-- modals/partials/name.blade.php -->
|
<!-- modals/partials/name.blade.php -->
|
||||||
|
@php
|
||||||
|
$required = $required ?? '';
|
||||||
|
@endphp
|
||||||
<div class="dynamic-form-row">
|
<div class="dynamic-form-row">
|
||||||
<div class="col-md-4 col-xs-12"><label for="modal-name">{{ trans('general.name') }}:
|
<div class="col-md-4 col-xs-12"><label for="modal-name">{{ trans('general.name') }}:
|
||||||
</label></div>
|
</label></div>
|
||||||
<div class="col-md-8 col-xs-12 required"><input type='text' name="name" id='modal-name' class="form-control"></div>
|
<div class="col-md-8 col-xs-12"><input type='text' name="name" id='modal-name' class="form-control" {{$required ? 'required' : ''}}></div>
|
||||||
</div>
|
</div>
|
||||||
<!-- modals/partials/name.blade.php -->
|
<!-- modals/partials/name.blade.php -->
|
|
@ -10,13 +10,13 @@
|
||||||
<div class="alert alert-danger" id="modal_error_msg" style="display:none">
|
<div class="alert alert-danger" id="modal_error_msg" style="display:none">
|
||||||
</div>
|
</div>
|
||||||
<div class="dynamic-form-row">
|
<div class="dynamic-form-row">
|
||||||
@include('partials.forms.edit.name', ['item' => new \App\Models\Statuslabel(),'translated_name' => trans('admin/statuslabels/table.name') ])
|
@include('partials.forms.edit.name', ['required' => 'true', 'item' => new \App\Models\Statuslabel(),'translated_name' => trans('admin/statuslabels/table.name') ])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="dynamic-form-row">
|
<div class="dynamic-form-row">
|
||||||
<div class="col-md-3 col-xs-12"><label for="modal-type">{{ trans('admin/statuslabels/table.status_type') }}:
|
<div class="col-md-3 col-xs-12"><label for="modal-type">{{ trans('admin/statuslabels/table.status_type') }}:
|
||||||
</label></div>
|
</label></div>
|
||||||
<div class="col-md-8 col-xs-12 required">{{ Form::select('type', $statuslabel_types, '', array('class'=>'select2', 'style'=>'width:100%','id' =>'modal-type')) }}</div>
|
<div class="col-md-8 col-xs-12">{{ Form::select('type', $statuslabel_types, '', array('class'=>'select2', 'style'=>'width:100%','id' =>'modal-type', 'required',)) }}</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -42,16 +42,16 @@
|
||||||
@include ('partials.forms.edit.location-profile-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
|
@include ('partials.forms.edit.location-profile-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
|
||||||
</div>
|
</div>
|
||||||
<div class="dynamic-form-row">
|
<div class="dynamic-form-row">
|
||||||
@include('partials.forms.edit.name-first', ['class' => 'col-md-8 col-xs-12-pull', 'style' => 'width:67%;'])
|
@include('partials.forms.edit.name-first', [ 'required' => 'true', 'class' => 'col-md-8 col-xs-12-pull', 'style' => 'width:67%;'])
|
||||||
</div>
|
</div>
|
||||||
<div class="dynamic-form-row">
|
<div class="dynamic-form-row">
|
||||||
@include('partials.forms.edit.name-last', ['class' => 'col-md-8 col-xs-12-pull', 'style' => 'width:67%;'])
|
@include('partials.forms.edit.name-last', ['required' => 'true', 'class' => 'col-md-8 col-xs-12-pull', 'style' => 'width:67%;'])
|
||||||
</div>
|
</div>
|
||||||
<div class="dynamic-form-row">
|
<div class="dynamic-form-row">
|
||||||
@include('partials.forms.edit.email')
|
@include('partials.forms.edit.email')
|
||||||
</div>
|
</div>
|
||||||
<div class="dynamic-form-row">
|
<div class="dynamic-form-row">
|
||||||
@include('partials.forms.edit.username')
|
@include('partials.forms.edit.username', [ 'required' => 'true'])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="dynamic-form-row">
|
<div class="dynamic-form-row">
|
||||||
|
@ -59,8 +59,8 @@
|
||||||
<div class="col-md-3 col-xs-12">
|
<div class="col-md-3 col-xs-12">
|
||||||
<label class="control-label" for="modal-password">{{ trans('admin/users/table.password') }}:</label>
|
<label class="control-label" for="modal-password">{{ trans('admin/users/table.password') }}:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-8 col-xs-12 required" style="margin-bottom:5px;">
|
<div class="col-md-8 col-xs-12 " style="margin-bottom:5px;">
|
||||||
<input type='password' name="password" id='modal-password' class="form-control">
|
<input type='password' name="password" id='modal-password' class="form-control" required>
|
||||||
<a href="#" class="left" id="modal-genPassword">Generate</a>
|
<a href="#" class="left" id="modal-genPassword">Generate</a>
|
||||||
<div id="modal-generated-password"></div>
|
<div id="modal-generated-password"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -72,8 +72,8 @@
|
||||||
<div class="col-md-3 col-xs-12 ">
|
<div class="col-md-3 col-xs-12 ">
|
||||||
<label class="control-label" for="modal-password_confirmation">{{ trans('admin/users/table.password_confirm') }}:</label>
|
<label class="control-label" for="modal-password_confirmation">{{ trans('admin/users/table.password_confirm') }}:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-8 col-xs-12 required">
|
<div class="col-md-8 col-xs-12">
|
||||||
<input class="form-control" type='password' name="password_confirmation" id='modal-password_confirmation'>
|
<input class="form-control" type='password' name="password_confirmation" id='modal-password_confirmation' required>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<!-- full company support is enabled or this user is a superadmin -->
|
<!-- full company support is enabled or this user is a superadmin -->
|
||||||
<div id="{{ $fieldname }}" class="form-group{{ $errors->has($fieldname) ? ' has-error' : '' }}">
|
<div id="{{ $fieldname }}" class="form-group{{ $errors->has($fieldname) ? ' has-error' : '' }}">
|
||||||
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
|
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
|
||||||
<div class="col-md-7">
|
<div class="col-md-8">
|
||||||
<select class="js-data-ajax" data-endpoint="companies" data-placeholder="{{ trans('general.select_company') }}" name="{{ $fieldname }}" style="width: 100%" id="company_select"{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
|
<select class="js-data-ajax" data-endpoint="companies" data-placeholder="{{ trans('general.select_company') }}" name="{{ $fieldname }}" style="width: 100%" id="company_select"{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
|
||||||
@if ($company_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
|
@if ($company_id = old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
|
||||||
<option value="{{ $company_id }}" selected="selected">
|
<option value="{{ $company_id }}" selected="selected">
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div id="location_id" class="form-group{{ $errors->has('location_id') ? ' has-error' : '' }}"{!! (isset($style)) ? ' style="'.e($style).'"' : '' !!}>
|
<div id="location_id" class="form-group{{ $errors->has('location_id') ? ' has-error' : '' }}"{!! (isset($style)) ? ' style="'.e($style).'"' : '' !!}>
|
||||||
|
|
||||||
{{ Form::label('location_id', $translated_name, array('class' => 'col-md-3 control-label')) }}
|
{{ Form::label('location_id', $translated_name, array('class' => 'col-md-3 control-label')) }}
|
||||||
<div class="col-md-7">
|
<div class="col-md-8">
|
||||||
<select class="js-data-ajax" data-endpoint="locations" data-placeholder="{{ trans('general.select_location') }}" name="location_id" style="width: 100%" id="location_id_location_select" aria-label="location_id">
|
<select class="js-data-ajax" data-endpoint="locations" data-placeholder="{{ trans('general.select_location') }}" name="location_id" style="width: 100%" id="location_id_location_select" aria-label="location_id">
|
||||||
@if ($location_id = old('location_id', (isset($user)) ? $user->location_id : ''))
|
@if ($location_id = old('location_id', (isset($user)) ? $user->location_id : ''))
|
||||||
<option value="{{ $location_id }}" selected="selected" role="option" aria-selected="true" role="option">
|
<option value="{{ $location_id }}" selected="selected" role="option" aria-selected="true" role="option">
|
||||||
|
|
|
@ -2,11 +2,12 @@
|
||||||
@php
|
@php
|
||||||
$class = $class ?? 'col-md-6';
|
$class = $class ?? 'col-md-6';
|
||||||
$style = $style ?? '';
|
$style = $style ?? '';
|
||||||
|
$required = $required ?? '';
|
||||||
@endphp
|
@endphp
|
||||||
<div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
|
<div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
|
||||||
<label class="col-md-3 control-label" for="first_name">{{ trans('general.first_name') }}</label>
|
<label class="col-md-3 control-label" for="first_name">{{ trans('general.first_name') }}</label>
|
||||||
<div class="{{$class ? $class : 'col-md-6'}}" style= "{{$style}}""{{ (Helper::checkIfRequired($user, 'first_name')) ? ' required' : '' }}">
|
<div class="{{$class ? $class : 'col-md-6'}}" style= "{{$style}}""{{ (Helper::checkIfRequired($user, 'first_name')) ? ' required' : '' }}">
|
||||||
<input class="form-control" type="text" name="first_name" id="first_name" value="{{ old('first_name', $user->first_name) }}" maxlength="191" />
|
<input class="form-control" type="text" name="first_name" id="first_name" value="{{ old('first_name', $user->first_name) }}" {{$required ? 'required' : ''}} maxlength="191" />
|
||||||
{!! $errors->first('first_name', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
{!! $errors->first('first_name', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
@php
|
@php
|
||||||
$class = $class ?? 'col-md-6';
|
$class = $class ?? 'col-md-6';
|
||||||
$style = $style ?? '';
|
$style = $style ?? '';
|
||||||
|
$required = $required ?? '';
|
||||||
@endphp
|
@endphp
|
||||||
<div class="form-group {{ $errors->has('last_name') ? 'has-error' : '' }}">
|
<div class="form-group {{ $errors->has('last_name') ? 'has-error' : '' }}">
|
||||||
<label class="col-md-3 control-label" for="last_name">{{ trans('general.last_name') }} </label>
|
<label class="col-md-3 control-label" for="last_name">{{ trans('general.last_name') }} </label>
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
<!-- partials/forms/edit/username.blade.php -->
|
<!-- partials/forms/edit/username.blade.php -->
|
||||||
|
@php
|
||||||
|
$required = $required ?? '';
|
||||||
|
@endphp
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-md-3 col-xs-12"><label for="modal-username">{{ trans('admin/users/table.username') }}:</label></div>
|
<div class="col-md-3 col-xs-12"><label for="modal-username">{{ trans('admin/users/table.username') }}:</label></div>
|
||||||
<div class="col-md-8 col-xs-12 required"><input type='text' name="username" id='modal-username' class="form-control"></div>
|
<div class="col-md-8 col-xs-12 required"><input type='text' name="username" id='modal-username' class="form-control" {{$required ? 'required' : ''}}></div>
|
||||||
</div>
|
</div>
|
||||||
<!-- partials/forms/edit/username.blade.php -->
|
<!-- partials/forms/edit/username.blade.php -->
|
Loading…
Reference in a new issue