Skip to content

Commit

Permalink
Merge branch 'main' into ans_remove_resource_list
Browse files Browse the repository at this point in the history
  • Loading branch information
anselmbradford authored Mar 21, 2024
2 parents 1b44670 + ddd0e04 commit b38d92b
Show file tree
Hide file tree
Showing 19 changed files with 412 additions and 525 deletions.
5 changes: 2 additions & 3 deletions cfgov/cfgov/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"wagtail_draftail_anchors",
"tccp",
"django_filters",
"django_htmx",
)

MIDDLEWARE = (
Expand All @@ -122,6 +123,7 @@
"corsheaders.middleware.CorsMiddleware",
"django.middleware.common.CommonMiddleware",
"core.middleware.PathBasedCsrfViewMiddleware",
"django_htmx.middleware.HtmxMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"core.middleware.ParseLinksMiddleware",
Expand Down Expand Up @@ -630,9 +632,6 @@
("environment is", "local"),
("environment is", "test"),
],
"TCCP_DEBUG_DETAILS": [
("environment is", "local"),
],
}

REGULATIONS_REFERENCE_MAPPING = [
Expand Down
124 changes: 62 additions & 62 deletions cfgov/paying_for_college/jinja2/paying-for-college/disclosure.html
Original file line number Diff line number Diff line change
Expand Up @@ -3135,70 +3135,70 @@ <h3 class="option_heading">
</p>
</section>
</div>
<aside class="get-options__sidebar column-well
column-well__emphasis content_sidebar">
<aside class="get-options__sidebar
column-well
column-well__emphasis
content_sidebar">
<div class="column-well_content">
<div class="followup__all">
<h3 class="option__take-action-header">
What you can do
</h3>
<p>
You can adjust some of the offer amounts
in the tool using some of the strategies
outlined above. For instance, you can
try reducing the amount of federal or
private loans to see how it affects your
overall debt and you can try reducing
your out-of-school expenses.
</p>
<p>
Changing amounts in this tool has no
effect on what financial aid is
actually being offered. If you want to
move forward with different amounts,
you will need to contact your school’s
financial aid representative to have
your financial aid package updated.
</p>
<h4>
Useful resources for new
college students
</h4>
<div>
<a
<h3 class="option__take-action-header">
What you can do
</h3>
<p>
You can adjust some of the offer amounts
in the tool using some of the strategies
outlined above. For instance, you can
try reducing the amount of federal or
private loans to see how it affects your
overall debt and you can try reducing
your out-of-school expenses.
</p>
<p>
Changing amounts in this tool has no
effect on what financial aid is
actually being offered. If you want to
move forward with different amounts,
you will need to contact your school’s
financial aid representative to have
your financial aid package updated.
</p>
<h4>
Useful resources for new
college students
</h4>
<div>
<a
href="https://collegescorecard.ed.gov"
target="_blank" rel="noopener noreferrer">College
Scorecard</a>
<p>Compare <a class="scorecard-school"
href="https://collegescorecard.ed.gov"
target="_blank" rel="noopener noreferrer">College
Scorecard</a>
<p>Compare <a class="scorecard-school"
href="https://collegescorecard.ed.gov"
target="_blank" rel="noopener noreferrer">your
school</a>’s annual costs,
graduation rates, and post-college
earnings.</p>
</div>
<p>
<a
href="https://www.consumer.ftc.gov/articles/0395-choosing-college-questions-ask"
target="_blank" rel="noopener noreferrer">Questions to ask
your college</a>
</p>
<div>
<a href="https://studentaid.gov/h/apply-for-aid/fafsa"
target="_blank" rel="noopener noreferrer">FAFSA&reg;</a>
<p>Apply for federal, state, and school
financial aid.</p>
</div>
<div>
<a href="https://www.consumerfinance.gov/paying-for-college/choose-a-student-loan/"
target="_blank" rel="noopener noreferrer">Student
loan guide</a>
<p>Choose a student loan that’s right
for you.</p>
</div>
<div>
<a href="https://www.consumerfinance.gov/paying-for-college/manage-your-college-money/" target="_blank" rel="noopener noreferrer">Student banking guide</a>
<p>Manage your college money.</p>
</div>
target="_blank" rel="noopener noreferrer">your
school</a>’s annual costs,
graduation rates, and post-college
earnings.</p>
</div>
<p>
<a
href="https://www.consumer.ftc.gov/articles/0395-choosing-college-questions-ask"
target="_blank" rel="noopener noreferrer">Questions to ask
your college</a>
</p>
<div>
<a href="https://studentaid.gov/h/apply-for-aid/fafsa"
target="_blank" rel="noopener noreferrer">FAFSA&reg;</a>
<p>Apply for federal, state, and school
financial aid.</p>
</div>
<div>
<a href="https://www.consumerfinance.gov/paying-for-college/choose-a-student-loan/"
target="_blank" rel="noopener noreferrer">Student
loan guide</a>
<p>Choose a student loan that’s right
for you.</p>
</div>
<div>
<a href="https://www.consumerfinance.gov/paying-for-college/manage-your-college-money/" target="_blank" rel="noopener noreferrer">Student banking guide</a>
<p>Manage your college money.</p>
</div>
</div>
</aside>
Expand Down
78 changes: 54 additions & 24 deletions cfgov/tccp/jinja2/tccp/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
{% block content_main %}
<div class="block block__flush-top">

<h1>{{ card.institution_name }} {{ card.product_name }}</h1>
<div class="eyebrow">{{ card.institution_name }}</div>
<h1>{{ card.product_name }}</h1>

{{ data_published(card.report_date) }}

<h2>Availability</h2>
<h2>Application requirements</h2>
<dl class="m-list m-list__card-details">
<dt>Location</dt>
<dd>
Expand Down Expand Up @@ -76,7 +77,7 @@ <h2>Availability</h2>
</table>
</dd>
<dt>
Secured card
Down payment required?
</dt>
<dd>
{{ "Yes" if card.secured_card else "No" }}
Expand Down Expand Up @@ -690,27 +691,56 @@ <h2>Rewards and perks</h2>
</dd>
{% endif %}
</dl>

{% if flag_enabled("TCCP_DEBUG_DETAILS") %}
<h3 class="h5">All fields</h3>

<table class="o-table o-table__striped">
<thead>
<tr>
<th>Field</th>
<th>Value</th>
</tr>
</thead>
<tbody>
{% for field in card._meta.fields %}
<tr>
<td>{{ field.name }}</td>
<td>{{ card.__getattribute__(field.name) }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
<h2>Fine print</h2>
<dl class="m-list m-list__card-details">
<dt>Grace period</dt>
<dd>
{{ card.grace_period ~ ' days until interest begins to accrue on
purchases' if grace_period_offered else 'None, interest begins
accruing on purchases immediately'
}}
</dd>
<dt>Minimum finance charge</dt>
<dd>
{{ '$' ~ '%.2f' | format(card.minimum_finance_charge_dollars | float)
if card.minimum_finance_charge else 'None'
}}
</dd>
<dt>Balance computation method</dt>
<dd>
{{ card.balance_computation_method | join(', ') if 'Other' is not in
card.balance_computation_method else
card.balance_computation_method_details
}}
</dd>
</dl>
<h2>Contact information</h2>
<dl class="m-list m-list__card-details">
{% if card.website_for_consumer %}
<dt>Website</dt>
<dd>
{# Some issuers submitted more than one URL for a card. In all
of those instances, the URLs are separated with a space, so
we'll only turn the submitted URL into a link if it doesn't
have a space in it for now. TODO: maybe split multiple URLs
up.
#}
{% if ' ' is not in card.website_for_consumer %}
<a href="{{ card.website_for_consumer }}">
{{- card.website_for_consumer -}}
</a>
{% else %}
{{ card.website_for_consumer }}
{% endif %}
</dd>
{% endif %}
{% if card.telephone_number_for_consumers %}
<dt>Phone</dt>
<dd>
{{ card.telephone_number_for_consumers }}
</dd>
{% endif %}
</dl>
</div>

{% endblock content_main %}
Expand Down
98 changes: 5 additions & 93 deletions cfgov/tccp/jinja2/tccp/cards.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{% extends "v1/layouts/layout-full.html" %}

{% from 'tccp/includes/data_published.html' import data_published %}
{% from 'tccp/includes/fields.html' import apr, apr_range %}
{% from 'tccp/includes/filter_form.html' import filter_form with context %}
{% import 'v1/includes/molecules/breadcrumbs.html' as breadcrumbs with context %}
{% import 'v1/includes/molecules/notification.html' as notification %}
{% from 'v1/includes/organisms/expandable.html' import expandable with context %}

{% block title -%}
Expand Down Expand Up @@ -67,97 +63,13 @@ <h3>{{ situation.title }}</h3>
{% endcall %}
</div>

{%- set purchase_apr_adjectives = ["less", "average", "more"] %}

<div class="block block__sub">
<div class="o-filterable-list-results htmx-results">

{% if count -%}
{{- notification.render(
'success',
true,
count ~ ' result' ~ count | pluralize()
) -}}
{%- else -%}
{{- notification.render(
'warning',
true,
'There are no results for your search.'
) -}}
{%- endif %}

<div class="block__sub">
<div class="a-label__heading">Key</div>

{% for adjective in purchase_apr_adjectives %}
<p class="u-mb0">
<span class="a-card-purchase-apr-rating a-card-purchase-apr-rating__{{ adjective }}">
{%- for i in range(loop.index) -%}
{{ svg_icon("dollar-round") }}
{%- endfor -%}

Pay {{ adjective ~ (" than average" if adjective != "average") }} interest
</span>
</p>
{% endfor %}
</div>

<p>
{% if stats_all.first_report_date -%}
{{ data_published(stats_all.first_report_date) }}
{%- endif %}
</p>

{%- macro card_name_cell(card) -%}
<a href="{{ card.url }}">
<div class="a-card-institution-name">{{ card.institution_name }}</div>
<div>{{ card.product_name }}</div>
</a>
{%- endmacro -%}

{%- macro purchase_apr_cell(card) -%}
{%- set adjective = purchase_apr_adjectives[
card.purchase_apr_for_tier_rating
] -%}

{{- apr(card.purchase_apr_for_tier) -}}

<span class="a-card-purchase-apr-rating a-card-purchase-apr-rating__{{ adjective }}">
{%- for i in range(card.purchase_apr_for_tier_rating + 1) %}
{{ svg_icon("dollar-round") }}
{% endfor -%}

<strong>Pay {{ adjective }} interest</strong>
</span>
{%- endmacro -%}

{%- set card_columns = [
{'heading': 'Credit card'},
{'heading': 'Purchase APR'},
{'heading': 'Account fee'},
{'heading': 'Balance transfer APR'},
{'heading': 'Offers rewards'},
] %}
{%- set card_rows = [] %}
{%- for card in results %}
{% do card_rows.append( [
card_name_cell(card) | safe,
purchase_apr_cell(card) | safe,
(card.periodic_fee_type | join(', ')) if card.periodic_fee_type else 'None',
apr(card.transfer_apr_for_tier) if card.transfer_apr_for_tier is not none else apr_range(card.transfer_apr_min, card.transfer_apr_max),
(card.rewards | join(', ')) if card.rewards else 'None'
] ) %}
{% endfor %}
{%- with value = {
'data': {
'columns': card_columns,
'rows': card_rows
},
'options': ['directory_table']
} %}
{% include 'v1/includes/organisms/tables/base.html' %}
{% endwith %}
<div class="o-filterable-list-results o-filterable-list-results__partial htmx-results">
{% include "tccp/includes/card_list.html" %}
</div>
<button data-js-hook="behavior_show-more" class="a-btn a-btn__link a-btn__warning a-btn__full-on-xs u-mt20 u-js-only">
Show more results with higher interest rates
</button>
</div>

{% endblock content_main %}
Loading

0 comments on commit b38d92b

Please sign in to comment.