style: update intervention note badges to transparent theme and change document sequencing badge to danger style

This commit is contained in:
kdeterme 2026-08-31 14:09:25 +02:00
parent 22efb9a6d9
commit 9181c1ab23
4 changed files with 12 additions and 12 deletions

View file

@ -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):

View file

@ -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,

View file

@ -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');

View file

@ -3400,7 +3400,7 @@ document.addEventListener('DOMContentLoaded', function() {
<div class="d-flex justify-content-between align-items-start gap-2">
<div class="note-content flex-grow-1">
<div class="d-flex flex-wrap align-items-center gap-2 mb-1">
<span class="badge note-type-badge d-inline-flex align-items-center gap-1 ${noteData.badge_class || 'bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle'}">
<span class="badge note-type-badge d-inline-flex align-items-center gap-1 ${noteData.badge_class || 'bg-transparent text-secondary border border-secondary'}">
<i class="bi ${noteData.icon_class || 'bi-chat-left-text'}"></i>
${noteData.note_type_display || ''}
</span>