User management and module improvements

- Added daily_mirror module to permissions system
- Fixed user module management - updates now work correctly
- Implemented dashboard module filtering based on user permissions
- Fixed warehouse create_locations page (config parser and delete)
- Implemented POST-Redirect-GET pattern to prevent duplicate entries
- Added application license system with validation middleware
- Cleaned up debug logging code
- Improved user module selection with fetch API instead of form submit
This commit is contained in:
ske087
2025-11-29 14:16:36 +02:00
parent 3e314332a7
commit 7912885046
9 changed files with 355 additions and 69 deletions

View File

@@ -12,6 +12,7 @@
<div class="dashboard-container">
<!-- Row of evenly distributed cards -->
{% if 'quality' in user_modules %}
<div class="dashboard-card">
<h3>Quality Module</h3>
<p>Final scanning module for production orders and quality reports access.</p>
@@ -20,26 +21,34 @@
<a href="{{ url_for('main.reports') }}" class="btn">Access to Quality reports</a>
</div>
</div>
{% endif %}
{% if 'warehouse' in user_modules %}
<div class="dashboard-card">
<h3>Access Warehouse Module</h3>
<p>Access warehouse module functionalities.</p>
<a href="{{ url_for('main.warehouse') }}" class="btn" id="launch-warehouse">Open Warehouse</a>
</div>
{% endif %}
{% if 'labels' in user_modules %}
<!-- New Card: Access Labels Module -->
<div class="dashboard-card">
<h3>Access Labels Module</h3>
<p>Module for label management.</p>
<a href="{{ url_for('main.etichete') }}" class="btn">Launch Labels Module</a>
</div>
{% endif %}
{% if user_role in ['superadmin', 'admin'] %}
<div class="dashboard-card">
<h3>Manage Settings</h3>
<p>Access and manage application settings.</p>
<a href="{{ url_for('main.settings') }}" class="btn">Access Settings Page</a>
</div>
{% endif %}
{% if 'daily_mirror' in user_modules %}
<div class="dashboard-card">
<h3>📊 Daily Mirror</h3>
<p>Business Intelligence and Production Reporting - Generate comprehensive daily reports including order quantities, production status, and delivery tracking.</p>
@@ -50,6 +59,7 @@
<strong>Tracks:</strong> Orders quantity • Production launched • Production finished • Orders delivered
</div>
</div>
{% endif %}
</div>
</div>