Rename Admin views directory, add some functions on models

This commit is contained in:
Ludovic CANDELLIER
2021-07-27 22:12:58 +02:00
parent daeece59c9
commit 9a0601d473
229 changed files with 81 additions and 349 deletions

View File

@@ -0,0 +1,13 @@
@extends('layout.index', [
'title' => __('Shop.tariffs.title'),
'subtitle' => __('Shop.tariffs.add'),
'breadcrumb' => [__('Shop.tariffs.title')]
])
@section('content')
{{ Form::open(['route' => 'Admin.Shop.Tariffs.store', 'id' => 'tariff-form', 'autocomplete' => 'off']) }}
@include('Admin.Shop.Tariffs.form')
</form>
@endsection

View File

@@ -0,0 +1,13 @@
@extends('layout.index', [
'title' => __('Shop.tariffs.title'),
'subtitle' => __('Shop.tariffs.edit'),
'breadcrumb' => [__('Shop.tariffs.title')]
])
@section('content')
{{ Form::open(['route' => 'Admin.Shop.Tariffs.store', 'id' => 'tariffs-form', 'autocomplete' => 'off']) }}
<input type="hidden" name="id" id="tariff_id" value="{{ $tariff['id'] }}">
@include('Admin.Shop.Tariffs.form')
</form>
@endsection

View File

@@ -0,0 +1,92 @@
<div class="row">
<div class="col-6">
<div class="row mb-3">
<div class="col-8">
{{ Form::label('name', 'Nom') }}
@include('components.input', ['name' => 'name', 'value' => $tariff['name'] ?? null, 'required' => true])
</div>
<div class="col-4">
{{ Form::label('name', 'Etat') }}
@include('components.select', ['name' => 'status_id', 'list' => $statuses ?? [], 'value' => $tariff['status_id'] ?? null, 'required' => true, 'with_empty' => ''])
</div>
</div>
<div class="row mb-3">
<div class="col-6">
{{ Form::label('name', 'Code') }}
@include('components.input', ['name' => 'code', 'value' => $tariff['code'] ?? null, 'required' => true])
</div>
<div class="col-6">
{{ Form::label('name', 'Ref') }}
@include('components.input', ['name' => 'ref', 'value' => $tariff['ref'] ?? null, 'required' => true])
</div>
</div>
<div class="row mb-3">
<div class="col-8">
{{ Form::label('name', 'Canal de vente par défaut') }}
@include('components.select', ['name' => 'sale_channel_id', 'list' => $sale_channels ?? [], 'value' => $tariff['sale_channel_id'] ?? null, 'required' => true, 'with_empty' => ''])
</div>
<div class="col-4">
{{ Form::label('name', 'Unité du tarif') }}
@include('components.select', ['name' => 'tariff_unity_id', 'list' => $tariff_unities ?? [], 'value' => $tariff['tariff_unity_id'] ?? null, 'required' => true, 'with_empty' => ''])
</div>
</div>
<div class="row mb-3">
<div class="col-12">
{{ Form::label('description', 'Description') }}
@include('components.textarea', ['name' => 'description', 'value' => $tariff['description'] ?? null, 'class' => 'editor', 'required' => false])
</div>
</div>
</div>
<div class="col-6">
@if ($tariff['id'] ?? false)
@component('components.card', ['title' => 'Liste de prix'])
@include('components.datatable', ['route' => route('Admin.Shop.PriceLists.index'), 'model' => 'price_lists', 'with_filters' => false, 'with_print' => false, 'dataTable' => $datatables['price_lists'], 'create_callback' => 'PriceListCreate();', 'edit_callback' => 'PriceListEdit(id);', 'delete_callback' => 'PriceListRefresh();'])
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-price_lists-filters'])
@include('Admin.Shop.PriceLists.partials.filters')
@endcomponent
@endcomponent
@endif
</div>
</div>
@include('components.save')
@include('load.form.editor')
@include('load.layout.modal')
@push('js')
<script>
$(function() {
initEditor();
});
function PriceListCreate() {
var tariff_id = $('#tariff_id').val();
var url_open = "{{ route('Admin.Shop.PriceLists.modalCreate') }}/" + tariff_id;
var url_save = "{{ route('Admin.Shop.PriceLists.storeAjax') }}";
openModal("{{ __('price_list') }}", '#price_list-form', url_open, url_save, "PriceListRefresh();");
}
function PriceListEdit(id) {
var url_open = "{{ route('Admin.Shop.PriceLists.modalEdit') }}/" + id;
var url_save = "{{ route('Admin.Shop.PriceLists.storeAjax') }}";
openModal("{{ __('price_list') }}", '#price_list-form', url_open, url_save, "PriceListRefresh();");
}
function PriceListRefresh()
{
reloadDatatable("price_lists");
}
</script>
@endpush

View File

@@ -0,0 +1,11 @@
@extends('layout.index', [
'title' => __('Shop.tariffs.title'),
'subtitle' => __('Shop.tariffs.list'),
'breadcrumb' => [__('Shop.tariffs.title')]
])
@section('content')
@include('components.datatable', ['route' => route('Admin.Shop.Tariffs.index'), 'model' => 'tariffs'])
@endsection
@include('load.layout.modal')

View File

@@ -0,0 +1,36 @@
@extends('layout.index', [
'title' => __('products.title'),
'subtitle' => __('products.title'),
'breadcrumb' => [__('products.title')]
])
@section('content')
<form action="{{ route('Shop.Products') }}" method="GET">
<div class="row">
<div class="col-md-offset-2 col-md-8">
<div class="box box-info">
<div class="box-body">
<div class="col-md-6">
<h3>{{ name }}</h3>
<h4>
{{ $product.section.name }}<br>
</h4>
</div>
<div class="col-md-6 text-right">
<h2>{{ $prix_total }} </h2>
<h4>{{ $residence['type_produit']['name'] }}</h4>
</div>
<div class="col-md-12">
@include('Hestimmo.modules.Lot.partials.carousel')
</div>
</div>
</div>
</div>
</div>
</form>
@endsection