From 55c1d7f02c10b7db6dafdfa100c409a5f76f6678 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Mon, 7 Jan 2019 22:51:02 +0100 Subject: [PATCH] Refactor templates --- bda/templates/bda/forms/attribution_label_table.html | 7 +------ bda/templates/bda/forms/date_tirage.html | 1 + .../bda/forms/revente_other_label_table.html | 11 +++-------- bda/templates/bda/forms/revente_self_label_table.html | 9 ++------- bda/templates/bda/forms/revente_sold_label_table.html | 7 ++----- 5 files changed, 9 insertions(+), 26 deletions(-) create mode 100644 bda/templates/bda/forms/date_tirage.html diff --git a/bda/templates/bda/forms/attribution_label_table.html b/bda/templates/bda/forms/attribution_label_table.html index d47af32d..b50b8290 100644 --- a/bda/templates/bda/forms/attribution_label_table.html +++ b/bda/templates/bda/forms/attribution_label_table.html @@ -1,6 +1 @@ -{% with spectacle=attribution.spectacle %} -{{ spectacle.title }} -{{ spectacle.date }} -{{ spectacle.location }} -{{ spectacle.price |floatformat }}€ -{% endwith %} \ No newline at end of file +{% include 'bda/forms/spectacle_label_table.html' with spectacle=attribution.spectacle %} \ No newline at end of file diff --git a/bda/templates/bda/forms/date_tirage.html b/bda/templates/bda/forms/date_tirage.html new file mode 100644 index 00000000..98b1c5e1 --- /dev/null +++ b/bda/templates/bda/forms/date_tirage.html @@ -0,0 +1 @@ +{{ revente.date_tirage }} diff --git a/bda/templates/bda/forms/revente_other_label_table.html b/bda/templates/bda/forms/revente_other_label_table.html index c2047ff3..99c82a08 100644 --- a/bda/templates/bda/forms/revente_other_label_table.html +++ b/bda/templates/bda/forms/revente_other_label_table.html @@ -1,8 +1,3 @@ -{% with spectacle=revente.attribution.spectacle user=revente.seller.user %} -{{ spectacle.title }} -{{ spectacle.date }} -{{ spectacle.location }} -{{ spectacle.price |floatformat }}€ -{{user.first_name}} {{user.last_name}} -{{ revente.date_tirage }} -{% endwith %} \ No newline at end of file +{% include 'bda/forms/spectacle_label_table.html' with spectacle=revente.attribution.spectacle %} +{% with user=revente.seller.user %} {{user.first_name}} {{user.last_name}} {% endwith%} +{% include 'bda/forms/date_tirage.html' %} \ No newline at end of file diff --git a/bda/templates/bda/forms/revente_self_label_table.html b/bda/templates/bda/forms/revente_self_label_table.html index 26700ee9..3f32b114 100644 --- a/bda/templates/bda/forms/revente_self_label_table.html +++ b/bda/templates/bda/forms/revente_self_label_table.html @@ -1,7 +1,2 @@ -{% with spectacle=revente.attribution.spectacle %} -{{ spectacle.title }} -{{ spectacle.date }} -{{ spectacle.location }} -{{ spectacle.price |floatformat }}€ -{% if revente.tirage_done %}Tirage infructueux{% else %}{{ revente.date_tirage }}{% endif %} -{% endwith %} \ No newline at end of file +{% include 'bda/forms/spectacle_label_table.html' with spectacle=revente.attribution.spectacle %} +{% include 'bda/forms/date_tirage.html' %} \ No newline at end of file diff --git a/bda/templates/bda/forms/revente_sold_label_table.html b/bda/templates/bda/forms/revente_sold_label_table.html index 92b83c44..31777648 100644 --- a/bda/templates/bda/forms/revente_sold_label_table.html +++ b/bda/templates/bda/forms/revente_sold_label_table.html @@ -1,7 +1,4 @@ -{% with spectacle=revente.attribution.spectacle user=revente.soldTo.user %} -{{ spectacle.title }} -{{ spectacle.date }} -{{ spectacle.location }} -{{ spectacle.price |floatformat }}€ +{% include 'bda/forms/spectacle_label_table.html' with spectacle=revente.attribution.spectacle %} +{% with user=revente.soldTo.user %} {{user.first_name}} {{user.last_name}} {% endwith %} \ No newline at end of file