This commit is contained in:
ericli1018
2025-06-13 12:24:35 +08:00
parent 1caae33c43
commit 6dfe3e0677
74 changed files with 1497 additions and 253 deletions

View File

@ -82,11 +82,13 @@ class EventCrudController extends CrudController
'label' => trans('backend.columnName.post_at'),
'type' => 'datetime',
'format' => 'YYYY/MM/DD HH:mm:SS',
'default' => \Carbon\Carbon::now(),
],
[
'name' => 'is_front_show',
'label' => trans('backend.columnName.is_front_show'),
'type' => 'boolean'
'type' => 'boolean',
'default' => true,
],
[
'name' => 'title',
@ -104,6 +106,13 @@ class EventCrudController extends CrudController
'showSingleChoise' => '0', // 0=hidden, 1=show(default)
'showComment' => '0', // 0=hidden, 1=show(default)
],
[
'name' => 'event_at',
'label' => trans('backend.columnName.event_at'),
'type' => 'datetime',
'format' => 'YYYY/MM/DD HH:mm:SS',
'default' => \Carbon\Carbon::now(),
],
[
'name' => 'venue',
'label' => trans('backend.columnName.venue'),
@ -122,9 +131,9 @@ class EventCrudController extends CrudController
'options' => [
//'selector' => 'textarea.tinymce',
//'skin' => 'dick-light',
'plugins' => 'lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
'plugins' => 'code lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
'menubar' => 'edit insert view format help',
'toolbar' => 'undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
'toolbar' => 'code undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
'language' => str_replace('-', '_', app()->getLocale()),
'height' => '500px',
],

View File

@ -19,7 +19,17 @@ class HomeCarouselCrudController extends CrudController
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
//use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\ReorderOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation { destroy as traitDestroy; }
public function destroy($id)
{
//CRUD::hasAccessOrFail('delete');
if (\App\Models\HomeCarousel::count() <= 7)
{
$this->crud->allowAccess('create');
}
return CRUD::delete($id);
}
/**
* Configure the CrudPanel object. Apply settings to all operations.
*
@ -31,6 +41,7 @@ class HomeCarouselCrudController extends CrudController
CRUD::setRoute(config('backpack.base.route_prefix') . '/home-carousel');
CRUD::setEntityNameStrings(trans('backend.home_carousel.content.item'), trans('backend.home_carousel.content.items'));
}
protected function setupReorderOperation()
@ -51,6 +62,15 @@ class HomeCarouselCrudController extends CrudController
$this->crud->orderBy('lft', 'asc')->orderBy('id', 'desc');
}
if (\App\Models\HomeCarousel::count() >= 6)
{
$this->crud->denyAccess('create');
}
else
{
$this->crud->allowAccess('create');
}
$this->crud->addColumns([
[
'name' => 'is_front_show',
@ -96,6 +116,17 @@ class HomeCarouselCrudController extends CrudController
'label' => trans('backend.columnName.link'),
'type' => 'text'
],
[
'name' => 'featured_photos',
'label' => trans('backend.columnName.featured_img'),
'type' => 'upload_img_multiple',
'upload' => true,
'disk' => 'public',
'hint' => '',
'qty' => 1, // 0=no limit, >0=limit
'showSingleChoise' => '0', // 0=hidden, 1=show(default)
'showComment' => '0', // 0=hidden, 1=show(default)
],
[
'name' => 'photos',
'label' => trans('backend.columnName.cover'),

View File

@ -82,16 +82,20 @@ class NewsCrudController extends CrudController
'label' => trans('backend.columnName.post_at'),
'type' => 'datetime',
'format' => 'YYYY/MM/DD HH:mm:SS',
'default' => \Carbon\Carbon::now(),
],
[
'name' => 'is_front_show',
'label' => trans('backend.columnName.is_front_show'),
'type' => 'boolean'
'type' => 'boolean',
'default' => true,
],
[
'name' => 'title',
'label' => trans('backend.columnName.title'),
'type' => 'text'
'type' => 'text',
],
[
'name' => 'photos',
@ -117,9 +121,9 @@ class NewsCrudController extends CrudController
'options' => [
//'selector' => 'textarea.tinymce',
//'skin' => 'dick-light',
'plugins' => 'lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
'plugins' => 'code lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
'menubar' => 'edit insert view format help',
'toolbar' => 'undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
'toolbar' => 'code undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
'language' => str_replace('-', '_', app()->getLocale()),
'height' => '500px',
],

View File

@ -132,7 +132,8 @@ class ProductCrudController extends CrudController
[
'name' => 'is_front_show',
'label' => trans('backend.columnName.is_front_show'),
'type' => 'boolean'
'type' => 'boolean',
'default' => true,
],
[
'name' => 'tip',
@ -168,9 +169,9 @@ class ProductCrudController extends CrudController
'options' => [
//'selector' => 'textarea.tinymce',
//'skin' => 'dick-light',
'plugins' => 'lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
'plugins' => 'code lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
'menubar' => 'edit insert view format help',
'toolbar' => 'undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
'toolbar' => 'code undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
'language' => str_replace('-', '_', app()->getLocale()),
'height' => '500px',
],
@ -183,9 +184,9 @@ class ProductCrudController extends CrudController
'options' => [
//'selector' => 'textarea.tinymce',
//'skin' => 'dick-light',
'plugins' => 'lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
'plugins' => 'code lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
'menubar' => 'edit insert view format help',
'toolbar' => 'undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
'toolbar' => 'code undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
'language' => str_replace('-', '_', app()->getLocale()),
'height' => '500px',
],
@ -199,13 +200,61 @@ class ProductCrudController extends CrudController
'options' => [
//'selector' => 'textarea.tinymce',
//'skin' => 'dick-light',
'plugins' => 'lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
'plugins' => 'code lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
'menubar' => 'edit insert view format help',
'toolbar' => 'undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
'toolbar' => 'code undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
'language' => str_replace('-', '_', app()->getLocale()),
'height' => '500px',
],
],
[
'name' => 'feature_resource',
'lable' => trans('backend.columnName.feature_resource'),
'type' => 'tinymce',
// optional overwrite of the configuration array
'options' => [
//'selector' => 'textarea.tinymce',
//'skin' => 'dick-light',
'plugins' => 'code lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
'menubar' => 'edit insert view format help',
'toolbar' => 'code undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
'language' => str_replace('-', '_', app()->getLocale()),
'height' => '500px',
],
],
[
'name' => 'feature_related_part',
'lable' => trans('backend.columnName.feature_related_part'),
'type' => 'tinymce',
// optional overwrite of the configuration array
'options' => [
//'selector' => 'textarea.tinymce',
//'skin' => 'dick-light',
'plugins' => 'code lists advlist image link media anchor table hr imagetools importcss insertdatetime paste searchreplace textcolor textpattern help',
'menubar' => 'edit insert view format help',
'toolbar' => 'code undo redo bold italic alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image media link',
'language' => str_replace('-', '_', app()->getLocale()),
'height' => '500px',
],
],
[
'name' => 'productRelateds',
'label' => trans('backend.columnName.product_related'),
'type' => 'select2_multiple',
'entity' => 'productRelateds',
'attribute' => 'title',
'model' => 'App\Models\Product',
'pivot' => true,
'allows_null' => true,
'select_all' => true,
'options' => (function ($query) {
$id = \Route::current()->parameter('id');
return $query->where('id', '<>', $id)->orderBy('title', 'ASC')->get();
}),
],
[
'name' => 'seo_keyword',

View File

@ -97,7 +97,8 @@ class SupportDistributionPartnerCrudController extends CrudController
[
'name' => 'is_front_show',
'label' => trans('backend.columnName.is_front_show'),
'type' => 'boolean'
'type' => 'boolean',
'default' => true,
],
[
'name' => 'photos',

View File

@ -97,7 +97,8 @@ class SupportEcosystemPartnerCrudController extends CrudController
[
'name' => 'is_front_show',
'label' => trans('backend.columnName.is_front_show'),
'type' => 'boolean'
'type' => 'boolean',
'default' => true,
],
[
'name' => 'photos',

View File

@ -24,6 +24,26 @@ class UserCrudController extends OrgController
'label' => trans('backpack::permissionmanager.email'),
'type' => 'email',
],
[
'name' => 'phone',
'label' => trans('backend.columnName.phone'),
'type' => 'text',
],
[
'name' => 'country',
'label' => trans('backend.columnName.country'),
'type' => 'text',
],
[
'name' => 'company',
'label' => trans('backend.columnName.company'),
'type' => 'text',
],
[
'name' => 'job_title',
'label' => trans('backend.columnName.job_title'),
'type' => 'text',
],
[ // n-n relationship (with pivot table)
'label' => trans('backpack::permissionmanager.roles'), // Table column heading
'type' => 'select_multiple',