Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions cfgov/ask_cfpb/jinja2/ask-cfpb/_ask-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,30 @@
is_subsection=True,
max_length=75
) %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this still needs to be a separate macro with various options if the search input is only being used on the answer page. Could we pull in the search bar from the searchgov page instead in the answer-page.html template, and just include the h3 header from here?

{%- set search_url = (
"/es/buscar/" if language == 'es' else
"/search/"
) -%}

<div class="o-search-bar">
<form method="get"
action="{{ _('/ask-cfpb/search/') }}"
action="{{ search_url }}"
data-cy="ask-search-form">
{% if show_label %}
<{{ 'h3' if is_subsection else 'h2' }}>
{{ _('Search for your question') }}
{{ _('Search all of consumerfinance.gov') }}
</{{ 'h3' if is_subsection else 'h2' }}>
{% endif %}

<div>
{% import 'v1/includes/organisms/search-input.html' as search_input %}
{% set placeholder_value = _('Search Ask CFPB for your question') %}
{% set placeholder_value = _('Enter your search term(s)') %}
{{ search_input.render({
"input_id": "o-search-bar_query",
"input_name": "q",
"input_value": ask_query,
"input_aria_label": _('Search for your question'),
"has_autocomplete": autocomplete,
"input_aria_label": _('Enter your search term(s)'),
"placeholder": placeholder_value,
"submit_aria_label": placeholder_value,
"max_length": max_length
Expand Down
31 changes: 19 additions & 12 deletions cfgov/ask_cfpb/jinja2/ask-cfpb/landing-page.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'v1/layouts/layout-2-1.html' %}
{% import 'v1/includes/templates/render_block.html' as render_block with context %}
{% import 'ask-cfpb/_ask-search.html' as ask_search with context %}
{% import 'v1/includes/molecules/notification.html' as notification with context %}

{% set read_answer_text = _('Read answer') %}

Expand All @@ -25,24 +25,31 @@
{% import 'v1/includes/molecules/translation-links.html' as translation_links with context %}
{{ translation_links.render(modifier_classes='block--flush-top') }}

{% for block in page.content %}
{% if block.block_type == 'notification' %}
{% set has_notification = true %}
{% include_block block %}
{% endif %}
{% endfor %}

<section class="ask-search block block--sub{% if has_notification == false %} block--flush-top{% endif %}">
{{ ask_search.render( language=page.language, is_subsection=False ) }}
</section>

{% for block in page.content %}
{% if block.block_type != 'notification' %}

@virginiacc virginiacc Nov 17, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember -- is it possible to add a notification block to this page's content section in the admin?

{% include_block block %}
{% endif %}
{% endfor %}
</div>

<div class="m-notification

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could add a new type (help?) to the notification molecule template so that could be used to output the notification content here:

{{- notification.render(
        'help',
        true,
        _('Can\'t find what you\'re looking for?'),
        '',
        [{
            'text': _('Search all of consumerfinance.gov'), 
            'url': _('/search/')  
        }]
    ) -}}

(And/or pull this notification out into a template so it can be reused on the see-all page?)

m-notification--visible
m-notification--success">
{{ svg_icon('help-round') }}
<div class="m-notification__content">
<div class="m-notification__message">{{ _('Can\'t find what you\'re looking for?') }}</div>
<ul class="m-list m-list--links">
<li class="m-list__item">
<a class="a-link a-link--jump" href="{{ _('/search/') }}">
<span class="a-link__text">
{{ _('Search all of consumerfinance.gov') }}
</span>
</a>
</li>
</ul>
</div>
</div>

{% endblock %}

{% block content_sidebar scoped -%}
Expand Down
45 changes: 16 additions & 29 deletions cfgov/ask_cfpb/jinja2/ask-cfpb/see-all.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,6 @@ <h1>
{{ page.overview }}
</p>
{% endif %}
<aside class="search-bar">
<form method="get" action=".">
<label for="ask-search" class="a-label h4">
{{ _('Narrow your results') }}
</label>
<div class="m-form-field">
<input
class="a-text-input a-text-input--full"
type="text"
aria-label="{{ _('Search term') }}"
name="search_term"
value="{{ search_term }}">
<button class="a-btn" id="ask-search" type="submit">
{{ _('Search') }}
</button>
<a class="a-btn a-btn--link a-btn--warning"
href=".">
{{ _('Clear search') }}
</a>
</div>
</form>
</aside>

<p class="results-message">{{ results_message }}</p>

<section class="results">
<div class="page-links">
Expand All @@ -81,11 +57,22 @@ <h1>
</div>
</section>
{% if not page.portal_category %}
<div class="block block--flush-bottom block--padded-bottom">
<p class="ask-search-link h4">
<span>{{ _("Don't see what you're looking for?") }}</span>
<a href="{{ _('/ask-cfpb/search/') }}">{{ _('Search our full library of answers') }}</a>
</p>
<div class="m-notification
m-notification--visible
m-notification--success">
{{ svg_icon('help-round') }}
<div class="m-notification__content">
<div class="m-notification__message">{{ _('Can't find what you're looking for?') }}</div>
<ul class="m-list m-list--links">
<li class="m-list__item">
<a class="a-link a-link--jump" href="{{ _('/search/') }}">
<span class="a-link__text">
{{ _('Search all of consumerfinance.gov') }}
</span>
</a>
</li>
</ul>
</div>
</div>
{% endif %}
{% endif %}
Expand Down
Binary file modified cfgov/ask_cfpb/locale/es/LC_MESSAGES/django.mo
Binary file not shown.
61 changes: 33 additions & 28 deletions cfgov/ask_cfpb/locale/es/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-06-04 17:28-0400\n"
"POT-Creation-Date: 2025-08-25 15:24-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand All @@ -18,18 +18,13 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: ask_cfpb/jinja2/ask-cfpb/_ask-search.html:40
#: ask_cfpb/jinja2/ask-cfpb/see-all.html:87
msgid "/ask-cfpb/search/"
msgstr "/es/obtener-respuestas/buscar/"

#: ask_cfpb/jinja2/ask-cfpb/_ask-search.html:44
msgid "Search for your question"
msgstr "Busque su pregunta"

#: ask_cfpb/jinja2/ask-cfpb/_ask-search.html:50
msgid "Search Ask CFPB for your question"
msgstr "Busque 'Obtener Respuestas' para su cuestionamiento"
msgid "Search all of consumerfinance.gov"
msgstr "Buscar la CFPB"

#: ask_cfpb/jinja2/ask-cfpb/_ask-search.html:56
msgid "Enter your search term(s)"
msgstr "Ingrese sus término(s) de búsqueda"

#: ask_cfpb/jinja2/ask-cfpb/answer-page.html:7
msgid "Consumer Financial Protection Bureau"
Expand All @@ -40,7 +35,7 @@ msgid "last reviewed"
msgstr "revisado"

#: ask_cfpb/jinja2/ask-cfpb/answer-page.html:57
#: ask_cfpb/jinja2/ask-cfpb/see-all.html:86
#: ask_cfpb/jinja2/ask-cfpb/see-all.html:62
msgid "Don't see what you're looking for?"
msgstr "¿No encuentra lo que busca?"

Expand Down Expand Up @@ -95,27 +90,19 @@ msgstr "Por favor escriba su búsqueda arriba"
msgid "Read answer"
msgstr "Leer la respuesta"

#: ask_cfpb/jinja2/ask-cfpb/landing-page.html:40
msgid "Can't find what you're looking for?"
msgstr "¿No encuentra lo que busca?"

#: ask_cfpb/jinja2/ask-cfpb/see-all.html:34
msgid "Read more"
msgstr "Leer más"

#: ask_cfpb/jinja2/ask-cfpb/see-all.html:49
msgid "Narrow your results"
msgstr "Búsqueda especial"

#: ask_cfpb/jinja2/ask-cfpb/see-all.html:55
msgid "Search term"
msgstr "Palabra a buscar"

#: ask_cfpb/jinja2/ask-cfpb/see-all.html:59
msgid "Search"
msgstr "Buscar"

#: ask_cfpb/jinja2/ask-cfpb/see-all.html:63
msgid "Clear search"
msgstr "Borrar búsqueda"
msgid "/ask-cfpb/search/"
msgstr "/es/obtener-respuestas/buscar/"

#: ask_cfpb/jinja2/ask-cfpb/see-all.html:87
#: ask_cfpb/jinja2/ask-cfpb/see-all.html:63
msgid "Search our full library of answers"
msgstr "Buscar en toda la lista de respuestas"

Expand Down Expand Up @@ -151,3 +138,21 @@ msgstr "Ver todos los resultados para"
#: ask_cfpb/templates/admin/export.html:3
msgid "Export Ask data"
msgstr ""

#~ msgid "Search for your question"
#~ msgstr "Busque su pregunta"

#~ msgid "Search Ask CFPB for your question"
#~ msgstr "Busque 'Obtener Respuestas' para su cuestionamiento"

#~ msgid "Narrow your results"
#~ msgstr "Búsqueda especial"

#~ msgid "Search term"
#~ msgstr "Palabra a buscar"

#~ msgid "Search"
#~ msgstr "Buscar"

#~ msgid "Clear search"
#~ msgstr "Borrar búsqueda"
Loading