A free open source IT asset/license management system
Updated forms
snipe2f82ff248c60
diff --git a/resources/views/accessories/edit.blade.php b/resources/views/accessories/edit.blade.phpindex 76e1961000..22bf5de20a 100644--- a/resources/views/accessories/edit.blade.php+++ b/resources/views/accessories/edit.blade.php@@ -13,11 +13,14 @@{{-- Page content --}}@section('content')-<x-container class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">+<x-container class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0"><x-form :$item route="{{ isset($item->id) ? route('accessories.update', ['accessory' => $item->id]) : route('accessories.store') }}">- <x-box>+ <x-box top_submit>+ @if ($item->id)+ <x-slot:header>{{ $item->name }}</x-slot:header>+ @endif<x-input.company-select:label="trans('general.company')"@@ -69,17 +72,20 @@name="order_number"/>- <div class="form-group {{ $errors->has('purchase_date') ? 'has-error' : '' }}">- <label for="purchase_date" class="col-md-3 control-label">{{ trans('general.purchase_date') }}</label>- <div class="input-group col-md-4">+ <x-form.row+ :label="trans('general.purchase_date')"+ name="purchase_date"+ input_div_class="col-md-4"+ >+ <x-slot:input><x-input.datepickername="purchase_date"id="purchase_date":value="old('purchase_date', $item->purchase_date ? date('Y-m-d', strtotime($item->purchase_date)) : '')"+ :placeholder="trans('general.select_date')"/>- <x-form.error name="purchase_date" />- </div>- </div>+ </x-slot:input>+ </x-form.row><x-input.purchase-cost:label="trans('general.unit_cost')"@@ -98,7 +104,7 @@type="textarea"/>- @include ('partials.forms.edit.image-upload', ['image_path' => app('accessories_upload_path')])+ <x-input.image-upload :item="$item" :imagePath="app('accessories_upload_path')" :clonedModel="$cloned_model ?? null" /><x-slot:customfooter><x-redirect_submit_optionsdiff --git a/resources/views/account/profile.blade.php b/resources/views/account/profile.blade.phpindex 5533e96845..909e29dced 100755--- a/resources/views/account/profile.blade.php+++ b/resources/views/account/profile.blade.php@@ -194,7 +194,7 @@@endif- @include ('partials.forms.edit.image-upload', ['fieldname' => 'avatar', 'image_path' => app('users_upload_path')])+ <x-input.image-upload :item="$user" fieldname="avatar" :imagePath="app('users_upload_path')" /><!-- Two factor opt in -->diff --git a/resources/views/blade/box/index.blade.php b/resources/views/blade/box/index.blade.phpindex 8be64fb1e0..f71d4972ee 100644--- a/resources/views/blade/box/index.blade.php+++ b/resources/views/blade/box/index.blade.php@@ -1,6 +1,7 @@@props(['box_style' => 'default','header' => false,+ 'top_submit' => false,])@aware(['name', 'route'])@@ -8,11 +9,32 @@<!-- Start box component --><div {{ $attributes->merge(['class' => 'box box-'.$box_style]) }}>- @if ($header)+ @if ($header || $top_submit)<div class="box-header with-border">- <h2 class="box-title">- {{ $header }}- </h2>+ @if ($top_submit)+ {{-- Long-form pattern: title on the left, save button pulled+ right. Title truncates with an ellipsis so a long+ display_name can't push the save button off the row. --}}+ <div class="row">+ <div class="col-md-10">+ @if ($header)+ <h2 class="box-title" style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; padding-top: 7px;">+ {{ $header }}+ </h2>+ @endif+ </div>+ <div class="col-md-2">+ <button type="submit" class="btn btn-success pull-right" name="submit">+ <x-icon type="checkmark"/>+ {{ trans('general.save') }}+ </button>+ </div>+ </div>+ @else+ <h2 class="box-title">+ {{ $header }}+ </h2>+ @endif</div>@endif@@ -43,4 +65,4 @@@elseif ($route)<x-box.footer />@endif-</div>\ No newline at end of file+</div>diff --git a/resources/views/blade/form/row.blade.php b/resources/views/blade/form/row.blade.phpindex 257824ed96..3a31dd8818 100644--- a/resources/views/blade/form/row.blade.php+++ b/resources/views/blade/form/row.blade.php@@ -5,9 +5,14 @@'item' => null,'info_tooltip_text' => null,'help_text' => null,+ // Opt-in raw-HTML help. Rendered UNESCAPED — only pass developer-authored+ // strings (translation strings with links, etc.). Never pass anything+ // that could contain user input without escaping it yourself first.+ 'help_html' => null,'help_icon' => null,'label' => null,- 'input_div_class' => 'col-md-8',+ 'label_class' => 'col-md-3',+ 'input_div_class' => 'col-md-7','errors_class' => $errors->has('support_url') ? ' has-error' : '','input_icon' => null,'input_group_addon' => null,@@ -16,26 +21,32 @@'max' => null,'rows' => null,'placeholder' => null,+ 'default' => null,])<div {{ $attributes->merge(['class' => 'form-group'. $errors_class]) }}><!-- form label -->@if (isset($label))- <x-form.label :for="$name" class="{{ $label_class ?? 'col-md-3' }}">{{ $label }}</x-form.label>+ <x-form.label :for="$name" class="{{ $label_class }}">{{ $label }}</x-form.label>@endif@php$blade_type = in_array($type, ['text', 'email', 'url', 'tel', 'number', 'password']) ? 'text' : $type;- // The vast majority of string columns in this schema are varchar(191),- // so default text-family inputs to that length when the caller didn't- // pass one explicitly. Textareas and numbers opt out — textareas often- // back TEXT columns with no length limit, and browsers ignore- // maxlength on type="number" anyway. Callers can still override with- // an explicit :maxlength="..."- $effective_maxlength = $maxlength ?? (in_array($type, ['text', 'email', 'url', 'tel', 'password']) ? 191 : null);+ // Maxlength precedence:+ // 1. Explicit :maxlength="..." from the caller (always wins).+ // 2. Model rules — Helper::fieldMaxLength reads `max:N` from the+ // model's validation rules so the browser cap matches the DB+ // column width automatically. Applied to all types except+ // textarea/number (textareas back TEXT columns with no length+ // limit; browsers ignore maxlength on type="number").+ // 3. Fallback 191 for text-family types (matches the vast majority+ // of varchar(191) columns in this schema).+ $effective_maxlength = $maxlength+ ?? ($type !== 'textarea' && $type !== 'number' ? Helper::fieldMaxLength($item, $name) : null)+ ?? (in_array($type, ['text', 'email', 'url', 'tel', 'password']) ? 191 : null);@endphp<div class="{{ $input_div_class }}">@@ -46,6 +57,17 @@<x-form.row>, so only the input area is hand-authored. --}}@isset($input){{ $input }}+ @elseif ($blade_type === 'colorpicker')+ {{-- Widget-shaped inputs (colorpicker, datepicker, etc.) don't share+ the text-family prop shape, so dispatch them explicitly with+ only the props they accept. Avoids leaking type/input_icon/+ maxlength/etc. as bogus HTML attrs on the widget's outer div. --}}+ <x-input.colorpicker+ :name="$name"+ :id="$name"+ :item="$item"+ :default="$default"+ />@else<x-dynamic-component:$name@@ -63,7 +85,6 @@:max="$max":rows="$rows":placeholder="$placeholder"-/>@endisset</div>@@ -85,7 +106,16 @@<x-form.error :name="$name" />@if ($help_text)- <x-form.help :name="$name" :icon="$help_icon">{!! $help_text !!}</x-form.help>+ <x-form.help :name="$name" :icon="$help_icon">{{ $help_text }}</x-form.help>+ @elseif ($help_html)+ {{-- Raw HTML help — the caller has opted in, we render unescaped+ straight to the <p>. See the help_html prop docs above. --}}+ <p class="help-block" id="{{ $name }}-help">+ @if ($help_icon)+ <x-icon :type="$help_icon" />+ @endif+ {!! $help_html !!}+ </p>@endif</div>diff --git a/resources/views/blade/form/tooltip.blade.php b/resources/views/blade/form/tooltip.blade.phpindex 5fcbe0e005..e44702ffca 100644--- a/resources/views/blade/form/tooltip.blade.php+++ b/resources/views/blade/form/tooltip.blade.php@@ -1,4 +1,4 @@-<a href="#" data-tooltip="true" title="{{ $slot }}" style="padding-left: 0;">+<a href="#" data-tooltip="true" title="{{ $slot }}" class="tooltip-spin-hover" style="padding-left: 0;"><x-icon type="more-info" style="font-size: 20px; margin-top: 5px;" /><span class="sr-only">{{ $slot }}</span></a>\ No newline at end of filediff --git a/resources/views/blade/input/colorpicker.blade.php b/resources/views/blade/input/colorpicker.blade.phpindex b5f9a523c8..0228f2adad 100644--- a/resources/views/blade/input/colorpicker.blade.php+++ b/resources/views/blade/input/colorpicker.blade.php@@ -3,12 +3,13 @@'name' => 'color','id' => 'color','div_id' => null,- 'placeholder'=> 'FF0000',+ 'placeholder' => '#FF0000',+ 'default' => null,])<!-- Colorpicker --><div {{ $attributes->merge(['class' => 'color input-group colorpicker-component row col-md-5']) }} id="{{ $div_id }}">- <input class="form-control" placeholder="{{ $placeholder }}" aria-label="{{ $name }}" name="{{ $name }}" type="text" id="{{ $id }}" value="{{ old($name, ($item->{$name} ?? '')) }}" {{ (config('app.lock_passwords')===true) ? ' disabled' : '' }}>+ <input class="form-control" placeholder="{{ $placeholder }}" aria-label="{{ $name }}" name="{{ $name }}" type="text" id="{{ $id }}" value="{{ old($name, $item->{$name} ?? $default ?? '') }}" {{ (config('app.lock_passwords')===true) ? ' disabled' : '' }}><span class="input-group-addon"><i style="border: 1px solid #b8b6b6"> </i></span></div>diff --git a/resources/views/blade/input/company-select.blade.php b/resources/views/blade/input/company-select.blade.phpindex 7133e35e53..c9200c76c4 100644--- a/resources/views/blade/input/company-select.blade.php+++ b/resources/views/blade/input/company-select.blade.php@@ -17,7 +17,7 @@])><label for="{{ $name }}" class="col-md-3 control-label">{{ $label }}</label>- <div class="col-md-6">+ <div class="col-md-7"><selectclass="js-data-ajax"data-endpoint="companies"@@ -50,12 +50,12 @@@if ($snipeSettings->full_multiple_companies_support == '1')@cannot('superadmin')- <div class="col-md-6 col-md-offset-3">+ <div class="col-md-7 col-md-offset-3"><p class="help-block"><x-icon type="tip" /> {{ trans('general.fmcs_company_select_note') }}</p></div>@endcannot@can('superadmin')- <div class="col-md-6 col-md-offset-3">+ <div class="col-md-7 col-md-offset-3"><p class="help-block"><x-icon type="tip" /> {{ trans('general.fmcs_company_select_superadmin_note') }}</p></div>@endcandiff --git a/resources/views/blade/input/purchase-cost.blade.php b/resources/views/blade/input/purchase-cost.blade.phpindex 508f9d5964..2028892cdd 100644--- a/resources/views/blade/input/purchase-cost.blade.php+++ b/resources/views/blade/input/purchase-cost.blade.php@@ -1,6 +1,7 @@@use('App\Helpers\Helper')@props([+ 'name' => 'purchase_cost','label' => null,'item' => null,'currencyType' => null,@@ -9,10 +10,10 @@<div@class(['form-group',- 'has-error' => $errors->has('purchase_cost'),+ 'has-error' => $errors->has($name),])>- <label for="purchase_cost" class="col-md-3 control-label">+ <label for="{{ $name }}" class="col-md-3 control-label">{{ $label ?? trans('general.purchase_cost') }}</label><div class="col-md-9">@@ -20,10 +21,10 @@<inputclass="form-control"type="text"- name="purchase_cost"- id="purchase_cost"+ name="{{ $name }}"+ id="{{ $name }}"aria-label="{{ $label ?? trans('general.purchase_cost') }}"- value="{{ old('purchase_cost', Helper::formatCurrencyOutput($item->purchase_cost)) }}"+ value="{{ old($name, Helper::formatCurrencyOutput($item->{$name} ?? null)) }}"maxlength="25"inputmode="decimal"pattern="[\d.,]+"@@ -34,7 +35,7 @@</span></div><div class="col-md-9" style="padding-left: 0">- <x-form.error name="purchase_cost" />+ <x-form.error :name="$name" /><p class="help-block">{{ trans('general.purchase_cost_format_help', ['format' => $snipeSettings->digit_separator]) }}</p></div></div>diff --git a/resources/views/categories/edit.blade.php b/resources/views/categories/edit.blade.phpindex 38d8729df3..854493d315 100755--- a/resources/views/categories/edit.blade.php+++ b/resources/views/categories/edit.blade.php@@ -1,104 +1,107 @@-@extends('layouts/edit-form', [- 'createText' => trans('admin/categories/general.create') ,- 'updateText' => trans('admin/categories/general.update'),- 'helpPosition' => 'right',- 'helpText' => trans('help.categories'),- 'topSubmit' => 'true',- 'formAction' => (isset($item->id)) ? route('categories.update', ['category' => $item->id]) : route('categories.store'),-])--@section('inputFields')-- <!-- Name -->- <x-form.row- :label="trans('general.name')"- :$item- name="name"- />---<!-- Type -->-<div class="form-group {{ $errors->has('category_type') ? ' has-error' : '' }}">- <label for="category_type" class="col-md-3 control-label">{{ trans('general.type') }}</label>- <div class="col-md-7 required">- <x-input.select- name="category_type"- :options="$category_types"- :selected="old('category_type', $item->category_type)"- :disabled="$item->category_type!='' || $item->itemCount() > 0"- style="min-width:350px"- aria-label="category_type"- />- <x-form.error name="category_type" />- </div>- <div class="col-md-7 col-md-offset-3">- <p class="help-block">{!! trans('admin/categories/message.update.cannot_change_category_type') !!} </p>- </div>-</div>--<livewire:category-edit-form- :alert-on-response="(bool) old('alert_on_response', $item->alert_on_response)"- :default-eula-text="$snipeSettings->default_eula_text"- :eula-text="old('eula_text', $item->eula_text)"- :require-acceptance="(bool) old('require_acceptance', $item->require_acceptance)"- :send-check-in-email="(bool) old('checkin_email', $item->checkin_email)"- :use-default-eula="(bool) old('use_default_eula', $item->use_default_eula)"-/>--@include ('partials.forms.edit.image-upload', ['image_path' => app('categories_upload_path')])--<div class="form-group{!! $errors->has('notes') ? ' has-error' : '' !!}">- <label for="notes" class="col-md-3 control-label">{{ trans('general.notes') }}</label>- <div class="col-md-8">- <x-input.textarea- name="notes"- id="notes"- :value="old('notes', $item->notes)"- placeholder="{{ trans('general.placeholders.notes') }}"- aria-label="notes"- rows="5"- />- <x-form.error name="notes" />- </div>-</div>----@if ($snipeSettings->default_eula_text!='')-<!-- Modal -->-<div class="modal fade" id="eulaModal" tabindex="-1" role="dialog" aria-labelledby="eulaModalLabel" aria-hidden="true">- <div class="modal-dialog">- <div class="modal-content">- <div class="modal-header">- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>- <h2 class="modal-title" id="eulaModalLabel">{{ trans('admin/settings/general.default_eula_text') }}</h2>- </div>- <div class="modal-body">- {{ \App\Models\Setting::getDefaultEula() }}- </div>- <div class="modal-footer">- <button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('button.cancel') }}</button>- </div>- </div>- </div>-</div>-@endif-- <fieldset name="color-preferences">- <x-form.legend help_text="{{ trans('general.tag_color_help') }}">- {{ trans('general.tag_color') }}- </x-form.legend>- <!-- color -->- <div class="form-group {{ $errors->has('tag_color') ? 'error' : '' }}">- <label for="tag_color" class="col-md-3 control-label">- {{ trans('general.tag_color') }}- </label>- <div class="col-md-9">- <x-input.colorpicker :item="$item" id="color" :value="old('color', ($item->color ?? '#f4f4f4'))" name="tag_color" id="tag_color" />- <x-form.error name="tag_color" />+@extends('layouts/default')++{{-- Page title --}}+@section('title')+ @if ($item->id)+ {{ trans('admin/categories/general.update') }}+ @else+ {{ trans('admin/categories/general.create') }}+ @endif+ @parent+@stop++{{-- Page content --}}+@section('content')++ <x-container class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0">++ <x-form :$item route="{{ ($item->id) ? route('categories.update', ['category' => $item->id]) : route('categories.store') }}">++ <x-box top_submit>+ @if ($item->id)+ <x-slot:header>{{ $item->name }}</x-slot:header>+ @endif++ <x-form.row+ :label="trans('general.name')"+ :$item+ name="name"+ />++ <x-form.row+ :label="trans('general.type')"+ name="category_type"+ input_div_class="col-md-7 required"+ :help_text="trans('admin/categories/message.update.cannot_change_category_type')"+ >+ <x-slot:input>+ <x-input.select+ name="category_type"+ :options="$category_types"+ :selected="old('category_type', $item->category_type)"+ :disabled="$item->category_type != '' || $item->itemCount() > 0"+ style="min-width:350px"+ aria-label="category_type"+ />+ </x-slot:input>+ </x-form.row>++ <livewire:category-edit-form+ :alert-on-response="(bool) old('alert_on_response', $item->alert_on_response)"+ :default-eula-text="$snipeSettings->default_eula_text"+ :eula-text="old('eula_text', $item->eula_text)"+ :require-acceptance="(bool) old('require_acceptance', $item->require_acceptance)"+ :send-check-in-email="(bool) old('checkin_email', $item->checkin_email)"+ :use-default-eula="(bool) old('use_default_eula', $item->use_default_eula)"+ />++ <x-input.image-upload :item="$item" :imagePath="app('categories_upload_path')" />++ <x-form.row+ :label="trans('general.notes')"+ :$item+ name="notes"+ type="textarea"+ :rows="5"+ :placeholder="trans('general.placeholders.notes')"+ />++ <fieldset name="color-preferences">+ <x-form.legend help_text="{{ trans('general.tag_color_help') }}">+ {{ trans('general.tag_color') }}+ </x-form.legend>+ <x-form.row+ :label="trans('general.tag_color')"+ :$item+ name="tag_color"+ type="colorpicker"+ />+ </fieldset>++ </x-box>++ </x-form>++ </x-container>++ @if ($snipeSettings->default_eula_text != '')+ {{-- EULA preview modal --}}+ <div class="modal fade" id="eulaModal" tabindex="-1" role="dialog" aria-labelledby="eulaModalLabel" aria-hidden="true">+ <div class="modal-dialog">+ <div class="modal-content">+ <div class="modal-header">+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>+ <h2 class="modal-title" id="eulaModalLabel">{{ trans('admin/settings/general.default_eula_text') }}</h2>+ </div>+ <div class="modal-body">+ {{ \App\Models\Setting::getDefaultEula() }}+ </div>+ <div class="modal-footer">+ <button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('button.cancel') }}</button>+ </div>+ </div></div></div>- </fieldset>-+ @endif@stopdiff --git a/resources/views/companies/edit.blade.php b/resources/views/companies/edit.blade.phpindex 164ace0085..867d071d11 100644--- a/resources/views/companies/edit.blade.php+++ b/resources/views/companies/edit.blade.php@@ -13,11 +13,14 @@{{-- Page content --}}@section('content')-<x-container class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">+<x-container class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0"><x-form :$item route="{{ isset($item->id) ? route('companies.update', ['company' => $item->id]) : route('companies.store') }}">- <x-box>+ <x-box top_submit>+ @if ($item->id)+ <x-slot:header>{{ $item->name }}</x-slot:header>+ @endif<x-form.row:label="trans('admin/companies/table.name')"@@ -36,12 +39,19 @@:label="trans('admin/suppliers/table.phone')":$itemname="phone"+ type="tel"+ input_icon="phone"+ input_group_addon="left"/><x-form.row:label="trans('admin/suppliers/table.fax')":$itemname="fax"+ type="tel"+ input_icon="fax"+ input_group_addon="left"+ :maxlength="34"/><x-form.row@@ -49,6 +59,8 @@:$itemname="email"type="email"+ input_icon="email"+ input_group_addon="left"/><x-form.row@@ -59,20 +71,18 @@:placeholder="trans('general.placeholders.notes')"/>- @include ('partials.forms.edit.image-upload', ['image_path' => app('companies_upload_path')])+ <x-input.image-upload :item="$item" :imagePath="app('companies_upload_path')" /><fieldset name="color-preferences"><x-form.legend help_text="{{ trans('general.tag_color_help') }}">{{ trans('general.tag_color') }}</x-form.legend>-- <div class="form-group {{ $errors->has('tag_color') ? 'has-error' : '' }}">- <label for="tag_color" class="col-md-3 control-label">{{ trans('general.tag_color') }}</label>- <div class="col-md-9">- <x-input.colorpicker :item="$item" id="tag_color" :value="old('tag_color', ($item->tag_color ?? '#f4f4f4'))" name="tag_color" />- <x-form.error name="tag_color" />- </div>- </div>+ <x-form.row+ :label="trans('general.tag_color')"+ :$item+ name="tag_color"+ type="colorpicker"+ /></fieldset></x-box>diff --git a/resources/views/components/edit.blade.php b/resources/views/components/edit.blade.phpindex c1c2557d0c..354cd0cd2d 100644--- a/resources/views/components/edit.blade.php+++ b/resources/views/components/edit.blade.php@@ -13,11 +13,20 @@{{-- Page content --}}@section('content')-<x-container class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">+<x-container class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0"><x-form :$item route="{{ isset($item->id) ? route('components.update', ['component' => $item->id]) : route('components.store') }}">- <x-box>+ <x-box top_submit>+ @if ($item->id)+ <x-slot:header>{{ $item->name }}</x-slot:header>+ @endif++ <x-input.company-select+ :label="trans('general.company')"+ name="company_id"+ :selected="old('company_id', $item->company_id)"+ /><x-form.row:label="trans('admin/components/table.title')"@@ -55,12 +64,6 @@name="model_number"/>- <x-input.company-select- :label="trans('general.company')"- name="company_id"- :selected="old('company_id', $item->company_id)"- />-<x-input.location-select:label="trans('general.location')"name="location_id"@@ -79,17 +82,20 @@name="order_number"/>- <div class="form-group {{ $errors->has('purchase_date') ? 'has-error' : '' }}">- <label for="purchase_date" class="col-md-3 control-label">{{ trans('general.purchase_date') }}</label>- <div class="input-group col-md-4">+ <x-form.row+ :label="trans('general.purchase_date')"+ name="purchase_date"+ input_div_class="col-md-4"+ >+ <x-slot:input><x-input.datepickername="purchase_date"id="purchase_date":value="old('purchase_date', $item->purchase_date ? date('Y-m-d', strtotime($item->purchase_date)) : '')"+ :placeholder="trans('general.select_date')"/>- <x-form.error name="purchase_date" />- </div>- </div>+ </x-slot:input>+ </x-form.row><x-input.purchase-cost:label="trans('general.unit_cost')"@@ -104,7 +110,7 @@type="textarea"/>- @include ('partials.forms.edit.image-upload', ['image_path' => app('components_upload_path')])+ <x-input.image-upload :item="$item" :imagePath="app('components_upload_path')" /><x-slot:customfooter><x-redirect_submit_optionsdiff --git a/resources/views/consumables/edit.blade.php b/resources/views/consumables/edit.blade.phpindex a4b22d08e8..f71eb8e261 100644--- a/resources/views/consumables/edit.blade.php+++ b/resources/views/consumables/edit.blade.php@@ -13,11 +13,14 @@{{-- Page content --}}@section('content')- <x-container class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">+ <x-container class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0"><x-form :$item route="{{ isset($item->id) ? route('consumables.update', ['consumable' => $item->id]) : route('consumables.store') }}">- <x-box>+ <x-box top_submit>+ @if ($item->id)+ <x-slot:header>{{ $item->name }}</x-slot:header>+ @endif<x-input.company-select:label="trans('general.company')"@@ -79,17 +82,20 @@name="order_number"/>- <div class="form-group {{ $errors->has('purchase_date') ? 'has-error' : '' }}">- <label for="purchase_date" class="col-md-3 control-label">{{ trans('general.purchase_date') }}</label>- <div class="input-group col-md-4">+ <x-form.row+ :label="trans('general.purchase_date')"+ name="purchase_date"+ input_div_class="col-md-4"+ >+ <x-slot:input><x-input.datepickername="purchase_date"id="purchase_date":value="old('purchase_date', $item->purchase_date ? date('Y-m-d', strtotime($item->purchase_date)) : '')"+ :placeholder="trans('general.select_date')"/>- <x-form.error name="purchase_date" />- </div>- </div>+ </x-slot:input>+ </x-form.row><x-input.purchase-cost:label="trans('general.unit_cost')"@@ -104,7 +110,7 @@type="textarea"/>- @include ('partials.forms.edit.image-upload', ['image_path' => app('consumables_upload_path')])+ <x-input.image-upload :item="$item" :imagePath="app('consumables_upload_path')" :clonedModel="$cloned_model ?? null" /><x-slot:customfooter><x-redirect_submit_optionsdiff --git a/resources/views/departments/edit.blade.php b/resources/views/departments/edit.blade.phpindex 782eaf3a0a..12d6a35def 100644--- a/resources/views/departments/edit.blade.php+++ b/resources/views/departments/edit.blade.php@@ -1,63 +1,97 @@-@extends('layouts/edit-form', [- 'createText' => trans('admin/departments/table.create') ,- 'updateText' => trans('admin/departments/table.update'),- 'formAction' => (isset($item->id)) ? route('departments.update', ['department' => $item->id]) : route('departments.store'),-])+@extends('layouts/default')++{{-- Page title --}}+@section('title')+ @if ($item->id)+ {{ trans('admin/departments/table.update') }}+ @else+ {{ trans('admin/departments/table.create') }}+ @endif+ @parent+@stop{{-- Page content --}}-@section('inputFields')+@section('content')- @include ('partials.forms.edit.name', ['translated_name' => trans('admin/departments/table.name')])+ <x-container class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0">- <!-- Company -->- @if (\App\Models\Company::canManageUsersCompanies())- @include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])- @else- <input id="hidden_company_id" type="hidden" name="company_id" value="{{ Auth::user()->company_id }}">- @endif+ <x-form :$item route="{{ ($item->id) ? route('departments.update', ['department' => $item->id]) : route('departments.store') }}">++ <x-box top_submit>+ @if ($item->id)+ <x-slot:header>{{ $item->name }}</x-slot:header>+ @endif- @include ('partials.forms.edit.phone')- @include ('partials.forms.edit.fax')+ @if (\App\Models\Company::canManageUsersCompanies())+ <x-input.company-select+ :label="trans('general.company')"+ name="company_id"+ :selected="old('company_id', $item->company_id)"+ />+ @else+ <input id="hidden_company_id" type="hidden" name="company_id" value="{{ Auth::user()->company_id }}">+ @endif- <!-- Manager -->- @include ('partials.forms.edit.user-select', ['translated_name' => trans('admin/users/table.manager'), 'fieldname' => 'manager_id'])+ <x-form.row+ :label="trans('admin/departments/table.name')"+ :$item+ name="name"+ />- <!-- Location -->- @include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])- @include ('partials.forms.edit.image-upload', ['image_path' => app('departments_upload_path')])+ <x-form.row+ :label="trans('admin/suppliers/table.phone')"+ :$item+ name="phone"+ type="tel"+ input_icon="phone"+ input_group_addon="left"+ />+ <x-form.row+ :label="trans('admin/suppliers/table.fax')"+ :$item+ name="fax"+ type="tel"+ input_icon="fax"+ input_group_addon="left"+ :maxlength="34"+ />- <div class="form-group{!! $errors->has('notes') ? ' has-error' : '' !!}">- <label for="notes" class="col-md-3 control-label">{{ trans('general.notes') }}</label>- <div class="col-md-8">- <x-input.textarea+ @include ('partials.forms.edit.user-select', ['translated_name' => trans('admin/users/table.manager'), 'fieldname' => 'manager_id'])++ <x-input.location-select+ :label="trans('general.location')"+ name="location_id"+ :selected="old('location_id', $item->location_id)"+ />++ <x-input.image-upload :item="$item" :imagePath="app('departments_upload_path')" />++ <x-form.row+ :label="trans('general.notes')"+ :$itemname="notes"- id="notes"- :value="old('notes', $item->notes)"- placeholder="{{ trans('general.placeholders.notes') }}"- aria-label="notes"- rows="5"- />- <x-form.error name="notes" />- </div>- </div>-- <fieldset name="color-preferences">- <x-form.legend help_text="{{ trans('general.tag_color_help') }}">- {{ trans('general.tag_color') }}- </x-form.legend>- <!-- color -->- <div class="form-group {{ $errors->has('tag_color') ? 'error' : '' }}">- <label for="tag_color" class="col-md-3 control-label">- {{ trans('general.tag_color') }}- </label>- <div class="col-md-9">- <x-input.colorpicker :item="$item" id="color" :value="old('color', ($item->color ?? '#f4f4f4'))" name="tag_color" id="tag_color" />- <x-form.error name="tag_color" />- </div>- </div>- </fieldset>+ type="textarea"+ :rows="5"+ :placeholder="trans('general.placeholders.notes')"+ />+ <fieldset name="color-preferences">+ <x-form.legend help_text="{{ trans('general.tag_color_help') }}">+ {{ trans('general.tag_color') }}+ </x-form.legend>+ <x-form.row+ :label="trans('general.tag_color')"+ :$item+ name="tag_color"+ type="colorpicker"+ />+ </fieldset>-@stop+ </x-box>+ </x-form>++ </x-container>++@stopdiff --git a/resources/views/hardware/audit.blade.php b/resources/views/hardware/audit.blade.phpindex 84bf23a27a..98e2a3232d 100644--- a/resources/views/hardware/audit.blade.php+++ b/resources/views/hardware/audit.blade.php@@ -128,7 +128,7 @@</div><!-- Audit Image -->- @include ('partials.forms.edit.image-upload', ['help_text' => trans('general.audit_images_help')])+ <x-input.image-upload :helpText="trans('general.audit_images_help')" /><!-- Custom fields -->@include("models/custom_fields_form", [diff --git a/resources/views/hardware/edit.blade.php b/resources/views/hardware/edit.blade.phpindex 3399700b79..c7a5c53bd5 100755--- a/resources/views/hardware/edit.blade.php+++ b/resources/views/hardware/edit.blade.php@@ -111,7 +111,7 @@- @include ('partials.forms.edit.image-upload', ['image_path' => app('assets_upload_path')])+ <x-input.image-upload :item="$item" :imagePath="app('assets_upload_path')" /><div id='custom_fields_content'>diff --git a/resources/views/licenses/edit.blade.php b/resources/views/licenses/edit.blade.phpindex b0ccc6fe63..4055192e44 100755--- a/resources/views/licenses/edit.blade.php+++ b/resources/views/licenses/edit.blade.php@@ -1,136 +1,218 @@-@extends('layouts/edit-form', [- 'createText' => trans('admin/licenses/form.create'),- 'updateText' => trans('admin/licenses/form.update'),- 'topSubmit' => true,- 'formAction' => ($item->id) ? route('licenses.update', ['license' => $item->id]) : route('licenses.store'),- 'index_route' => 'licenses.index',- 'options' => [- 'back' => trans('admin/hardware/form.redirect_to_type',['type' => trans('general.previous_page')]),- 'index' => trans('admin/hardware/form.redirect_to_all', ['type' => 'licenses']),- 'item' => trans('admin/hardware/form.redirect_to_type', ['type' => trans('general.license')]),- ]-])+@extends('layouts/default')++{{-- Page title --}}+@section('title')+ @if ($item->id)+ {{ trans('admin/licenses/form.update') }}+ @else+ {{ trans('admin/licenses/form.create') }}+ @endif+ @parent+@stop{{-- Page content --}}-@section('inputFields')-@include ('partials.forms.edit.name', ['translated_name' => trans('admin/licenses/form.name')])-@include ('partials.forms.edit.category-select', ['translated_name' => trans('admin/categories/general.category_name'), 'fieldname' => 'category_id', 'required' => 'true', 'category_type' => 'license'])----<!-- Seats -->-<div class="form-group {{ $errors->has('seats') ? ' has-error' : '' }}">- <label for="seats" class="col-md-3 control-label">{{ trans('admin/licenses/form.seats') }}</label>- <div class="col-md-7 col-sm-12">- <div class="col-md-12" style="padding-left:0px">- <input class="form-control" type="number" min="0" name="seats" id="seats" value="{{ old('seats', $item->seats) }}" minlength="1" required style="width: 97px;">- </div>- </div>- <div class="col-md-8 col-md-offset-3"><x-form.error name="seats" /></div>-</div>-@include ('partials.forms.edit.minimum_quantity')--<!-- Serial-->-@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">- <textarea class="form-control" type="text" name="serial" id="serial" rows="5"{{ (Helper::checkIfRequired($item, 'serial')) ? ' required' : '' }}>{{ old('serial', $item->serial) }}</textarea>- <x-form.error name="serial" />- </div>- </div>-@endcan--@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])-@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id',])--<!-- Licensed to name -->-<div class="form-group {{ $errors->has('license_name') ? ' has-error' : '' }}">- <label for="license_name" class="col-md-3 control-label">{{ trans('admin/licenses/form.to_name') }}</label>- <div class="col-md-7">- <input class="form-control" type="text" name="license_name" id="license_name" value="{{ old('license_name', $item->license_name) }}" />- <x-form.error name="license_name" />- </div>-</div>--<!-- Licensed to email -->-<div class="form-group {{ $errors->has('license_email') ? ' has-error' : '' }}">- <label for="license_email" class="col-md-3 control-label">{{ trans('admin/licenses/form.to_email') }}</label>- <div class="col-md-7">- <input class="form-control" type="email" name="license_email" id="license_email" value="{{ old('license_email', $item->license_email) }}" />- <x-form.error name="license_email" />- </div>-</div>--<!-- Reassignable -->-<div class="form-group {{ $errors->has('reassignable') ? ' has-error' : '' }}">- <div class="col-md-3 control-label">- <strong>{{ trans('admin/licenses/form.reassignable') }}</strong>- </div>- <div class="col-md-7">- <label class="form-control">- <input type="checkbox" name="reassignable" value="1" aria-label="reassignable" @checked(old('reassignable', $item->id ? $item->reassignable : '1'))>- {{ trans('general.yes') }}- </label>- </div>-</div>---@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])-@include ('partials.forms.edit.order_number')-@include ('partials.forms.edit.purchase_cost')-@include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.purchase_date'),'fieldname' => 'purchase_date'])--<!-- Expiration Date -->-<div class="form-group {{ $errors->has('expiration_date') ? ' has-error' : '' }}">- <label for="expiration_date" class="col-md-3 control-label">{{ trans('admin/licenses/form.expiration') }}</label>-- <div class="input-group col-md-4">- <div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-today-btn="true" data-date-today-highlight="true" data-autoclose="true" data-date-clear-btn="true">- <input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="expiration_date" id="expiration_date" value="{{ old('expiration_date', ($item->expiration_date) ? $item->expiration_date->format('Y-m-d') : '') }}" maxlength="10">- <span class="input-group-addon"><x-icon type="calendar" /></span>- </div>- <x-form.error name="expiration_date" />- </div>--</div>--<!-- Termination Date -->-<div class="form-group {{ $errors->has('termination_date') ? ' has-error' : '' }}">- <label for="termination_date" class="col-md-3 control-label">{{ trans('admin/licenses/form.termination_date') }}</label>-- <div class="input-group col-md-4">- <div class="input-group date" data-provide="datepicker" data-date-today-btn="true" data-date-today-highlight="true" 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="termination_date" id="termination_date" value="{{ old('termination_date', ($item->termination_date) ? $item->termination_date->format('Y-m-d') : '') }}" maxlength="10">- <span class="input-group-addon"><x-icon type="calendar" /></span>- </div>- <x-form.error name="termination_date" />- </div>-</div>--{{-- @TODO How does this differ from Order #? --}}-<!-- Purchase Order -->-<div class="form-group {{ $errors->has('purchase_order') ? ' has-error' : '' }}">- <label for="purchase_order" class="col-md-3 control-label">{{ trans('admin/licenses/form.purchase_order') }}</label>- <div class="col-md-3 text-right">- <input class="form-control" type="text" name="purchase_order" id="purchase_order" value="{{ old('purchase_order', $item->purchase_order) }}" maxlength="191" />- <x-form.error name="purchase_order" />- </div>-</div>--@include ('partials.forms.edit.depreciation')--<!-- Maintained -->-<div class="form-group {{ $errors->has('maintained') ? ' has-error' : '' }}">- <div class="col-md-3 control-label"><strong>{{ trans('admin/licenses/form.maintained') }}</strong></div>- <div class="col-md-7">- <label class="form-control">- <input type="checkbox" name="maintained" value="1" aria-label="maintained" @checked(old('maintained', $item->maintained))>- {{ trans('general.yes') }}- </label>- </div>-</div>--@include ('partials.forms.edit.notes')+@section('content')++ <x-container class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0">++ <x-form :$item route="{{ ($item->id) ? route('licenses.update', ['license' => $item->id]) : route('licenses.store') }}">++ <x-box top_submit>+ @if ($item->id)+ <x-slot:header></x-slot:header>+ @endif++ <x-input.company-select+ :label="trans('general.company')"+ name="company_id"+ :selected="old('company_id', $item->company_id)"+ />++ <x-form.row+ :label="trans('general.name')"+ :$item+ name="name"+ />++ <x-input.category-select+ :label="trans('general.category')"+ name="category_id"+ :selected="old('category_id', $item->category_id)"+ required+ categoryType="license"+ />++ <x-form.row+ :label="trans('admin/licenses/form.seats')"+ :$item+ name="seats"+ type="number"+ :min="0"+ input_div_class="col-md-2"+ />++ <x-input.minimum-quantity :item="$item"/>++ @can('viewKeys', $item)+ <x-form.row+ :label="trans('admin/licenses/form.license_key')"+ :$item+ name="serial"+ type="textarea"+ :rows="5"+ input_div_class="col-md-7"+ />+ @endcan++ <x-input.manufacturer-select+ :label="trans('general.manufacturer')"+ name="manufacturer_id"+ :selected="old('manufacturer_id', $item->manufacturer_id)"+ />++ <x-form.row+ :label="trans('admin/licenses/form.to_name')"+ :$item+ name="license_name"+ input_div_class="col-md-7"+ />++ <x-form.row+ :label="trans('admin/licenses/form.to_email')"+ :$item+ name="license_email"+ type="email"+ input_div_class="col-md-7"+ />++ {{-- Reassignable defaults to CHECKED for new licenses (see the+ old() fallback) since it's the most common use-case.+ <x-form.checkbox-row>'s single-mode falls+ back to `$item->{$name} ?? false`, which would default new+ records to unchecked. Hand-authored here to preserve the+ old behavior. --}}+ <div class="form-group {{ $errors->has('reassignable') ? ' has-error' : '' }}">+ <div class="col-md-3 control-label">+ <strong>{{ trans('admin/licenses/form.reassignable') }}</strong>+ </div>+ <div class="col-md-7">+ <label class="form-control">+ <input type="checkbox" name="reassignable" value="1" aria-label="reassignable" @checked(old('reassignable', $item->id ? $item->reassignable : '1'))>+ {{ trans('general.yes') }}+ </label>+ </div>+ </div>++ <x-input.supplier-select+ :label="trans('general.supplier')"+ name="supplier_id"+ :selected="old('supplier_id', $item->supplier_id)"+ />++ <x-form.row+ :label="trans('general.order_number')"+ :$item+ name="order_number"+ input_div_class="col-md-7 col-sm-12"+ />+ <x-input.purchase-cost :item="$item"/>++ <x-form.row+ :label="trans('general.purchase_date')"+ name="purchase_date"+ input_div_class="col-md-4"+ >+ <x-slot:input>+ <x-input.datepicker+ name="purchase_date"+ :value="old('purchase_date', $item->purchase_date ? date('Y-m-d', strtotime($item->purchase_date)) : '')"+ :placeholder="trans('general.select_date')"+ />+ </x-slot:input>+ </x-form.row>++ <x-form.row+ :label="trans('admin/licenses/form.expiration')"+ name="expiration_date"+ input_div_class="col-md-4"+ >+ <x-slot:input>+ <x-input.datepicker+ name="expiration_date"+ :value="old('expiration_date', $item->expiration_date ? date('Y-m-d', strtotime($item->expiration_date)) : '')"+ :placeholder="trans('general.select_date')"+ />+ </x-slot:input>+ </x-form.row>++ <x-form.row+ :label="trans('admin/licenses/form.termination_date')"+ name="termination_date"+ input_div_class="col-md-4"+ >+ <x-slot:input>+ <x-input.datepicker+ name="termination_date"+ :value="old('termination_date', $item->termination_date ? date('Y-m-d', strtotime($item->termination_date)) : '')"+ :placeholder="trans('general.select_date')"+ />+ </x-slot:input>+ </x-form.row>++ <x-form.row+ :label="trans('admin/licenses/form.purchase_order')"+ :$item+ name="purchase_order"+ input_div_class="col-md-3"+ />++ <x-form.row+ :label="trans('general.depreciation')"+ name="depreciation_id"+ input_div_class="col-md-7"+ >+ <x-slot:input>+ <x-input.select+ name="depreciation_id"+ id="depreciation_id"+ :options="$depreciation_list"+ :selected="old('depreciation_id', $item->depreciation_id)"+ style="width:350px;"+ aria-label="depreciation_id"+ />+ </x-slot:input>+ </x-form.row>++ <x-form.checkbox-row+ name="maintained"+ :label="trans('admin/licenses/form.maintained')"+ :item="$item"+ />++ <x-form.row+ :label="trans('general.notes')"+ :$item+ name="notes"+ type="textarea"+ input_div_class="col-md-7 col-sm-12"+ />++ <x-slot:customfooter>+ <x-redirect_submit_options+ index_route="licenses.index"+ :button_label="trans('general.save')"+ :options="[+ 'back' => trans('admin/hardware/form.redirect_to_type', ['type' => trans('general.previous_page')]),+ 'index' => trans('admin/hardware/form.redirect_to_all', ['type' => 'licenses']),+ 'item' => trans('admin/hardware/form.redirect_to_type', ['type' => trans('general.license')]),+ ]"+ />+ </x-slot:customfooter>++ </x-box>++ </x-form>++ </x-container>@stopdiff --git a/resources/views/livewire/category-edit-form.blade.php b/resources/views/livewire/category-edit-form.blade.phpindex 7ea4b06061..762d764d85 100644--- a/resources/views/livewire/category-edit-form.blade.php+++ b/resources/views/livewire/category-edit-form.blade.php@@ -10,7 +10,9 @@:disabled="$this->eulaTextDisabled"/><p class="help-block">{!! trans('admin/categories/general.eula_text_help') !!} </p>- <p class="help-block">{!! trans('admin/settings/general.eula_markdown') !!} </p>+ <x-form.help name="eula_text" icon="markdown">+ {{ trans('general.markdown') }}+ </x-form.help><x-form.error name="eula_text" /></div>@if ($this->eulaTextDisabled)diff --git a/resources/views/locations/edit.blade.php b/resources/views/locations/edit.blade.phpindex ac67b0ee00..7a39e22bf4 100755--- a/resources/views/locations/edit.blade.php+++ b/resources/views/locations/edit.blade.php@@ -1,98 +1,126 @@+@extends('layouts/default')++{{-- Page title --}}+@section('title')+ @if ($item->id)+ {{ trans('admin/locations/table.update') }}+ @else+ {{ trans('admin/locations/table.create') }}+ @endif+ @parent+@stop+@push('js')-<script nonce="{{ csrf_token() }}">- $(function () {- $('[name="company_id"]').on('select2:select select2:clear', function (e) {- var companyId = $(this).val() || null;- var $parentSelect = $('#parent_id_location_select');- $parentSelect.data('company-id', companyId);- $parentSelect.val(null).trigger('change');+ <script nonce="{{ csrf_token() }}">+ $(function () {+ $('[name="company_id"]').on('select2:select select2:clear', function (e) {+ var companyId = $(this).val() || null;+ var $parentSelect = $('#parent_id_location_select');+ $parentSelect.data('company-id', companyId);+ $parentSelect.val(null).trigger('change');+ });});- });-</script>+ </script>@endpush-@extends('layouts/edit-form', [- 'createText' => trans('admin/locations/table.create') ,- 'updateText' => trans('admin/locations/table.update'),- 'topSubmit' => true,- 'formAction' => (isset($item->id)) ? route('locations.update', ['location' => $item->id]) : route('locations.store'),-])-{{-- Page content --}}-@section('inputFields')-@include ('partials.forms.edit.name', ['translated_name' => trans('admin/locations/table.name')])--<!-- parent -->-@include ('partials.forms.edit.location-select', ['translated_name' => trans('admin/locations/table.parent'), 'fieldname' => 'parent_id', 'exclude_id' => isset($item) ? $item->id : null, 'company_id' => isset($item) ? $item->company_id : null])--<!-- Manager-->-@include ('partials.forms.edit.user-select', ['translated_name' => trans('admin/users/table.manager'), 'fieldname' => 'manager_id'])--<!-- Company -->-@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])--@include ('partials.forms.edit.phone')-@include ('partials.forms.edit.fax')--<!-- Currency -->-<div class="form-group {{ $errors->has('currency') ? ' has-error' : '' }}">- <label for="currency" class="col-md-3 control-label">- {{ trans('admin/locations/table.currency') }}- </label>- <div class="col-md-7">- <input class="form-control" style="width:100px" type="text" name="currency" aria-label="currency" id="currency" value="{{ old('currency', $item->currency) }}"{!! (Helper::checkIfRequired($item, 'currency')) ? ' required' : '' !!} maxlength="3" />- <x-form.error name="currency" />-- </div>-</div>--@include ('partials.forms.edit.address')--<!-- LDAP Search OU -->-@if ($snipeSettings->ldap_enabled == 1)- <div class="form-group {{ $errors->has('ldap_ou') ? ' has-error' : '' }}">- <label for="ldap_ou" class="col-md-3 control-label">- {{ trans('admin/locations/table.ldap_ou') }}- </label>- <div class="col-md-7">- <input class="form-control" type="text" name="ldap_ou" aria-label="ldap_ou" id="ldap_ou" value="{{ old('ldap_ou', $item->ldap_ou) }}"{!! (Helper::checkIfRequired($item, 'ldap_ou')) ? ' required' : '' !!} maxlength="191" />- <x-form.error name="ldap_ou" />- </div>- </div>-@endif---@include ('partials.forms.edit.image-upload', ['image_path' => app('locations_upload_path')])--<div class="form-group{!! $errors->has('notes') ? ' has-error' : '' !!}">- <label for="notes" class="col-md-3 control-label">{{ trans('general.notes') }}</label>- <div class="col-md-8">- <x-input.textarea- name="notes"- id="notes"- :value="old('notes', $item->notes)"- placeholder="{{ trans('general.placeholders.notes') }}"- aria-label="notes"- rows="5"- />- <x-form.error name="notes" />- </div>-</div>--<fieldset name="color-preferences">- <x-form.legend help_text="{{ trans('general.tag_color_help') }}">- {{ trans('general.tag_color') }}- </x-form.legend>- <!-- color -->- <div class="form-group {{ $errors->has('tag_color') ? 'error' : '' }}">- <label for="tag_color" class="col-md-3 control-label">- {{ trans('general.tag_color') }}- </label>- <div class="col-md-9">- <x-input.colorpicker :item="$item" id="color" :value="old('color', ($item->color ?? '#f4f4f4'))" name="tag_color" id="tag_color" />- <x-form.error name="tag_color" />- </div>- </div>-</fieldset>-@stop+@section('content')++ <x-container class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0">++ <x-form :$item route="{{ ($item->id) ? route('locations.update', ['location' => $item->id]) : route('locations.store') }}">++ <x-box top_submit>+ @if ($item->id)+ <x-slot:header>{{ $item->name }}</x-slot:header>+ @endif++ <x-input.company-select+ :label="trans('general.company')"+ name="company_id"+ :selected="old('company_id', $item->company_id)"+ />++ <x-form.row+ :label="trans('admin/locations/table.name')"+ :$item+ name="name"+ />++ <x-input.location-select+ :label="trans('admin/locations/table.parent')"+ name="parent_id"+ :selected="old('parent_id', $item->parent_id)"+ :companyId="$item->company_id"+ id="parent_id_location_select"+ />++ @include ('partials.forms.edit.user-select', ['translated_name' => trans('admin/users/table.manager'), 'fieldname' => 'manager_id'])+ <x-form.row+ :label="trans('admin/suppliers/table.phone')"+ :$item+ name="phone"+ type="tel"+ input_icon="phone"+ input_group_addon="left"+ />++ <x-form.row+ :label="trans('admin/suppliers/table.fax')"+ :$item+ name="fax"+ type="tel"+ input_icon="fax"+ input_group_addon="left"+ :maxlength="34"+ />++ <x-form.row+ :label="trans('admin/locations/table.currency')"+ :$item+ name="currency"+ :maxlength="3"+ input_div_class="col-md-2"+ />++ <x-form.address :item="$item" />++ @if ($snipeSettings->ldap_enabled == 1)+ <x-form.row+ :label="trans('admin/locations/table.ldap_ou')"+ :$item+ name="ldap_ou"+ />+ @endif++ <x-input.image-upload :item="$item" :imagePath="app('locations_upload_path')" :clonedModel="$cloned_model ?? null" />++ <x-form.row+ :label="trans('general.notes')"+ :$item+ name="notes"+ type="textarea"+ :rows="5"+ :placeholder="trans('general.placeholders.notes')"+ />++ <fieldset name="color-preferences">+ <x-form.legend help_text="{{ trans('general.tag_color_help') }}">+ {{ trans('general.tag_color') }}+ </x-form.legend>+ <x-form.row+ :label="trans('general.tag_color')"+ :$item+ name="tag_color"+ type="colorpicker"+ />+ </fieldset>++ </x-box>++ </x-form>++ </x-container>++@stopdiff --git a/resources/views/maintenance-types/edit.blade.php b/resources/views/maintenance-types/edit.blade.phpindex 5848281e86..7a7d7ec707 100644--- a/resources/views/maintenance-types/edit.blade.php+++ b/resources/views/maintenance-types/edit.blade.php@@ -20,12 +20,16 @@@section('content')<x-container class="col-md-6 col-md-offset-3"><x-form :$item route="{{ $item->id ? route('maintenance-types.update', $item->id) : route('maintenance-types.store') }}">- <x-box>+ <x-box top_submit>+ @if ($item->id)+ <x-slot:header>{{ $item->name }}</x-slot:header>+ @endif+<x-form.row- :label="trans('general.name')"- :$item- name="name"- required="true"+ :label="trans('general.name')"+ :$item+ name="name"+ required/></x-box></x-form>diff --git a/resources/views/maintenances/edit.blade.php b/resources/views/maintenances/edit.blade.phpindex 9fc1e2e2a1..db43dc469b 100644--- a/resources/views/maintenances/edit.blade.php+++ b/resources/views/maintenances/edit.blade.php@@ -2,238 +2,160 @@{{-- Page title --}}@section('title')- @if ($item->id)- {{ trans('admin/maintenances/form.update') }}- @else- {{ trans('admin/maintenances/form.create') }}- @endif- @parent-@stop---@section('header_right')-<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">- {{ trans('general.back') }}</a>+ @if ($item->id)+ {{ trans('admin/maintenances/form.update') }}+ @else+ {{ trans('admin/maintenances/form.create') }}+ @endif+ @parent@stop-{{-- Page content --}}@section('content')-<div class="row">- <div class="col-md-6 col-md-offset-3">- @if ($item->id)- <form class="form-horizontal" method="post" action="{{ route('maintenances.update', $item->id) }}" autocomplete="off" enctype="multipart/form-data">- {{ method_field('PUT') }}- @else- <form class="form-horizontal" method="post" action="{{ route('maintenances.store') }}" autocomplete="off" enctype="multipart/form-data">- @endif- <!-- CSRF Token -->- {{ csrf_field() }}-- <div class="box box-default">-- @if ($item->id)- <div class="box-header with-border">- <h2 class="box-title">- {{ $item->title }}- </h2>- </div><!-- /.box-header -->- @endif-- <div class="box-body">-- @include ('partials.forms.edit.name', ['translated_name' => trans('general.name'), 'required' => 'true'])-- <!-- This is a new maintenance -->- @if (!$item->id)--- @include ('partials.forms.edit.asset-select', [- 'translated_name' => trans('general.assets'),- 'fieldname' => 'selected_assets[]',- 'multiple' => true,- 'required' => true,- 'select_id' => 'assigned_assets_select',- 'asset_selector_div_id' => 'assets_for_maintenance_div',- 'asset_ids' => $item->id ? $item->asset()->pluck('id')->toArray() : old('selected_assets'),- 'asset_id' => $item->id ? $item->asset()->pluck('id')->toArray() : null- ])- @else-- @if ($item->asset->company)- <div class="form-group">- <label for="company" class="control-label col-md-3">- {{ trans('general.company') }}- </label>-- <div class="col-md-9">- <p class="form-control-static">- {{ $item->asset->company->name }}- </p>- </div>- </div>- @endif-- <div class="form-group">- <label for="asset" class="control-label col-md-3">- {{ trans('general.asset') }}- </label>-- <div class="col-md-9">- <p class="form-control-static">- {{ $item->asset ? $item->asset->present()->fullName : '' }}- </p>- </div>- </div>-- @if ($item->asset->location)- <div class="form-group">- <label for="location" class="control-label col-md-3">- {{ trans('general.location') }}- </label>-- <div class="col-md-9">- <p class="form-control-static">- {{ $item->asset->location->name }}- </p>- </div>- </div>- @endif-- @endif--- @include ('partials.forms.edit.maintenance_type')-- <!-- Responsible Party -->- <div class="form-group {{ $errors->has('responsible_party_id') ? ' has-error' : '' }}">- <label for="responsible_party_id" class="col-md-3 control-label">- {{ trans('admin/maintenances/form.responsible_party') }}- </label>- <div class="col-md-7">- <select- class="js-data-ajax select2"- data-endpoint="users"- name="responsible_party_id"- id="responsible_party_id"- data-placeholder="{{ trans('general.select_user') }}"- aria-label="responsible_party_id"- style="width: 100%;"- >- @if ($item->responsibleParty)- <option value="{{ $item->responsibleParty->id }}" selected="selected">- {{ $item->responsibleParty->display_name }}- </option>- @elseif (! $item->id)- <option value="{{ auth()->id() }}" selected="selected">- {{ auth()->user()->display_name }}- </option>- @endif- </select>- <x-form.error name="responsible_party_id" />- </div>- </div>-- <!-- Start Date -->- <div class="form-group {{ $errors->has('start_date') ? ' has-error' : '' }}">- <label for="start_date" class="col-md-3 control-label">- {{ trans('admin/maintenances/form.start_date') }}- </label>-- <div class="col-md-4">- <x-input.datepicker- name="start_date"- :value="old('start_date', $item->start_date)"- placeholder="{{ trans('general.select_date') }}"- required="{{ Helper::checkIfRequired($item, 'start_date') }}"- />- <x-form.error name="start_date" />- </div>- </div>-+ <x-container class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0">+ <x-form :$item route="{{ $item->id ? route('maintenances.update', $item->id) : route('maintenances.store') }}">- <!-- Completion Date -->- <div class="form-group {{ $errors->has('completion_date') ? ' has-error' : '' }}">- <label for="start_date" class="col-md-3 control-label">{{ trans('admin/maintenances/form.completion_date') }}</label>+ <x-box top_submit>+ @if ($item->id)+ <x-slot:header>{{ $item->title }}</x-slot:header>+ @endif- <div class="input-group col-md-4">- <x-input.datepicker- name="completion_date"- :value="old('start_date', $item->completion_date)"- placeholder="{{ trans('general.select_date') }}"- required="Helper::checkIfRequired($item, 'completion_date')"- />- <x-form.error name="completion_date" />- </div>- </div>-- @include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])--- <!-- Warranty -->- <div class="form-group">- <div class="col-sm-offset-3 col-sm-9">- <label class="form-control">- <input type="checkbox" value="1" name="is_warranty" id="is_warranty" {{ old('is_warranty', $item->is_warranty) == '1' ? ' checked="checked"' : '' }}>- {{ trans('admin/maintenances/form.is_warranty') }}- </label>- </div>- </div>--- <!-- Asset Maintenance Cost -->- <div class="form-group {{ $errors->has('cost') ? ' has-error' : '' }}">- <label for="cost" class="col-md-3 control-label">{{ trans('admin/maintenances/form.cost') }}</label>- <div class="col-md-9">- <div class="input-group col-md-5" style="padding-left: 0px;">- <input class="form-control" type="text" inputmode="decimal" pattern="[\d.,]+" name="cost" aria-label="cost" id="cost" value="{{ old('cost', \App\Helpers\Helper::formatCurrencyOutput($item->cost)) }}" maxlength="25" data-msg-pattern="{{ trans('general.purchase_cost_invalid') }}"/>- <span class="input-group-addon">- @if (($item->asset) && ($item->asset->location) && ($item->asset->location->currency != ''))- {{ $item->asset->location->currency }}+ <x-form.row+ :label="trans('general.name')"+ :$item+ name="name"+ required+ />++ @if (! $item->id)+ @include ('partials.forms.edit.asset-select', [+ 'translated_name' => trans('general.assets'),+ 'fieldname' => 'selected_assets[]',+ 'multiple' => true,+ 'required' => true,+ 'select_id' => 'assigned_assets_select',+ 'asset_selector_div_id' => 'assets_for_maintenance_div',+ 'asset_ids' => $item->id ? $item->asset()->pluck('id')->toArray() : old('selected_assets'),+ 'asset_id' => $item->id ? $item->asset()->pluck('id')->toArray() : null,+ ])@else- {{ $snipeSettings->default_currency }}+ @if ($item->asset->company)+ <x-form.static :label="trans('general.company')">{{ $item->asset->company->name }}</x-form.static>+ @endif++ <x-form.static :label="trans('general.asset')">+ {{ $item->asset ? $item->asset->present()->fullName : '' }}+ </x-form.static>++ @if ($item->asset->location)+ <x-form.static :label="trans('general.location')">{{ $item->asset->location->name }}</x-form.static>+ @endif@endif- </span>- </div>- <div class="col-md-9" style="padding-left: 0px;">- <x-form.error name="cost" />- <p class="help-block">{{ trans('general.purchase_cost_format_help', ['format' => $snipeSettings->digit_separator]) }}</p>- </div>- </div>- </div>-- <div class="form-group {{ $errors->has('url') ? ' has-error' : '' }}">- <label for="url" class="col-md-3 control-label">{{ trans('general.url') }}</label>- <div class="col-md-7">- <input class="form-control" name="url" type="url" id="url" value="{{ old('url', $item->url) }}" placeholder="https://example.com">- <x-form.error name="url" />- </div>- </div>--- @include ('partials.forms.edit.image-upload', ['image_path' => app('maintenances_path')])- @include ('partials.forms.edit.file-upload', ['input_id' => 'maintenanceFileUpload'])--- <!-- Notes -->- <div class="form-group {{ $errors->has('notes') ? ' has-error' : '' }}">- <label for="notes" class="col-md-3 control-label">{{ trans('admin/maintenances/form.notes') }}</label>- <div class="col-md-7">- <textarea class="col-md-6 form-control" id="notes" name="notes">{{ old('notes', $item->notes) }}</textarea>- <p class="help-block">{!! trans('general.markdown') !!}</p>- <x-form.error name="notes" />- </div>- </div>- </div> <!-- .box-body -->-- <div class="box-footer text-right">- <button type="submit" class="btn btn-success"><x-icon type="checkmark" /> {{ trans('general.save') }}</button>- </div>- </div> <!-- .box-default -->- </form>- </div>-</div>++ @include ('partials.forms.edit.maintenance_type')++ <x-form.row+ :label="trans('admin/maintenances/form.responsible_party')"+ name="responsible_party_id"+ >+ <x-slot:input>+ <select+ class="js-data-ajax select2"+ data-endpoint="users"+ name="responsible_party_id"+ id="responsible_party_id"+ data-placeholder="{{ trans('general.select_user') }}"+ aria-label="responsible_party_id"+ style="width: 100%;"+ >+ @if ($item->responsibleParty)+ <option value="{{ $item->responsibleParty->id }}" selected="selected">+ {{ $item->responsibleParty->display_name }}+ </option>+ @elseif (! $item->id)+ <option value="{{ auth()->id() }}" selected="selected">+ {{ auth()->user()->display_name }}+ </option>+ @endif+ </select>+ </x-slot:input>+ </x-form.row>++ <x-form.row+ :label="trans('admin/maintenances/form.start_date')"+ name="start_date"+ input_div_class="col-md-4"+ >+ <x-slot:input>+ <x-input.datepicker+ name="start_date"+ :value="old('start_date', $item->start_date)"+ :placeholder="trans('general.select_date')"+ :required="Helper::checkIfRequired($item, 'start_date')"+ />+ </x-slot:input>+ </x-form.row>++ <x-form.row+ :label="trans('admin/maintenances/form.completion_date')"+ name="completion_date"+ input_div_class="col-md-4"+ >+ <x-slot:input>+ <x-input.datepicker+ name="completion_date"+ :value="old('completion_date', $item->completion_date)"+ :placeholder="trans('general.select_date')"+ :required="Helper::checkIfRequired($item, 'completion_date')"+ />+ </x-slot:input>+ </x-form.row>++ <x-input.supplier-select+ :label="trans('general.supplier')"+ name="supplier_id"+ :selected="old('supplier_id', $item->supplier_id)"+ />++ <x-form.checkbox-row+ name="is_warranty"+ :label="trans('admin/maintenances/form.is_warranty')"+ :item="$item"+ />++ <x-input.purchase-cost+ name="cost"+ :label="trans('admin/maintenances/form.cost')"+ :item="$item"+ :currencyType="$item->asset?->location?->currency ?: null"+ />++ <x-form.row+ :label="trans('general.url')"+ :$item+ name="url"+ type="url"+ input_icon="link"+ input_group_addon="left"+ placeholder="https://example.com"+ />++ <x-input.image-upload :item="$item" :imagePath="app('maintenances_path')"/>+ <x-input.file-upload inputId="maintenanceFileUpload"/>++ <x-form.row+ :label="trans('admin/maintenances/form.notes')"+ :$item+ name="notes"+ type="textarea"+ />++ </x-box>++ </x-form>++ </x-container>@stopdiff --git a/resources/views/manufacturers/edit.blade.php b/resources/views/manufacturers/edit.blade.phpindex 3fb75584a9..7f1ab62996 100755--- a/resources/views/manufacturers/edit.blade.php+++ b/resources/views/manufacturers/edit.blade.php@@ -2,117 +2,110 @@{{-- Page title --}}@section('title')- {{ trans('general.manufacturers') }}+ @if ($item->id)+ {{ trans('admin/manufacturers/table.update') }}+ @else+ {{ trans('admin/manufacturers/table.create') }}+ @endif+ @parent@stop{{-- Page content --}}@section('content')- <x-container class="col-md-6 col-md-offset-3">+ <x-container class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0">- <x-form :$item route="{{ (isset($item->id)) ? route('manufacturers.update', ['manufacturer' => $item->id]) : route('manufacturers.store') }}">+ <x-form :$item route="{{ ($item->id) ? route('manufacturers.update', ['manufacturer' => $item->id]) : route('manufacturers.store') }}">- <x-box>+ <x-box top_submit>+ @if ($item->id)+ <x-slot:header>{{ $item->name }}</x-slot:header>+ @endif- <!-- Name --><x-form.row- :label="trans('admin/manufacturers/table.name')"- :$item- name="name"+ :label="trans('admin/manufacturers/table.name')"+ :$item+ name="name"/>- <!-- URL --><x-form.row- :label="trans('general.url')"- :$item- name="url"- type="url"- input_icon="link"- input_group_addon="left"- placeholder="https://example.com"+ :label="trans('general.url')"+ :$item+ name="url"+ type="url"+ input_icon="link"+ input_group_addon="left"+ placeholder="https://example.com"/>- <!-- Support URL --><x-form.row- :label="trans('admin/manufacturers/table.support_url')"- :$item- name="support_url"- type="url"- help_text="{!! trans('admin/manufacturers/message.support_url_help') !!}"- input_icon="link"- input_group_addon="left"- placeholder="https://example.com"+ :label="trans('admin/manufacturers/table.support_url')"+ :$item+ name="support_url"+ type="url"+ :help_html="trans('admin/manufacturers/message.support_url_help')"+ input_icon="link"+ input_group_addon="left"+ placeholder="https://example.com"/>- <!-- Warranty Lookup URL --><x-form.row- :label="trans('admin/manufacturers/table.warranty_lookup_url')"- :$item- name="warranty_lookup_url"- type="url"- help_text="{!! trans('admin/manufacturers/message.support_url_help') !!}"- input_icon="link"- input_group_addon="left"- placeholder="https://example.com"+ :label="trans('admin/manufacturers/table.warranty_lookup_url')"+ :$item+ name="warranty_lookup_url"+ type="url"+ :help_html="trans('admin/manufacturers/message.support_url_help')"+ input_icon="link"+ input_group_addon="left"+ placeholder="https://example.com"/>- <!-- Support Phone --><x-form.row- :label="trans('admin/manufacturers/table.support_phone')"- :$item- name="support_phone"- input_div_class="col-md-6"- type="tel"- input_icon="phone"- input_group_addon="left"- placeholder="1-800-555-5555"+ :label="trans('admin/manufacturers/table.support_phone')"+ :$item+ name="support_phone"+ type="tel"+ input_icon="phone"+ input_group_addon="left"+ placeholder="1-800-555-5555"/>-- <!-- Support Email --><x-form.row- :label="trans('admin/manufacturers/table.support_email')"- :$item- name="support_email"- input_div_class="col-md-6"- type="email"- input_icon="email"- input_group_addon="left"- placeholder="[email protected]"+ :label="trans('admin/manufacturers/table.support_email')"+ :$item+ name="support_email"+ type="email"+ input_icon="email"+ input_group_addon="left"+ placeholder="[email protected]"/>+ <x-input.image-upload :item="$item" :imagePath="app('manufacturers_upload_path')" />- @include ('partials.forms.edit.image-upload', ['image_path' => app('manufacturers_upload_path')])--- <!-- Notes --><x-form.row- :label="trans('general.notes')"- :$item- name="notes"- type="textarea"- placeholder="{{ trans('general.placeholders.notes') }}"+ :label="trans('general.notes')"+ :$item+ name="notes"+ type="textarea"+ :placeholder="trans('general.placeholders.notes')"/><fieldset name="color-preferences"><x-form.legend help_text="{{ trans('general.tag_color_help') }}">{{ trans('general.tag_color') }}</x-form.legend>- <!-- color -->- <div class="form-group {{ $errors->has('tag_color') ? 'error' : '' }}">- <label for="tag_color" class="col-md-3 control-label">- {{ trans('general.tag_color') }}- </label>- <div class="col-md-9">- <x-input.colorpicker :item="$item" id="color" :value="old('color', ($item->color ?? '#f4f4f4'))" name="tag_color" id="tag_color" />- <x-form.error name="tag_color" />- </div>- </div>+ <x-form.row+ :label="trans('general.tag_color')"+ :$item+ name="tag_color"+ type="colorpicker"+ /></fieldset>+</x-box></x-form>-</x-container>+ </x-container>@stopdiff --git a/resources/views/models/custom_fields_form.blade.php b/resources/views/models/custom_fields_form.blade.phpindex 6f412ba84f..ac75f378af 100644--- a/resources/views/models/custom_fields_form.blade.php+++ b/resources/views/models/custom_fields_form.blade.php@@ -47,7 +47,7 @@<!-- Markdown Textarea --><textarea rows="6" class="col-md-6 form-control" id="{{ $field->db_column_name() }}" name="{{ $field->db_column_name() }}"{{ ($field->pivot->required=='1') ? ' required' : '' }}>{{ old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : $field->defaultValue($model->id))) }}</textarea><p class="help-block">- <i class="fab fa-markdown" aria-hidden="true"></i> {{ trans('admin/custom_fields/general.markdown_supported') }}+ <i class="fab fa-markdown" aria-hidden="true"></i> {{ trans('general.markdown') }}</p>@elseif ($field->element=='checkbox')diff --git a/resources/views/models/edit.blade.php b/resources/views/models/edit.blade.phpindex 2ad3eb2f5c..4f39629ae8 100755--- a/resources/views/models/edit.blade.php+++ b/resources/views/models/edit.blade.php@@ -1,66 +1,118 @@-@extends('layouts/edit-form', [- 'createText' => trans('admin/models/table.create') ,- 'updateText' => trans('admin/models/table.update'),- 'topSubmit' => true,- 'helpPosition' => 'right',- 'helpText' => trans('admin/models/general.about_models_text'),- 'formAction' => (isset($item->id)) ? route('models.update', ['model' => $item->id]) : route('models.store'),-])+@extends('layouts/default')++{{-- Page title --}}+@section('title')+ @if ($item->id)+ {{ trans('admin/models/table.update') }}+ @else+ {{ trans('admin/models/table.create') }}+ @endif+ @parent+@stop{{-- Page content --}}-@section('inputFields')-@include ('partials.forms.edit.name', ['translated_name' => trans('admin/models/table.name'), 'required' => 'true'])-@include ('partials.forms.edit.category-select', ['translated_name' => trans('admin/categories/general.category_name'), 'fieldname' => 'category_id', 'required' => 'true', 'category_type' => 'asset'])-@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id'])-@include ('partials.forms.edit.model_number')-@include ('partials.forms.edit.depreciation')-@include ('partials.forms.edit.minimum_quantity')--<!-- require serial boolean -->-<div class="form-group">- <label for="require_serial" class="col-md-3 control-label">- {{ trans('admin/hardware/general.require_serial') }}- </label>-- <div class="col-md-9">- <div class="form-inline" style="display: flex; align-items: center; gap: 8px;">- <input type="checkbox" name="require_serial" value="1" @checked(old('require_serial', $item->require_serial)) id="require_serial" aria-label="require_serial" />- <a- href="#"- data-tooltip="true"- title="{{ trans('admin/hardware/general.require_serial_help') }}"- style="display: inline-flex; align-items: center;"- >- <x-icon type="info-circle" />- <span class="sr-only">{{ trans('admin/hardware/general.require_serial_help') }}</span>- </a>- </div>- </div>-</div>-<!-- EOL -->--<div class="form-group {{ $errors->has('eol') ? ' has-error' : '' }}">- <label for="eol" class="col-md-3 control-label">{{ trans('general.eol') }}</label>- <div class="col-md-3 col-sm-4 col-xs-7">- <div class="input-group">- <input class="form-control" type="text" name="eol" id="eol" value="{{ old('eol', isset($item->eol)) ? $item->eol : '' }}" />- <span class="input-group-addon">- {{ trans('general.months') }}- </span>- </div>- </div>- <div class="col-md-9 col-md-offset-3">- <x-form.error name="eol" />- </div>-</div>--<!-- Custom Fieldset -->-<!-- If $item->id is null we are cloning the model and we need the $model_id variable -->-@livewire('custom-field-set-default-values-for-model', ["model_id" => $item->id ?? $model_id ?? null])--@include ('partials.forms.edit.notes')-@include ('partials.forms.edit.requestable', ['requestable_text' => trans('admin/models/general.requestable')])-@include ('partials.forms.edit.image-upload', ['image_path' => app('models_upload_path')])+@section('content')++ <x-container class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0">++ <x-form :$item route="{{ ($item->id) ? route('models.update', ['model' => $item->id]) : route('models.store') }}">++ <x-box top_submit>+ @if ($item->id)+ <x-slot:header>{{ $item->name }}</x-slot:header>+ @endif++ <x-form.row+ :label="trans('admin/models/table.name')"+ :$item+ name="name"+ required+ />++ <x-input.category-select+ :label="trans('admin/categories/general.category_name')"+ name="category_id"+ :selected="old('category_id', $item->category_id)"+ required+ categoryType="asset"+ />++ <x-input.manufacturer-select+ :label="trans('general.manufacturer')"+ name="manufacturer_id"+ :selected="old('manufacturer_id', $item->manufacturer_id)"+ />++ <x-form.row+ :label="trans('general.model_no')"+ :$item+ name="model_number"+ input_div_class="col-md-7"+ />++ <x-form.row+ :label="trans('general.depreciation')"+ name="depreciation_id"+ input_div_class="col-md-7"+ >+ <x-slot:input>+ <x-input.select+ name="depreciation_id"+ id="depreciation_id"+ :options="$depreciation_list"+ :selected="old('depreciation_id', $item->depreciation_id)"+ style="width:350px;"+ aria-label="depreciation_id"+ />+ </x-slot:input>+ </x-form.row>++ <x-input.minimum-quantity :item="$item" />++ <x-form.checkbox-row+ name="require_serial"+ :label="trans('admin/hardware/general.require_serial')"+ :item="$item"+ :info_tooltip_text="trans('admin/hardware/general.require_serial_help')"+ />++ <x-form.row+ :label="trans('general.eol')"+ name="eol"+ input_div_class="col-md-3 col-sm-4 col-xs-7"+ >+ <x-slot:input>+ <div class="input-group">+ <input class="form-control" type="text" name="eol" id="eol" value="{{ old('eol', $item->eol ?? '') }}" aria-label="eol" />+ <span class="input-group-addon">{{ trans('general.months') }}</span>+ </div>+ </x-slot:input>+ </x-form.row>++ {{-- Custom Fieldset --}}+ {{-- If $item->id is null we are cloning the model and we need the $model_id variable --}}+ @livewire('custom-field-set-default-values-for-model', ['model_id' => $item->id ?? $model_id ?? null])++ <x-form.row+ :label="trans('general.notes')"+ :$item+ name="notes"+ type="textarea"+ input_div_class="col-md-7 col-sm-12"+ />++ <x-form.checkbox-row+ name="requestable"+ :label="trans('admin/models/general.requestable')"+ :item="$item"+ />++ <x-input.image-upload :item="$item" :imagePath="app('models_upload_path')" :clonedModel="$cloned_model ?? null" />++ </x-box>++ </x-form>+ </x-container>@stopdiff --git a/resources/views/partials/forms/edit/address.blade.php b/resources/views/partials/forms/edit/address.blade.phpindex 948e46fb03..8e6b66889c 100644--- a/resources/views/partials/forms/edit/address.blade.php+++ b/resources/views/partials/forms/edit/address.blade.php@@ -44,9 +44,9 @@</div><div class="form-group {{ $errors->has('zip') ? ' has-error' : '' }}">- <label for="zip" class="col-md-3 control-label" maxlength="10">{{ trans('general.zip') }}</label>- <div class="col-md-7">- <input class="form-control" name="zip" type="text" id="zip" value="{{ old('zip', $item->zip) }}">+ <label for="zip" class="col-md-3 control-label">{{ trans('general.zip') }}</label>+ <div class="col-md-3">+ <input class="form-control" name="zip" type="text" id="zip" value="{{ old('zip', $item->zip) }}" maxlength="10" aria-label="zip"><x-form.error name="zip" /></div></div>diff --git a/resources/views/settings/general.blade.php b/resources/views/settings/general.blade.phpindex 2aae45fc05..0b0f66b7fe 100644--- a/resources/views/settings/general.blade.php+++ b/resources/views/settings/general.blade.php@@ -165,7 +165,9 @@/><x-form.error name="default_eula_text" /><p class="help-block">{{ trans('admin/settings/general.default_eula_help_text') }}</p>- <p class="help-block">{!! trans('admin/settings/general.eula_markdown') !!}</p>+ <x-form.help name="default_eula_text" icon="markdown">+ {{ trans('general.markdown') }}+ </x-form.help></div></div>diff --git a/resources/views/suppliers/edit.blade.php b/resources/views/suppliers/edit.blade.phpindex d85db7c09e..48502e261c 100755--- a/resources/views/suppliers/edit.blade.php+++ b/resources/views/suppliers/edit.blade.php@@ -1,55 +1,104 @@-@extends('layouts/edit-form', [- 'createText' => trans('admin/suppliers/table.create') ,- 'updateText' => trans('admin/suppliers/table.update'),- 'helpTitle' => trans('admin/suppliers/table.about_suppliers_title'),- 'helpText' => trans('admin/suppliers/table.about_suppliers_text'),- 'formAction' => (isset($item->id)) ? route('suppliers.update', ['supplier' => $item->id]) : route('suppliers.store'),-])+@extends('layouts/default')+{{-- Page title --}}+@section('title')+ @if ($item->id)+ {{ trans('admin/suppliers/table.update') }}+ @else+ {{ trans('admin/suppliers/table.create') }}+ @endif+ @parent+@stop{{-- Page content --}}-@section('inputFields')--@include ('partials.forms.edit.name', ['translated_name' => trans('admin/suppliers/table.name')])-@include ('partials.forms.edit.address')--<div class="form-group {{ $errors->has('contact') ? ' has-error' : '' }}">- <label for="contact" class="col-md-3 control-label">{{ trans('admin/suppliers/table.contact') }}</label>- <div class="col-md-7">- <input class="form-control" name="contact" type="text" id="contact" value="{{ old('contact', $item->contact) }}">- <x-form.error name="contact" />- </div>-</div>--@include ('partials.forms.edit.phone')-@include ('partials.forms.edit.fax')-@include ('partials.forms.edit.email')--<div class="form-group {{ $errors->has('url') ? ' has-error' : '' }}">- <label for="url" class="col-md-3 control-label">{{ trans('general.url') }}</label>- <div class="col-md-7">- <input class="form-control" name="url" type="url" id="url" value="{{ old('url', $item->url) }}">- <x-form.error name="url" />- </div>-</div>--@include ('partials.forms.edit.notes')-@include ('partials.forms.edit.image-upload', ['image_path' => app('suppliers_upload_path')])--<fieldset name="color-preferences">- <x-form.legend help_text="{{ trans('general.tag_color_help') }}">- {{ trans('general.tag_color') }}- </x-form.legend>- <!-- color -->- <div class="form-group {{ $errors->has('tag_color') ? 'error' : '' }}">- <label for="tag_color" class="col-md-3 control-label">- {{ trans('general.tag_color') }}- </label>- <div class="col-md-9">- <x-input.colorpicker :item="$item" id="color" :value="old('color', ($item->color ?? '#f4f4f4'))" name="tag_color" id="tag_color" />- <x-form.error name="tag_color" />- </div>- </div>-</fieldset>+@section('content')++ <x-container class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0">++ <x-form :$item route="{{ ($item->id) ? route('suppliers.update', ['supplier' => $item->id]) : route('suppliers.store') }}">++ <x-box top_submit>+ @if ($item->id)+ <x-slot:header>{{ $item->name }}</x-slot:header>+ @endif++ <x-form.row+ :label="trans('admin/suppliers/table.name')"+ :$item+ name="name"+ />++ <x-form.address :item="$item" />++ <x-form.row+ :label="trans('admin/suppliers/table.contact')"+ :$item+ name="contact"+ />++ <x-form.row+ :label="trans('admin/suppliers/table.phone')"+ :$item+ name="phone"+ type="tel"+ input_icon="phone"+ input_group_addon="left"+ />++ <x-form.row+ :label="trans('admin/suppliers/table.fax')"+ :$item+ name="fax"+ type="tel"+ input_icon="fax"+ input_group_addon="left"+ :maxlength="34"+ />++ <x-form.row+ :label="trans('admin/suppliers/table.email')"+ :$item+ name="email"+ type="email"+ input_icon="email"+ input_group_addon="left"+ />++ <x-form.row+ :label="trans('general.url')"+ :$item+ name="url"+ type="url"+ input_icon="link"+ input_group_addon="left"+ placeholder="https://example.com"+ />++ <x-form.row+ :label="trans('general.notes')"+ :$item+ name="notes"+ type="textarea"+ />++ <x-input.image-upload :item="$item" :imagePath="app('suppliers_upload_path')" />++ <fieldset name="color-preferences">+ <x-form.legend help_text="{{ trans('general.tag_color_help') }}">+ {{ trans('general.tag_color') }}+ </x-form.legend>+ <x-form.row+ :label="trans('general.tag_color')"+ :$item+ name="tag_color"+ type="colorpicker"+ />+ </fieldset>++ </x-box>++ </x-form>++ </x-container>@stopdiff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.phpindex 412231f027..fa994903ef 100755--- a/resources/views/users/edit.blade.php+++ b/resources/views/users/edit.blade.php@@ -305,7 +305,7 @@@endif- @include ('partials.forms.edit.image-upload', ['fieldname' => 'avatar', 'image_path' => app('users_upload_path')])+ <x-input.image-upload :item="$item" fieldname="avatar" :imagePath="app('users_upload_path')" :clonedModel="$cloned_model ?? null" /><!-- begin optional disclosure arrow stuff -->