first upload all files
This commit is contained in:
18
Modules/Tax/Resources/views/admin/taxes/create.blade.php
Normal file
18
Modules/Tax/Resources/views/admin/taxes/create.blade.php
Normal file
@@ -0,0 +1,18 @@
|
||||
@extends('admin::layout')
|
||||
|
||||
@component('admin::components.page.header')
|
||||
@slot('title', trans('admin::resource.create', ['resource' => trans('tax::taxes.tax')]))
|
||||
|
||||
<li><a href="{{ route('admin.taxes.index') }}">{{ trans('tax::taxes.taxes') }}</a></li>
|
||||
<li class="active">{{ trans('admin::resource.create', ['resource' => trans('tax::taxes.tax')]) }}</li>
|
||||
@endcomponent
|
||||
|
||||
@section('content')
|
||||
<form method="POST" action="{{ route('admin.taxes.store') }}" class="form-horizontal" id="tax-create-form" novalidate>
|
||||
{{ csrf_field() }}
|
||||
|
||||
{!! $tabs->render(compact('taxClass')) !!}
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@include('tax::admin.taxes.partials.shortcuts')
|
||||
20
Modules/Tax/Resources/views/admin/taxes/edit.blade.php
Normal file
20
Modules/Tax/Resources/views/admin/taxes/edit.blade.php
Normal file
@@ -0,0 +1,20 @@
|
||||
@extends('admin::layout')
|
||||
|
||||
@component('admin::components.page.header')
|
||||
@slot('title', trans('admin::resource.edit', ['resource' => trans('tax::taxes.tax')]))
|
||||
@slot('subtitle', $taxClass->title)
|
||||
|
||||
<li><a href="{{ route('admin.taxes.index') }}">{{ trans('tax::taxes.taxes') }}</a></li>
|
||||
<li class="active">{{ trans('admin::resource.edit', ['resource' => trans('tax::taxes.tax')]) }}</li>
|
||||
@endcomponent
|
||||
|
||||
@section('content')
|
||||
<form method="POST" action="{{ route('admin.taxes.update', $taxClass) }}" class="form-horizontal" id="tax-edit-form" novalidate>
|
||||
{{ csrf_field() }}
|
||||
{{ method_field('put') }}
|
||||
|
||||
{!! $tabs->render(compact('taxClass')) !!}
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@include('tax::admin.taxes.partials.shortcuts')
|
||||
38
Modules/Tax/Resources/views/admin/taxes/index.blade.php
Normal file
38
Modules/Tax/Resources/views/admin/taxes/index.blade.php
Normal file
@@ -0,0 +1,38 @@
|
||||
@extends('admin::layout')
|
||||
|
||||
@component('admin::components.page.header')
|
||||
@slot('title', trans('tax::taxes.taxes'))
|
||||
|
||||
<li class="active">{{ trans('tax::taxes.taxes') }}</li>
|
||||
@endcomponent
|
||||
|
||||
@component('admin::components.page.index_table')
|
||||
@slot('buttons', ['create'])
|
||||
@slot('resource', 'taxes')
|
||||
@slot('name', trans('tax::taxes.tax'))
|
||||
|
||||
@component('admin::components.table')
|
||||
@slot('thead')
|
||||
<tr>
|
||||
@include('admin::partials.table.select_all')
|
||||
|
||||
<th>{{ trans('admin::admin.table.id') }}</th>
|
||||
<th>{{ trans('tax::taxes.table.tax_class') }}</th>
|
||||
<th data-sort>{{ trans('admin::admin.table.created') }}</th>
|
||||
</tr>
|
||||
@endslot
|
||||
@endcomponent
|
||||
@endcomponent
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
new DataTable('#taxes-table .table', {
|
||||
columns: [
|
||||
{ data: 'checkbox', orderable: false, searchable: false, width: '3%' },
|
||||
{ data: 'id', width: '5%' },
|
||||
{ data: 'label', name: 'translations.label', orderable: false, defaultContent: '' },
|
||||
{ data: 'created', name: 'created_at' },
|
||||
],
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,14 @@
|
||||
@push('shortcuts')
|
||||
<dl class="dl-horizontal">
|
||||
<dt><code>b</code></dt>
|
||||
<dd>{{ trans('admin::admin.shortcuts.back_to_index', ['name' => trans('tax::taxes.tax')]) }}</dd>
|
||||
</dl>
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
keypressAction([
|
||||
{ key: 'b', route: "{{ route('admin.taxes.index') }}" }
|
||||
]);
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,6 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{{ Form::text('label', trans('tax::attributes.label'), $errors, $taxClass, ['required' => true]) }}
|
||||
{{ Form::select('based_on', trans('tax::attributes.based_on'), $errors, trans('tax::taxes.form.based_on'), $taxClass, ['required' => true]) }}
|
||||
</div>
|
||||
</div>
|
||||
37
Modules/Tax/Resources/views/admin/taxes/tabs/rates.blade.php
Normal file
37
Modules/Tax/Resources/views/admin/taxes/tabs/rates.blade.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<div class="tax-rates-wrapper">
|
||||
<div class="table-responsive">
|
||||
<table class="options tax-rates table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>{{ trans('tax::attributes.name') }}</th>
|
||||
<th>{{ trans('tax::attributes.country') }}</th>
|
||||
<th class="state">{{ trans('tax::attributes.state') }}</th>
|
||||
<th class="city">{{ trans('tax::attributes.city') }}</th>
|
||||
<th class="zip">{{ trans('tax::attributes.zip') }}</th>
|
||||
<th class="rate">{{ trans('tax::attributes.rate') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody id="tax-rates">
|
||||
{{-- Tax rate row will be added here dynamically using JS --}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-default m-b-15" id="add-new-rate">
|
||||
{{ trans('tax::taxes.form.add_new_rate') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@include('tax::admin.taxes.tabs.templates.rate')
|
||||
@include('tax::admin.taxes.tabs.templates.state_input')
|
||||
@include('tax::admin.taxes.tabs.templates.state_select')
|
||||
|
||||
@push('globals')
|
||||
<script>
|
||||
FleetCart.data['tax_rates'] = {!! old_json('rates', $taxClass->taxRates) !!};
|
||||
FleetCart.errors['tax_rates'] = @json($errors->get('rates.*'), JSON_FORCE_OBJECT);
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,50 @@
|
||||
<script type="text/html" id="tax-rate-template">
|
||||
<tr class="tax-rate">
|
||||
<td class="text-center">
|
||||
<span class="drag-icon">
|
||||
<i class="fa"></i>
|
||||
<i class="fa"></i>
|
||||
</span>
|
||||
</td>
|
||||
|
||||
<td class="tax-name">
|
||||
<input type="hidden" name="rates[<%- rateId %>][id]" value="<%- rate.id %>">
|
||||
|
||||
<input type="text" name="rates[<%- rateId %>][name]" value="<%- rate.name %>" class="form-control" id="rates.<%- rateId %>.name">
|
||||
</td>
|
||||
|
||||
<td class="country">
|
||||
<select class="custom-select-black" name="rates[<%- rateId %>][country]" id="rates.<%- rateId %>.country">
|
||||
<option value="">{{ trans('admin::admin.form.please_select') }}</option>
|
||||
|
||||
@foreach ($countries as $code => $name)
|
||||
<option value="{{ $code }}" <%= rate.country === '{{ $code }}' ? 'selected' : '' %>>
|
||||
{{ $name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td class="state">
|
||||
<input type="text" name="rates[<%- rateId %>][state]" value="<%- rate.state %>" class="form-control" id="rates.<%- rateId %>.state" placeholder="*">
|
||||
</td>
|
||||
|
||||
<td class="city">
|
||||
<input type="text" name="rates[<%- rateId %>][city]" value="<%- rate.city %>" class="form-control" id="rates.<%- rateId %>.city" placeholder="*">
|
||||
</td>
|
||||
|
||||
<td class="zip">
|
||||
<input type="text" name="rates[<%- rateId %>][zip]" value="<%- rate.zip %>" class="form-control" id="rates.<%- rateId %>.zip" placeholder="*">
|
||||
</td>
|
||||
|
||||
<td class="rate">
|
||||
<input type="number" name="rates[<%- rateId %>][rate]" value="<%- rate.rate %>" step="0.01" min="0" class="form-control" id="rates.<%- rateId %>.rate">
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-default delete-row" data-toggle="tooltip" title="{{ trans('tax::taxes.form.delete_rate') }}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</script>
|
||||
@@ -0,0 +1,3 @@
|
||||
<script type="text/html" id="state-input-template">
|
||||
<input type="text" name="rates[<%- rateId %>][state]" class="form-control" id="rates.<%- rateId %>.state" placeholder="*">
|
||||
</script>
|
||||
@@ -0,0 +1,9 @@
|
||||
<script type="text/html" id="state-select-template">
|
||||
<select name="rates[<%- rateId %>][state]" class="form-control custom-select-black" id="rates.<%- rateId %>.state">
|
||||
<option value="">{{ trans('admin::admin.form.please_select') }}</option>
|
||||
|
||||
<% _.forEach(states, function (state, code) { %>
|
||||
<option value="<%- code %>"><%- state %></option>
|
||||
<% }); %>
|
||||
</select>
|
||||
</script>
|
||||
Reference in New Issue
Block a user