Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ask CFPB: Featured cards tidying #8288

Merged
merged 2 commits into from
Apr 3, 2024
Merged
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
76 changes: 38 additions & 38 deletions cfgov/v1/jinja2/v1/includes/molecules/feature-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
value.category.url: A string for the URL of the category page.

value.category.text: A string for the title of the category.

value.category.aria_label: (Optional) An aria-label for the category page link.

value.icon: A string corresponding to an SVG icon.

Expand All @@ -40,44 +38,46 @@

<article class="m-card">
<h2 class="m-card_heading">
<a class="" href="{{ value.category.url }}">
<span class="m-card_icon">{{ svg_icon( value.icon ) }}</span>
<span>{{ value.category.text }}</span>
</a>
<a href="{{ value.category.url }}">
<span class="m-card_icon">{{ svg_icon( value.icon ) }}</span>
<span>{{ value.category.text }}</span>
</a>
</h2>

<ul class="m-list">
{%- for link in value.links %}
<li class="m-list_item">
{%- if link.text is not none and link.text.find('@') > -1 -%}
{%- if not value.emails is defined -%}
{%- do value.update({'emails':[{'url':link.text}]}) -%}
{%- endif -%}
{% include 'contact-email.html' with context %}
{%- else -%}
{%- set link_text = link.text if link.text
else 'Learn More' -%}

{%- set link -%}
<a class="a_link a-link__partially-styled"
href="{{ link.url }}"
{%- if link.aria_label -%}
aria-label="{{ link.aria_label }}"
{%- endif %}>
<span class="a-link__partially-styled_plain">{{ link_text }} </span>
<span class="a-link__partially-styled_underlined">{{ _('Read answer') }}</span>

<ul class="m-list">
{%- for link in value.links %}
<li class="m-list_item">
{%- if link.text is not none and link.text.find('@') > -1 -%}
{%- if not value.emails is defined -%}
{%- do value.update({'emails':[{'url':link.text}]}) -%}
{%- endif -%}
{% include 'contact-email.html' with context %}
{%- else -%}
{%- set link_text = link.text if link.text else 'Learn More' -%}
{%- set link -%}
<a class="a_link a-link__partially-styled"
href="{{ link.url }}"
{%- if link.aria_label -%}
aria-label="{{ link.aria_label }}"
{%- endif %}>
<span class="a-link__partially-styled_plain">
{{ link_text }}
</span>
<span class="a-link__partially-styled_underlined">
{{ _('Read answer') }}
</span>
</a>
{%- endset -%}
{{ link | safe }}
{%- endif %}
</li>
{%- endfor %}
</ul>

<div class="m-card_footer">
<a href="{{ value.category.url }}">
{{ value.footer_label }}
</a>
{%- endset -%}
{{ link | safe }}
{%- endif %}
</li>
{%- endfor %}
</ul>

<div class="m-card_footer">
<a href="{{ value.category.url }}">
{{ value.footer_label }}
</a>
</div>

</article>
Expand Down
49 changes: 24 additions & 25 deletions cfgov/v1/jinja2/v1/includes/organisms/feature-cards.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,31 @@
{%- from 'v1/includes/blocks/heading.html' import heading without context %}
{%- from 'v1/includes/molecules/feature-card.html' import feature_card with context %}

<section class="ask-categories">
<section>
<h2 class="u-show-on-mobile u-mt45">
Browse questions by category
</h2>

<ul class="u-show-on-mobile category_list m-list m-list__links u-mb0">
{% for card in value.feature_cards %}
<li class="m-list_item">
<a class="m-list_link a-link a-link__jump a-link__icon-after-text" href="{{ card.category.url }}">
<span class="a-link_text">{{ card.category.text }}</span>
{{ svg_icon( card.icon ) }}
</a>
</li>
{% endfor %}
</ul>

<div class="u-hide-on-mobile question-categories u-mb30">
<div class="o-card-group o-card-group__column-2">
<div class="o-card-group_cards">

{% for card in value.feature_cards %}
{{- feature_card(card) }}
{% endfor %}

</div>
</div>
</div>

</section>
<ul class="u-show-on-mobile category_list m-list m-list__links u-mb0">
{% for card in value.feature_cards %}
<li class="m-list_item">
<a class="m-list_link a-link a-link__jump a-link__icon-after-text" href="{{ card.category.url }}">
<span class="a-link_text">{{ card.category.text }}</span>
{{ svg_icon( card.icon ) }}
</a>
</li>
{% endfor %}
</ul>

<div class="u-hide-on-mobile question-categories u-mb30">
<div class="o-card-group o-card-group__column-2">
<div class="o-card-group_cards">

{% for card in value.feature_cards %}
{{- feature_card(card) }}
{% endfor %}

</div>
</div>
</div>
</section>
Loading