Working state before icon/utils fixes - Oct 22

This commit is contained in:
2025-10-21 21:56:54 +02:00
parent a7d9d44a13
commit 5be47b91a2
39 changed files with 6017 additions and 508 deletions

View File

@@ -1,3 +1,4 @@
// static/admin/js/vendors.js
// Admin Vendor Creation Component
function vendorCreation() {
return {
@@ -26,7 +27,8 @@ function vendorCreation() {
checkAuth() {
if (!Auth.isAuthenticated()) {
window.location.href = '/static/admin/login.html';
// ← CHANGED: Use new Jinja2 route
window.location.href = '/admin/login';
return false;
}
@@ -34,7 +36,8 @@ function vendorCreation() {
if (!user || user.role !== 'admin') {
Utils.showToast('Access denied. Admin privileges required.', 'error');
Auth.logout();
window.location.href = '/static/admin/login.html';
// ← CHANGED: Use new Jinja2 route
window.location.href = '/admin/login';
return false;
}
@@ -52,11 +55,14 @@ function vendorCreation() {
Auth.logout();
Utils.showToast('Logged out successfully', 'success', 2000);
setTimeout(() => {
window.location.href = '/static/admin/login.html';
// ← CHANGED: Use new Jinja2 route
window.location.href = '/admin/login';
}, 500);
}
},
// ... rest of the methods stay the same ...
// Auto-format vendor code (uppercase)
formatVendorCode() {
this.formData.vendor_code = this.formData.vendor_code