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,21 @@
@extends('layout.index', [
'title' => __('countries.title'),
'subtitle' => __('countries.add'),
'breadcrumb' => [
__('Country.title') => 'Admin.Country.index'
]
])
@section('content')
{{ Form::open(['route' => 'Admin.Country.store', 'id' => 'country-form', 'autocomplete' => 'off']) }}
@include('components.save')
@component('components.card')
@include('admin.Country.form')
@endcomponent
</form>
@endsection

View File

@@ -0,0 +1,12 @@
@extends('layout.index', [
'title' => __('DueDiligence.distributors.title'),
'subtitle' => __('DueDiligence.distributors.list'),
'breadcrumb' => [__('DueDiligence.distributors.title')]
])
@section('content')
@include('apps.DueDiligence.admin.Distributor.partials.dashboard')
@endsection

View File

@@ -0,0 +1,23 @@
@extends('layout.index', [
'title' => __('countries.title'),
'subtitle' => __('countries.edit'),
'breadcrumb' => [
__('countries.title') => 'Admin.Country.index'
]
])
@section('content')
{{ Form::open(['route' => 'Admin.Country.store', 'id' => 'country-form', 'autocomplete' => 'off']) }}
<input type="hidden" name="id" value="{{ $country['id'] }}">
@include('components.save')
@component('components.card')
@include('admin.Country.form')
@endcomponent
</form>
@endsection

View File

@@ -0,0 +1,3 @@
<html>
@include('apps.DueDiligence.admin.Distributor.partials.table', ['logo2' => public_path('/storage/partner/fundglobam/images/logo.png') ])
</html>

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="{{ App::getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex, nofollow">
</head>
<body>
@include('apps.DueDiligence.admin.Distributor.partials.table', ['logo' => '/storage/partner/fundglobam/images/logo.png'])
<script>
// window.print();
// window.history.back();
</script>
</body>
</html>

View File

@@ -0,0 +1,31 @@
@include('load.form.select2')
<div class="row mb-3">
<div class="col-6">
{{ Form::label('name', __('name')) }}
@include('components.input-translate', ['name' => 'name', 'value' => $country['name'] ?? null, 'translations' => $country->translations['name'] ?? null, 'required' => true])
</div>
<div class="col-6">
{{ Form::label('zone', __('zone')) }}
@include('components.select', ['name' => 'zone', 'value' => $country['zone_id'] ?? null, 'list' => $zones ?? null, 'required' => true])
</div>
</div>
<div class="row mb-3">
<div class="col-6">
{{ Form::label('name', __('region')) }}
@include('components.select', ['name' => 'region', 'value' => $country['region'] ?? null, 'list' => $regions ?? null, 'required' => true])
</div>
<div class="col-6">
{{ Form::label('nale', __('subregion')) }}
@include('components.select', ['name' => 'zone', 'value' => $country['subregion'] ?? null, 'list' => $subregions ?? null, 'required' => true])
</div>
</div>
@push('js')
<script>
$(function() {
initSelect2();
});
</script>
@endpush

View File

@@ -0,0 +1,57 @@
@extends('layout.index', [
'title' => __('application.title'),
'subtitle' => __('application.list'),
'breadcrumb' => [
]
])
@include('load.form.select2')
@include('load.form.toggle')
@section('content')
<nav>
<div class="nav nav-tabs">
<a href="#dashboard" data-toggle="tab" class="nav-item nav-link" role="tab" aria-controls="dashboard" aria-selected="true">
{{ __('dashboard') }}
</a>
<a href="#list" data-toggle="tab" class="nav-item nav-link active" role="tab" aria-controls="list" aria-selected="false">
{{ __('list') }}
</a>
</div>
</nav>
<div class="tab-content mb-0">
<div class="tab-pane fade" id="dashboard">
@component('components.card')
@include('admin.Core.App.Application.partials.dashboard')
@endcomponent
</div>
<div class="tab-pane fade show active" id="list">
@component('components.card')
@include('components.datatable', ['route' => route('Admin.Core.App.Application.index'), 'model' => 'applications', 'with_filters' => true, 'with_exports' => true, 'callback' => 'handleApplication();'])
@endcomponent
@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-applications-filters'])
@include('admin.Core.App.Application.partials.filters', ['model' => 'applications'])
@endcomponent
</div>
</div>
@endsection
@push('js')
<script>
function handleApplication() {
initToggle("{{ route('Admin.Core.App.Application.toggleActive') }}");
}
$(document).ready(function () {
initSelect2();
});
</script>
@endpush

View File

@@ -0,0 +1,31 @@
<h3 class="text-white">{{ __('documentation_types') }}</h3>
@include('components.datatable', ['route' => route('Admin.DocumentationType.index'), 'model' => 'documentation_types', 'with_filters' => true, 'with_exports' => true, 'create_callback' => 'DocumentationTypeCreate();', 'edit_callback' => 'DocumentationTypeEdit(id);'])
@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-documentation_types-filters'])
@include('apps.admin.DocumentationType.partials.filters', ['model' => 'documentation_types'])
@endcomponent
@push('js')
<script>
function DocumentationTypeCreate(id) {
var distributor_id = $('#distributor_id').val();
var url_open = "{{ route('Admin.DocumentationType.modalCreate') }}" + '/' + distributor_id;
var url_save = "{{ route('Admin.DocumentationType.storeAjax') }}";
openModal("{{ __('country') }}", '#country-form', url_open, url_save, "DocumentationTypeRefresh();");
}
function DocumentationTypeEdit(id) {
var url_open = "{{ route('Admin.DocumentationType.modalEdit') }}" + '/' + id;
var url_save = "{{ route('Admin.DocumentationType.storeAjax') }}";
openModal("{{ __('country') }}", '#country-form', url_open, url_save, "DocumentationTypeRefresh();");
}
function DocumentationTypeRefresh()
{
reloadDatatable("documentation_types");
}
</script>
@endpush

View File

@@ -0,0 +1,76 @@
{{ Form::open(['route' => 'DueDiligence.Admin.CountryParam.store', 'id' => 'country_param-form', 'autocomplete' => 'off', 'files' => true]) }}
<input type="hidden" name="id" value="{{ $country_param['id'] ?? null }}">
<input type="hidden" name="distributor_id" value="{{ $country_param['distributor_id'] ?? null }}">
<div class="row">
<div class="col-8">
<div class="row mb-3">
<div class="col-md-4">
{{ Form::label('name', __('date')) }}<br/>
@include('components.form.datepicker', ['name' => 'date', 'value' => $country_param['date'] ?? null])
</div>
<div class="col-md-2">
{{ Form::label('name', __('ope_rrai')) }}<br/>
@include('components.input', ['name' => 'rrai', 'value' => $country_param['rrai'] ?? null])
</div>
<div class="col-md-3">
{{ Form::label('name', __('color')) }}<br/>
@include('components.select', ['name' => 'index', 'list' => App\Repositories\DueDiligence\CountryParams::getRiskColors(), 'value' => $country_param['index'] ?? null, 'with_empty' => ''])
</div>
<div class="col-md-3">
{{ Form::label('name', __('broken_arrows')) }}<br/>
@include('components.input', ['name' => 'broken', 'value' => $country_param['broken'] ?? null])
</div>
</div>
<div class="row mb-3">
<div class="col-12">
{{ Form::label('name', __('comments')) }}<br/>
@include('components.form.editor', ['name' => 'comments', 'value' => $country_param['comments'] ?? null])
</div>
</div>
</div>
<div class="col-4">
@include('components.widgets.pdfPreview',['container' => 'country_param-file'])
{{ Form::label('name', __('file')) }}<br/>
@include('components.file', ['name' => 'file', 'value' => $country_param['file'] ?? null])
</div>
</div>
</form>
<script>
$(function() {
initSelect2();
var id = {{ $country_param['id'] ?? 'false' }};
var distributor_id = {{ $country_param['distributor_id'] ?? 'false' }};
var path = '/DueDiligence/Admin/CountryParam';
@if (isset($country_param['file']))
var file = path + '/getDocument/' + distributor_id + '/' + encodeURIComponent("{{ $country_param['file'] }}");
PDFObject.embed(file, "#country_param-file-preview");
$('#country_param-file').removeClass('d-none');
@endif
$('.file').fileinput({
showCaption: false,
dropZoneEnabled: false,
showUpload: false,
});
$('.datepicker').datetimepicker({
format: 'L',
@if (!isset($country_param['date']))
date: new Date()
@endif
});
$('.editor').tinymce({});
});
</script>

View File

@@ -0,0 +1,2 @@
<form id="{{ $model }}-filters">
</form>

View File

@@ -0,0 +1,16 @@
@extends('layout.index', [
'title' => __('DueDiligence.distributors.title'),
'subtitle' => __('DueDiligence.distributors.show'),
'breadcrumb' => [
__('DueDiligence.title') => 'DueDiligence.Admin.index',
__('DueDiligence.distributors.title') => 'DueDiligence.Admin.Distributor.index'
]
])
@section('content')
@component('components.card')
@include('apps.DueDiligence.admin.Distributor.form')
@endcomponent
@endsection

View File

@@ -0,0 +1,21 @@
@extends('layout.index', [
'title' => __('application_modules.title'),
'subtitle' => __('application_modules.add'),
'breadcrumb' => [
__('Country.title') => 'Admin.Core.App.ApplicationModule.index'
]
])
@section('content')
{{ Form::open(['route' => 'Admin.Core.App.ApplicationModule.store', 'id' => 'application_module-form', 'autocomplete' => 'off']) }}
@include('components.save')
@component('components.card')
@include('admin.Core.App.ApplicationModule.form')
@endcomponent
</form>
@endsection

View File

@@ -0,0 +1,12 @@
@extends('layout.index', [
'title' => __('DueDiligence.distributors.title'),
'subtitle' => __('DueDiligence.distributors.list'),
'breadcrumb' => [__('DueDiligence.distributors.title')]
])
@section('content')
@include('apps.DueDiligence.admin.Distributor.partials.dashboard')
@endsection

View File

@@ -0,0 +1,24 @@
@extends('layout.index', [
'title' => __('application_modules.title'),
'subtitle' => __('application_modules.edit'),
'breadcrumb' => [
__('Application_Module.title') => 'Admin.Core.App.ApplicationModule.index'
]
])
@section('content')
{{ Form::open(['route' => 'Admin.Core.App.ApplicationModule.store', 'id' => 'application_module-form', 'autocomplete' => 'off']) }}
<input type="hidden" name="id" value="{{ $application_module['id'] ?? null }}">
@include('components.save')
@component('components.card')
@include('admin.Core.App.ApplicationModule.form')
@endcomponent
</form>
@endsection

View File

@@ -0,0 +1,3 @@
<html>
@include('apps.DueDiligence.admin.Distributor.partials.table', ['logo2' => public_path('/storage/partner/fundglobam/images/logo.png') ])
</html>

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="{{ App::getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex, nofollow">
</head>
<body>
@include('apps.DueDiligence.admin.Distributor.partials.table', ['logo' => '/storage/partner/fundglobam/images/logo.png'])
<script>
// window.print();
// window.history.back();
</script>
</body>
</html>

View File

@@ -0,0 +1,25 @@
<div class="row mb-3">
<div class="col-6">
{{ Form::label('name', __('application')) }}
@include('components.select', ['name' => 'application_id', 'value' => $application_module['application_id'] ?? null, 'list' => $applications, 'required' => true, 'with_empty' => ''])
</div>
</div>
<div class="row mb-3">
<div class="col-6">
{{ Form::label('name', __('name')) }}
@include('components.input-translate', ['name' => 'name', 'value' => $application_module['name'] ?? null, 'translations' => $application_module->translations['name'] ?? null, 'required' => true])
</div>
</div>
@include('load.form.select2')
@include('load.form.save')
@push('js')
<script>
$(function() {
initSelect2();
initSaveForm('.save', '#application_module-form');
});
</script>
@endpush

View File

@@ -0,0 +1,57 @@
@extends('layout.index', [
'title' => __('application_module.title'),
'subtitle' => __('application_module.list'),
'breadcrumb' => [
]
])
@include('load.form.select2')
@include('load.form.toggle')
@section('content')
<nav>
<div class="nav nav-tabs">
<a href="#dashboard" data-toggle="tab" class="nav-item nav-link" role="tab" aria-controls="dashboard" aria-selected="true">
{{ __('dashboard') }}
</a>
<a href="#list" data-toggle="tab" class="nav-item nav-link active" role="tab" aria-controls="list" aria-selected="false">
{{ __('list') }}
</a>
</div>
</nav>
<div class="tab-content mb-0">
<div class="tab-pane fade" id="dashboard">
@component('components.card')
@include('admin.Core.App.ApplicationModule.partials.dashboard')
@endcomponent
</div>
<div class="tab-pane fade show active" id="list">
@component('components.card')
@include('components.datatable', ['route' => route('Admin.Core.App.ApplicationModule.index'), 'model' => 'application_modules', 'with_filters' => true, 'with_exports' => true, 'callback' => 'handleApplicationModule();'])
@endcomponent
@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-application_modules-filters'])
@include('admin.Core.App.ApplicationModule.partials.filters', ['model' => 'applications'])
@endcomponent
</div>
</div>
@endsection
@push('js')
<script>
function handleApplicationModule() {
initToggle("{{ route('Admin.Core.App.ApplicationModule.toggleActive') }}");
}
$(document).ready(function () {
initSelect2();
});
</script>
@endpush

View File

@@ -0,0 +1,31 @@
<h3 class="text-white">{{ __('documentation_types') }}</h3>
@include('components.datatable', ['route' => route('Admin.DocumentationType.index'), 'model' => 'documentation_types', 'with_filters' => true, 'with_exports' => true, 'create_callback' => 'DocumentationTypeCreate();', 'edit_callback' => 'DocumentationTypeEdit(id);'])
@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-documentation_types-filters'])
@include('apps.admin.DocumentationType.partials.filters', ['model' => 'documentation_types'])
@endcomponent
@push('js')
<script>
function DocumentationTypeCreate(id) {
var distributor_id = $('#distributor_id').val();
var url_open = "{{ route('Admin.DocumentationType.modalCreate') }}" + '/' + distributor_id;
var url_save = "{{ route('Admin.DocumentationType.storeAjax') }}";
openModal("{{ __('country') }}", '#country-form', url_open, url_save, "DocumentationTypeRefresh();");
}
function DocumentationTypeEdit(id) {
var url_open = "{{ route('Admin.DocumentationType.modalEdit') }}" + '/' + id;
var url_save = "{{ route('Admin.DocumentationType.storeAjax') }}";
openModal("{{ __('country') }}", '#country-form', url_open, url_save, "DocumentationTypeRefresh();");
}
function DocumentationTypeRefresh()
{
reloadDatatable("documentation_types");
}
</script>
@endpush

View File

@@ -0,0 +1,76 @@
{{ Form::open(['route' => 'DueDiligence.Admin.CountryParam.store', 'id' => 'country_param-form', 'autocomplete' => 'off', 'files' => true]) }}
<input type="hidden" name="id" value="{{ $country_param['id'] ?? null }}">
<input type="hidden" name="distributor_id" value="{{ $country_param['distributor_id'] ?? null }}">
<div class="row">
<div class="col-8">
<div class="row mb-3">
<div class="col-md-4">
{{ Form::label('name', __('date')) }}<br/>
@include('components.form.datepicker', ['name' => 'date', 'value' => $country_param['date'] ?? null])
</div>
<div class="col-md-2">
{{ Form::label('name', __('ope_rrai')) }}<br/>
@include('components.input', ['name' => 'rrai', 'value' => $country_param['rrai'] ?? null])
</div>
<div class="col-md-3">
{{ Form::label('name', __('color')) }}<br/>
@include('components.select', ['name' => 'index', 'list' => App\Repositories\DueDiligence\CountryParams::getRiskColors(), 'value' => $country_param['index'] ?? null, 'with_empty' => ''])
</div>
<div class="col-md-3">
{{ Form::label('name', __('broken_arrows')) }}<br/>
@include('components.input', ['name' => 'broken', 'value' => $country_param['broken'] ?? null])
</div>
</div>
<div class="row mb-3">
<div class="col-12">
{{ Form::label('name', __('comments')) }}<br/>
@include('components.form.editor', ['name' => 'comments', 'value' => $country_param['comments'] ?? null])
</div>
</div>
</div>
<div class="col-4">
@include('components.widgets.pdfPreview',['container' => 'country_param-file'])
{{ Form::label('name', __('file')) }}<br/>
@include('components.file', ['name' => 'file', 'value' => $country_param['file'] ?? null])
</div>
</div>
</form>
<script>
$(function() {
initSelect2();
var id = {{ $country_param['id'] ?? 'false' }};
var distributor_id = {{ $country_param['distributor_id'] ?? 'false' }};
var path = '/DueDiligence/Admin/CountryParam';
@if (isset($country_param['file']))
var file = path + '/getDocument/' + distributor_id + '/' + encodeURIComponent("{{ $country_param['file'] }}");
PDFObject.embed(file, "#country_param-file-preview");
$('#country_param-file').removeClass('d-none');
@endif
$('.file').fileinput({
showCaption: false,
dropZoneEnabled: false,
showUpload: false,
});
$('.datepicker').datetimepicker({
format: 'L',
@if (!isset($country_param['date']))
date: new Date()
@endif
});
$('.editor').tinymce({});
});
</script>

View File

@@ -0,0 +1,2 @@
<form id="{{ $model }}-filters">
</form>

View File

@@ -0,0 +1,16 @@
@extends('layout.index', [
'title' => __('DueDiligence.distributors.title'),
'subtitle' => __('DueDiligence.distributors.show'),
'breadcrumb' => [
__('DueDiligence.title') => 'DueDiligence.Admin.index',
__('DueDiligence.distributors.title') => 'DueDiligence.Admin.Distributor.index'
]
])
@section('content')
@component('components.card')
@include('apps.DueDiligence.admin.Distributor.form')
@endcomponent
@endsection