diff --git a/RIGS/templates/organisation_detail.html b/RIGS/templates/organisation_detail.html index dd61004f..a08962bc 100644 --- a/RIGS/templates/organisation_detail.html +++ b/RIGS/templates/organisation_detail.html @@ -1,92 +1 @@ - {% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %} -{% load widget_tweaks %} - -{% block title %}Organisation | {{ object.name }}{% endblock %} - -{% block content %} -
- {% if not request.is_ajax %} -
-

Organisation | {{ object.name }}

-
- {% endif %} -
-
-
Organisation Details
-
-
-
Name
-
{{ object.name }}
- -
Phone
-
{{ object.phone }}
- -
Email
-
{{ object.email }}
- -
Address
-
{{ object.address|linebreaksbr }}
- -
Notes
-
{{ object.notes|linebreaksbr }}
- -
Union Account
-
{{ object.union_account|yesno|capfirst }}
-
-
-
-
-
-
-
Associated People
-
-
- {% for person,count in object.persons %} - {{ person.pk|stringformat:"05d" }} | {{ person.name }} {{count}} - {% endfor %} -
-
-
-
-
-
-
-
-
Associated Events
- {% with object.latest_events as events %} - {% include 'event_table.html' %} - {% endwith %} -
-
-
- - - {% if not request.is_ajax %} -
-
-
- Edit -
- {% include 'partials/last_edited.html' with target="organisation_history" %} -
-
- {% endif %} - -{% endblock %} - -{% if request.is_ajax %} - {% block footer %} -
-
- - {% include 'partials/last_edited.html' with target="organisation_history" %} -
-
- {% endblock %} -{% endif %} +{% include 'generic_detail.html' with type='Organisation' history_link='organisation_history' detail_link='organisation_detail' update_link='organisation_update' associated='partials/associated_people.html' %} diff --git a/RIGS/templates/partials/associated_organisations.html b/RIGS/templates/partials/associated_organisations.html new file mode 100644 index 00000000..eab97b27 --- /dev/null +++ b/RIGS/templates/partials/associated_organisations.html @@ -0,0 +1,10 @@ +
+
+
Associated Organisations
+ +
+
diff --git a/RIGS/templates/partials/associated_people.html b/RIGS/templates/partials/associated_people.html new file mode 100644 index 00000000..bdaa0e5c --- /dev/null +++ b/RIGS/templates/partials/associated_people.html @@ -0,0 +1,12 @@ +
+
+
Associated People
+
+ {% for person,count in object.persons %} + {{ person.pk|stringformat:"05d" }} | {{ person.name }} {{count}} + {% empty %} +
None
+ {% endfor %} +
+
+
diff --git a/RIGS/templates/person_detail.html b/RIGS/templates/person_detail.html index e1686022..447d781b 100644 --- a/RIGS/templates/person_detail.html +++ b/RIGS/templates/person_detail.html @@ -1,92 +1 @@ -{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %} -{% load widget_tweaks %} - -{% block title %}Person | {{ object.name }}{% endblock %} - -{% block content %} -
- {% if not request.is_ajax %} -
-

Person | {{ object.name }}

-
- -
-
- Edit -
-
- {% endif %} -
-
-
Person Details
-
-
-
Name
-
{{ object.name }}
- -
Phone
-
{{ object.phone }}
- -
Email
-
{{ object.email }}
- -
Address
-
{{ object.address|linebreaksbr }}
- -
Notes
-
{{ object.notes|linebreaksbr }}
-
-
-
-
-
-
-
Associated Organisations
- -
-
-
- -
-
-
-
Associated Events
- {% with object.latest_events as events %} - {% include 'event_table.html' %} - {% endwith %} -
-
-
-{% if not request.is_ajax %} -
-
-
- Edit -
- {% include 'partials/last_edited.html' with target="person_history" %} -
-
-{% endif %} -{% endblock %} - -{% if request.is_ajax %} - {% block footer %} -
-
- - {% include 'partials/last_edited.html' with target="person_history" %} -
-
- {% endblock %} -{% endif %} +{% include 'generic_detail.html' with type='Person' history_link='person_history' detail_link='person_detail' update_link='person_update' associated='partials/associated_organisations.html' %} diff --git a/RIGS/templates/venue_detail.html b/RIGS/templates/venue_detail.html index 954369b3..efb57021 100644 --- a/RIGS/templates/venue_detail.html +++ b/RIGS/templates/venue_detail.html @@ -1,83 +1 @@ -{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %} -{% load widget_tweaks %} - -{% block title %}Venue | {{ object.name }}{% endblock %} - -{% block content %} -
- {% if not request.is_ajax %} -
-

Venue | {{ object.name }}

-
- {% endif %} -
-
-
Venue Details
-
-
-
Name
-
{{ object.name }}
- -
Phone
-
{{ object.phone }}
- -
Email
-
{{ object.email }}
- -
Address
-
{{ object.address|linebreaksbr }}
- -
Notes
-
{{ object.notes|linebreaksbr }}
- -
Three Phase Available
-
{{ object.three_phase_available|yesno|capfirst }}
-
-
-
-
-
- -
-
-
-
Associated Events
-
- {% with object.latest_events as events %} - {% include 'event_table.html' %} - {% endwith %} -
-
-
-
- - {% if not request.is_ajax %} -
-
-
- Edit -
- {% include 'partials/last_edited.html' with target="venue_history" %} -
-
- {% endif %} - -{% endblock %} - - -{% if request.is_ajax %} - {% block footer %} -
-
- - {% include 'partials/last_edited.html' with target="venue_history" %} -
-
- {% endblock %} -{% endif %} +{% include 'generic_detail.html' with type='Venue' history_link='venue_history' detail_link='venue_detail' update_link='venue_update' %} diff --git a/templates/generic_detail.html b/templates/generic_detail.html new file mode 100644 index 00000000..fe07424c --- /dev/null +++ b/templates/generic_detail.html @@ -0,0 +1,83 @@ +{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %} +{% load widget_tweaks %} + +{% block title %}{{ type }} | {{ object.name }}{% endblock %} + +{% block content %} +
+ {% if not request.is_ajax %} +
+

{{ type }} | {{ object.name }}

+
+ {% endif %} +
+
+
{{ type }} Details
+
+
+
Name
+
{{ object.name }}
+ +
Phone
+
{{ object.phone }}
+ +
Email
+
{{ object.email }}
+ +
Address
+
{{ object.address|linebreaksbr }}
+ +
Notes
+
{{ object.notes|linebreaksbr }}
+ + {% if object.three_phase_available is not None %} +
Three Phase Available
+
{{ object.three_phase_available|yesno|capfirst }}
+ {% endif%} + + {% if object.union_account is not None %} +
Union Account
+
{{ object.union_account|yesno|capfirst }}
+ {% endif%} +
+
+
+
+ {% include associated|safe %} +
+
+
+
+
Associated Events
+ {% include 'event_table.html' with events=object.latest_events %} +
+
+
+ + {% if not request.is_ajax %} +
+
+
+ Edit +
+ {% include 'partials/last_edited.html' with target=history_link %} +
+
+ {% endif %} +{% endblock %} +{% if request.is_ajax %} + {% block footer %} +
+
+ + {% include 'partials/last_edited.html' with target=history_link %} +
+
+ {% endblock %} +{% endif %} diff --git a/templates/partials/associated_organisations.html b/templates/partials/associated_organisations.html new file mode 100644 index 00000000..eab97b27 --- /dev/null +++ b/templates/partials/associated_organisations.html @@ -0,0 +1,10 @@ +
+
+
Associated Organisations
+ +
+