Skip to content

Commit

Permalink
Merge pull request #571 from nasirkhan/dev
Browse files Browse the repository at this point in the history
Base layout update, file browser fix
  • Loading branch information
nasirkhan committed Apr 21, 2024
2 parents 97571e3 + cc3b2c2 commit 7d7f7c8
Show file tree
Hide file tree
Showing 19 changed files with 756 additions and 583 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,88 +9,5 @@
@endsection

@section('content')
<div class="card">
<div class="card-body">

<x-backend.section-header>
<i class="{{ $module_icon }}"></i> {{ __($module_title) }} <small class="text-muted">{{ __($module_action) }}</small>

<x-slot name="subtitle">
@lang(":module_name Management Dashboard", ['module_name'=>Str::title($module_name)])
</x-slot>
<x-slot name="toolbar">
<x-backend.buttons.return-back />
<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>
</x-slot>
</x-backend.section-header>

<div class="row mt-4">
<div class="col">
<table id="datatable" class="table table-bordered table-hover table-responsive-sm">
<thead>
<tr>
<th>
#
</th>
<th>
Name
</th>
<th>
Updated At
</th>
<th>
Created By
</th>
<th class="text-end">
Action
</th>
</tr>
</thead>

<tbody>
@foreach($$module_name as $module_name_singular)
<tr>
<td>
{{ $module_name_singular->id }}
</td>
<td>
<strong>
{{ $module_name_singular->name }}
</strong>
</td>
<td>
{{ $module_name_singular->updated_at->isoFormat('llll') }}
</td>
<td>
{{ $module_name_singular->created_by }}
</td>
<td class="text-end">
<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>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
<div class="card-footer">
<div class="row">
<div class="col-7">
<div class="float-left">
Total {{ $$module_name->total() }} {{ ucwords($module_name) }}
</div>
</div>
<div class="col-5">
<div class="float-end">
{!! $$module_name->render() !!}
</div>
</div>
</div>
</div>
</div>
<x-backend.layouts.trash :data="$$module_name" :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" />
@endsection

@section ('after-scripts-end')

@endsection
20 changes: 11 additions & 9 deletions Modules/Post/Resources/views/backend/posts/create.blade.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
@extends('backend.layouts.app')

@section('title') {{ __($module_action) }} {{ __($module_title) }} @endsection
@section('title')
{{ __($module_action) }} {{ __($module_title) }}
@endsection

@section('breadcrumbs')
<x-backend.breadcrumbs>
<x-backend.breadcrumb-item route='{{route("backend.$module_name.index")}}' icon='{{ $module_icon }}'>
{{ __($module_title) }}
</x-backend.breadcrumb-item>
<x-backend.breadcrumb-item type="active">{{ __($module_action) }}</x-backend.breadcrumb-item>
</x-backend.breadcrumbs>
<x-backend.breadcrumbs>
<x-backend.breadcrumb-item route='{{ route("backend.$module_name.index") }}' icon='{{ $module_icon }}'>
{{ __($module_title) }}
</x-backend.breadcrumb-item>
<x-backend.breadcrumb-item type="active">{{ __($module_action) }}</x-backend.breadcrumb-item>
</x-backend.breadcrumbs>
@endsection

@section('content')
<x-backend.layouts.create :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" :module_action="$module_action" />
@endsection
<x-backend.layouts.create :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" :module_action="$module_action" />
@endsection
21 changes: 12 additions & 9 deletions Modules/Post/Resources/views/backend/posts/edit.blade.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
@extends('backend.layouts.app')

@section('title') {{ __($module_action) }} {{ __($module_title) }} @endsection
@section('title')
{{ __($module_action) }} {{ __($module_title) }}
@endsection

@section('breadcrumbs')
<x-backend.breadcrumbs>
<x-backend.breadcrumb-item route='{{route("backend.$module_name.index")}}' icon='{{ $module_icon }}'>
{{ __($module_title) }}
</x-backend.breadcrumb-item>
<x-backend.breadcrumb-item type="active">{{ __($module_action) }}</x-backend.breadcrumb-item>
</x-backend.breadcrumbs>
<x-backend.breadcrumbs>
<x-backend.breadcrumb-item route='{{ route("backend.$module_name.index") }}' icon='{{ $module_icon }}'>
{{ __($module_title) }}
</x-backend.breadcrumb-item>
<x-backend.breadcrumb-item type="active">{{ __($module_action) }}</x-backend.breadcrumb-item>
</x-backend.breadcrumbs>
@endsection

@section('content')
<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" />
@endsection
<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" />
@endsection
26 changes: 16 additions & 10 deletions Modules/Post/Resources/views/backend/posts/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
{!! field_required($required) !!}
<div class="input-group mb-3">
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required", 'aria-label' => 'Image', 'aria-describedby' => 'button-image']) }}
<button class="btn btn-outline-info" id="button-image" data-input="button-image"
<button class="btn btn-outline-info" id="button-image" data-input="{{ $field_name }}"
type="button"><i class="fas fa-folder-open"></i>&nbsp;@lang('Browse')</button>
</div>

Expand All @@ -98,12 +98,13 @@
<?php
$field_name = 'category_id';
$field_lable = __("post::$module_name.$field_name");
$field_options = (!empty($data))?optional($data->category())->pluck('name', 'id'):'';
$selected = (!empty($data))?optional($data->category())->pluck('id')->toArray():'';
$field_options = !empty($data) ? optional($data->category())->pluck('name', 'id') : '';
$selected = !empty($data) ? optional($data->category())->pluck('id')->toArray() : '';
$field_placeholder = __('Select an option');
$required = 'required';
?>
{{ html()->label($field_lable, $field_name)->class('form-label')->for($field_name) }} {!! field_required($required) !!}
{{ html()->label($field_lable, $field_name)->class('form-label')->for($field_name) }}
{!! field_required($required) !!}
{{ html()->select($field_name, $field_options, $selected)->placeholder($field_placeholder)->class('form-select select2-category')->attributes(["$required"]) }}
</div>
</div>
Expand All @@ -116,7 +117,8 @@
$required = 'required';
$select_options = \Modules\Post\Enums\PostType::toArray();
?>
{{ html()->label($field_lable, $field_name)->class('form-label')->for($field_name) }} {!! field_required($required) !!}
{{ html()->label($field_lable, $field_name)->class('form-label')->for($field_name) }}
{!! field_required($required) !!}
{{ html()->select($field_name, $select_options)->class('form-select')->attributes(["$required"]) }}
</div>
</div>
Expand Down Expand Up @@ -144,14 +146,18 @@
<?php
$field_name = 'tags_list[]';
$field_lable = __("post::$module_name.tags");
$field_options = (!empty($data))?optional($data->tags)->pluck('name', 'id'):'';
$selected = (!empty($data))?optional($data->tags)->pluck('id')->toArray():'';
$field_options = !empty($data) ? optional($data->tags)->pluck('name', 'id') : '';
$selected = !empty($data)
? optional($data->tags)
->pluck('id')
->toArray()
: '';
$field_placeholder = __('Select an option');
$required = '';
?>
{{ html()->label($field_lable, $field_name)->class('form-label')->for($field_name) }}
{!! field_required($required) !!}
{{ html()->multiselect( $field_name, $field_options, $selected)->class('form-control select2-tags')->attributes(["$required"]) }}
{{ html()->multiselect($field_name, $field_options, $selected)->class('form-control select2-tags')->attributes(["$required"]) }}
</div>
</div>
</div>
Expand Down Expand Up @@ -254,8 +260,6 @@
</div>
</div>

<!-- Select2 Library -->
<x-library.select2 />

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

<!-- Select2 Library -->
<x-library.select2 />
<script type="module">
$(document).ready(function() {
$(document).on('select2:open', () => {
Expand Down
4 changes: 2 additions & 2 deletions Modules/Post/Resources/views/backend/posts/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class="text-muted">{{ __($module_action) }}</small>
</a>
</li>
<!-- <li>
<hr class="dropdown-divider">
</li> -->
<hr class="dropdown-divider">
</li> -->
</ul>
</div>
@endcan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class="text-muted">{{ __($module_action) }}</small>
</a>
</li>
<!-- <li>
<hr class="dropdown-divider">
</li> -->
<hr class="dropdown-divider">
</li> -->
</ul>
</div>
@endcan
Expand Down
3 changes: 1 addition & 2 deletions Modules/Post/Resources/views/backend/posts/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
<ul>
@foreach ($$module_name_singular->tags as $tag)
<li>
<a
href="{{ route('backend.tags.show', [$tag->id, $tag->slug]) }}">{{ $tag->name }}</a>
<a href="{{ route('backend.tags.show', [$tag->id, $tag->slug]) }}">{{ $tag->name }}</a>
</li>
@endforeach
</ul>
Expand Down
96 changes: 8 additions & 88 deletions Modules/Post/Resources/views/backend/posts/trash.blade.php
Original file line number Diff line number Diff line change
@@ -1,96 +1,16 @@
@extends ('backend.layouts.app')

@section('title') {{ __($module_action) }} {{ __($module_title) }} @endsection
@section('title')
{{ __($module_action) }} {{ __($module_title) }}
@endsection

@section('breadcrumbs')
<x-backend.breadcrumbs>
<x-backend.breadcrumb-item type="active" icon='{{ $module_icon }}'>{{ __($module_title) }}</x-backend.breadcrumb-item>
</x-backend.breadcrumbs>
<x-backend.breadcrumbs>
<x-backend.breadcrumb-item type="active"
icon='{{ $module_icon }}'>{{ __($module_title) }}</x-backend.breadcrumb-item>
</x-backend.breadcrumbs>
@endsection

@section('content')
<div class="card">
<div class="card-body">

<x-backend.section-header>
<i class="{{ $module_icon }}"></i> {{ __($module_title) }} <small class="text-muted">{{ __($module_action) }}</small>

<x-slot name="subtitle">
@lang(":module_name Management Dashboard", ['module_name'=>Str::title($module_name)])
</x-slot>
<x-slot name="toolbar">
<x-backend.buttons.return-back />
<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>
</x-slot>
</x-backend.section-header>

<div class="row mt-4">
<div class="col">
<table id="datatable" class="table table-bordered table-hover table-responsive-sm">
<thead>
<tr>
<th>
#
</th>
<th>
Name
</th>
<th>
Updated At
</th>
<th>
Created By
</th>
<th class="text-end">
Action
</th>
</tr>
</thead>

<tbody>
@foreach($$module_name as $module_name_singular)
<tr>
<td>
{{ $module_name_singular->id }}
</td>
<td>
<strong>
{{ $module_name_singular->name }}
</strong>
</td>
<td>
{{ $module_name_singular->updated_at->isoFormat('llll') }}
</td>
<td>
{{ $module_name_singular->created_by }}
</td>
<td class="text-end">
<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>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
<div class="card-footer">
<div class="row">
<div class="col-7">
<div class="float-left">
Total {{ $$module_name->total() }} {{ ucwords($module_name) }}
</div>
</div>
<div class="col-5">
<div class="float-end">
{!! $$module_name->render() !!}
</div>
</div>
</div>
</div>
</div>
@endsection

@section ('after-scripts-end')

<x-backend.layouts.trash :data="$$module_name" :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" />
@endsection
Loading

0 comments on commit 7d7f7c8

Please sign in to comment.