IT Assets: add Maintenance page with modal form

New database table: maintenance_records
- Fields: asset, start_date, end_date, status (open/in_progress/closed),
  initial_diagnosis, action_taken, action_result

New routes (/maintenance/):
- List with status + asset filters and pagination
- POST /new — create record (editor+); auto-sets asset status to 'maintenance'
- GET /<id>/edit — opens list page with modal pre-filled
- POST /<id>/update — save edits; auto-clears 'maintenance' status on close
- POST /<id>/delete — remove record

UI:
- Bootstrap modal form shared for add and edit
- Clicking any table row opens the modal pre-filled with that row's data
- Asset field locked in edit mode (cannot change asset)
- Delete button per row (with confirmation)
- Sidebar: 'Maintenance' link added under Hardware section
This commit is contained in:
ske087
2026-07-08 22:56:21 +03:00
parent 95ea6a3a35
commit 55a088eff4
7 changed files with 581 additions and 3 deletions
@@ -139,6 +139,10 @@
class="nav-link {% if request.blueprint == 'assets' %}active{% endif %}">
<i class="bi bi-laptop"></i> Assets
</a>
<a href="{{ url_for('maintenance.index') }}"
class="nav-link {% if request.blueprint == 'maintenance' %}active{% endif %}">
<i class="bi bi-wrench-adjustable"></i> Maintenance
</a>
{% if current_user.is_editor %}
<a href="{{ url_for('assets.create') }}"
class="nav-link {% if request.endpoint == 'assets.create' %}active{% endif %}">