Skip to content

Commit 7d7f7c8

Browse files
authored
Merge pull request #571 from nasirkhan/dev
Base layout update, file browser fix
2 parents 97571e3 + cc3b2c2 commit 7d7f7c8

File tree

19 files changed

+756
-583
lines changed

19 files changed

+756
-583
lines changed

Modules/Category/Resources/views/backend/categories/trash.blade.php

Lines changed: 1 addition & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -9,88 +9,5 @@
99
@endsection
1010

1111
@section('content')
12-
<div class="card">
13-
<div class="card-body">
14-
15-
<x-backend.section-header>
16-
<i class="{{ $module_icon }}"></i> {{ __($module_title) }} <small class="text-muted">{{ __($module_action) }}</small>
17-
18-
<x-slot name="subtitle">
19-
@lang(":module_name Management Dashboard", ['module_name'=>Str::title($module_name)])
20-
</x-slot>
21-
<x-slot name="toolbar">
22-
<x-backend.buttons.return-back />
23-
<a href='{{ route("backend.$module_name.index") }}' class="btn btn-secondary" data-toggle="tooltip" title="{{ ucwords($module_name) }} List"><i class="fas fa-list"></i> List</a>
24-
</x-slot>
25-
</x-backend.section-header>
26-
27-
<div class="row mt-4">
28-
<div class="col">
29-
<table id="datatable" class="table table-bordered table-hover table-responsive-sm">
30-
<thead>
31-
<tr>
32-
<th>
33-
#
34-
</th>
35-
<th>
36-
Name
37-
</th>
38-
<th>
39-
Updated At
40-
</th>
41-
<th>
42-
Created By
43-
</th>
44-
<th class="text-end">
45-
Action
46-
</th>
47-
</tr>
48-
</thead>
49-
50-
<tbody>
51-
@foreach($$module_name as $module_name_singular)
52-
<tr>
53-
<td>
54-
{{ $module_name_singular->id }}
55-
</td>
56-
<td>
57-
<strong>
58-
{{ $module_name_singular->name }}
59-
</strong>
60-
</td>
61-
<td>
62-
{{ $module_name_singular->updated_at->isoFormat('llll') }}
63-
</td>
64-
<td>
65-
{{ $module_name_singular->created_by }}
66-
</td>
67-
<td class="text-end">
68-
<a href="{{route("backend.$module_name.restore", $module_name_singular)}}" class="btn btn-warning btn-sm" data-method="PATCH" data-token="{{csrf_token()}}" data-toggle="tooltip" title="{{__('labels.backend.restore')}}"><i class='fas fa-undo'></i> {{__('labels.backend.restore')}}</a>
69-
</td>
70-
</tr>
71-
@endforeach
72-
</tbody>
73-
</table>
74-
</div>
75-
</div>
76-
</div>
77-
<div class="card-footer">
78-
<div class="row">
79-
<div class="col-7">
80-
<div class="float-left">
81-
Total {{ $$module_name->total() }} {{ ucwords($module_name) }}
82-
</div>
83-
</div>
84-
<div class="col-5">
85-
<div class="float-end">
86-
{!! $$module_name->render() !!}
87-
</div>
88-
</div>
89-
</div>
90-
</div>
91-
</div>
12+
<x-backend.layouts.trash :data="$$module_name" :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" />
9213
@endsection
93-
94-
@section ('after-scripts-end')
95-
96-
@endsection
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
@extends('backend.layouts.app')
22

3-
@section('title') {{ __($module_action) }} {{ __($module_title) }} @endsection
3+
@section('title')
4+
{{ __($module_action) }} {{ __($module_title) }}
5+
@endsection
46

57
@section('breadcrumbs')
6-
<x-backend.breadcrumbs>
7-
<x-backend.breadcrumb-item route='{{route("backend.$module_name.index")}}' icon='{{ $module_icon }}'>
8-
{{ __($module_title) }}
9-
</x-backend.breadcrumb-item>
10-
<x-backend.breadcrumb-item type="active">{{ __($module_action) }}</x-backend.breadcrumb-item>
11-
</x-backend.breadcrumbs>
8+
<x-backend.breadcrumbs>
9+
<x-backend.breadcrumb-item route='{{ route("backend.$module_name.index") }}' icon='{{ $module_icon }}'>
10+
{{ __($module_title) }}
11+
</x-backend.breadcrumb-item>
12+
<x-backend.breadcrumb-item type="active">{{ __($module_action) }}</x-backend.breadcrumb-item>
13+
</x-backend.breadcrumbs>
1214
@endsection
1315

1416
@section('content')
15-
<x-backend.layouts.create :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" :module_action="$module_action" />
16-
@endsection
17+
<x-backend.layouts.create :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" :module_action="$module_action" />
18+
@endsection
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
@extends('backend.layouts.app')
22

3-
@section('title') {{ __($module_action) }} {{ __($module_title) }} @endsection
3+
@section('title')
4+
{{ __($module_action) }} {{ __($module_title) }}
5+
@endsection
46

57
@section('breadcrumbs')
6-
<x-backend.breadcrumbs>
7-
<x-backend.breadcrumb-item route='{{route("backend.$module_name.index")}}' icon='{{ $module_icon }}'>
8-
{{ __($module_title) }}
9-
</x-backend.breadcrumb-item>
10-
<x-backend.breadcrumb-item type="active">{{ __($module_action) }}</x-backend.breadcrumb-item>
11-
</x-backend.breadcrumbs>
8+
<x-backend.breadcrumbs>
9+
<x-backend.breadcrumb-item route='{{ route("backend.$module_name.index") }}' icon='{{ $module_icon }}'>
10+
{{ __($module_title) }}
11+
</x-backend.breadcrumb-item>
12+
<x-backend.breadcrumb-item type="active">{{ __($module_action) }}</x-backend.breadcrumb-item>
13+
</x-backend.breadcrumbs>
1214
@endsection
1315

1416
@section('content')
15-
<x-backend.layouts.edit :data="$$module_name_singular" :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" :module_action="$module_action" />
16-
@endsection
17+
<x-backend.layouts.edit :data="$$module_name_singular" :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon"
18+
:module_action="$module_action" />
19+
@endsection

Modules/Post/Resources/views/backend/posts/form.blade.php

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
{!! field_required($required) !!}
8585
<div class="input-group mb-3">
8686
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required", 'aria-label' => 'Image', 'aria-describedby' => 'button-image']) }}
87-
<button class="btn btn-outline-info" id="button-image" data-input="button-image"
87+
<button class="btn btn-outline-info" id="button-image" data-input="{{ $field_name }}"
8888
type="button"><i class="fas fa-folder-open"></i>&nbsp;@lang('Browse')</button>
8989
</div>
9090

@@ -98,12 +98,13 @@
9898
<?php
9999
$field_name = 'category_id';
100100
$field_lable = __("post::$module_name.$field_name");
101-
$field_options = (!empty($data))?optional($data->category())->pluck('name', 'id'):'';
102-
$selected = (!empty($data))?optional($data->category())->pluck('id')->toArray():'';
101+
$field_options = !empty($data) ? optional($data->category())->pluck('name', 'id') : '';
102+
$selected = !empty($data) ? optional($data->category())->pluck('id')->toArray() : '';
103103
$field_placeholder = __('Select an option');
104104
$required = 'required';
105105
?>
106-
{{ html()->label($field_lable, $field_name)->class('form-label')->for($field_name) }} {!! field_required($required) !!}
106+
{{ html()->label($field_lable, $field_name)->class('form-label')->for($field_name) }}
107+
{!! field_required($required) !!}
107108
{{ html()->select($field_name, $field_options, $selected)->placeholder($field_placeholder)->class('form-select select2-category')->attributes(["$required"]) }}
108109
</div>
109110
</div>
@@ -116,7 +117,8 @@
116117
$required = 'required';
117118
$select_options = \Modules\Post\Enums\PostType::toArray();
118119
?>
119-
{{ html()->label($field_lable, $field_name)->class('form-label')->for($field_name) }} {!! field_required($required) !!}
120+
{{ html()->label($field_lable, $field_name)->class('form-label')->for($field_name) }}
121+
{!! field_required($required) !!}
120122
{{ html()->select($field_name, $select_options)->class('form-select')->attributes(["$required"]) }}
121123
</div>
122124
</div>
@@ -144,14 +146,18 @@
144146
<?php
145147
$field_name = 'tags_list[]';
146148
$field_lable = __("post::$module_name.tags");
147-
$field_options = (!empty($data))?optional($data->tags)->pluck('name', 'id'):'';
148-
$selected = (!empty($data))?optional($data->tags)->pluck('id')->toArray():'';
149+
$field_options = !empty($data) ? optional($data->tags)->pluck('name', 'id') : '';
150+
$selected = !empty($data)
151+
? optional($data->tags)
152+
->pluck('id')
153+
->toArray()
154+
: '';
149155
$field_placeholder = __('Select an option');
150156
$required = '';
151157
?>
152158
{{ html()->label($field_lable, $field_name)->class('form-label')->for($field_name) }}
153159
{!! field_required($required) !!}
154-
{{ html()->multiselect( $field_name, $field_options, $selected)->class('form-control select2-tags')->attributes(["$required"]) }}
160+
{{ html()->multiselect($field_name, $field_options, $selected)->class('form-control select2-tags')->attributes(["$required"]) }}
155161
</div>
156162
</div>
157163
</div>
@@ -254,8 +260,6 @@
254260
</div>
255261
</div>
256262

257-
<!-- Select2 Library -->
258-
<x-library.select2 />
259263

260264
@push('after-styles')
261265
<link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.20/summernote-lite.min.css" rel="stylesheet">
@@ -323,6 +327,8 @@
323327
$('#button-image').filemanager('image');
324328
</script>
325329

330+
<!-- Select2 Library -->
331+
<x-library.select2 />
326332
<script type="module">
327333
$(document).ready(function() {
328334
$(document).on('select2:open', () => {

Modules/Post/Resources/views/backend/posts/index.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class="text-muted">{{ __($module_action) }}</small>
3838
</a>
3939
</li>
4040
<!-- <li>
41-
<hr class="dropdown-divider">
42-
</li> -->
41+
<hr class="dropdown-divider">
42+
</li> -->
4343
</ul>
4444
</div>
4545
@endcan

Modules/Post/Resources/views/backend/posts/index_datatable.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class="text-muted">{{ __($module_action) }}</small>
3838
</a>
3939
</li>
4040
<!-- <li>
41-
<hr class="dropdown-divider">
42-
</li> -->
41+
<hr class="dropdown-divider">
42+
</li> -->
4343
</ul>
4444
</div>
4545
@endcan

Modules/Post/Resources/views/backend/posts/show.blade.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
<ul>
4545
@foreach ($$module_name_singular->tags as $tag)
4646
<li>
47-
<a
48-
href="{{ route('backend.tags.show', [$tag->id, $tag->slug]) }}">{{ $tag->name }}</a>
47+
<a href="{{ route('backend.tags.show', [$tag->id, $tag->slug]) }}">{{ $tag->name }}</a>
4948
</li>
5049
@endforeach
5150
</ul>
Lines changed: 8 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,16 @@
11
@extends ('backend.layouts.app')
22

3-
@section('title') {{ __($module_action) }} {{ __($module_title) }} @endsection
3+
@section('title')
4+
{{ __($module_action) }} {{ __($module_title) }}
5+
@endsection
46

57
@section('breadcrumbs')
6-
<x-backend.breadcrumbs>
7-
<x-backend.breadcrumb-item type="active" icon='{{ $module_icon }}'>{{ __($module_title) }}</x-backend.breadcrumb-item>
8-
</x-backend.breadcrumbs>
8+
<x-backend.breadcrumbs>
9+
<x-backend.breadcrumb-item type="active"
10+
icon='{{ $module_icon }}'>{{ __($module_title) }}</x-backend.breadcrumb-item>
11+
</x-backend.breadcrumbs>
912
@endsection
1013

1114
@section('content')
12-
<div class="card">
13-
<div class="card-body">
14-
15-
<x-backend.section-header>
16-
<i class="{{ $module_icon }}"></i> {{ __($module_title) }} <small class="text-muted">{{ __($module_action) }}</small>
17-
18-
<x-slot name="subtitle">
19-
@lang(":module_name Management Dashboard", ['module_name'=>Str::title($module_name)])
20-
</x-slot>
21-
<x-slot name="toolbar">
22-
<x-backend.buttons.return-back />
23-
<a href='{{ route("backend.$module_name.index") }}' class="btn btn-secondary" data-toggle="tooltip" title="{{ ucwords($module_name) }} List"><i class="fas fa-list"></i> List</a>
24-
</x-slot>
25-
</x-backend.section-header>
26-
27-
<div class="row mt-4">
28-
<div class="col">
29-
<table id="datatable" class="table table-bordered table-hover table-responsive-sm">
30-
<thead>
31-
<tr>
32-
<th>
33-
#
34-
</th>
35-
<th>
36-
Name
37-
</th>
38-
<th>
39-
Updated At
40-
</th>
41-
<th>
42-
Created By
43-
</th>
44-
<th class="text-end">
45-
Action
46-
</th>
47-
</tr>
48-
</thead>
49-
50-
<tbody>
51-
@foreach($$module_name as $module_name_singular)
52-
<tr>
53-
<td>
54-
{{ $module_name_singular->id }}
55-
</td>
56-
<td>
57-
<strong>
58-
{{ $module_name_singular->name }}
59-
</strong>
60-
</td>
61-
<td>
62-
{{ $module_name_singular->updated_at->isoFormat('llll') }}
63-
</td>
64-
<td>
65-
{{ $module_name_singular->created_by }}
66-
</td>
67-
<td class="text-end">
68-
<a href="{{route("backend.$module_name.restore", $module_name_singular)}}" class="btn btn-warning btn-sm" data-method="PATCH" data-token="{{csrf_token()}}" data-toggle="tooltip" title="{{__('labels.backend.restore')}}"><i class='fas fa-undo'></i> {{__('labels.backend.restore')}}</a>
69-
</td>
70-
</tr>
71-
@endforeach
72-
</tbody>
73-
</table>
74-
</div>
75-
</div>
76-
</div>
77-
<div class="card-footer">
78-
<div class="row">
79-
<div class="col-7">
80-
<div class="float-left">
81-
Total {{ $$module_name->total() }} {{ ucwords($module_name) }}
82-
</div>
83-
</div>
84-
<div class="col-5">
85-
<div class="float-end">
86-
{!! $$module_name->render() !!}
87-
</div>
88-
</div>
89-
</div>
90-
</div>
91-
</div>
92-
@endsection
93-
94-
@section ('after-scripts-end')
95-
15+
<x-backend.layouts.trash :data="$$module_name" :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" />
9616
@endsection

0 commit comments

Comments
 (0)