From 0f59327d676cf2e0811e403a25426c470c8f5647 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Mon, 9 Nov 2020 14:41:40 +0300 Subject: [PATCH 1/4] admin theme && fixed version excel export libs --- .../resources/views/table/body.twig | 31 -------- .../resources/views/table/categories.twig | 74 ------------------ .../resources/views/table/table.twig | 78 +++++++++++++++++++ .../Category/Table/CategoryTableBuilder.php | 2 +- 4 files changed, 79 insertions(+), 106 deletions(-) delete mode 100644 addons/default/visiosoft/cats-module/resources/views/table/body.twig delete mode 100644 addons/default/visiosoft/cats-module/resources/views/table/categories.twig create mode 100644 addons/default/visiosoft/cats-module/resources/views/table/table.twig diff --git a/addons/default/visiosoft/cats-module/resources/views/table/body.twig b/addons/default/visiosoft/cats-module/resources/views/table/body.twig deleted file mode 100644 index d281f735f..000000000 --- a/addons/default/visiosoft/cats-module/resources/views/table/body.twig +++ /dev/null @@ -1,31 +0,0 @@ - -{% for row in table.rows %} - - - {% if table.options.sortable %} - - {{ icon('fa fa-arrows handle') }} - - - {% endif %} - - {% if not table.actions.empty() %} - - - - {% endif %} - - {% for column in row.columns %} - - {{ column.value|raw }} - - {% endfor %} - - - {{ buttons(row.buttons)|raw }} - - - -{% endfor %} - diff --git a/addons/default/visiosoft/cats-module/resources/views/table/categories.twig b/addons/default/visiosoft/cats-module/resources/views/table/categories.twig deleted file mode 100644 index ce728b2fd..000000000 --- a/addons/default/visiosoft/cats-module/resources/views/table/categories.twig +++ /dev/null @@ -1,74 +0,0 @@ -{{ asset_add("scripts.js", "streams::js/table/table.js") }} - -{% if not actions.empty() %} - {{ asset_add("scripts.js", "streams::js/table/actions.js") }} -{% endif %} - -{% if table.options.sortable %} - {{ asset_add("scripts.js", "streams::js/table/sortable.js") }} -{% endif %} -{% if app.request.get('cat') != null %} - {% set parent = category_detail(app.request.get('cat')) %} - {% if parent.parent_category is null %} - {% set parent_url = url('admin/cats') %} - {% else %} - {% set parent_url = url('admin/cats?cat='~parent.parent_category_id) %} - {% endif %} - -
- -
-{% endif %} -
- {{ view("streams::table/partials/filters", {'table': table}) }} - {{ view("streams::table/partials/views", {'table': table}) }} - {{ view(table.options.heading ?: "streams::table/partials/heading", {'table': table}) }} - {% if not table.rows.empty() %} - {% block card %} -
- - {{ form_open({ 'url': url_full() }) }} -
- - - {{ view("streams::table/partials/header", {'table': table}) }} - - {% block body %} - {{ view("visiosoft.module.cats::table.body", {'table': table}) }} - {% endblock %} - - {{ view("streams::table/partials/footer", {'table': table}) }} - -
-
- {{ form_close() }} - -
- {% endblock %} - {% else %} - - {% block no_results %} -
-
- {{ trans(table.options.get('no_results_message', 'streams::message.no_results')) }} -
-
- {% endblock %} - - {% endif %} - -
diff --git a/addons/default/visiosoft/cats-module/resources/views/table/table.twig b/addons/default/visiosoft/cats-module/resources/views/table/table.twig new file mode 100644 index 000000000..ee81ee3ac --- /dev/null +++ b/addons/default/visiosoft/cats-module/resources/views/table/table.twig @@ -0,0 +1,78 @@ +{{ asset_add("scripts.js", "streams::js/table/table.js") }} + +{% if not actions.empty() %} + {{ asset_add("scripts.js", "streams::js/table/actions.js") }} +{% endif %} + +{% if table.options.sortable %} + {{ asset_add("scripts.js", "streams::js/table/sortable.js") }} +{% endif %} + +
+ {{ view("streams::table/partials/filters", {'table': table}) }} + +
+
+ {{ view("streams::table/partials/views", {'table': table}) }} + {{ view(table.options.heading ?: "streams::table/partials/heading", {'table': table}) }} +
+
+ {% if app.request.get('cat') != null %} + {% set parent = category_detail(app.request.get('cat')) %} + {% if parent.parent_category is null %} + {% set parent_url = url('admin/cats') %} + {% else %} + {% set parent_url = url('admin/cats?cat='~parent.parent_category_id) %} + {% endif %} + + + {% endif %} +
+
+ {% if not table.rows.empty() %} + {% block card %} + {{ form_open({ 'url': url_full() }) }} +
+ + + {{ view("streams::table/partials/header", {'table': table}) }} + + {% block body %} + {{ view("streams::table/partials/body", {'table': table}) }} + {% endblock %} + + {{ view("streams::table/partials/footer", {'table': table}) }} + +
+
+ {{ form_close() }} + {% endblock %} + {% else %} + + {% block no_results %} +
+
+ {{ trans(table.options.get('no_results_message', 'streams::message.no_results')) }} +
+
+ {% endblock %} + + {% endif %} +
+
+ +
diff --git a/addons/default/visiosoft/cats-module/src/Category/Table/CategoryTableBuilder.php b/addons/default/visiosoft/cats-module/src/Category/Table/CategoryTableBuilder.php index cb46970f3..2a777889e 100644 --- a/addons/default/visiosoft/cats-module/src/Category/Table/CategoryTableBuilder.php +++ b/addons/default/visiosoft/cats-module/src/Category/Table/CategoryTableBuilder.php @@ -80,7 +80,7 @@ class CategoryTableBuilder extends TableBuilder * @var array */ protected $options = [ - 'table_view' => 'visiosoft.module.cats::table.categories' + 'table_view' => 'visiosoft.module.cats::table.table' ]; /** From 2cdc469f5e470dd200651b65f6e93080c0cbd4f4 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Mon, 9 Nov 2020 16:14:34 +0300 Subject: [PATCH 2/4] fixed link && messages error --- .../cats-module/resources/views/table/table.twig | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/default/visiosoft/cats-module/resources/views/table/table.twig b/addons/default/visiosoft/cats-module/resources/views/table/table.twig index ee81ee3ac..39b538de4 100644 --- a/addons/default/visiosoft/cats-module/resources/views/table/table.twig +++ b/addons/default/visiosoft/cats-module/resources/views/table/table.twig @@ -18,18 +18,18 @@
{% if app.request.get('cat') != null %} - {% set parent = category_detail(app.request.get('cat')) %} - {% if parent.parent_category is null %} - {% set parent_url = url('admin/cats') %} - {% else %} - {% set parent_url = url('admin/cats?cat='~parent.parent_category_id) %} - {% endif %}
+ {% set parent = category_detail(app.request.get('cat')) %} + {% if parent.parent_category is null %} + {% set parent_url = url('admin/cats') %} + {% else %} + {% set parent_url = url('admin/cats?cat='~parent.parent_category_id) %} + {% endif %} Go To Parent From c50ca7b6e7cb68e169aa296fe8968b51fd8a4432 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Mon, 9 Nov 2020 16:48:04 +0300 Subject: [PATCH 3/4] added trans --- .../default/visiosoft/cats-module/resources/lang/en/field.php | 1 + .../visiosoft/cats-module/resources/views/table/table.twig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/default/visiosoft/cats-module/resources/lang/en/field.php b/addons/default/visiosoft/cats-module/resources/lang/en/field.php index 3970e949b..be9a83b85 100644 --- a/addons/default/visiosoft/cats-module/resources/lang/en/field.php +++ b/addons/default/visiosoft/cats-module/resources/lang/en/field.php @@ -32,4 +32,5 @@ return [ 'please_wait' => 'Please wait.Deleting Sub Categories', 'category_selection' => 'Category Selection', + 'go_to_parent' => 'Go To Parent', ]; diff --git a/addons/default/visiosoft/cats-module/resources/views/table/table.twig b/addons/default/visiosoft/cats-module/resources/views/table/table.twig index 39b538de4..475461661 100644 --- a/addons/default/visiosoft/cats-module/resources/views/table/table.twig +++ b/addons/default/visiosoft/cats-module/resources/views/table/table.twig @@ -31,7 +31,7 @@ {% set parent_url = url('admin/cats?cat='~parent.parent_category_id) %} {% endif %} - Go To Parent + {{ trans('module.field.go_to_parent') }}
{% endif %} From 0450fb500acfb584e66bad38c09d3bb562247aa5 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Tue, 10 Nov 2020 16:49:13 +0300 Subject: [PATCH 4/4] fixed trans && fixed watermark image --- .../visiosoft/cats-module/resources/views/table/table.twig | 2 +- .../media-field_type/src/Http/Controller/UploadController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/default/visiosoft/cats-module/resources/views/table/table.twig b/addons/default/visiosoft/cats-module/resources/views/table/table.twig index 475461661..5fc3bacf8 100644 --- a/addons/default/visiosoft/cats-module/resources/views/table/table.twig +++ b/addons/default/visiosoft/cats-module/resources/views/table/table.twig @@ -31,7 +31,7 @@ {% set parent_url = url('admin/cats?cat='~parent.parent_category_id) %} {% endif %} - {{ trans('module.field.go_to_parent') }} + {{ trans('module::field.go_to_parent') }}
{% endif %} diff --git a/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php b/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php index 613ab7454..4a987a0e2 100644 --- a/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php +++ b/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php @@ -111,7 +111,7 @@ class UploadController extends AdminController if ($settings_value['watermark_type'] == 'image') { - if (!$watermarkimage = $this->files->find($settings_value['watermark_image'])) { + if ($watermarkimage = $this->files->find($settings_value['watermark_image'])) { $watermark = WaterMark::make(app_storage_path() . '/files-module/local/' . $watermarkimage->path()); $image->insert($watermark, $settings_value['watermark_position']); }