mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-06 17:58:24 -04:00
- Changing things back to govukFieldset
- Added the usaAlert component - Edited styles because stripping out UK styles broke the highlighting section
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
{% set visuallyHiddenText = params.visuallyHiddenText | default("Error") -%}
|
||||
|
||||
<span {%- if params.id %} id="{{ params.id }}"{% endif %} class="usa-error-message{%- if params.classes %} {{ params.classes }}{% endif %}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
|
||||
{% if visuallyHiddenText %}<span class="usa-sr-only">{{ visuallyHiddenText }}:</span> {% endif -%}
|
||||
{{ params.html | safe if params.html else params.text }}
|
||||
</span>
|
||||
|
||||
<div {%- if params.id %} id="{{ params.id }}"{% endif %} class="usa-alert {%- if params.classes %} {{ params.classes }}{% endif %}">
|
||||
{%- if params.slim %}
|
||||
<div class="usa-alert usa-alert--slim usa-alert--{{params.type}} {%- if params.classes %} {{ params.classes }}{% endif %}" {%- if params.id %} id="{{ params.id }}"{% endif %}>
|
||||
<div class="usa-alert__body">
|
||||
<h4 class="usa-alert__heading">Informative status</h4>
|
||||
<p class="usa-alert__text">
|
||||
Lorem ipsum dolor sit amet,
|
||||
<a class="usa-link" href="javascript:void(0);">consectetur adipiscing</a>
|
||||
elit, sed do eiusmod.
|
||||
{{params.text}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="usa-alert usa-alert--{{params.type}} {%- if params.classes %} {{ params.classes }}{% endif %}" {%- if params.id %} id="{{ params.id }}"{% endif %}>
|
||||
<div class="usa-alert__body">
|
||||
<h{{params.header_level}} class="usa-alert__heading">{{params.heading}}</h{{params.header_level}}>
|
||||
<p class="usa-alert__text">
|
||||
{{params.text}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
{#- Define common attributes that we can use across all element types #}
|
||||
|
||||
{%- set commonAttributes %} class="usa-button{% if params.classes %} {{ params.classes }}{% endif %}{% if params.disabled %} govuk-button--disabled{% endif %}"{% for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}{% endset %}
|
||||
{%- set commonAttributes %} class="usa-button{% if params.classes %} {{ params.classes }}{% endif %}{% if params.disabled %} usa-button--disabled{% endif %}"{% for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}{% endset %}
|
||||
|
||||
{#- Define common attributes we can use for both button and input types #}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</a>
|
||||
|
||||
{%- elseif element == 'button' %}
|
||||
<button {%- if params.value %} value="{{ params.value }}"{% endif %} {{- buttonAttributes | safe }} {{- commonAttributes | safe }}>
|
||||
<button {%- if params.value %} value="{{ params.value }}"{% endif %} {{- buttonAttributes | safe }} {{- commonAttributes | safe }} {% if params.disabled %}disabled{% endif %}>
|
||||
{{ params.html | safe if params.html else params.text }}
|
||||
</button>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{% from "../error-message/macro.njk" import usaErrorMessage -%}
|
||||
{% from "../fieldset/macro.njk" import usaFieldset %}
|
||||
{% from "../fieldset/macro.njk" import govukFieldset %}
|
||||
{% from "../hint/macro.njk" import usaHint %}
|
||||
{% from "../label/macro.njk" import usaLabel %}
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
<div class="usa-form-group {%- if params.errorMessage %} usa-form-group--error{% endif %} {%- if params.formGroup.classes %} {{ params.formGroup.classes }}{% endif %}">
|
||||
{% if params.fieldset %}
|
||||
{% call usaFieldset({
|
||||
{% call govukFieldset({
|
||||
describedBy: describedBy,
|
||||
classes: params.fieldset.classes,
|
||||
attributes: params.fieldset.attributes,
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{% macro usaFieldset(params) %}
|
||||
{% macro govukFieldset(params) %}
|
||||
{%- include "./template.njk" -%}
|
||||
{% endmacro %}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{% from "../error-message/macro.njk" import usaErrorMessage -%}
|
||||
{% from "../fieldset/macro.njk" import usaFieldset %}
|
||||
{% from "../fieldset/macro.njk" import govukFieldset %}
|
||||
{% from "../hint/macro.njk" import usaHint %}
|
||||
{% from "../label/macro.njk" import usaLabel %}
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
|
||||
<div class="usa-form-group {%- if params.errorMessage %} usa-form-group--error{% endif %} {%- if params.formGroup.classes %} {{ params.formGroup.classes }}{% endif %}">
|
||||
{% if params.fieldset %}
|
||||
{% call usaFieldset({
|
||||
{% call govukFieldset({
|
||||
describedBy: describedBy,
|
||||
classes: params.fieldset.classes,
|
||||
attributes: params.fieldset.attributes,
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{% macro usaTextarea(params) %}
|
||||
{% macro govukTextarea(params) %}
|
||||
{%- include "./template.njk" -%}
|
||||
{% endmacro %}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% from "components/components/fieldset/macro.njk" import usaFieldset %}
|
||||
{% from "components/components/fieldset/macro.njk" import govukFieldset %}
|
||||
{% from "components/components/error-message/macro.njk" import usaErrorMessage %}
|
||||
|
||||
{% macro list_entry(
|
||||
@@ -14,7 +14,7 @@
|
||||
{% else %}
|
||||
{% set attributes = {} %}
|
||||
{% endif %}
|
||||
{% call usaFieldset({
|
||||
{% call govukFieldset({
|
||||
"legend": {
|
||||
"text": field.label.text,
|
||||
"isPageHeading": False
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{% from "components/components/error-message/macro.njk" import usaErrorMessage -%}
|
||||
{% from "components/components/fieldset/macro.njk" import usaFieldset %}
|
||||
{% from "components/components/fieldset/macro.njk" import govukFieldset %}
|
||||
{% from "components/components/hint/macro.njk" import usaHint %}
|
||||
{% from "components/components/radio-label/macro.njk" import usaRadioLabel %}
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
<div class="{% if formGroup %}usa-form-group{% endif %} {%- if params.errorMessage %} usa-form-group--error{% endif %} {%- if params.formGroup.classes %} {{ params.formGroup.classes }}{% endif %}">
|
||||
{% if params.fieldset %}
|
||||
{% call usaFieldset({
|
||||
{% call govukFieldset({
|
||||
describedBy: describedBy,
|
||||
classes: params.fieldset.classes,
|
||||
attributes: params.fieldset.attributes,
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/form.html" import form_wrapper %}
|
||||
{% from "components/components/back-link/macro.njk" import usaBackLink %}
|
||||
{% from "components/components/alert/macro.njk" import usaAlert %}
|
||||
|
||||
{% block service_page_title %}
|
||||
{{ heading_action }} text message template
|
||||
@@ -19,13 +20,11 @@
|
||||
|
||||
{{ page_header('{} text message template'.format(heading_action)) }}
|
||||
|
||||
<div class="usa-alert usa-alert--info usa-alert--slim">
|
||||
<div class="usa-alert__body">
|
||||
<p class="usa-alert__text">
|
||||
Don't worry, saving the template will not send
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{{ usaAlert({
|
||||
"type": "info",
|
||||
"text": "Don't worry, saving the template will not send",
|
||||
"classes": "margin-top-2 usa-button--secondary"
|
||||
}) }}
|
||||
|
||||
{% if current_service.prefix_sms %}
|
||||
{% set content_hint = 'Your service name will be added to the start of your message. You can turn this off in Settings.' %}
|
||||
@@ -35,7 +34,7 @@
|
||||
<div class="grid-row">
|
||||
<div class="grid-col-8">
|
||||
{{ form.name(param_extensions={
|
||||
"classes": "",
|
||||
"extra_form_group_classes": "margin-bottom-2",
|
||||
"hint": {"text": "Your recipients will not see this"}
|
||||
}) }}
|
||||
{{ textbox(
|
||||
@@ -44,6 +43,7 @@
|
||||
width='1-1',
|
||||
hint=content_hint,
|
||||
rows=5,
|
||||
extra_form_group_classes='margin-bottom-1',
|
||||
placeholder='Edit me! Check out the Personalization section below for details on cool ((stuff)) you can do with your messages!'
|
||||
) }}
|
||||
{% if current_user.platform_admin %}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
{% from "components/form.html" import form_wrapper %}
|
||||
{% from "components/page-header.html" import page_header %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/components/alert/macro.njk" import usaAlert %}
|
||||
|
||||
|
||||
{% extends "withnav_template.html" %}
|
||||
|
||||
@@ -34,13 +36,11 @@
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="{% if current_user.has_permissions('manage_templates') %} grid-col-10 {% else %} grid-col-12 {% endif %}">
|
||||
<div class="usa-alert usa-alert--info usa-alert--slim">
|
||||
<div class="usa-alert__body">
|
||||
<p class="usa-alert__text">
|
||||
Every message starts with a template. To send, choose or create a template.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{{ usaAlert({
|
||||
"text": "Every message starts with a template. To send, choose or create a template.",
|
||||
"slim": true,
|
||||
"type": "info",
|
||||
}) }}
|
||||
{{ folder_path(
|
||||
folders=template_folder_path,
|
||||
service_id=current_service.id,
|
||||
|
||||
Reference in New Issue
Block a user