Merge pull request #1283 from openclassify/vedat

fix table limit
This commit is contained in:
spektra2147 2022-02-08 14:15:23 +03:00 committed by GitHub
commit 5b0ad6ad9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 91 additions and 68 deletions

View File

@ -10,6 +10,7 @@
]
},
"require": {
"fruitcake/laravel-cors": "^2.0"
"fruitcake/laravel-cors": "^2.0",
"visiosoft/style_selector-module": "*"
}
}

View File

@ -0,0 +1,63 @@
{% extends layout('ad-detail') %}
{% block styles %}
{{ asset_style("visiosoft.module.advs::css/detail.css") }}
{% endblock %}
{% block content %}
<section id="main" class="clearfix details-page">
<div class="container">
<!-- admin -->
{% include "visiosoft.module.advs::ad-detail/partials/author-button" %}
<!-- admin -->
{% if setting_value('visiosoft.theme.base::breadcrumbs') %}
<!-- breadcrumb -->
{% include "visiosoft.module.advs::ad-detail/partials/breadcrumb" %}
<!-- breadcrumb -->
{% endif %}
{% include "visiosoft.module.advs::ad-detail/partials/ad-status" %}
<h2 class="title">
{{ adv.title }}
{{ addBlock('ad-detail/title/action',{'adv_id':adv.id})|raw }}
</h2>
<!--detail-ad -->
<div class="section slider mb-4">
<div class="row">
{% include "visiosoft.module.advs::ad-detail/partials/slider" %}
<div class="col-md-5">
{% if setting_value('visiosoft.theme.base::ad_details') %}
{% include "visiosoft.module.advs::ad-detail/partials/detail" %}
{% endif %}
</div>
</div>
</div>
<!--detail-ad -->
<ul class="docs list-unstyled">
{% for doc in adv.doc_files %}
<li><a class="text-dark small" href="{{ doc.url }}" download><i
class="fa fa-lg fa-download small"></i> {{ doc.name }}</a></li>
{% endfor %}
</ul>
{% 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 %}
</div>
{% include "visiosoft.module.advs::ad-detail/partials/dropleft-edit" %}
</section>
{{ asset_add("scripts.js", "visiosoft.module.advs::js/viewed.js") }}
{% endblock %}

View File

@ -1,62 +1 @@
{% extends layout('ad-detail') %}
{% block styles %}
{{ asset_style("visiosoft.module.advs::css/detail.css") }}
{% endblock %}
{% block content %}
<section id="main" class="clearfix details-page">
<div class="container">
<!-- admin -->
{% include "visiosoft.module.advs::ad-detail/partials/author-button" %}
<!-- admin -->
{% if setting_value('visiosoft.theme.base::breadcrumbs') %}
<!-- breadcrumb -->
{% include "visiosoft.module.advs::ad-detail/partials/breadcrumb" %}
<!-- breadcrumb -->
{% endif %}
{% include "visiosoft.module.advs::ad-detail/partials/ad-status" %}
<h2 class="title">
{{ adv.title }}
{{ addBlock('ad-detail/title/action',{'adv_id':adv.id})|raw }}
</h2>
<!--detail-ad -->
<div class="section slider mb-4">
<div class="row">
{% include "visiosoft.module.advs::ad-detail/partials/slider" %}
<div class="col-md-5">
{% if setting_value('visiosoft.theme.base::ad_details') %}
{% include "visiosoft.module.advs::ad-detail/partials/detail" %}
{% endif %}
</div>
</div>
</div>
<!--detail-ad -->
<ul class="docs list-unstyled">
{% for doc in adv.doc_files %}
<li><a class="text-dark small" href="{{ doc.url }}" download><i class="fa fa-lg fa-download small"></i> {{ doc.name }}</a></li>
{% endfor %}
</ul>
{% 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 %}
</div>
{% include "visiosoft.module.advs::ad-detail/partials/dropleft-edit" %}
</section>
{{ asset_add("scripts.js", "visiosoft.module.advs::js/viewed.js") }}
{% endblock %}
{% include style_selector('detail','visiosoft.module.advs')~"::ad-detail/default" %}

View File

@ -13,6 +13,7 @@
{% endblock %}
{% block content %}
{% set form_params = app.request.session.get('_old_input') %}
<section class="clearfix home-default">
{% 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 %}
</label>
@ -244,7 +245,7 @@
<div class="col-md-12">
<div class="field-group advs_desc">
{% 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 %}
</div>
</div>

View File

@ -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 */

View File

@ -5,7 +5,7 @@ let initModal = function () {
let loading = '<div class="modal-loading"><div class="active loader large"></div></div>';
// 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);
});