Skip to content

Commit

Permalink
layout update
Browse files Browse the repository at this point in the history
  • Loading branch information
nasirkhan committed Jul 30, 2023
1 parent 51cf8df commit 482e10e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 157 deletions.
55 changes: 1 addition & 54 deletions src/stubs/Resources/views/backend/stubViews/create.blade.stub
Original file line number Diff line number Diff line change
Expand Up @@ -12,58 +12,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 ms-1" data-toggle="tooltip" title="{{ __($module_title) }} List"><i class="fas fa-list-ul"></i> List</a>
</x-slot>
</x-backend.section-header>

<hr>

<div class="row mt-4">
<div class="col">
{{ html()->form('POST', route("backend.$module_name.store"))->acceptsFiles()->class('form')->open() }}

@include ("$module_path.$module_name.form")

<div class="row">
<div class="col-6">
<div class="form-group">
{{ html()->button($text = "<i class='fas fa-plus-circle'></i> " . ucfirst($module_action) . "", $type = 'submit')->class('btn btn-success') }}
</div>
</div>
<div class="col-6">
<div class="float-end">
<div class="form-group">
<x-buttons.cancel></x-buttons.cancel>
</div>
</div>
</div>
</div>

{{ html()->form()->close() }}

</div>
</div>
</div>

<div class="card-footer">
<div class="row">
<div class="col">

</div>
</div>
</div>
</div>


<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
57 changes: 1 addition & 56 deletions src/stubs/Resources/views/backend/stubViews/edit.blade.stub
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,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 />
<x-buttons.show route='{!!route("backend.$module_name.show", $$module_name_singular)!!}' title="{{__('Show')}} {{ ucwords(Str::singular($module_name)) }}" class="ms-1" />
</x-slot>
</x-backend.section-header>

<hr>

<div class="row mt-4">
<div class="col">
{{ html()->modelForm($$module_name_singular, 'PATCH', route("backend.$module_name.update", $$module_name_singular))->acceptsFiles()->class('form')->open() }}

@include ("$module_path.$module_name.form")

<div class="row">
<div class="col-4">
<div class="form-group">
{{ html()->submit($text = icon('fas fa-save')." Save")->class('btn btn-success') }}
</div>
</div>
{{ html()->form()->close() }}

<div class="col-8">
<div class="float-end">
@can('delete_'.$module_name)
<a href="{{route("backend.$module_name.destroy", $$module_name_singular)}}" class="btn btn-danger" data-method="DELETE" data-token="{{csrf_token()}}" data-toggle="tooltip" title="{{__('labels.backend.delete')}}"><i class="fas fa-trash-alt"></i></a>
@endcan
<x-buttons.cancel></x-buttons.cancel>
</div>
</div>
</div>

</div>
</div>
</div>

<div class="card-footer">
<div class="row">
<div class="col">
<small class="float-end text-muted">
Updated: {{$$module_name_singular->updated_at->diffForHumans()}},
Created at: {{$$module_name_singular->created_at->isoFormat('LLLL')}}
</small>
</div>
</div>
</div>
</div>

<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
12 changes: 6 additions & 6 deletions src/stubs/Resources/views/backend/stubViews/form.blade.stub
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="row mb-3">
<div class="col-12 col-sm-4">
<div class="row">
<div class="col-12 col-sm-4 mb-3">
<div class="form-group">
<?php
$field_name = 'name';
Expand All @@ -11,7 +11,7 @@
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
</div>
</div>
<div class="col-12 col-sm-4">
<div class="col-12 col-sm-4 mb-3">
<div class="form-group">
<?php
$field_name = 'slug';
Expand All @@ -23,7 +23,7 @@
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
</div>
</div>
<div class="col-12 col-sm-4">
<div class="col-12 col-sm-4 mb-3">
<div class="form-group">
<?php
$field_name = 'status';
Expand All @@ -42,8 +42,8 @@
</div>
</div>

<div class="row mb-3">
<div class="col-12">
<div class="row">
<div class="col-12 mb-3">
<div class="form-group">
<?php
$field_name = 'description';
Expand Down
42 changes: 1 addition & 41 deletions src/stubs/Resources/views/backend/stubViews/show.blade.stub
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,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>
@can('edit_'.$module_name)
<x-buttons.edit route='{!!route("backend.$module_name.edit", $$module_name_singular)!!}' title="{{__('Edit')}} {{ ucwords(Str::singular($module_name)) }}" class="ms-1" />
@endcan
</x-slot>
</x-backend.section-header>

<hr>

<div class="row mt-4">
<div class="col-12">

@include('backend.includes.show')

</div>
</div>
</div>

<div class="card-footer">
<div class="row">
<div class="col">
<small class="float-end text-muted">
Updated: {{$$module_name_singular->updated_at->diffForHumans()}},
Created at: {{$$module_name_singular->created_at->isoFormat('LLLL')}}
</small>
</div>
</div>
</div>
</div>

<x-backend.layouts.show :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

0 comments on commit 482e10e

Please sign in to comment.