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

Move state and territory filter #6490

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
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
13 changes: 10 additions & 3 deletions fec/data/templates/macros/filters/contributor-states.jinja
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{% macro field(name='name', id_suffix='') %}
<div class="filter">
{% macro field(name='name', id_suffix='', minor_label_text=False, helper_text=False, restricted_field=False) %}
<div class="filter{% if helper_text %} restricted-fields{% endif %}">
<fieldset class="js-dropdown js-filter" data-filter="checkbox">
<legend class="label" for="state">State or Territory</legend>
{% if minor_label_text %}
<label for="state">State or Territory</label>
{% else %}
<legend class="label" for="state">State or Territory</legend>
{% endif %}
{% if helper_text %}
<label class="label--help u-margin--top">{{ helper_text }}</label>
{% endif %}
<ul class="dropdown__selected"></ul>
<div class="dropdown">
<button type="button" class="dropdown__button button--alt" data-name="{{ name }}">More</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@ Filter individual contributions
{{ typeahead.field('committee_id', 'Recipient Name or ID', helper_text = 'Limit 10 recipient names or IDs') }}
<legend class="label u-margin--top">Contributor details</legend>
{{ text.field(name = 'contributor_name', title = 'Name', minor_label_text = True, helper_text = 'Limit 10 contributor names or IDs') }}
{{ text.field(name = 'contributor_zip', title = 'ZIP code', attrs = {'maxlength':5}, minor_label_text = True, helper_text = 'Limit 10 ZIP codes') }}
{{ text.field(name = 'contributor_city', title = 'City', minor_label_text = True, helper_text = 'Limit 10 cities') }}
{{ states.field('contributor_state', minor_label_text = True, helper_text = 'When searching by state or territory, and across multiple time periods, choose one or more fields: recipient name or ID, contributor name or ID, city, ZIP code, occupation, employer, or image number.', restricted_field = True) }}
{{ text.field(name = 'contributor_zip', title = 'ZIP code', attrs = {'maxlength':5}, minor_label_text = True, helper_text = 'Limit 10 ZIP codes') }}
{{ text.field(name = 'contributor_occupation', title = 'Occupation', minor_label_text = True, helper_text = 'Use the employer field to search by occupation in reports filed before 2003. Limit 10 occupations') }}
{{ text.field(name = 'contributor_employer', title = 'Employer', minor_label_text = True, helper_text = 'Limit 10 employers') }}
{{ text.field(name = 'image_number', title = 'Image number') }}
</div>
<div class="js-accordion accordion--neutral restricted-fields" data-content-prefix="filter" data-open-first="true">
<button type="button" class="js-accordion-trigger accordion__button">Time period</button>
<div class="accordion__content">
{{ years.cycles('two_year_transaction_period', 'Report time period', multi_time_period_label="When searching multiple time periods, choose one or more fields: recipient name or ID, contributor name, city, ZIP code, occupation or employer, or image number.") }}
<label class="label--help u-margin--top">When searching accross multiple time periods, choose one or more fields: <br /> recipient name or ID, contributor name or ID, city, ZIP code, occupation or employer, or image number.</label>
{{ years.cycles('two_year_transaction_period', 'Report time period') }}
{{ date.field('date', 'Receipt date range' ) }}
</div>
<button type="button" class="js-accordion-trigger accordion__button">More contributor details</button>
<div class="accordion__content">
{{ states.field('contributor_state') }}
</div>
<button type="button" class="js-accordion-trigger accordion__button">Recipient committee type</button>
<div class="accordion__content">
<label class="label--help u-margin--top">When searching by recipient committee type and across multiple time periods, choose one or more fields: <br /> recipient name or ID, contributor name or ID, city, ZIP code, occupation or employer, or image number.</label>
{% import 'macros/filters/committee-types.jinja' as committee_type %}
{{ committee_type.field(committee_type='recipient_committee_type', organization_type='recipient_committee_org_type', designation='recipient_committee_designation') }}
</div>
<button type="button" class="js-accordion-trigger accordion__button">Contribution details</button>
<div class="accordion__content">
<label class="label--help u-margin--top">When searching by contribution details and across multiple time periods, choose one or more fields: <br /> ecipient name or ID, contributor name or ID, city, ZIP code, occupation, employer, or image number.</label>
{{ range.amount('amount', 'Contribution amount') }}
<div class="message message--info message--small">
<span class="t-block">Receipts are reported periodically, according to the filer's reporting schedule. Receipts are updated as they’re processed— that time can vary.</span>
Expand Down
12 changes: 6 additions & 6 deletions fec/data/templates/partials/receipts-filter.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Filter receipts
<legend class="label u-margin--top">Source details</legend>
{{ typeahead.field(name = 'contributor_name', title = 'Name or ID', dataset='committees', allow_text=True, minor_label_text = True, helper_text = 'Limit 10 source names or IDs') }}
{{ text.field(name = 'contributor_city', title = 'City', minor_label_text = True, helper_text = 'Limit 10 cities') }}
{{ states.field('contributor_state', minor_label_text = True, helper_text = 'When searching by state or territory, and across multiple time periods, choose one or more fields: recipient name or ID, source name or ID, city, ZIP code, occupation, employer, or image number.', restricted_field = True) }}
{{ text.field(name = 'contributor_zip', title = 'ZIP code', attrs = {'maxlength':5}, minor_label_text = True, helper_text = 'Limit 10 ZIP codes') }}
{{ text.field(name = 'contributor_occupation', title = 'Occupation', minor_label_text = True, helper_text = 'Use the employer field to search by occupation in reports filed before 2003. Limit 10 occupations') }}
{{ text.field(name = 'contributor_employer', title = 'Employer', minor_label_text = True, helper_text = 'Limit 10 employers') }}
Expand All @@ -42,22 +43,21 @@ Filter receipts
<div class="js-accordion accordion--neutral restricted-fields" data-content-prefix="filter" data-open-first="true">
<button type="button" class="js-accordion-trigger accordion__button">Time period</button>
<div class="accordion__content">
{{ years.cycles('two_year_transaction_period', 'Report time period', multi_time_period_label="When searching multiple time periods, choose one or more fields: recipient name or ID, source name or ID, city, ZIP code, occupation or employer, or image number.") }}
<label class="label--help u-margin--top">When searching accross multiple time periods, choose one or more fields: <br /> recipient name or ID, source name or ID, city, ZIP code, occupation, employer, or image number.</label>
{{ years.cycles('two_year_transaction_period', 'Report time period') }}
{{ date.field('date', 'Receipt date range' ) }}
</div>
<button type="button" class="js-accordion-trigger accordion__button">More source details</button>
<div class="accordion__content">
{{ states.field('contributor_state') }}
{% include 'partials/filters/unique-receipts.jinja' %}
</div>
<button type="button" class="js-accordion-trigger accordion__button">Recipient committee type</button>
<div class="accordion__content">
<label class="label--help u-margin--top">When searching by recipient committee type and across multiple time periods, choose one or more fields: <br /> recipient name or ID, source name or ID, city, ZIP code, occupation, employer, or image number.</label>
{% import 'macros/filters/committee-types.jinja' as committee_type %}
{{ committee_type.field(committee_type='recipient_committee_type', organization_type='recipient_committee_org_type', designation='recipient_committee_designation') }}
</div>
<button type="button" class="js-accordion-trigger accordion__button">Receipt details</button>
<div class="accordion__content">
<label class="label--help u-margin--top">When searching by receipt details and across multiple time periods, choose one or more fields: <br /> recipient name or ID, source name or ID, city, ZIP code, occupation, employer, or image number.</label>
{{ range.amount('amount', 'Receipt amount') }}
{% include 'partials/filters/unique-receipts.jinja' %}
{{ dropdown.select_single('line_number', 'Receipt type', options=constants.line_numbers.receipts, default='', title_prefix='Received by', forms =['Form 3','Form 3P','Form 3X'] )}}
<div class="js-line-number-message message message--info message--small">
<span class="t-block">Filters for receipt types are available only for filings from 2007 or later.</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $(function() {
useExport: true,
rowCallback: modalRenderRow,
error400Message:
'<p>You&#39;re trying to search across multiple time periods. Filter by recipient name or ID, contributor details, or image number for results.</p>',
'<p><p>You&#39;re trying to search across multiple time periods. Filter by recipient name or ID, other contributor details, or image number.</p>',
callbacks: {
afterRender: modalRenderFactory(donationTemplate)
}
Expand Down
2 changes: 1 addition & 1 deletion fec/fec/static/js/pages/datatable-receipts.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $(function() {
useExport: true,
rowCallback: modalRenderRow,
error400Message:
'<p>You&#39;re trying to search across multiple time periods. Filter by recipient name or ID, source details, or image number for results.</p>',
'<p>You&#39;re trying to search across multiple time periods. Filter by recipient name or ID, other source details, or image number.</p>',
callbacks: {
afterRender: modalRenderFactory(donationTemplate)
}
Expand Down