diff --git a/addons/default/visiosoft/advs-module/composer.json b/addons/default/visiosoft/advs-module/composer.json index a028944ee..df501fdd2 100644 --- a/addons/default/visiosoft/advs-module/composer.json +++ b/addons/default/visiosoft/advs-module/composer.json @@ -10,6 +10,7 @@ ] }, "require": { - "fruitcake/laravel-cors": "^2.0" + "fruitcake/laravel-cors": "^2.0", + "visiosoft/style_selector-module": "*" } } diff --git a/addons/default/visiosoft/advs-module/resources/views/ad-detail/default.twig b/addons/default/visiosoft/advs-module/resources/views/ad-detail/default.twig new file mode 100644 index 000000000..a3ba48edf --- /dev/null +++ b/addons/default/visiosoft/advs-module/resources/views/ad-detail/default.twig @@ -0,0 +1,63 @@ +{% extends layout('ad-detail') %} + + {% block styles %} + {{ asset_style("visiosoft.module.advs::css/detail.css") }} + {% endblock %} + + {% block content %} +
+
+ + + {% include "visiosoft.module.advs::ad-detail/partials/author-button" %} + + + {% if setting_value('visiosoft.theme.base::breadcrumbs') %} + + {% include "visiosoft.module.advs::ad-detail/partials/breadcrumb" %} + + {% endif %} + {% include "visiosoft.module.advs::ad-detail/partials/ad-status" %} +

+ {{ adv.title }} + {{ addBlock('ad-detail/title/action',{'adv_id':adv.id})|raw }} +

+ + +
+
+ {% include "visiosoft.module.advs::ad-detail/partials/slider" %} +
+ {% if setting_value('visiosoft.theme.base::ad_details') %} + {% include "visiosoft.module.advs::ad-detail/partials/detail" %} + {% endif %} +
+
+
+ + + + + {% if setting_value('visiosoft.theme.base::ad_details_tab') %} + + {% if blocks('ad-item-content-block-area') is null %} + {% include "visiosoft.module.advs::ad-detail/partials/content" %} + {% else %} + {{ blocks('ad-item-content-block-area') }} + {% endif %} + + {{ addBlock('ad-detail/widget', {'price': adv.price, 'id': adv.id})|raw }} + {% endif %} +
+ + {% include "visiosoft.module.advs::ad-detail/partials/dropleft-edit" %} +
+ + {{ asset_add("scripts.js", "visiosoft.module.advs::js/viewed.js") }} + + {% endblock %} \ No newline at end of file diff --git a/addons/default/visiosoft/advs-module/resources/views/ad-detail/detail.twig b/addons/default/visiosoft/advs-module/resources/views/ad-detail/detail.twig index 68354d50a..839549b15 100644 --- a/addons/default/visiosoft/advs-module/resources/views/ad-detail/detail.twig +++ b/addons/default/visiosoft/advs-module/resources/views/ad-detail/detail.twig @@ -1,62 +1 @@ -{% extends layout('ad-detail') %} - -{% block styles %} - {{ asset_style("visiosoft.module.advs::css/detail.css") }} -{% endblock %} - -{% block content %} -
-
- - - {% include "visiosoft.module.advs::ad-detail/partials/author-button" %} - - - {% if setting_value('visiosoft.theme.base::breadcrumbs') %} - - {% include "visiosoft.module.advs::ad-detail/partials/breadcrumb" %} - - {% endif %} - {% include "visiosoft.module.advs::ad-detail/partials/ad-status" %} -

- {{ adv.title }} - {{ addBlock('ad-detail/title/action',{'adv_id':adv.id})|raw }} -

- - -
-
- {% include "visiosoft.module.advs::ad-detail/partials/slider" %} -
- {% if setting_value('visiosoft.theme.base::ad_details') %} - {% include "visiosoft.module.advs::ad-detail/partials/detail" %} - {% endif %} -
-
-
- - - - - {% if setting_value('visiosoft.theme.base::ad_details_tab') %} - - {% if blocks('ad-item-content-block-area') is null %} - {% include "visiosoft.module.advs::ad-detail/partials/content" %} - {% else %} - {{ blocks('ad-item-content-block-area') }} - {% endif %} - - {{ addBlock('ad-detail/widget', {'price': adv.price, 'id': adv.id})|raw }} - {% endif %} -
- - {% include "visiosoft.module.advs::ad-detail/partials/dropleft-edit" %} -
- - {{ asset_add("scripts.js", "visiosoft.module.advs::js/viewed.js") }} - -{% endblock %} \ No newline at end of file +{% include style_selector('detail','visiosoft.module.advs')~"::ad-detail/default" %} \ No newline at end of file diff --git a/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig b/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig index 08885794e..d8cd6d2b5 100644 --- a/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig +++ b/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig @@ -13,6 +13,7 @@ {% endblock %} {% block content %} + {% set form_params = app.request.session.get('_old_input') %}
{% include 'visiosoft.module.advs::new-ad/partials/steps' with {'step': 'new-create'} %} @@ -75,7 +76,7 @@ {% for field in form.fields.translations('name') %} {{ field.setAttributes({ 'class': 'd-block mt-3 w-100 border-0' - }).render({'form': form})|raw }} + }).setValue(form_params[field.field~"_"~field.getLocale()]).render({'form': form})|raw }} {% endfor %} @@ -244,7 +245,7 @@
{% for field in form.fields.translations('advs_desc') %} - {{ field.render({'form': form})|raw }} + {{ field.setValue(form_params[field.field~"_"~field.getLocale()]).render({'form': form})|raw }} {% endfor %}
diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php index 4051f986f..e23ea0a62 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php @@ -784,7 +784,7 @@ class AdvsController extends PublicController if ($this->request->action == "update") { $error = $form->build($this->request->update_id)->validate()->getFormErrors()->getMessages(); if (!empty($error)) { - return $this->redirect->back(); + return $this->redirect->back()->withInput(); } /* Update Adv */ diff --git a/addons/default/visiosoft/defaultadmin-theme/resources/js/theme/modal.js b/addons/default/visiosoft/defaultadmin-theme/resources/js/theme/modal.js index 4bfb28a12..44123df75 100644 --- a/addons/default/visiosoft/defaultadmin-theme/resources/js/theme/modal.js +++ b/addons/default/visiosoft/defaultadmin-theme/resources/js/theme/modal.js @@ -5,7 +5,7 @@ let initModal = function () { let loading = ''; // Loading state - modal.on('loading', function() { + modal.on('loading', function () { $(this).find('.modal-content').append(loading); }); @@ -36,6 +36,25 @@ let initModal = function () { }); }); + // Remove onchange event in ajax select field + if ($('.table--ajax').find('.table-limit').length > 0) { + $('.table--ajax').find('.table-limit').removeAttr("onchange"); + } + + // Handle ajax select in modals. + $('.table--ajax .table-limit').on('change', function (e) { + + e.preventDefault(); + + let wrapper = $(this).closest('.modal-content'); + + wrapper.append(loading); + + $.get($(this).val(), function (html) { + wrapper.html(html); + }); + }); + // Handle ajax forms in modals. modal.on('submit', 'form.ajax', function (e) { @@ -79,7 +98,7 @@ $(document).ajaxComplete(function () { $(document).on('show.bs.modal', '.modal', function () { let zIndex = 1040 + (10 * $('.modal:visible').length); $(this).css('z-index', zIndex); - setTimeout(function() { + setTimeout(function () { $('.modal-backdrop').not('.modal-stack').css('z-index', zIndex - 1).addClass('modal-stack'); }, 0); });