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

Update fax to is_fax boolean label #3212

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 2 additions & 3 deletions cfgov/jinja2/v1/_includes/molecules/contact-phone.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

value: Object defined from a StreamField block.

value.fax: (Optional) A fax number.
value.is_fax: (Optional) Whether phones[i].number is a fax number.

value.phones: An array containing objects with phone number details.

Expand All @@ -25,8 +25,7 @@

{% from 'macros/util/format/contact.html' import format_phone as format_phone %}
<div class="m-contact m-contact-phone" data-qa-hook="contact-phone">
{# TODO: Update fax param name to is_fax to make clear it's a boolean. #}
{% if value.fax == true %}
{% if value.is_fax == true %}
{% set icon = 'cf-icon-fax' %}
{% set label = 'Fax' %}
{% else %}
Expand Down
4 changes: 2 additions & 2 deletions cfgov/v1/atomic_elements/molecules.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ class Meta:


class ContactPhone(blocks.StructBlock):
fax = blocks.BooleanBlock(default=False, required=False,
label='Is this number a fax?')
is_fax = blocks.BooleanBlock(default=False, required=False,
label='Is this number a fax?')
phones = blocks.ListBlock(
blocks.StructBlock([
('number', blocks.CharBlock(max_length=15)),
Expand Down
47 changes: 47 additions & 0 deletions cfgov/v1/migrations/0086_update_contact_phone_fax_label.py

Large diffs are not rendered by default.