From 1138cfcde59098a80fe6334b7fc57975cd178a31 Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Thu, 25 Jun 2020 19:31:51 +0100 Subject: [PATCH] Make supplier detail use the generic template --- RIGS/templates/organisation_detail.html | 2 +- .../templates/partials/associated_events.html | 8 ++ RIGS/templates/person_detail.html | 2 +- RIGS/templates/venue_detail.html | 2 +- .../templates/partials/associated_assets.html | 8 ++ assets/templates/supplier_detail.html | 76 +------------------ templates/generic_detail.html | 15 ++-- 7 files changed, 26 insertions(+), 87 deletions(-) create mode 100644 RIGS/templates/partials/associated_events.html create mode 100644 assets/templates/partials/associated_assets.html diff --git a/RIGS/templates/organisation_detail.html b/RIGS/templates/organisation_detail.html index a08962bc..6d6733c0 100644 --- a/RIGS/templates/organisation_detail.html +++ b/RIGS/templates/organisation_detail.html @@ -1 +1 @@ -{% include 'generic_detail.html' with type='Organisation' history_link='organisation_history' detail_link='organisation_detail' update_link='organisation_update' associated='partials/associated_people.html' %} +{% include 'generic_detail.html' with type='Organisation' history_link='organisation_history' detail_link='organisation_detail' update_link='organisation_update' associated='partials/associated_people.html' associated2='partials/associated_events.html' %} diff --git a/RIGS/templates/partials/associated_events.html b/RIGS/templates/partials/associated_events.html new file mode 100644 index 00000000..7334235d --- /dev/null +++ b/RIGS/templates/partials/associated_events.html @@ -0,0 +1,8 @@ +
+
+
+
Associated Events
+ {% include 'event_table.html' with events=object.latest_events %} +
+
+
diff --git a/RIGS/templates/person_detail.html b/RIGS/templates/person_detail.html index 447d781b..4f4288fc 100644 --- a/RIGS/templates/person_detail.html +++ b/RIGS/templates/person_detail.html @@ -1 +1 @@ -{% include 'generic_detail.html' with type='Person' history_link='person_history' detail_link='person_detail' update_link='person_update' associated='partials/associated_organisations.html' %} +{% include 'generic_detail.html' with type='Person' history_link='person_history' detail_link='person_detail' update_link='person_update' associated='partials/associated_organisations.html' associated2='partials/associated_events.html' %} diff --git a/RIGS/templates/venue_detail.html b/RIGS/templates/venue_detail.html index efb57021..50971b7b 100644 --- a/RIGS/templates/venue_detail.html +++ b/RIGS/templates/venue_detail.html @@ -1 +1 @@ -{% include 'generic_detail.html' with type='Venue' history_link='venue_history' detail_link='venue_detail' update_link='venue_update' %} +{% include 'generic_detail.html' with type='Venue' history_link='venue_history' detail_link='venue_detail' update_link='venue_update' associated2='partials/associated_events.html' %} diff --git a/assets/templates/partials/associated_assets.html b/assets/templates/partials/associated_assets.html new file mode 100644 index 00000000..2bf2b5e5 --- /dev/null +++ b/assets/templates/partials/associated_assets.html @@ -0,0 +1,8 @@ +
+
+
Associated Assets
+ {% with object.assets.all as object_list %} + {% include 'partials/asset_list_table.html' %} + {% endwith %} +
+
diff --git a/assets/templates/supplier_detail.html b/assets/templates/supplier_detail.html index 800196e9..166dbc5b 100644 --- a/assets/templates/supplier_detail.html +++ b/assets/templates/supplier_detail.html @@ -1,75 +1 @@ -{% extends request.is_ajax|yesno:'base_ajax.html,base_assets.html' %} -{% block title %}Supplier | {{ object.name }}{% endblock %} - -{% block content %} -
- {% if not request.is_ajax %} -
-

Supplier | {{ object.name }}

-
-
-
- Edit -
-
- {% endif %} -
-
-
Supplier Details
-
-
-
Name
-
{{ object.name }}
- -
Phone
-
{% if object.phone %}{% endif %}{{ object.phone }}{% if object.phone %}{% endif %}
- -
Email
-
{% if object.email %}{% endif %}{{ object.email }}{% if object.email %}{% endif %}
- -
Address
-
{{ object.address|linebreaksbr }}
- -
Notes
-
{{ object.notes|linebreaksbr }}
-
-
-
-
-
-
-
Associated Assets
- {% with object.assets.all as object_list %} - {% include 'partials/asset_list_table.html' %} - {% endwith %} -
-
-
-{% if not request.is_ajax %} -
-
-
- Edit -
- {% include 'partials/last_edited.html' with target="supplier_history" %} -
-
-{% endif %} -{% endblock %} -{% if request.is_ajax %} -{% block footer %} -
-
- - {% include 'partials/last_edited.html' with target="supplier_history" %} -
-
-{% endblock %} -{% endif %} +{% include 'generic_detail.html' with type='Supplier' history_link='supplier_history' detail_link='supplier_detail' update_link='supplier_update' associated='partials/associated_assets.html' associated2='None' %} diff --git a/templates/generic_detail.html b/templates/generic_detail.html index fe07424c..be5a5d04 100644 --- a/templates/generic_detail.html +++ b/templates/generic_detail.html @@ -43,16 +43,13 @@ - {% include associated|safe %} - -
-
-
-
Associated Events
- {% include 'event_table.html' with events=object.latest_events %} -
-
+ {% if associated %} + {% include associated|safe %} + {% endif %}
+ {% if associated2 %} + {% include associated2|safe %} + {% endif %} {% if not request.is_ajax %}