ui: заменить оставшиеся боковые панели на центрированные popup.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-13 13:12:21 +03:00
parent 31dd3b4ffc
commit 4e1d5f221e
12 changed files with 107 additions and 52 deletions
+17 -11
View File
@@ -515,8 +515,10 @@
</div>
{% if can_manage_vendors and vendor_form %}
<div id="dislo-vendor-panel-overlay" onclick="disloVendorPanelClose()" style="display:none; position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:1000;"></div>
<div id="dislo-vendor-panel" style="position:fixed; top:0; right:0; height:100vh; width:26rem; max-width:92vw; background:var(--color-card); box-shadow:-8px 0 24px rgba(0,0,0,0.18); z-index:1001; transform:translateX(100%); transition:transform 250ms ease; overflow-y:auto;">
<div id="dislo-vendor-panel" role="dialog" aria-modal="true"
style="display:none; position:fixed; inset:0; z-index:80; background:rgba(0,0,0,0.4); align-items:flex-start; justify-content:center; padding:1.5rem 1rem; overflow-y:auto;"
onclick="if(event.target===this) disloVendorPanelClose()">
<div style="background:var(--color-card); border-radius:0.75rem; border:1px solid var(--color-border); box-shadow:0 20px 60px rgb(0 0 0/0.2); width:100%; max-width:36rem; margin:auto;">
<form id="dislo-vendor-form"
hx-post="{% if vendor_form.instance.pk %}/dislocation/vendors/{{ vendor_form.instance.pk }}/update/{% else %}/dislocation/vendors/create/{% endif %}"
hx-target="#main-content" hx-indicator="#loader" hx-disabled-elt="find button[type=submit]">
@@ -571,6 +573,7 @@
<button type="submit" class="btn btn-primary" style="width:100%; margin-top:0.5rem;">{% trans "Сохранить" %}</button>
</div>
</form>
</div>
</div>
{% endif %}
</div>
@@ -667,15 +670,20 @@ function disloVendorPanelOpen() {
});
const activeEl = form.querySelector('[name="is_active"]');
if (activeEl) activeEl.checked = true;
document.getElementById('dislo-vendor-panel-overlay').style.display = 'block';
document.getElementById('dislo-vendor-panel').style.transform = 'translateX(0)';
disloVendorPanelShow();
}
function disloVendorPanelShow() {
const panel = document.getElementById('dislo-vendor-panel');
if (!panel) return;
panel.style.display = 'flex';
document.body.style.overflow = 'hidden';
}
function disloVendorPanelClose() {
const overlay = document.getElementById('dislo-vendor-panel-overlay');
const panel = document.getElementById('dislo-vendor-panel');
if (overlay) overlay.style.display = 'none';
if (panel) panel.style.transform = 'translateX(100%)';
if (panel) panel.style.display = 'none';
document.body.style.overflow = '';
}
function disloVendorEdit(pk) {
@@ -701,13 +709,11 @@ function disloVendorEdit(pk) {
set('comments', btn.dataset.comments);
const activeEl = form.querySelector('[name="is_active"]');
if (activeEl) activeEl.checked = btn.dataset.active === '1';
document.getElementById('dislo-vendor-panel-overlay').style.display = 'block';
document.getElementById('dislo-vendor-panel').style.transform = 'translateX(0)';
disloVendorPanelShow();
}
{% if vendor_form_error and can_manage_vendors %}
document.getElementById('dislo-vendor-panel-overlay').style.display = 'block';
document.getElementById('dislo-vendor-panel').style.transform = 'translateX(0)';
disloVendorPanelShow();
{% endif %}
disloVendorFilter();