feat: Moved InvoiceSettings Tab content to "tabs" directory -> modular approach

This commit is contained in:
IceToast 2022-01-02 19:38:13 +01:00
parent 41b0f03219
commit ef732d5426
2 changed files with 130 additions and 127 deletions

View file

@ -37,10 +37,15 @@
<!-- Nav pills --> <!-- Nav pills -->
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link active" data-toggle="pill" href="#dashboard-icons">{{__('Dashboard icons')}}</a> <a class="nav-link active" data-toggle="pill"
href="#dashboard-icons">{{ __('Dashboard icons') }}</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#invoice-settings">{{__('Invoice Settings')}}</a> <a class="nav-link" data-toggle="pill"
href="#invoice-settings">{{ __('Invoice Settings') }}</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#invoice">{{ __('Invoice Settings2') }}</a>
</li> </li>
</ul> </ul>
@ -87,118 +92,15 @@
<button class="btn btn-primary">{{ __('Submit') }}</button> <button class="btn btn-primary">{{ __('Submit') }}</button>
</form> </form>
<p class="text-muted">Images and Icons may be cached, use <code>CNTRL + F5</code><sup>(google <p class="text-muted">Images and Icons may be cached, use <code>CNTRL +
F5</code><sup>(google
chrome hotkey)</sup> to reload without cache to see your changes appear :)</p> chrome hotkey)</sup> to reload without cache to see your changes appear :)</p>
</div> </div>
<div class="tab-pane mt-3" id="invoice-settings"> @foreach ($tabs as $tab)
<div class="float-right"> @include($tab)
<a href="{{route('admin.settings.downloadAllInvoices')}}"><button class="btn btn-success">{{__('Download all Invoices')}}</button></a> @endforeach
</div>
<form method="POST" enctype="multipart/form-data" class="mb-3"
action="{{route('admin.settings.update.invoicesettings')}}">
@csrf
@method('PATCH')
<div class="row">
<div class="col-md-6 col-lg-4 col-12">
<!-- Name -->
<div class="form-group">
<div class="custom-control mb-3">
<label for="company-name">{{__('Enter your companys name' )}}</label>
<input x-model="company-name" id="company-name" name="company-name"
type="text" value="{{$company_name}}"
class="form-control @error('company-name') is-invalid @enderror">
</div>
</div>
<!-- address -->
<div class="form-group">
<div class="custom-control mb-3">
<label
for="company-address">{{__('Enter your companys address' )}}</label>
<input x-model="company-address" id="company-address"
name="company-address" type="text" value="{{$company_adress}}"
class="form-control @error('company-address') is-invalid @enderror">
</div>
</div>
<!-- Phone -->
<div class="form-group">
<div class="custom-control mb-3">
<label
for="company-phone">{{__('Enter your companys phone number' )}}</label>
<input x-model="company-phone" id="company-phone" name="company-phone"
type="text" value="{{$company_phone}}"
class="form-control @error('company-phone') is-invalid @enderror">
</div>
</div>
<!-- VAT -->
<div class="form-group">
<div class="custom-control mb-3">
<label for="company-vat">{{__('Enter your companys VAT id' )}}</label>
<input x-model="company-vat" id="company-vat" name="company-vat"
type="text" value="{{$company_vat}}"
class="form-control @error('company-vat') is-invalid @enderror">
</div>
</div>
<!-- email -->
<div class="form-group">
<div class="custom-control mb-3">
<label
for="company-mail">{{__('Enter your companys email address' )}}</label>
<input x-model="company-mail" id="company-mail" name="company-mail"
type="text" value="{{$company_mail}}"
class="form-control @error('company-mail') is-invalid @enderror">
</div>
</div>
<!-- website -->
<div class="form-group">
<div class="custom-control mb-3">
<label
for="company-web">{{__('Enter your companys website' )}}</label>
<input x-model="company-web" id="company-web" name="company-web"
type="text" value="{{$company_web}}"
class="form-control @error('company-web') is-invalid @enderror">
</div>
</div>
<!-- website -->
<div class="form-group">
<div class="custom-control mb-3">
<label
for="invoice-prefix">{{__('Enter your custom invoice prefix' )}}</label>
<input x-model="invoice-prefix" id="invoice-prefix" name="invoice-prefix"
type="text" value="{{$invoice_prefix}}"
class="form-control @error('invoice-prefix') is-invalid @enderror">
</div>
</div>
<!-- logo -->
<div class="form-group">
<div class="custom-control mb-3">
<label for="logo">{{__('Logo')}}</label>
<div class="custom-file mb-3">
<input type="file" accept="image/png,image/jpeg,image/jpg" class="custom-file-input"
name="logo" id="logo">
<label class="custom-file-label selected"
for="favicon">{{__('Select Invoice Logo')}}</label>
</div>
</div>
@error('logo')
<span class="text-danger">
{{$message}}
</span>
@enderror
</div>
</div>
</div>
<button class="btn btn-primary">{{__('Submit')}}</button>
<!-- end -->
</div>
</div> </div>

View file

@ -0,0 +1,101 @@
<div class="tab-pane mt-3" id="invoice">
<div class="float-right">
<a href="{{ route('admin.settings.downloadAllInvoices') }}"><button
class="btn btn-success">{{ __('Download all Invoices') }}</button></a>
</div>
<form method="POST" enctype="multipart/form-data" class="mb-3"
action="{{ route('admin.settings.update.invoicesettings') }}">
@csrf
@method('PATCH')
<div class="row">
<div class="col-md-6 col-lg-4 col-12">
<!-- Name -->
<div class="form-group">
<div class="custom-control mb-3">
<label for="company-name">{{ __('Enter your companys name') }}</label>
<input x-model="company-name" id="company-name" name="company-name" type="text"
value="{{ $invoiceSettings->company_name }}"
class="form-control @error('company-name') is-invalid @enderror">
</div>
</div>
<!-- address -->
<div class="form-group">
<div class="custom-control mb-3">
<label for="company-address">{{ __('Enter your companys address') }}</label>
<input x-model="company-address" id="company-address" name="company-address" type="text"
value="{{ $Invoices->invoiceSettings->company_address }}"
class="form-control @error('company-address') is-invalid @enderror">
</div>
</div>
<!-- Phone -->
<div class="form-group">
<div class="custom-control mb-3">
<label for="company-phone">{{ __('Enter your companys phone number') }}</label>
<input x-model="company-phone" id="company-phone" name="company-phone" type="text"
value="{{ $Invoices->invoiceSettings->company_phone }}"
class="form-control @error('company-phone') is-invalid @enderror">
</div>
</div>
<!-- VAT -->
<div class="form-group">
<div class="custom-control mb-3">
<label for="company-vat">{{ __('Enter your companys VAT id') }}</label>
<input x-model="company-vat" id="company-vat" name="company-vat" type="text"
value="{{ $Invoices->invoiceSettings->company_vat }}"
class="form-control @error('company-vat') is-invalid @enderror">
</div>
</div>
<!-- email -->
<div class="form-group">
<div class="custom-control mb-3">
<label for="company-mail">{{ __('Enter your companys email address') }}</label>
<input x-model="company-mail" id="company-mail" name="company-mail" type="text"
value="{{ $Invoices->invoiceSettings->company_mail }}"
class="form-control @error('company-mail') is-invalid @enderror">
</div>
</div>
<!-- website -->
<div class="form-group">
<div class="custom-control mb-3">
<label for="company-web">{{ __('Enter your companys website') }}</label>
<input x-model="company-web" id="company-web" name="company-web" type="text"
value="{{ $Invoices->invoiceSettings->company_web }}"
class="form-control @error('company-web') is-invalid @enderror">
</div>
</div>
<!-- website -->
<div class="form-group">
<div class="custom-control mb-3">
<label for="invoice-prefix">{{ __('Enter your custom invoice prefix') }}</label>
<input x-model="invoice-prefix" id="invoice-prefix" name="invoice-prefix" type="text"
value="{{ $Invoices->invoiceSettings->invoice_prefix }}"
class="form-control @error('invoice-prefix') is-invalid @enderror">
</div>
</div>
<!-- logo -->
<div class="form-group">
<div class="custom-control mb-3">
<label for="logo">{{ __('Logo') }}</label>
<div class="custom-file mb-3">
<input type="file" accept="image/png,image/jpeg,image/jpg" class="custom-file-input"
name="logo" id="logo">
<label class="custom-file-label selected"
for="favicon">{{ __('Select Invoice Logo') }}</label>
</div>
</div>
@error('logo')
<span class="text-danger">
{{ $Invoices->invoiceSettings->message }}
</span>
@enderror
</div>
</div>
</div>
<button class="btn btn-primary">{{ __('Submit') }}</button>
<!-- end -->
</div>