From 9181c1ab236e41555962170a84069a51d0bc4300 Mon Sep 17 00:00:00 2001 From: kdeterme Date: Mon, 31 Aug 2026 14:09:25 +0200 Subject: [PATCH] style: update intervention note badges to transparent theme and change document sequencing badge to danger style --- loko/interventions/models.py | 16 ++++++++-------- .../services/document_sequencing.py | 2 +- .../interventions/detail/intervention_notes.js | 4 ++-- .../intervention_detail_mobile.html | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/loko/interventions/models.py b/loko/interventions/models.py index b388ba6..f3779d1 100644 --- a/loko/interventions/models.py +++ b/loko/interventions/models.py @@ -1229,13 +1229,13 @@ class InterventionNote(models.Model): OTHER = "other", _("Autre") NOTE_TYPE_STYLES = { - NoteType.WORK_DONE: {"badge_class": "bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle", "icon_class": "bi-clipboard-check"}, - NoteType.MATERIAL: {"badge_class": "bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle", "icon_class": "bi-box-seam"}, - NoteType.EQUIPMENT: {"badge_class": "bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle", "icon_class": "bi-tools"}, - NoteType.IMPORTANT_INFO: {"badge_class": "bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle", "icon_class": "bi-exclamation-octagon-fill"}, - NoteType.ORIGIN: {"badge_class": "bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle", "icon_class": "bi-flag-fill"}, - NoteType.COMMENT: {"badge_class": "bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle", "icon_class": "bi-chat-dots"}, - NoteType.OTHER: {"badge_class": "bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle", "icon_class": "bi-sticky"}, + NoteType.WORK_DONE: {"badge_class": "bg-transparent text-secondary border border-secondary", "icon_class": "bi-clipboard-check"}, + NoteType.MATERIAL: {"badge_class": "bg-transparent text-secondary border border-secondary", "icon_class": "bi-box-seam"}, + NoteType.EQUIPMENT: {"badge_class": "bg-transparent text-secondary border border-secondary", "icon_class": "bi-tools"}, + NoteType.IMPORTANT_INFO: {"badge_class": "bg-transparent text-secondary border border-secondary", "icon_class": "bi-exclamation-octagon-fill"}, + NoteType.ORIGIN: {"badge_class": "bg-transparent text-secondary border border-secondary", "icon_class": "bi-flag-fill"}, + NoteType.COMMENT: {"badge_class": "bg-transparent text-secondary border border-secondary", "icon_class": "bi-chat-dots"}, + NoteType.OTHER: {"badge_class": "bg-transparent text-secondary border border-secondary", "icon_class": "bi-sticky"}, } NOTE_TYPE_PRIORITIES = { @@ -1272,7 +1272,7 @@ class InterventionNote(models.Model): @property def type_badge_class(self): - return self.NOTE_TYPE_STYLES.get(self.note_type, {"badge_class": "bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle"}).get("badge_class", "bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle") + return self.NOTE_TYPE_STYLES.get(self.note_type, {"badge_class": "bg-transparent text-secondary border border-secondary"}).get("badge_class", "bg-transparent text-secondary border border-secondary") @property def type_icon_class(self): diff --git a/loko/interventions/services/document_sequencing.py b/loko/interventions/services/document_sequencing.py index 07ab581..a4fc78e 100644 --- a/loko/interventions/services/document_sequencing.py +++ b/loko/interventions/services/document_sequencing.py @@ -214,7 +214,7 @@ def get_sequenced_intervention_documents( 'title': _("Avant réalisation"), 'subtitle': _("Préparation, constat initial et pièces administratives"), 'icon': 'bi-clipboard-check', - 'badge_class': 'bg-info-subtle text-info-emphasis border border-info-subtle', + 'badge_class': 'bg-danger-subtle text-danger-emphasis border border-danger-subtle', 'period_display': period_before, 'modal_id': 'interventionDocViewerModal_before', 'documents': before_docs, diff --git a/loko/interventions/static/interventions/detail/intervention_notes.js b/loko/interventions/static/interventions/detail/intervention_notes.js index 9a43c6a..33f001a 100644 --- a/loko/interventions/static/interventions/detail/intervention_notes.js +++ b/loko/interventions/static/interventions/detail/intervention_notes.js @@ -209,7 +209,7 @@ metadata.className = 'd-flex flex-wrap align-items-center gap-2 mb-1'; const badge = document.createElement('span'); - const badgeClass = `badge note-type-badge d-inline-flex align-items-center gap-1 ${note.note_type_badge_class || 'bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle'}`.trim(); + const badgeClass = `badge note-type-badge d-inline-flex align-items-center gap-1 ${note.note_type_badge_class || 'bg-transparent text-secondary border border-secondary'}`.trim(); badge.className = badgeClass; const badgeIcon = document.createElement('i'); badgeIcon.className = `bi ${note.note_type_icon_class || 'bi-card-text'}`; @@ -291,7 +291,7 @@ badge.innerHTML = ''; // Recréer le contenu du badge - const badgeClass = `badge note-type-badge d-inline-flex align-items-center gap-1 ${note.note_type_badge_class || 'bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle'}`.trim(); + const badgeClass = `badge note-type-badge d-inline-flex align-items-center gap-1 ${note.note_type_badge_class || 'bg-transparent text-secondary border border-secondary'}`.trim(); badge.className = badgeClass; const icon = document.createElement('i'); diff --git a/loko/interventions/templates/interventions/intervention_detail_mobile.html b/loko/interventions/templates/interventions/intervention_detail_mobile.html index d1cf0db..2f94238 100644 --- a/loko/interventions/templates/interventions/intervention_detail_mobile.html +++ b/loko/interventions/templates/interventions/intervention_detail_mobile.html @@ -3400,7 +3400,7 @@ document.addEventListener('DOMContentLoaded', function() {
- + ${noteData.note_type_display || ''}