Skip to content

Commit

Permalink
Updates based on run through with Ash
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjamc committed Mar 25, 2024
1 parent c7b72e0 commit bb66d06
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 77 deletions.
4 changes: 3 additions & 1 deletion additional_codes/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ class AdditionalCodeDescriptionEditCreate(
"""UI endpoint for editing AdditionalCodeDescription CREATE instances."""

form_class = AdditionalCodeDescriptionForm
template_name = "common/edit_description.jinja"

def get_template_names(self):
return "common/edit_description.jinja"

@transaction.atomic
def form_valid(self, form):
Expand Down
3 changes: 2 additions & 1 deletion common/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ class DescriptionForm(forms.ModelForm):
)

description = forms.CharField(
help_text="Edit or overwrite the existing description",
help_text="You may enter HTML formatting if required. See the guide below "
"for more information.",
widget=forms.Textarea,
)

Expand Down
36 changes: 0 additions & 36 deletions common/jinja2/common/create_description.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,6 @@
{% from "components/breadcrumbs.jinja" import breadcrumbs %}

{% set page_title = "Create a new " ~ described_object._meta.verbose_name ~ " description" %}
{% set description_help_html %}

<p class="govuk-body">
It is possible to use HTML when defining descriptions. The table below shows
a few examples of useful codes that you may want to use. Please use HTML sparingly and only where
absolutely necessary.
</p>
{{ govukTable({
"head": [
{"text": "Code(s)"},
{"text": "Usage"},
{"text": "Example", "classes": "govuk-!-width-one-third"},
],
"rows": [[
{"text": "<b></b>"},
{"text": "Make a piece of content bold. It is preferable to use the tag pair <strong></strong> instead of <b></b>, however many of the Taric descriptions already use standard bold tags."},
{"html": "This is " ~ '<b>bold</b>'|e ~ " content <br> becomes <br> This is <b>bold<b> content"},
],
[
{"text": "<em></em>"},
{"text": "Make a piece of content italicised"},
{"html": "This is " ~ '<em>italicised</em>'|e ~ " content <br> becomes <br> This is <em>italicised</em> content"},
],
[
{"text": "<u></u>"},
{"text": "Make a piece of content underlined"},
{"html": "This is " ~ '<u>underlined</u>'|e ~ " content <br> becomes <br> This is <u>underlined</u> content"},
],
[
{"text": "<a href=\'\'></a>"},
{"text": "Add a hyperlink"},
{"html": "This is " ~ "<a href=:\'https://www.gov.uk\'>a hyperlink to gov.uk</a>"|e ~ "<br> becomes <br> <a href=:'https://www.gov.uk'>a hyperlink to gov.uk</a>"},
]
]
}) }}
{% endset %}

{% block breadcrumb %}
{{ breadcrumbs(request, [
Expand Down
36 changes: 0 additions & 36 deletions common/jinja2/common/edit_description.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,6 @@
{% set page_title = "Edit " ~ described_object._meta.verbose_name ~ ": " ~ described_object ~ " description details"%}


{% set description_help_html %}
<p class="govuk-body">
It is possible to use HTML when defining descriptions. The table below shows
a few examples of useful codes that you may want to use. Please use HTML sparingly and only where
absolutely necessary.
</p>
{{ govukTable({
"head": [
{"text": "Code(s)"},
{"text": "Usage"},
{"text": "Example", "classes": "govuk-!-width-one-third"},
],
"rows": [[
{"text": "<b></b>"},
{"text": "Make a piece of content bold. It is preferable to use the tag pair <strong></strong> instead of <b></b>, however many of the Taric descriptions already use standard bold tags."},
{"html": "This is " ~ '<b>bold</b>'|e ~ " content <br> becomes <br> This is <b>bold<b> content"},
],
[
{"text": "<em></em>"},
{"text": "Make a piece of content italicised"},
{"html": "This is " ~ '<em>italicised</em>'|e ~ " content <br> becomes <br> This is <em>italicised</em> content"},
],
[
{"text": "<u></u>"},
{"text": "Make a piece of content underlined"},
{"html": "This is " ~ '<u>underlined</u>'|e ~ " content <br> becomes <br> This is <u>underlined</u> content"},
],
[
{"text": "<a href=\'\'></a>"},
{"text": "Add a hyperlink"},
{"html": "This is " ~ "<a href=\'https://www.gov.uk\'>a hyperlink to gov.uk</a>"|e ~ "<br> becomes <br> <a href='https://www.gov.uk'>a hyperlink to gov.uk</a>"},
]
]
}) }}
{% endset %}

{% block breadcrumb %}
{{ breadcrumbs(request, [
{"text": "Find and edit " ~ described_object._meta.verbose_name_plural, "href": described_object.get_url("list")},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class Report(ReportBaseTable):
name = "Quotas expiring soon"
enabled = True
description = "This table shows quotas with definition, sub-quota, blocking or suspension periods about to expire with no future definition period."
description = "This table shows quotas with definition, sub-quota, blocking or suspension periods due to expire in the next 5 weeks with no future definition period."
tabular_reports = True
tab_name = "Definitions"
tab_name2 = "Sub-quota associations"
Expand Down
2 changes: 1 addition & 1 deletion workbaskets/jinja2/workbaskets/detail.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
{"text": "{:%d %b %y %H:%M}".format(workbasket.created_at)}
],
[
{"text": "Last updated"},
{"text": "Activity date"},
{"text": "{:%d %b %y %H:%M}".format(workbasket.updated_at)}
],
]}) }}
Expand Down
2 changes: 1 addition & 1 deletion workbaskets/tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_workbasket_create_form_invalid_data():
factories.WorkBasketFactory(title="123321")
form = forms.WorkbasketCreateForm(data={"title": "123321", "reason": "test"})
assert not form.is_valid()
assert "Workbasket with this Title already exists." in form.errors["title"]
assert "A workbasket with this title already exists" in form.errors["title"]


def test_selectable_objects_form():
Expand Down

0 comments on commit bb66d06

Please sign in to comment.