From 7614d5611279e722c445b30c208d35da6ba170bc Mon Sep 17 00:00:00 2001 From: kdeterme Date: Mon, 17 Aug 2026 12:32:59 +0200 Subject: [PATCH] refactor: redesign mobile control list cards and enhance FAB styling --- .../static/controls/controls_index_mobile.css | 164 ++++++++++++++++-- .../controls/_controls_list_mobile.html | 116 ++++++++----- 2 files changed, 216 insertions(+), 64 deletions(-) diff --git a/loko/controls/static/controls/controls_index_mobile.css b/loko/controls/static/controls/controls_index_mobile.css index 28c7b8f..e478d5e 100644 --- a/loko/controls/static/controls/controls_index_mobile.css +++ b/loko/controls/static/controls/controls_index_mobile.css @@ -30,20 +30,40 @@ z-index: 2100; } -/* FAB bouton carte : au-dessus du footer */ +/* === FAB BOUTON CARTE (Floating Action Button en bas à droite) === */ #map-fab-btn { - position: fixed; - bottom: 4.5rem; - right: 1rem; - z-index: 1050; - border-radius: 50%; - width: 3.25rem; - height: 3.25rem; - display: flex; - align-items: center; - justify-content: center; - box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); - padding: 0; + position: fixed !important; + bottom: 4.5rem !important; + right: 1.25rem !important; + z-index: 1050 !important; + border-radius: 50% !important; + width: 3.5rem !important; + height: 3.5rem !important; + display: flex !important; + align-items: center !important; + justify-content: center !important; + box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important; + padding: 0 !important; + background-color: var(--brand-color, #2f3e8b) !important; + border: none !important; + color: #ffffff !important; + cursor: pointer; + transition: transform 0.15s ease, box-shadow 0.15s ease; +} + +#map-fab-btn:hover { + box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45) !important; + color: #ffffff !important; + transform: scale(1.05); +} + +#map-fab-btn:active { + transform: scale(0.92) !important; +} + +#map-fab-btn i { + font-size: 1.4rem !important; + line-height: 1; } .maplibregl-popup-content a { @@ -52,19 +72,127 @@ text-decoration: none; } +/* === CARTE DE CONTRÔLE === */ .control-card { cursor: pointer; - transition: background-color 0.2s, transform 0.15s; - border-radius: 0.5rem; + transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease; + border-radius: 0.6rem; + border: 1px solid #e2e8f0; + background-color: #ffffff; } .control-card:active { - background-color: #f1f3f5; + background-color: #f8f9fa; transform: scale(0.99); } -.badge { - font-size: 0.75rem; +/* === BADGES DE TYPE & STATUT === */ +.control-type-badge { + font-weight: 600; + font-size: 0.72rem; + padding: 0.25em 0.55em; + border-radius: 0.35rem; + display: inline-flex; + align-items: center; + white-space: nowrap; +} + +.control-type-control { + background-color: #e0edff; + color: #0d6efd; + border: 1px solid #b6d4fe; +} + +.control-type-site_report { + background-color: #fff3cd; + color: #664d03; + border: 1px solid #ffecb5; +} + +.control-type-statement { + background-color: #f8d7da; + color: #842029; + border: 1px solid #f5c2c7; +} + +.control-type-meeting_report { + background-color: #cff4fc; + color: #055160; + border: 1px solid #b6effb; +} + +.control-type-other { + background-color: #f8f9fa; + color: #495057; + border: 1px solid #dee2e6; +} + +.control-status-badge { + font-weight: 600; + font-size: 0.72rem; + padding: 0.25em 0.55em; + border-radius: 0.35rem; + display: inline-flex; + align-items: center; + white-space: nowrap; +} + +.control-status-in_progress { + background-color: #ffc107; + color: #000; +} + +.control-status-information { + background-color: #0dcaf0; + color: #000; +} + +.control-status-to_be_processed { + background-color: #dc3545; + color: #fff; +} + +.control-status-processed { + background-color: #198754; + color: #fff; +} + +.control-status-validated { + background-color: #0d6efd; + color: #fff; +} + +.control-status-canceled { + background-color: #6c757d; + color: #fff; +} + +.control-status-other { + background-color: #6c757d; + color: #fff; +} + +/* === CHIPS THÉMATIQUES & CATÉGORIES === */ +.badge-chip { + font-weight: 500; + font-size: 0.72rem; + padding: 0.22em 0.55em; + border-radius: 1rem; + display: inline-flex; + align-items: center; + white-space: nowrap; +} + +.badge-theme { + background-color: #f1f5f9; + color: #334155; + border: 1px solid #cbd5e1; +} + +.badge-category { + background-color: #f8fafc; + color: #475569; + border: 1px solid #e2e8f0; } .form-select, diff --git a/loko/controls/templates/controls/_controls_list_mobile.html b/loko/controls/templates/controls/_controls_list_mobile.html index 6bc9824..facde9c 100644 --- a/loko/controls/templates/controls/_controls_list_mobile.html +++ b/loko/controls/templates/controls/_controls_list_mobile.html @@ -8,81 +8,105 @@ {% endif %} {% for control in controls %} -
+
-
- -
- {% for theme in control.thematics.all %} - - {% if theme.icon %}{% endif %}{{ theme.name }} - - {% endfor %} - {% for cat in control.categories.all %} - {{ cat.get_name }} - {% endfor %} -
- - -
+ +
+ {{ control.control_code }} +
+ {% if control.control_type == 'control' %} - + {{ control.get_control_type_display }} {% elif control.control_type == 'site_report' %} - + {{ control.get_control_type_display }} {% elif control.control_type == 'statement' %} - + {{ control.get_control_type_display }} {% elif control.control_type == 'meeting_report' %} - + {{ control.get_control_type_display }} {% else %} - {{ control.get_control_type_display }} + + {{ control.get_control_type_display }} + {% endif %} + {% if control.status == 'in_progress' %} - {{ control.get_status_display }} + + {{ control.get_status_display }} + {% elif control.status == 'information' %} - {{ control.get_status_display }} + + {{ control.get_status_display }} + {% elif control.status == 'to_be_processed' %} - {{ control.get_status_display }} + + {{ control.get_status_display }} + {% elif control.status == 'processed' %} - {{ control.get_status_display }} + + {{ control.get_status_display }} + {% elif control.status == 'validated' %} - {{ control.get_status_display }} + + {{ control.get_status_display }} + {% elif control.status == 'canceled' %} - {{ control.get_status_display }} + + {{ control.get_status_display }} + {% else %} - {{ control.get_status_display }} + + {{ control.get_status_display }} + {% endif %}
-
- {{ control.control_code }} - {% if control.description %} -
{{ control.description|truncatewords:15 }}
+ + {% if control.thematics.exists or control.categories.exists %} +
+ {% for theme in control.thematics.all %} + + {% if theme.icon %}{% endif %}{{ theme.name }} + + {% endfor %} + {% for cat in control.categories.all %} + + {{ cat.get_name }} + + {% endfor %} +
+ {% endif %} + + + {% if control.description %} +
{{ control.description|truncatewords:15 }}
+ {% endif %} + + +
+ {% if control.location %} +
+ {{ control.location }} +
+ {% endif %} + {% if control.project %} +
+ {{ control.project.name }} +
{% endif %}
- {% if control.location %} -
- {{ control.location }} -
- {% endif %} - - {% if control.project %} -
- {{ control.project.name }} -
- {% endif %} - -
+ +
{% if control.control_author %} {{ control.control_author|short_name }} · @@ -91,7 +115,7 @@
{% if control.remarks.count > 0 %}
- + {{ control.remarks.count }}