From 89eed2aaa438ca0c0db8d11692dee22e1825d493 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Thu, 5 Sep 2024 11:26:32 +0100 Subject: wip: Improved form for adding engagement components - travel, planning, regulation and reporting forms look a bit nicer --- core/static/css/output.css | 25 +++++++ .../engagements/engagement_effort_create.html | 86 ++++++++++++++++------ 2 files changed, 87 insertions(+), 24 deletions(-) diff --git a/core/static/css/output.css b/core/static/css/output.css index 67f0dc9..89f69f1 100644 --- a/core/static/css/output.css +++ b/core/static/css/output.css @@ -1302,6 +1302,10 @@ html { margin-left: 1rem; } +.mr-2 { + margin-right: 0.5rem; +} + .mt-1 { margin-top: 0.25rem; } @@ -1342,6 +1346,11 @@ html { display: grid; } +.size-6 { + width: 1.5rem; + height: 1.5rem; +} + .min-h-full { min-height: 100%; } @@ -1378,6 +1387,10 @@ html { flex-direction: column; } +.items-end { + align-items: flex-end; +} + .items-center { align-items: center; } @@ -1773,6 +1786,18 @@ html { color: rgb(255 255 255 / var(--tw-text-opacity)); } +.underline { + text-decoration-line: underline; +} + +.decoration-pink-500 { + text-decoration-color: #ec4899; +} + +.decoration-2 { + text-decoration-thickness: 2px; +} + .shadow { --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color); diff --git a/engagements/templates/engagements/engagement_effort_create.html b/engagements/templates/engagements/engagement_effort_create.html index b776fd8..86deb2c 100644 --- a/engagements/templates/engagements/engagement_effort_create.html +++ b/engagements/templates/engagements/engagement_effort_create.html @@ -1,34 +1,72 @@ {% extends "core/base.html" %} +{% load widget_tweaks %} {% block title %}Add {{ etype }} effort to Engagement{% endblock title %} {% block content %} -
-
-

Register your {{ etype|lower }} effort for the {{ engagement.engagement_type.name|title }} event

-

{{ engagement.external_party }} on {{ engagement.proposed_start_date }}

- -
- {% csrf_token %} - {% for field in form %} -
- - {{ field }} - {% if field.help_text %} -

{{ field.help_text }}

- {% endif %} -
- {% endfor %} -
- +
+
+ + +
+
+

Register your {{ etype|lower }} effort for + the {{ engagement.engagement_type.name|title }} event

+
+ + + + +

{{ engagement.external_party }}

- + +
+ + + +

+ {% if engagement.proposed_start_date == engagement.proposed_end_date %} + {{ engagement.proposed_start_date|date:"j M Y" }} + {% else %} + {{ engagement.proposed_start_date|date:"j M Y" }} - {{ engagement.proposed_end_date|date:"j M Y" }} + {% endif %} +

+
+ +
+ {% csrf_token %} + {% for field in form %} +
+
+ +
+
+ {% render_field field class+="block w-full rounded-md border-0 p-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" %} + {% for error in field.errors %} + {{ field }} + {% endfor %} +
+ {% if field.help_text %} +

{{ field.help_text }}

+ {% endif %} +
+ {% endfor %} +
+ +
+
+
-
{% endblock content %} -- cgit v1.2.3