mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-06 06:28:25 -04:00
Swap headings for list items in template list
I'm mainly making this change because it's useful for the CSS that styles the hint text when the link is focused for the link to have no parent container. That being said, there isn't really enough content underneath these headings to justify them as it is. I've wrapped them in a list instead because: - they're structured like a list - we already called them a `template-list` This commit also replaces the `message-type` class on the paragraph below where the headings went, for consistency. It also removes the CSS for that class as I couldn't find anywhere else that used it now.
This commit is contained in:
@@ -56,14 +56,6 @@ $message-type-bottom-spacing: govuk-spacing(4);
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&-type {
|
|
||||||
position: relative; /* needs to be non-static to have a z-index above the link :before element */
|
|
||||||
color: $govuk-secondary-text-colour;
|
|
||||||
margin: 0 0 $message-type-bottom-spacing 0;
|
|
||||||
padding-left: 0;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.template-list {
|
.template-list {
|
||||||
|
|||||||
@@ -26,6 +26,10 @@
|
|||||||
<nav id="template-list" class="{{ 'govuk-!-margin-top-1' if (not show_template_nav and not show_search_box) else 'govuk-!-margin-top-6' }}">
|
<nav id="template-list" class="{{ 'govuk-!-margin-top-1' if (not show_template_nav and not show_search_box) else 'govuk-!-margin-top-6' }}">
|
||||||
{% set checkboxes_data = [] %}
|
{% set checkboxes_data = [] %}
|
||||||
|
|
||||||
|
{% if not current_user.has_permissions('manage_templates') %}
|
||||||
|
<ul>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% for item in template_list %}
|
{% for item in template_list %}
|
||||||
|
|
||||||
{% set item_link_content %}
|
{% set item_link_content %}
|
||||||
@@ -73,17 +77,19 @@
|
|||||||
{% set _ = checkboxes_data.append(checkbox_config) %}
|
{% set _ = checkboxes_data.append(checkbox_config) %}
|
||||||
|
|
||||||
{% if not current_user.has_permissions('manage_templates') %}
|
{% if not current_user.has_permissions('manage_templates') %}
|
||||||
<div class="template-list-item {%- if item.ancestors %} template-list-item-hidden-by-default {%- else %} template-list-item-without-ancestors{%- endif %}">
|
<li class="template-list-item {%- if item.ancestors %} template-list-item-hidden-by-default {%- else %} template-list-item-without-ancestors{%- endif %}">
|
||||||
<h2 class="message-name">
|
|
||||||
{{ item_link_content }}
|
{{ item_link_content }}
|
||||||
</h2>
|
<p class="template-list-item-hint govuk-!-margin-bottom-4">
|
||||||
<p class="message-type govuk-!-margin-bottom-4">
|
|
||||||
{{ item.hint }}
|
{{ item.hint }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if not current_user.has_permissions('manage_templates') %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if current_user.has_permissions('manage_templates') %}
|
{% if current_user.has_permissions('manage_templates') %}
|
||||||
{{ templates_and_folders_form.templates_and_folders(param_extensions={
|
{{ templates_and_folders_form.templates_and_folders(param_extensions={
|
||||||
"items": checkboxes_data,
|
"items": checkboxes_data,
|
||||||
|
|||||||
@@ -38,9 +38,9 @@
|
|||||||
{{ live_search(target_selector='#template-list .template-list-item', show=True, form=search_form) }}
|
{{ live_search(target_selector='#template-list .template-list-item', show=True, form=search_form) }}
|
||||||
|
|
||||||
<nav id="template-list">
|
<nav id="template-list">
|
||||||
|
<ul>
|
||||||
{% for item in templates_and_folders %}
|
{% for item in templates_and_folders %}
|
||||||
<div class="template-list-item {% if item.ancestors %}template-list-item-hidden-by-default{% endif %} {% if not item.ancestors %}template-list-item-without-ancestors{% endif %}">
|
<li class="template-list-item {% if item.ancestors %}template-list-item-hidden-by-default{% endif %} {% if not item.ancestors %}template-list-item-without-ancestors{% endif %}">
|
||||||
<h2 class="message-name">
|
|
||||||
{% for ancestor in item.ancestors %}
|
{% for ancestor in item.ancestors %}
|
||||||
<a href="{{ url_for('.conversation_reply', service_id=current_service.id, notification_id=notification_id, from_folder=ancestor.id) }}" class="govuk-link govuk-link--no-visited-state template-list-folder">
|
<a href="{{ url_for('.conversation_reply', service_id=current_service.id, notification_id=notification_id, from_folder=ancestor.id) }}" class="govuk-link govuk-link--no-visited-state template-list-folder">
|
||||||
{{ ancestor.name }}
|
{{ ancestor.name }}
|
||||||
@@ -55,12 +55,12 @@
|
|||||||
<span class="live-search-relevant">{{ item.name }}</span>
|
<span class="live-search-relevant">{{ item.name }}</span>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</h2>
|
<p class="template-list-item-hint govuk-hint">
|
||||||
<p class="message-type">
|
|
||||||
{{ item.hint }}
|
{{ item.hint }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,9 +26,9 @@
|
|||||||
autofocus=True
|
autofocus=True
|
||||||
) }}
|
) }}
|
||||||
<nav id="template-list">
|
<nav id="template-list">
|
||||||
|
<ul>
|
||||||
{% for item in services_templates_and_folders %}
|
{% for item in services_templates_and_folders %}
|
||||||
<div class="template-list-item {% if item.ancestors %}template-list-item-hidden-by-default{% endif %} {% if not item.ancestors %}template-list-item-without-ancestors{% endif %}">
|
<li class="template-list-item {% if item.ancestors %}template-list-item-hidden-by-default{% endif %} {% if not item.ancestors %}template-list-item-without-ancestors{% endif %}">
|
||||||
<h2 class="message-name">
|
|
||||||
{% for ancestor in item.ancestors %}
|
{% for ancestor in item.ancestors %}
|
||||||
{% if ancestor.is_service %}
|
{% if ancestor.is_service %}
|
||||||
<a href="{{ url_for('.choose_template_to_copy', service_id=current_service.id, from_service=ancestor.service_id) }}" class="govuk-link govuk-link--no-visited-state template-list-folder">
|
<a href="{{ url_for('.choose_template_to_copy', service_id=current_service.id, from_service=ancestor.service_id) }}" class="govuk-link govuk-link--no-visited-state template-list-folder">
|
||||||
@@ -51,12 +51,12 @@
|
|||||||
<span class="live-search-relevant">{{ item.name }}</span>
|
<span class="live-search-relevant">{{ item.name }}</span>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</h2>
|
<p class="template-list-item-hint govuk-hint">
|
||||||
<p class="message-type">
|
|
||||||
{{ item.hint }}
|
{{ item.hint }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ def test_should_show_page_for_choosing_a_template(
|
|||||||
for index, expected_link in enumerate(expected_nav_links):
|
for index, expected_link in enumerate(expected_nav_links):
|
||||||
assert links_in_page[index].text.strip() == expected_link
|
assert links_in_page[index].text.strip() == expected_link
|
||||||
|
|
||||||
template_links = page.select('#template-list .govuk-label a, .message-name a')
|
template_links = page.select('#template-list .govuk-label a, .template-list-item a')
|
||||||
|
|
||||||
assert len(template_links) == len(expected_templates)
|
assert len(template_links) == len(expected_templates)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user