From 616c9b9e75e11f7fae3e52f75a622405b92ea42a Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 29 Jun 2015 02:52:39 +0100 Subject: [PATCH] Rewrote venue detail UI, and added 3-phase to detail & forms --- RIGS/templates/RIGS/venue_detail.html | 106 +++++++++++++++++--------- RIGS/templates/RIGS/venue_form.html | 14 ++++ RIGS/views.py | 4 +- 3 files changed, 85 insertions(+), 39 deletions(-) diff --git a/RIGS/templates/RIGS/venue_detail.html b/RIGS/templates/RIGS/venue_detail.html index a2fd4c7f..83233f35 100644 --- a/RIGS/templates/RIGS/venue_detail.html +++ b/RIGS/templates/RIGS/venue_detail.html @@ -1,64 +1,96 @@ {% extends request.is_ajax|yesno:"base_ajax.html,base.html" %} {% load widget_tweaks %} -{% block title %}{{ object.name }}{% endblock %} +{% block title %}Venue {{ object.pk|stringformat:"05d" }} | {{ object.name }}{% endblock %} {% block content %}
-
- {% if not request.is_ajax %} -

{{ object.name }}
- - Last edited at {{ object.last_edited_at|date:"d/m/Y H:i" }} by {{ object.last_edited_by.name }} - -

-
- Edit + {% if not request.is_ajax %} +
+

Venue {{ object.pk|stringformat:"05d" }} | {{ object.name }}

+
+ +
+ - {% endif %} -
-
-
Name
-
{{ object.name }}
+
+ {% endif %} +
+
+
Venue Details
+
+
+
Name
+
{{ object.name }}
-
Phone
-
{{ object.phone }}
+
Phone
+
{{ object.phone }}
-
Email
-
{{ object.email }}
+
Email
+
{{ object.email }}
-
Address
-
{{ object.address|linebreaksbr }}
+
Address
+
{{ object.address|linebreaksbr }}
-
Notes
-
{{ object.notes|linebreaksbr }}
-
+
Notes
+
{{ object.notes|linebreaksbr }}
+ +
Three Phase Available
+
{{ object.three_phase_available|yesno|capfirst }}
+ +
- {% with object.latest_events as events %} - {% include 'RIGS/event_table.html' %} - {% endwith %} +
+
Associated Events
+
+ {% with object.latest_events as events %} + {% include 'RIGS/event_table.html' %} + {% endwith %} +
+
+ + {% if not request.is_ajax %} + + {% endif %} + {% endblock %} + {% if request.is_ajax %} {% block footer %}
- -
- diff --git a/RIGS/templates/RIGS/venue_form.html b/RIGS/templates/RIGS/venue_form.html index 8d058502..4d99af7e 100644 --- a/RIGS/templates/RIGS/venue_form.html +++ b/RIGS/templates/RIGS/venue_form.html @@ -58,7 +58,21 @@ {% render_field form.notes class+="form-control" placeholder=form.notes.label %}
+ + +
+
+
+ +
+
+
+
+ +
diff --git a/RIGS/views.py b/RIGS/views.py index 0894d800..772d92a7 100644 --- a/RIGS/views.py +++ b/RIGS/views.py @@ -176,7 +176,7 @@ class VenueDetail(generic.DetailView): class VenueCreate(generic.CreateView): model = models.Venue - fields = ['name','phone','email','address','notes'] + fields = ['name','phone','email','address','notes','three_phase_available'] def get_success_url(self): if self.request.is_ajax(): @@ -193,7 +193,7 @@ class VenueCreate(generic.CreateView): class VenueUpdate(generic.UpdateView): model = models.Venue - fields = ['name','phone','email','address','notes'] + fields = ['name','phone','email','address','notes','three_phase_available'] def get_success_url(self): if self.request.is_ajax():