Skip to content

Commit

Permalink
Merge pull request #821 from ministryofjustice/br-be-gone
Browse files Browse the repository at this point in the history
Turn plain <br> that's escaped by template renderer to a full stop.
  • Loading branch information
Nicholas Tollervey authored Jun 25, 2020
2 parents c12272d + cac9156 commit cef30cb
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion controlpanel/frontend/jinja2/datasource-create.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h1 class="govuk-heading-xl">{{ page_title }}</h1>
"maxlength": "60",
},
"value": form.name.value(),
"errorMessage": { "html": form.name.errors|join("<br>") } if form.name.errors else {}
"errorMessage": { "html": form.name.errors|join(". ") } if form.name.errors else {}
}) }}
<button class="govuk-button">Create data source</button>
</form>
Expand Down
8 changes: 4 additions & 4 deletions controlpanel/frontend/jinja2/parameter-create.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h1 class="govuk-heading-xl">{{ page_title }}</h1>
"attributes": {},
"items": app_type_choices,
"value": form.app_type.value(),
"errorMessage": { "html": form.app_type.errors|join("<br>") } if form.app_type.errors else {}
"errorMessage": { "html": form.app_type.errors|join(". ") } if form.app_type.errors else {}
})
}}

Expand All @@ -54,7 +54,7 @@ <h1 class="govuk-heading-xl">{{ page_title }}</h1>
"maxlength": "60",
"data-role-endpoint": url("parameters-list-roles"),
},
"errorMessage": {"html": form.role_name.errors|join("<br>")} if form.role_name.errors else {},
"errorMessage": {"html": form.role_name.errors|join(". ")} if form.role_name.errors else {},
"classes": "govuk-input--error govuk-!-width-two-thirds" if form.role_name.errors else "govuk-!-width-two-thirds",
"value": form.role_name.value(),
"items": []
Expand All @@ -80,7 +80,7 @@ <h1 class="govuk-heading-xl">{{ page_title }}</h1>
"maxlength": "60",
},
"value": form.key.value(),
"errorMessage": { "html": form.key.errors|join("<br>") } if form.key.errors else {}
"errorMessage": { "html": form.key.errors|join(". ") } if form.key.errors else {}
})
}}

Expand All @@ -95,7 +95,7 @@ <h1 class="govuk-heading-xl">{{ page_title }}</h1>
"attributes": {
},
"value": form.value.value(),
"errorMessage": { "html": form.value.errors|join("<br>") } if form.value.errors else {}
"errorMessage": { "html": form.value.errors|join(". ") } if form.value.errors else {}
})
}}
<button class="govuk-button">Create parameter</button>
Expand Down
2 changes: 1 addition & 1 deletion controlpanel/frontend/jinja2/policy-create.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h1 class="govuk-heading-xl">{{ legend }}</h1>
"maxlength": "60",
},
"value": form.name.value(),
"errorMessage": { "html": form.name.errors|join("<br>") } if form.name.errors else {}
"errorMessage": { "html": form.name.errors|join(". ") } if form.name.errors else {}
})
}}

Expand Down
2 changes: 1 addition & 1 deletion controlpanel/frontend/jinja2/tool-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1 class="govuk-heading-xl">Your tools</h1>
<tr class="govuk-table__row sse-listener tool-status" data-tool-name="{{ tool.chart_name }}">
<td class="govuk-table__cell">
{{ tool.name }}
<br>
<br/>
<small class="tool-app-version">
{% if deployment %}
{{ deployment.get_installed_app_version(id_token) or "Unknown" }}
Expand Down
6 changes: 3 additions & 3 deletions controlpanel/frontend/jinja2/webapp-create.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"hint": {
"text": '60 chars max, only lowercase letters, numbers, periods and hyphens, auto-prefixed with "' + env + '"'
},
"errorMessage": {"text": form.new_datasource_name.errors|join("<br>")} if form.new_datasource_name.errors else {},
"errorMessage": {"text": form.new_datasource_name.errors|join(". ")} if form.new_datasource_name.errors else {},
"value": form.new_datasource_name.value()
}) }}
</div>
Expand All @@ -33,7 +33,7 @@
{%- if form.existing_datasource_id.errors %} govuk-form-group--error{% endif %}">
{{ govukLabel({"text": "Select webapp data source"}) }}
{% if form.existing_datasource_id.errors -%}
{{ govukErrorMessage({"text": form.existing_datasource_id.errors|join("<br>")}) }}
{{ govukErrorMessage({"text": form.existing_datasource_id.errors|join(". ")}) }}
{%- endif %}
{{ form.existing_datasource_id }}
</div>
Expand All @@ -57,7 +57,7 @@ <h1 class="govuk-heading-xl">{{ page_title }}</h1>
"text": "Github repository",
"classes": "govuk-label--m"
},
"errorMessage": {"html": form.repo_url.errors|join("<br>")} if form.repo_url.errors else {},
"errorMessage": {"html": form.repo_url.errors|join(". ")} if form.repo_url.errors else {},
"classes": "govuk-input--error" if form.repo_url.errors else "",
"value": form.repo_url.value(),
"items": repos
Expand Down
2 changes: 1 addition & 1 deletion controlpanel/frontend/jinja2/webapp-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ <h2 class="govuk-heading-m">App data sources</h2>
<div class="govuk-form-group">
{{ govukLabel({"text": "Connect an app data source"}) }}
{% if grant_access_form.datasource.errors -%}
{{ govukErrorMessage({"text": grant_access_form.datasource.errors|join("<br>")}) }}
{{ govukErrorMessage({"text": grant_access_form.datasource.errors|join(". ")}) }}
{%- endif %}
{{ grant_access_form.datasource }}
</div>
Expand Down

0 comments on commit cef30cb

Please sign in to comment.