Skip to content

Commit 7025331

Browse files
committed
add short date filter and note form
1 parent 261d2a8 commit 7025331

File tree

4 files changed

+74
-2
lines changed

4 files changed

+74
-2
lines changed

application/blueprints/planning_consideration/views.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ def add_note(slug):
544544
page = {"title": "Add note", "submit_text": "Save note"}
545545

546546
return render_template(
547-
"questiontypes/input.html", consideration=consideration, form=form, page=page
547+
"note-form.html", consideration=consideration, form=form, page=page
548548
)
549549

550550

@@ -569,7 +569,7 @@ def edit_note(slug, note_id):
569569
page = {"title": "Edit note", "submit_text": "Update note"}
570570

571571
return render_template(
572-
"questiontypes/input.html", consideration=consideration, form=form, page=page
572+
"note-form.html", consideration=consideration, form=form, page=page, note=note
573573
)
574574

575575

application/static/stylesheets/application.css

+3
Original file line numberDiff line numberDiff line change
@@ -8581,3 +8581,6 @@ p + .govuk-heading-s,
85818581
.app-previous-item .govuk-summary-list__value {
85828582
font-size: 14pt;
85838583
line-height: 1.2; } }
8584+
8585+
.app-note__actions span {
8586+
margin-right: 5px; }

application/templates/note-form.html

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{% extends 'layouts/base.html' %}
2+
3+
{% block beforeContent %}
4+
5+
{{ govukBreadcrumbs({
6+
'items': [
7+
{
8+
'text': "Home",
9+
'href': "/"
10+
},
11+
{
12+
'text': "Planning consideration",
13+
'href': "/"
14+
},
15+
{
16+
'text': consideration.name,
17+
'href': url_for('planning_consideration.consideration', slug=consideration.slug)
18+
},
19+
{
20+
'text': "Add note",
21+
}
22+
]
23+
}) }}
24+
25+
{% endblock beforeContent %}
26+
27+
{% block content %}
28+
29+
<div class="govuk-grid-column-three-quarters">
30+
<span class="govuk-caption-xl">{{ consideration.name }}</span>
31+
<h1 class="govuk-heading-xl">{{ page.title }}</h1>
32+
</div>
33+
34+
35+
<div class="govuk-grid-row">
36+
<div class="govuk-grid-column-two-thirds">
37+
38+
{% if note %}
39+
{% set post_url = url_for('planning_consideration.edit_note', slug=consideration.slug, note_id=note.id) %}
40+
{% else %}
41+
{% set post_url = url_for('planning_consideration.add_note', slug=consideration.slug) %}
42+
{% endif %}
43+
44+
<form class="govuk-form" method="POST" action="{{ post_url }}">
45+
{{ form.hidden_tag() }}
46+
<div class="govuk-form-group">
47+
{{ form.text.label(class='govuk-label') }}
48+
{{ form.text(class='govuk-textarea', rows=15) }}
49+
{% if form.errors %}
50+
<ul>
51+
{% for error in field.errors %}
52+
<li>{{ error }}</li>
53+
{% endfor %}
54+
</ul>
55+
{% endif %}
56+
</div>
57+
<div class="govuk-button-group">
58+
<button class="govuk-button" type="submit">{{ page.submit_text }}</button>
59+
<a class="govuk-link" href="{{ url_for('planning_consideration.consideration', slug=consideration.slug) }}">Cancel</a>
60+
</div>
61+
</form>
62+
</div>
63+
</div>
64+
65+
{% endblock content %}

src/scss/application.scss

+4
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,7 @@ $govuk-new-link-styles: true;
109109
@include govuk-font($size: 16);
110110
}
111111
}
112+
113+
.app-note__actions span {
114+
margin-right: 5px;
115+
}

0 commit comments

Comments
 (0)