diff --git a/RIGS/templates/client_eventdetails.html b/RIGS/templates/client_eventdetails.html deleted file mode 100644 index e7b88151..00000000 --- a/RIGS/templates/client_eventdetails.html +++ /dev/null @@ -1,78 +0,0 @@ -
-
-
-
Contact Details
-
-
-
Person
-
- {% if event.person %} - {{ event.person.name }} - {% endif %} -
- -
Email
-
- {{ event.person.email }} -
- -
Phone Number
-
{{ event.person.phone }}
-
-
-
- {% if event.organisation %} -
-
Organisation Details
-
-
-
Organisation
-
- {{ event.organisation.name }} -
- -
Phone Number
-
{{ object.organisation.phone }}
-
-
-
- {% endif %} -
- -
-
-
Event Info
-
-
-
Event Venue
-
- {% if object.venue %} - - {{ object.venue }} - - {% endif %} -
- -
Status
-
{{ event.get_status_display }}
- -
 
- -
Access From
-
{{ event.access_at|date:"D d M Y H:i"|default:"" }}
- -
Event Starts
-
{{ event.start_date|date:"D d M Y" }} {{ event.start_time|date:"H:i" }}
- -
Event Ends
-
{{ event.end_date|date:"D d M Y" }} {{ event.end_time|date:"H:i" }}
- -
 
- -
Event Description
-
{{ event.description|linebreaksbr }}
-
-
-
-
-
diff --git a/RIGS/templates/event_detail_buttons.html b/RIGS/templates/event_detail_buttons.html index bca4fc50..27e3a301 100644 --- a/RIGS/templates/event_detail_buttons.html +++ b/RIGS/templates/event_detail_buttons.html @@ -1,5 +1,5 @@
- {% if event.is_rig %} @@ -7,7 +7,7 @@ class="fas fa-print"> {% endif %} - {% if event.is_rig %} @@ -19,6 +19,8 @@ btn-warning {% elif event.auth_request_to %} btn-info + {% else %} + btn-secondary {% endif %} " href="{% url 'event_authorise_request' object.pk %}"> diff --git a/RIGS/templates/eventauthorisation.html b/RIGS/templates/eventauthorisation.html new file mode 100644 index 00000000..55f2e8f2 --- /dev/null +++ b/RIGS/templates/eventauthorisation.html @@ -0,0 +1,48 @@ +{% extends 'base_client.html' %} +{% load widget_tweaks %} +{% load static %} + +{% block js %} + + +{% endblock %} + +{% block title %} + {% if event.is_rig %}N{{ event.pk|stringformat:"05d" }}{% else %}{{ event.pk }}{% endif %} | {{ event.name }} +{% endblock %} + +{% block content %} + + +
+ {% include 'partials/client_eventdetails.html' %} +
+ +
+
+
+ {% with object=event %} + {% include 'item_table.html' %} + {% endwith %} +
+
+
+ + {% block authorisation %} + {% endblock %} +{% endblock %} diff --git a/RIGS/templates/eventauthorisation_client_success.html b/RIGS/templates/eventauthorisation_client_success.html index 398dee80..ad335860 100644 --- a/RIGS/templates/eventauthorisation_client_success.html +++ b/RIGS/templates/eventauthorisation_client_success.html @@ -9,13 +9,7 @@ by {{ object.name }} as of {{ object.event.last_edited_at }}.

-

- {% if object.event.organisation and object.event.organisation.union_account %}{# internal #} - Your event is now fully booked and payment will be processed by the finance department automatically. - {% else %}{# external #} - Your event is now fully booked and our finance department will be contact to arrange payment. - {% endif %} -

+

Your event is now fully booked and payment will be processed by the finance department automatically.

TEC PA & Lighting

{% endblock %} diff --git a/RIGS/templates/eventauthorisation_client_success.txt b/RIGS/templates/eventauthorisation_client_success.txt index c511fc72..9d6fd51b 100644 --- a/RIGS/templates/eventauthorisation_client_success.txt +++ b/RIGS/templates/eventauthorisation_client_success.txt @@ -2,10 +2,6 @@ Hi {{ to_name|default_if_none:"there" }}, Your event N{{object.event.pk|stringformat:"05d"}} has been successfully authorised for £{{object.amount}} by {{object.name}} as of {{object.event.last_edited_at}}. -{% if object.event.organisation and object.event.organisation.union_account %}{# internal #} Your event is now fully booked and payment will be processed by the finance department automatically. -{% else %}{# external #} -Your event is now fully booked and our finance department will be contact to arrange payment. -{% endif %} TEC PA & Lighting diff --git a/RIGS/templates/eventauthorisation_form.html b/RIGS/templates/eventauthorisation_form.html index 41549024..3a3bbfd5 100644 --- a/RIGS/templates/eventauthorisation_form.html +++ b/RIGS/templates/eventauthorisation_form.html @@ -1,130 +1,94 @@ -{% extends 'base_client.html' %} +{% extends 'eventauthorisation.html' %} {% load widget_tweaks %} -{% load static %} {% block js %} - - {% endblock %} -{% block title %} - {% if event.is_rig %}N{{ event.pk|stringformat:"05d" }}{% else %}{{ event.pk }}{% endif %} | {{ event.name }} -{% endblock %} +{% block authorisation %} +
+
+
+
Event Authorisation
-{% block content %} - +
+
+ {% csrf_token %} + {% include 'form_errors.html' %} +
+
+

+ I agree that I am authorised to approve this event. I agree that I am the + President/Treasurer or account holder of the hirer, or that I + have the written permission of the + President/Treasurer or account holder of the hirer stating that + I can authorise this event. +

+
-
- {% include 'client_eventdetails.html' %} -
+
+
+ -
-
- {% with object=event %} - {% include 'item_table.html' %} - {% endwith %} -
-
- -
-
-
-
Event Authorisation
- -
- - {% csrf_token %} - {% include 'form_errors.html' %} -
-
-

- I agree that I am authorised to approve this event. I agree that I am the - President/Treasurer or account holder of the hirer, or that I - have the written permission of the - President/Treasurer or account holder of the hirer stating that - I can authorise this event. -

-
- -
-
- - -
- {% render_field form.name class+="form-control" %} -
-
- -
- -
- {% render_field form.uni_id class+="form-control" %} -
+
+ {% render_field form.name class+="form-control" %}
-
-
- -
- {% render_field form.account_code class+="form-control" %} -
-
- -
- -
- {% render_field form.amount class+="form-control" %} -
-
-
- -
-
-
-
- -
-
-
- -
-
- -
+
+ +
+ {% render_field form.uni_id class+="form-control" %}
- -
+ +
+
+ +
+ {% render_field form.account_code class+="form-control" %} +
+
+ +
+ +
+ {% render_field form.amount class+="form-control" %} +
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+
+
{% endblock %} diff --git a/RIGS/templates/eventauthorisation_success.html b/RIGS/templates/eventauthorisation_success.html index 358b2035..a1395fae 100644 --- a/RIGS/templates/eventauthorisation_success.html +++ b/RIGS/templates/eventauthorisation_success.html @@ -1,64 +1,42 @@ -{% extends 'base_client.html' %} +{% extends 'eventauthorisation.html' %} {% load widget_tweaks %} -{% block title %} - {% if event.is_rig %}N{{ event.pk|stringformat:"05d" }}{% else %}{{ event.pk }}{% endif %} | {{ event.name }} +{% block js %} {% endblock %} -{% block content %} -
-
-

- {% if event.is_rig %}N{{ event.pk|stringformat:"05d" }}{% else %}{{ event.pk }}{% endif %} - | {{ event.name }} {% if event.dry_hire %}Dry Hire{% endif %} -

-
-
+{% block authorisation %} +
+
+
+
Event Authorisation
- {% include 'client_eventdetails.html' %} +
+
+
+
+
Name
+
{{ object.name }}
-
-
- {% with object=event %} - {% include 'item_table.html' %} - {% endwith %} -
-
+
Email
+
{{ object.email }}
-
-
-
-
Event Authorisation
+
University ID
+
{{ object.uni_id }}
+
+
-
-
-
-
-
Name
-
{{ object.name }}
+
+
+
Account code
+
{{ object.account_code }}
-
Email
-
{{ object.email }}
- - {% if internal %} -
University ID
-
{{ object.uni_id }}
- {% endif %} -
-
- -
-
-
Account code
-
{{ object.account_code }}
- -
Authorised amount
-
£ {{ object.amount|floatformat:2 }}
-
-
+
Authorised amount
+
£ {{ object.amount|floatformat:2 }}
+
+
{% endblock %} diff --git a/RIGS/templates/partials/client_eventdetails.html b/RIGS/templates/partials/client_eventdetails.html new file mode 100644 index 00000000..8e23b873 --- /dev/null +++ b/RIGS/templates/partials/client_eventdetails.html @@ -0,0 +1,76 @@ +
+
+
Contact Details
+
+
+
Person
+
+ {% if event.person %} + {{ event.person.name }} + {% endif %} +
+ +
Email
+
+ {{ event.person.email }} +
+ +
Phone Number
+
{{ event.person.phone }}
+
+
+
+ {% if event.organisation %} +
+
Organisation Details
+
+
+
Organisation
+
+ {{ event.organisation.name }} +
+ +
Phone Number
+
{{ object.organisation.phone }}
+
+
+
+ {% endif %} +
+ +
+
+
Event Info
+
+
+
Event Venue
+
+ {% if object.venue %} + + {{ object.venue }} + + {% endif %} +
+ +
Status
+
{{ event.get_status_display }}
+ +
 
+ +
Access From
+
{{ event.access_at|date:"D d M Y H:i"|default:"" }}
+ +
Event Starts
+
{{ event.start_date|date:"D d M Y" }} {{ event.start_time|date:"H:i" }}
+ +
Event Ends
+
{{ event.end_date|date:"D d M Y" }} {{ event.end_time|date:"H:i" }}
+ +
 
+ +
Event Description
+
{{ event.description|linebreaksbr }}
+
+
+
+
diff --git a/RIGS/tests/test_functional.py b/RIGS/tests/test_functional.py index cb90b09c..b7dae92a 100644 --- a/RIGS/tests/test_functional.py +++ b/RIGS/tests/test_functional.py @@ -208,6 +208,8 @@ class TestEventCreate(BaseRigboardTest): self.page.person_selector.toggle() self.assertFalse(self.page.person_selector.is_open) + self.page.name = "Test Date Validation 2" + # end time before start self.page.start_date = datetime.date(2020, 1, 1) self.page.start_time = datetime.time(10, 00)