From 3fde5c0691be05aa6534d4fcafd3d1a4241e1ce4 Mon Sep 17 00:00:00 2001 From: Naval Kishore Date: Tue, 17 Apr 2018 08:25:07 +0530 Subject: [PATCH 1/5] Added one extra input for menu description --- Modules/Core/Config/core.php | 2 +- ..._column_to_menuitems_translation_table.php | 32 ++++++++ Modules/Menu/Entities/Menuitem.php | 3 +- Modules/Menu/Entities/MenuitemTranslation.php | 2 +- .../partials/create-trans-fields.blade.php | 5 ++ .../partials/edit-trans-fields.blade.php | 6 ++ Modules/Menu/composer.json | 2 +- .../Resources/lang/core/es/core.php | 24 ------ .../Resources/lang/core/es/settings.php | 1 - .../Resources/lang/core/es/sidebar.php | 1 - .../Resources/lang/core/pl/core.php | 39 ++-------- .../Resources/lang/core/pl/settings.php | 5 +- .../Resources/lang/core/pl/sidebar.php | 1 - .../Resources/lang/dashboard/es/dashboard.php | 10 --- .../Resources/lang/dashboard/pl/dashboard.php | 21 ----- .../Resources/lang/media/es/folders.php | 11 --- .../Resources/lang/media/es/media.php | 9 --- .../Resources/lang/media/es/messages.php | 3 - .../Resources/lang/media/pl/folders.php | 11 --- .../Resources/lang/media/pl/media.php | 44 ----------- .../Resources/lang/media/pl/messages.php | 9 --- .../Resources/lang/menu/de/menu.php | 1 + .../Resources/lang/menu/en/menu.php | 1 + .../Resources/lang/menu/es/menu-items.php | 5 -- .../Resources/lang/menu/es/menu.php | 5 +- .../Resources/lang/menu/fr/menu.php | 1 + .../Resources/lang/menu/it/menu.php | 1 + .../Resources/lang/menu/ko/menu.php | 1 + .../Resources/lang/menu/nl/menu.php | 1 + .../Resources/lang/menu/pl/menu-items.php | 24 ------ .../Resources/lang/menu/pl/menu.php | 42 ---------- .../Resources/lang/menu/pl/messages.php | 14 ---- .../Resources/lang/menu/pl/validation.php | 6 -- .../Resources/lang/menu/pt/menu.php | 1 + .../Resources/lang/menu/ru/menu.php | 1 + .../Resources/lang/menu/tr/menu.php | 1 + .../Resources/lang/menu/zh/menu.php | 1 + .../lang/notification/es/messages.php | 4 - .../lang/notification/pl/messages.php | 20 ----- .../Resources/lang/page/de/pages.php | 4 +- .../Resources/lang/page/en/pages.php | 1 - .../Resources/lang/page/es/messages.php | 1 - .../Resources/lang/page/es/pages.php | 15 +--- .../Resources/lang/page/fr/pages.php | 4 +- .../Resources/lang/page/ko/pages.php | 4 +- .../Resources/lang/page/nl/pages.php | 4 +- .../Resources/lang/page/pl/messages.php | 8 +- .../Resources/lang/page/pl/pages.php | 41 ++++------ .../Resources/lang/page/pt/pages.php | 4 +- .../Resources/lang/page/ru/pages.php | 4 +- .../Resources/lang/page/tr/pages.php | 4 +- .../Resources/lang/page/zh/pages.php | 4 +- .../Resources/lang/setting/es/settings.php | 2 - .../Resources/lang/setting/pl/messages.php | 5 -- .../Resources/lang/setting/pl/settings.php | 16 ---- .../Resources/lang/tag/es/tags.php | 15 ---- .../Resources/lang/tag/pl/tags.php | 15 ---- .../lang/translation/es/translations.php | 6 -- .../lang/translation/pl/translations.php | 40 ---------- .../Resources/lang/user/es/auth.php | 1 - .../Resources/lang/user/es/messages.php | 5 -- .../Resources/lang/user/es/roles.php | 12 +-- .../Resources/lang/user/es/users.php | 23 ------ .../Resources/lang/user/pl/auth.php | 23 ------ .../Resources/lang/user/pl/button.php | 8 -- .../Resources/lang/user/pl/messages.php | 29 ------- .../Resources/lang/user/pl/roles.php | 43 ----------- .../Resources/lang/user/pl/users.php | 72 ------------------ .../Resources/lang/workshop/es/modules.php | 5 -- .../Resources/lang/workshop/es/themes.php | 3 - .../Resources/lang/workshop/es/workshop.php | 5 +- .../Resources/lang/workshop/pl/modules.php | 39 ---------- .../Resources/lang/workshop/pl/themes.php | 14 ---- .../Resources/lang/workshop/pl/workbench.php | 25 ------ .../Resources/lang/workshop/pl/workshop.php | 8 -- .../Adminlte/assets/img/blur-background04.jpg | Bin 402286 -> 402276 bytes .../Adminlte/assets/img/blur-background08.jpg | Bin 378156 -> 378141 bytes .../Adminlte/assets/img/blur-background09.jpg | Bin 390733 -> 390725 bytes .../fonts/fontawesome-webfont.eot | Bin 165717 -> 165716 bytes .../fonts/fontawesome-webfont.ttf | Bin 165523 -> 165522 bytes .../vendor/admin-lte/dist/img/boxed-bg.jpg | Bin 123770 -> 123769 bytes .../vendor/admin-lte/dist/img/photo3.jpg | Bin 392079 -> 392075 bytes .../vendor/admin-lte/dist/img/photo4.jpg | Bin 1179224 -> 1179205 bytes .../vendor/font-awesome/fonts/FontAwesome.otf | Bin 134808 -> 134801 bytes .../fonts/fontawesome-webfont.eot | Bin 165742 -> 165717 bytes .../fonts/fontawesome-webfont.ttf | Bin 165548 -> 165523 bytes .../fonts/fontawesome-webfont.woff | Bin 98024 -> 98019 bytes .../fonts/fontawesome-webfont.woff2 | Bin 77160 -> 77159 bytes 88 files changed, 95 insertions(+), 788 deletions(-) create mode 100644 Modules/Menu/Database/Migrations/2018_04_08_110347_add_description_column_to_menuitems_translation_table.php delete mode 100644 Modules/Translation/Resources/lang/dashboard/pl/dashboard.php delete mode 100644 Modules/Translation/Resources/lang/media/es/folders.php delete mode 100644 Modules/Translation/Resources/lang/media/pl/folders.php delete mode 100644 Modules/Translation/Resources/lang/media/pl/media.php delete mode 100644 Modules/Translation/Resources/lang/media/pl/messages.php delete mode 100644 Modules/Translation/Resources/lang/menu/pl/menu-items.php delete mode 100644 Modules/Translation/Resources/lang/menu/pl/menu.php delete mode 100644 Modules/Translation/Resources/lang/menu/pl/messages.php delete mode 100644 Modules/Translation/Resources/lang/menu/pl/validation.php delete mode 100644 Modules/Translation/Resources/lang/notification/pl/messages.php delete mode 100644 Modules/Translation/Resources/lang/setting/pl/messages.php delete mode 100644 Modules/Translation/Resources/lang/setting/pl/settings.php delete mode 100644 Modules/Translation/Resources/lang/tag/es/tags.php delete mode 100644 Modules/Translation/Resources/lang/tag/pl/tags.php delete mode 100644 Modules/Translation/Resources/lang/translation/pl/translations.php delete mode 100644 Modules/Translation/Resources/lang/user/pl/auth.php delete mode 100644 Modules/Translation/Resources/lang/user/pl/button.php delete mode 100644 Modules/Translation/Resources/lang/user/pl/messages.php delete mode 100644 Modules/Translation/Resources/lang/user/pl/roles.php delete mode 100644 Modules/Translation/Resources/lang/user/pl/users.php delete mode 100644 Modules/Translation/Resources/lang/workshop/pl/modules.php delete mode 100644 Modules/Translation/Resources/lang/workshop/pl/themes.php delete mode 100644 Modules/Translation/Resources/lang/workshop/pl/workbench.php delete mode 100644 Modules/Translation/Resources/lang/workshop/pl/workshop.php diff --git a/Modules/Core/Config/core.php b/Modules/Core/Config/core.php index cceffa89f..8a99fccaa 100644 --- a/Modules/Core/Config/core.php +++ b/Modules/Core/Config/core.php @@ -82,7 +82,7 @@ 'admin-assets' => [ // Css 'bootstrap.css' => ['theme' => 'vendor/bootstrap/dist/css/bootstrap.min.css'], - 'font-awesome.css' => ['cdn' => 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'], + 'font-awesome.css' => ['theme' => 'vendor/font-awesome/css/font-awesome.min.css'], 'alertify.core.css' => ['theme' => 'css/vendor/alertify/alertify.core.css'], 'alertify.default.css' => ['theme' => 'css/vendor/alertify/alertify.default.css'], 'dataTables.bootstrap.css' => ['theme' => 'vendor/datatables.net-bs/css/dataTables.bootstrap.min.css'], diff --git a/Modules/Menu/Database/Migrations/2018_04_08_110347_add_description_column_to_menuitems_translation_table.php b/Modules/Menu/Database/Migrations/2018_04_08_110347_add_description_column_to_menuitems_translation_table.php new file mode 100644 index 000000000..94d8067ee --- /dev/null +++ b/Modules/Menu/Database/Migrations/2018_04_08_110347_add_description_column_to_menuitems_translation_table.php @@ -0,0 +1,32 @@ +string('description')->after('uri')->nullable()->default(null); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('menu__menuitem_translations', function (Blueprint $table) { + $table->dropColumn('description'); + }); + } +} diff --git a/Modules/Menu/Entities/Menuitem.php b/Modules/Menu/Entities/Menuitem.php index 517140c94..35d5ba45c 100644 --- a/Modules/Menu/Entities/Menuitem.php +++ b/Modules/Menu/Entities/Menuitem.php @@ -10,7 +10,7 @@ class Menuitem extends Model { use Translatable, NestableTrait; - public $translatedAttributes = ['title', 'uri', 'url', 'status', 'locale']; + public $translatedAttributes = ['title', 'uri', 'url', 'status', 'locale', 'description']; protected $fillable = [ 'menu_id', 'page_id', @@ -27,6 +27,7 @@ class Menuitem extends Model 'link_type', 'locale', 'class', + 'description' ]; protected $table = 'menu__menuitems'; diff --git a/Modules/Menu/Entities/MenuitemTranslation.php b/Modules/Menu/Entities/MenuitemTranslation.php index 76b1f80c4..11161bce3 100644 --- a/Modules/Menu/Entities/MenuitemTranslation.php +++ b/Modules/Menu/Entities/MenuitemTranslation.php @@ -6,6 +6,6 @@ class MenuitemTranslation extends Model { - public $fillable = ['title', 'uri', 'url', 'status', 'locale']; + public $fillable = ['title', 'uri', 'url', 'status', 'locale', 'description']; protected $table = 'menu__menuitem_translations'; } diff --git a/Modules/Menu/Resources/views/admin/menuitems/partials/create-trans-fields.blade.php b/Modules/Menu/Resources/views/admin/menuitems/partials/create-trans-fields.blade.php index f09c01efa..03a04b5c1 100644 --- a/Modules/Menu/Resources/views/admin/menuitems/partials/create-trans-fields.blade.php +++ b/Modules/Menu/Resources/views/admin/menuitems/partials/create-trans-fields.blade.php @@ -16,6 +16,11 @@ {!! Form::text("{$lang}[url]", old("{$lang}[url]"), ['class' => 'form-control', 'placeholder' => trans('menu::menu.form.url')]) !!} {!! $errors->first("{$lang}[url]", ':message') !!} +
+ {!! Form::label("{$lang}[description]", trans('menu::menu.form.description')) !!} + {!! Form::text("{$lang}[description]", old("{$lang}[description]"), ['class' => 'form-control', 'placeholder' => trans('menu::menu.form.description')]) !!} + {!! $errors->first("{$lang}[description]", ':message') !!} +
+
+ {!! Form::label("{$lang}[description]", trans('menu::menu.form.description')) !!} + hasTranslation($lang) ? $menuItem->translate($lang)->description : '' ?> + {!! Form::text("{$lang}[description]", old("{$lang}[description]", $old), ['class' => 'form-control', 'placeholder' => trans('menu::menu.form.description')]) !!} + {!! $errors->first("{$lang}[description]", ':message') !!} +
hasTranslation($lang) ? $menuItem->translate($lang)->status : false ?>
-
- {!! Form::label("{$lang}[description]", trans('menu::menu.form.description')) !!} - {!! Form::text("{$lang}[description]", old("{$lang}[description]"), ['class' => 'form-control', 'placeholder' => trans('menu::menu.form.description')]) !!} - {!! $errors->first("{$lang}[description]", ':message') !!} -
-
- {!! Form::label("{$lang}[description]", trans('menu::menu.form.description')) !!} - hasTranslation($lang) ? $menuItem->translate($lang)->description : '' ?> - {!! Form::text("{$lang}[description]", old("{$lang}[description]", $old), ['class' => 'form-control', 'placeholder' => trans('menu::menu.form.description')]) !!} - {!! $errors->first("{$lang}[description]", ':message') !!} -
hasTranslation($lang) ? $menuItem->translate($lang)->status : false ?>
+
+ {!! Form::label("{$lang}[description]", trans('menu::menu.form.description')) !!} + {!! Form::text("{$lang}[description]", old("{$lang}[description]"), ['class' => 'form-control', 'placeholder' => trans('menu::menu.form.description')]) !!} + {!! $errors->first("{$lang}[description]", ':message') !!} +
+
+ {!! Form::label("{$lang}[description]", trans('menu::menu.form.description')) !!} + hasTranslation($lang) ? $menuItem->translate($lang)->description : '' ?> + {!! Form::text("{$lang}[description]", old("{$lang}[description]", $old), ['class' => 'form-control', 'placeholder' => trans('menu::menu.form.description')]) !!} + {!! $errors->first("{$lang}[description]", ':message') !!} +
hasTranslation($lang) ? $menuItem->translate($lang)->status : false ?>