From f646813ffd2af21a2bc5891b3e48a1ffc184c083 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Mon, 17 Jun 2024 12:16:44 +0200 Subject: [PATCH] Siae edit form: basic activity list display --- lemarche/siaes/models.py | 4 ++ .../dashboard/_siae_activity_card.html | 39 +++++++++++++++++++ .../templates/dashboard/siae_edit_base.html | 5 +++ .../dashboard/siae_edit_search_2.html | 23 +++++++++++ .../templatetags/siae_sectors_display.py | 11 ++++-- lemarche/www/dashboard_siaes/urls.py | 2 + lemarche/www/dashboard_siaes/views.py | 11 ++++++ 7 files changed, 91 insertions(+), 4 deletions(-) create mode 100644 lemarche/templates/dashboard/_siae_activity_card.html create mode 100644 lemarche/templates/dashboard/siae_edit_search_2.html diff --git a/lemarche/siaes/models.py b/lemarche/siaes/models.py index 9e1005ec1..d11497db4 100644 --- a/lemarche/siaes/models.py +++ b/lemarche/siaes/models.py @@ -1439,6 +1439,10 @@ class Meta: verbose_name_plural = "Activités" ordering = ["-created_at"] + @property + def presta_type_display(self) -> str: + return choice_array_to_string(siae_constants.PRESTA_CHOICES, self.presta_type) + class SiaeOffer(models.Model): name = models.CharField(verbose_name="Nom", max_length=255) diff --git a/lemarche/templates/dashboard/_siae_activity_card.html b/lemarche/templates/dashboard/_siae_activity_card.html new file mode 100644 index 000000000..67e6e3898 --- /dev/null +++ b/lemarche/templates/dashboard/_siae_activity_card.html @@ -0,0 +1,39 @@ +{% load static siae_sectors_display %} + +
+
+
+

{{ activity.sector_group }}

+ +
    + {% siae_sectors_display activity display_max=6 output_format='li' %} +
+ +

+ + Type(s) de prestation : + {{ activity.presta_type_display }} +

+

+ + Situé à {{ activity.location }} + {{ activity.location }} +

+
+ +
+
diff --git a/lemarche/templates/dashboard/siae_edit_base.html b/lemarche/templates/dashboard/siae_edit_base.html index b71fdbe16..b25d51921 100644 --- a/lemarche/templates/dashboard/siae_edit_base.html +++ b/lemarche/templates/dashboard/siae_edit_base.html @@ -79,6 +79,11 @@ Votre référencement +