Rework on product name/description and translate

This commit is contained in:
Deon George
2022-10-18 23:23:45 +11:00
parent bfd17b0686
commit b719efb58c
15 changed files with 148 additions and 62 deletions

View File

@@ -3,24 +3,56 @@
<div class="col-12">
<h3>Product Details @include('adminlte::widget.success_button')</h3>
<hr>
@dump($errors)
<form class="g-0 needs-validation" method="POST" enctype="multipart/form-data" role="form">
@csrf
<div class="row">
<!-- Product Name -->
<div class="col-12 col-sm-9 col-md-12 col-xl-6">
<!-- Product ID -->
<div class="col-12 col-sm-9 col-md-4 col-xl-3">
@include('adminlte::widget.form_text',[
'label'=>'Product Name',
'label'=>'Product ID',
'icon'=>'fas fa-atom',
'id'=>'description.name',
'old'=>'description.name',
'name'=>'description[name]',
'value'=>$o->name ?? '',
'id'=>'translate.name_short',
'old'=>'translate.name_short',
'name'=>'translate[name_short]',
'value'=>$o->name_short ?? '',
])
</div>
<!-- Product Name -->
<div class="col-12 col-sm-9 col-md-8 col-xl-9">
@include('adminlte::widget.form_text',[
'label'=>'Product Name',
'icon'=>'fas fa-atom',
'id'=>'translate.name_detail',
'old'=>'translate.name_detail',
'name'=>'translate[name_detail]',
'value'=>$o->name_detail ?? '',
])
</div>
</div>
<div class="row">
<div class="col-12">
<div class="form-group @error('description') is-invalid @enderror">
<!-- Product Description -->
<label for="description_full" class="col-form-label">Product Description</label>
<div class="input-group">
<div class="w-100">
<textarea class="textarea" id="description" name="translate[description]" placeholder="Full Description">{!! old('description',$o->description) ?? '' !!}</textarea>
<span class="invalid-feedback" role="alert">
@error('description')
{{ $message }}
@enderror
</span>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<!-- Active -->
<div class="col-3">
@include('adminlte::widget.form_toggle',[
@@ -43,7 +75,7 @@
'old'=>'model',
'name'=>'model',
'options'=>$o->availableTypes()->transform(function($item) { return ['id'=>$item,'value'=>$item]; }),
'value'=>get_class($o->type) ?? '',
'value'=>($o->type && $x=get_class($o->type)) ? $x : '',
])
</div>
</div>
@@ -97,7 +129,9 @@
@section('page-scripts')
@css(select2)
@css(simplemde)
@js(select2,autofocus)
@js(simplemde)
<script type="text/javascript">
// Get a list of supplier items matching this type to populate model_id
@@ -129,6 +163,8 @@
}
$(document).ready(function() {
new SimpleMDE({ element: $('.textarea')[0], forceSync: true });
$('#model').on('change',function(item) {
if ($(this).val()) {
$('#supplier_product').show();

View File

@@ -8,7 +8,7 @@
@endsection
@section('contentheader_title')
Service: {{ $o->sid }} <strong>{{ $o->product->name }}</strong>
Service: {{ $o->sid }} <strong>{{ $o->product->name_detail }}</strong>
@endsection
@section('contentheader_description')
{{ $o->name }}

View File

@@ -24,7 +24,7 @@
<td><a href="{{ url('u/service',[$oo->id]) }}">{{ $oo->sid }}</a></td>
<td>{{ $oo->product->category_name }}</td>
<td>{{ $oo->name_short }}</td>
<td>{{ $oo->product->name }}</td>
<td>{{ $oo->product->name_short }}</td>
<td>{{ $oo->external_billing ? '-' : $oo->invoice_next->format('Y-m-d') }}</td>
</tr>
@endforeach

View File

@@ -36,8 +36,8 @@
@foreach($xx=$offering->items->with(['products.product.services'])->get() as $oo)
<tr>
<td>{{ $oo->id }}</td>
<td>{{ $oo->name }}</td>
<td>{{ $oo->name_long }}</td>
<td>{{ $oo->name_short }}</td>
<td>{{ $oo->name_detail }}</td>
<td class="text-right">{{ $oo->active ? 'YES' : 'NO' }}</td>
<td class="text-right">{{ number_format($oo->setup_cost_taxable,2) }}</td>
<td class="text-right">{{ number_format($oo->base_cost_taxable,2) }}</td>

View File

@@ -1,6 +1,6 @@
<!-- $o = Product::class -->
<div class="col-md-12">
<p>{!! $o->name_long !!}</p>
<p>{!! $o->name_detail !!}</p>
</div>
<table class="table table-condensed">

View File

@@ -1,6 +1,6 @@
<!-- $o = Product::class -->
<div class="col-md-12">
<p>{!! $o->name_long !!}</p>
<p>{!! $o->name_detail !!}</p>
</div>
<table class="table table-condensed">

View File

@@ -1,6 +1,6 @@
<!-- $o = Product::class -->
<div class="col-md-12">
<p>{!! $o->name_long !!}</p>
<p>{!! $o->name_detail !!}</p>
</div>
<table class="table table-condensed">

View File

@@ -1,6 +1,6 @@
<!-- $o = Product::class -->
<div class="col-md-12">
<p>{!! $o->name_long !!}</p>
<p>{!! $o->name_detail !!}</p>
</div>
<table class="table table-condensed">

View File

@@ -1,6 +1,6 @@
<!-- $o = Product::class -->
<div class="col-md-12">
<p>{!! $o->name_long !!}</p>
<p>{!! $o->name_detail !!}</p>
</div>
<table class="table table-condensed">