simplify variables names for templates, refactor to be multi-model

This commit is contained in:
Ludovic CANDELLIER
2023-03-28 00:17:04 +02:00
parent 3dc6c70c4d
commit bc1cf1190b
11 changed files with 89 additions and 75 deletions

View File

@@ -5,9 +5,9 @@
<div class="row mb-3">
<div class="col-6">
@include('components.form.select', [
'id_name' => 'user_id',
'name' => 'user_id',
'list' => $users,
'id_name' => 'model_id',
'name' => 'model_id',
'list' => $list,
'class' => 'select2',
'with_empty' => '',
'label' => __('Core.users.name'),
@@ -23,13 +23,10 @@
<script>
initSelect2();
$('#user_id').change(function() {
console.log('ici');
var user_id = $(this).find(":selected").val();
$('#model_id').change(function() {
var model_id = $(this).find(":selected").val();
var template_id = $('#template_id').val();
console.log(user_id);
console.log(template_id);
var url = "{{ route('Admin.Core.Mail.MailTemplate.preview') }}/" + template_id + '/' + user_id;
var url = "{{ route('Admin.Core.Mail.MailTemplate.preview') }}/" + template_id + '/' + model_id;
$.get(url, function(data) {
$('#previewTemplate').html(data);
});

View File

@@ -32,7 +32,7 @@
<div class="row mb-3">
<div class="col-12">
{{ Form::label('', __('Description')) }}
<textarea name="description" class="form-control">{{ $delivery['description'] }}</textarea>
<textarea name="description" class="form-control">{{ $delivery['description'] ?? '' }}</textarea>
</div>
</div>