Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prettier code formatter added #617

Merged
merged 4 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
dist
.env*
vendor/
/vendor
public/
.git
**/.git
package-lock.json
composer.lock
15 changes: 15 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"printWidth": 120,
"semi": true,
"tabWidth": 4,
"trailingComma": "all",
"plugins": ["@shufo/prettier-plugin-blade", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": ["*.blade.php"],
"options": {
"parser": "blade"
}
}
]
}
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/Category/Resources/views/backend/categories/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
59 changes: 31 additions & 28 deletions Modules/Category/Resources/views/backend/categories/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$field_name = 'name';
$field_lable = label_case($field_name);
$field_placeholder = $field_lable;
$required = "required";
$required = 'required';
?>
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
Expand All @@ -17,7 +17,7 @@
$field_name = 'slug';
$field_lable = label_case($field_name);
$field_placeholder = $field_lable;
$required = "";
$required = '';
?>
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
Expand All @@ -29,7 +29,7 @@
$field_name = 'group_name';
$field_lable = label_case($field_name);
$field_placeholder = $field_lable;
$required = "";
$required = '';
?>
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
Expand All @@ -43,31 +43,34 @@
$field_name = 'image';
$field_lable = label_case($field_name);
$field_placeholder = $field_lable;
$required = "";
$required = '';
?>
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
{{ html()->input("file", $field_name)->class('form-control')->attributes(["$required"]) }}
{{ html()->input('file', $field_name)->class('form-control')->attributes(["$required"]) }}
</div>
</div>

@if($data && $data->getMedia($module_name)->first())
<div class="col-4">
<div class="float-end">
<figure class="figure">
<a href="{{ asset($data->$field_name) }}" data-lightbox="image-set" data-title="Path: {{ asset($data->$field_name) }}">
<img src="{{ asset($data->getMedia($module_name)->first()->getUrl('thumb300')) }}" class="figure-img img-fluid rounded img-thumbnail" alt="">
</a>
<!-- <figcaption class="figure-caption">Path: </figcaption> -->
</figure>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="image_remove" id="image_remove" name="image_remove">
<label class="form-check-label" for="image_remove">
Remove this image
</label>
@if ($data && $data->getMedia($module_name)->first())
<div class="col-4">
<div class="float-end">
<figure class="figure">
<a href="{{ asset($data->$field_name) }}" data-lightbox="image-set"
data-title="Path: {{ asset($data->$field_name) }}">
<img src="{{ asset($data->getMedia($module_name)->first()->getUrl('thumb300')) }}"
class="figure-img img-fluid rounded img-thumbnail" alt="">
</a>
<!-- <figcaption class="figure-caption">Path: </figcaption> -->
</figure>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="image_remove" id="image_remove"
name="image_remove">
<label class="form-check-label" for="image_remove">
Remove this image
</label>
</div>
</div>
</div>
</div>
<x-library.lightbox />
<x-library.lightbox />
@endif
</div>
<div class="row">
Expand All @@ -77,7 +80,7 @@
$field_name = 'description';
$field_lable = label_case($field_name);
$field_placeholder = $field_lable;
$required = "";
$required = '';
?>
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
{{ html()->textarea($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
Expand All @@ -92,7 +95,7 @@
$field_name = 'meta_title';
$field_lable = label_case($field_name);
$field_placeholder = $field_lable;
$required = "";
$required = '';
?>
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
Expand All @@ -104,7 +107,7 @@
$field_name = 'meta_keyword';
$field_lable = label_case($field_name);
$field_placeholder = $field_lable;
$required = "";
$required = '';
?>
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
Expand All @@ -116,7 +119,7 @@
$field_name = 'meta_description';
$field_lable = label_case($field_name);
$field_placeholder = $field_lable;
$required = "";
$required = '';
?>
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
Expand All @@ -130,12 +133,12 @@
<?php
$field_name = 'status';
$field_lable = label_case($field_name);
$field_placeholder = "-- Select an option --";
$required = "required";
$field_placeholder = '-- Select an option --';
$required = 'required';
$select_options = \Modules\Category\Enums\CategoryStatus::toArray();
?>
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
{{ html()->select($field_name, $select_options)->class('form-select')->attributes(["$required"]) }}
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,13 +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')
<x-backend.layouts.trash :data="$$module_name" :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" />
<x-backend.layouts.trash :data="$$module_name" :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" />
@endsection
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
</p>
</x-frontend.header-block>



<section class="bg-white p-6 text-gray-600 dark:bg-gray-700 dark:text-gray-300 sm:p-20">
<div class="grid grid-cols-1 gap-6 sm:grid-cols-1">
<div class="text-center">
Expand Down
1 change: 0 additions & 1 deletion Modules/Post/Resources/views/backend/posts/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@
</div>
</div>


@push('after-styles')
<link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.20/summernote-lite.min.css" rel="stylesheet">
<style>
Expand Down
4 changes: 2 additions & 2 deletions Modules/Post/Resources/views/backend/posts/trash.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
@endsection

@section('content')
<x-backend.layouts.trash :data="$$module_name" :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" />
@endsection
<x-backend.layouts.trash :data="$$module_name" :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" />
@endsection
20 changes: 11 additions & 9 deletions Modules/Tag/Resources/views/backend/tags/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/Tag/Resources/views/backend/tags/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
Loading
Loading