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

PR: 6179, 6180 national party account #6273

Merged
merged 24 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f963c22
NatPartyAcct - add feature flags
rfultz May 17, 2024
a9ed727
Tidying page code appearance
rfultz May 17, 2024
3b48617
Fixing typos
rfultz May 17, 2024
6c80453
NatPartyAcct - create constants
rfultz May 17, 2024
b6fb4e8
NatPartyAcct - create receipts templates, filters
rfultz May 17, 2024
50d8461
NatPartyAcct - create disbursements templates, filters
rfultz May 17, 2024
42149c8
NatPartyAcct - add links to /data/browse-data/
rfultz May 17, 2024
136b6dc
NatPartyAcct - define URLs
rfultz May 17, 2024
94e0ff7
Tidying page code appearance
rfultz May 21, 2024
461958f
Pytest errors, formatting
rfultz May 29, 2024
ad8a575
National Party Accounts - add tests
rfultz May 29, 2024
3145a11
Merge branch 'develop' into feature/6179-6180-national-party-account
rfultz May 29, 2024
b6fdb69
National Party Accounts - PR feedback
rfultz May 29, 2024
ffdf638
National Party Accounts PR updates
rfultz May 29, 2024
69000c7
dropdown.select_single documentation
rfultz May 30, 2024
d542249
Create dropdown.select_single_flat_list
rfultz May 30, 2024
5a71839
Make select-filter line-type prefix conditional
rfultz May 30, 2024
b2ba77a
Formatting
rfultz May 30, 2024
6183fbb
National party accounts PR feedback
rfultz May 30, 2024
38c988b
Created a stringsMatch helper
rfultz May 30, 2024
841d80c
Documentation
rfultz May 30, 2024
bca812a
National Party Accounts - link committee_id values where we can
rfultz May 30, 2024
3e9159e
Formatting
rfultz May 30, 2024
8624a77
National party accounts - recipient name can be text
rfultz May 31, 2024
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
67 changes: 64 additions & 3 deletions fec/data/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@
('AA', 'Armed Forces Americas'),
('AE', 'Armed Forces Europe'),
('AP', 'Armed Forces Pacific'),
('ZZ', 'Foreign Countries'), }).items(), key=operator.itemgetter(1)))
('ZZ', 'Foreign Countries'),
}).items(), key=operator.itemgetter(1)))

parties = OrderedDict([
('DEM', 'Democratic Party'),
Expand Down Expand Up @@ -478,6 +479,11 @@
['Filer', 'Report type', 'Version', 'Receipt date', 'Coverage end date', 'Total contributions',
'Total independent expenditures']),
('audit', ['Committee name', 'Election cycle', 'Final report', 'Findings and issues', 'Candidate']),
('national-party-account-receipts',
['Recipient', 'Source', 'Party account', 'Date', 'Amount']),
('national-party-account-disbursements',
['Spender name', 'Recipient', 'Party account', 'Description', 'Date', 'Amount']),
('debts', ['Committee name', 'Creditor/Debtor name', 'Beginning balance', 'Ending balance', 'Coverage end date']),
])

line_numbers = {
Expand Down Expand Up @@ -549,7 +555,8 @@
('F3X-23', 'Line 23: Contributions to federal candidates/committees and other political committees'),
('F3X-26', 'Line 26: Loan repayments made'),
('F3X-27', 'Line 27: Loans made'),
('F3X-28A', 'Line 28a: Refunds of contributions made to individuals/persons other than political committees'),
('F3X-28A',
'Line 28a: Refunds of contributions made to individuals/persons other than political committees'),
('F3X-28B', 'Line 28b: Refunds of contributions to political party committees'),
('F3X-28C', 'Line 28c: Refunds of contributions to other political committees'),
('F3X-28D', 'Line 28d: Total contributions refunds'),
Expand All @@ -573,6 +580,60 @@
},
}

national_party_account_keys = ['k', 'label']

national_party_account_dropdowns = {
'account_types': [
{'k': '', 'label': 'More'},
{'k': 'CONVENTION', 'label': 'Convention'},
{'k': 'HEADQUARTERS', 'label': 'Headquarters'},
{'k': 'RECOUNT', 'label': 'Recount'},
],
'disbursements_line_numbers': [
{'k': '', 'label': 'More'},
{'k': 'F3X-29', 'label': 'Form 3X, line 29'},
patphongs marked this conversation as resolved.
Show resolved Hide resolved
],
'disbursements_types': [
{'k': '', 'label': 'More'},
{'k': '40', 'label': 'CONVENTION ACCOUNT DISBURSEMENT'},
{'k': '40T', 'label': 'CONVENTION ACCOUNT REFUND - TRIBAL'},
{'k': '40Y', 'label': 'CONVENTION ACCOUNT REFUND - INDIVIDUAL'},
{'k': '40Z', 'label': 'CONVENTION ACCOUNT REFUND - REGISTERED FILER'},
{'k': '41', 'label': 'HEADQUARTERS ACCOUNT DISBURSEMENT'},
{'k': '41T', 'label': 'HEADQUARTERS ACCOUNT REFUND - TRIBAL'},
{'k': '41Y', 'label': 'HEADQUARTERS ACCOUNT REFUND - INDIVIDUAL'},
{'k': '41Z', 'label': 'HEADQUARTERS ACCOUNT REFUND - REGISTERED FILER'},
{'k': '42', 'label': 'RECOUNT ACCOUNT DISBURSEMENT'},
{'k': '42T', 'label': 'RECOUNT ACCOUNT REFUND - TRIBAL'},
{'k': '42Y', 'label': 'RECOUNT ACCOUNT REFUND - INDIVIDUAL'},
{'k': '42Z', 'label': 'RECOUNT ACCOUNT REFUND - REGISTERED FILER'},
],
'receipt_types': [
{'k': '', 'label': 'More'},
{'k': '30', 'label': 'CONVENTION ACCOUNT RECEIPT - INDIVIDUAL'},
{'k': '30E', 'label': 'EARMARKED – CONVENTION'},
{'k': '30F', 'label': 'MEMO RECEIPT FROM REGISTERED FILER - JF CONVENTION ACCOUNT'},
{'k': '30G', 'label': 'TRANSFER IN - CONVENTION ACCOUNT'},
{'k': '30J', 'label': 'MEMO RECEIPT FROM INDIVIDUAL - JF CONVENTION ACCOUNT'},
{'k': '30K', 'label': 'CONVENTION ACCOUNT RECEIPT - REGISTERED FILER'},
{'k': '30T', 'label': 'CONVENTION ACCOUNT RECEIPT - TRIBAL'},
{'k': '31', 'label': 'HEADQUARTERS ACCOUNT RECEIPT- INDIVIDUAL'},
{'k': '31E', 'label': 'EARMARKED – HEADQUARTERS'},
{'k': '31F', 'label': 'MEMO RECEIPT FROM REGISTERED FILER - JF HEADQUARTERS ACCOUNT'},
{'k': '31G', 'label': 'TRANSFER IN - HEADQUARTERS ACCOUNT'},
{'k': '31J', 'label': 'MEMO RECEIPT FROM INDIVIDUAL - JF HEADQUARTERS ACCOUNT'},
{'k': '31K', 'label': 'HEADQUARTERS ACCOUNT RECEIPT - REGISTERED FILER'},
{'k': '31T', 'label': 'HEADQUARTERS ACCOUNT RECEIPT - TRIBAL'},
{'k': '32', 'label': 'RECOUNT ACCOUNT RECEIPT- INDIVIDUAL'},
{'k': '32E', 'label': 'EARMARKED – RECOUNT'},
{'k': '32F', 'label': 'MEMO RECEIPT FROM REGISTERED FILER - JF RECOUNT ACCOUNT'},
{'k': '32G', 'label': 'TRANSFER IN - RECOUNT ACCOUNT'},
{'k': '32J', 'label': 'MEMO RECEIPT FROM INDIVIDUAL - JF RECOUNT ACCOUNT'},
{'k': '32K', 'label': 'RECOUNT ACCOUNT RECEIPT- REGISTERED FILER'},
{'k': '32T', 'label': 'RECOUNT ACCOUNT RECEIPT - TRIBAL'},
]
}


# RAISING_FORMATTER, SPENDING_FORMATTER, CASH_FORMATTER, IE_FORMATTER
# These are used to format the display of financial summary data on committee pages
Expand Down Expand Up @@ -704,7 +765,7 @@
'label': 'Allocated operating expenditures - federal share',
'level': '3',
'type': {'link': 'allocated-federal-nonfederal-disbursements'},
}),
}),
('shared_nonfed_operating_expenditures', # F3X, H4
{
'label': 'Allocated operating expenditures - nonfederal share',
Expand Down
8 changes: 3 additions & 5 deletions fec/data/templates/datatable.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
{% set breadcrumbs_title=title %}
{% set breadcrumbs=[('/data/browse-data/', 'Browse data')] %}

{% block title %}
Browse {{ title }}
{% endblock %}
{% block title %}Browse {{ title }}{% endblock %}

{% block css %}
{% block css -%}
<link rel="stylesheet" type="text/css" href="{{ asset_for_css('datatables.css') }}" />
{% endblock %}
{%- endblock %}

{% block body %}

Expand Down
30 changes: 15 additions & 15 deletions fec/data/templates/layouts/main.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
<html lang="en">
<head>

<title>{% block title %}{% endblock %} | FEC </title>
{% set title = self.title() %}
<title>{% block title %}{% endblock %} | FEC</title>
{%- set title = self.title() -%}
patphongs marked this conversation as resolved.
Show resolved Hide resolved

{% include 'partials/meta-tags.jinja' %}
{% if (FEC_CMS_ENVIRONMENT == 'PRODUCTION') %}
{%- include 'partials/meta-tags.jinja' -%}
{% if (FEC_CMS_ENVIRONMENT == 'PRODUCTION') -%}
{% include 'partials/meta-tags-preconnects.jinja' %}
{% endif %}
{%- endif %}

{% block css %}
<link rel="stylesheet" type="text/css" href="{{ asset_for_css('base.css') }}" />
{% endblock css %}

{% block head_js %}
<script>
var canSkipPolyfills = ('fetch' in window && 'assign' in Object);
if (!canSkipPolyfills) {
var pfScriptElem = document.createElement('script');
pfScriptElem.async = false;
pfScriptElem.src = '{{ asset_for_js('polyfills.js') }}';
document.head.appendChild(pfScriptElem);
}
</script>
{% block head_js -%}
<script>
var canSkipPolyfills = ('fetch' in window && 'assign' in Object);
if (!canSkipPolyfills) {
var pfScriptElem = document.createElement('script');
pfScriptElem.async = false;
pfScriptElem.src = '{{ asset_for_js('polyfills.js') }}';
document.head.appendChild(pfScriptElem);
}
</script>
{% endblock %}

{% include 'partials/google-tag-manager-script.jinja' %}
Expand Down
9 changes: 9 additions & 0 deletions fec/data/templates/partials/browse-data/raising.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
<p>Search individual contributions to see who is donating to candidates and committees. Search for contributors by name, location, employer and occupation.</p>
</div>
</li>
{%- if FEATURES.nat_party_acct_receipts -%}
<li>
<i class="icon i-magnifying-glass icon--absolute--left"></i>
<div class="content__section--indent-left">
<h4><a href="/data/national-party-account-receipts/">National party account receipts</a></h4>
<p>Search contributions to <span class="term" data-term="national party committee" title="Click to define" tabindex="0">national party committee accounts</span> including presidential nominating conventions, national party headquarters buildings, and election recounts and contests and other legal proceedings accounts. Search for contributsions by name, location, employer and occupation and party account.</p>
</div>
</li>
{%- endif -%}
<li>
<div class="content__section--indent-left">
<h4>Lobbyist bundled contributions</h4>
Expand Down
9 changes: 9 additions & 0 deletions fec/data/templates/partials/browse-data/spending.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@
<p>Search <span class="term" data-term="coordinated party expenditure" title="Click to define" tabindex="0">party coordinated expenditures</span> by specific national or state party committee, candidate and payee.</p>
</div>
</li>
{%- if FEATURES.nat_party_acct_disbursements -%}
<li>
<i class="icon i-magnifying-glass icon--absolute--left"></i>
<div class="content__section--indent-left">
<h4><a href="/data/national-party-account-disbursements/">National party account disbursements</a></h4>
<p>Search disbursements made from <span class="term" data-term="national party committee" title="Click to define" tabindex="0">national party committee accounts</span> including presidential nominating conventions, national party headquarters buildings, and election recounts and contests and other legal proceedings accounts. Search by recipient, purpose, amount, date and party account.</p>
</div>
</li>
{%- endif -%}
{% if FEATURES.h4_allocated_disbursements %}
<li>
<i class="icon i-magnifying-glass icon--absolute--left"></i>
Expand Down
2 changes: 1 addition & 1 deletion fec/data/templates/partials/disbursements-filter.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Filter disbursements
<div class="accordion__content">
{{ text.field('disbursement_description', 'Description') }}
{{ range.amount('amount', 'Disbursement amount') }}
{{ dropdown.select_single( 'line_number', 'Disbursement type', options=constants.line_numbers.disbursements, default='', title_prefix='Made by', forms=['Form 3','Form 3P','Fotm 3X']) }}
{{ dropdown.select_single( 'line_number', 'Disbursement type', options=constants.line_numbers.disbursements, default='', title_prefix='Made 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 disbursement types are available only for filings from 2007 or later.</span>
</div>
Expand Down
95 changes: 47 additions & 48 deletions fec/data/templates/partials/meta-tags.jinja
Original file line number Diff line number Diff line change
@@ -1,51 +1,50 @@
{% if parent == 'legal' %}
{% set description = "Clarify campaign finance legal requirements on the new fec.gov. Search across advisory opinions, closed Matters Under Review, statutes, and regulations all at once, with search results designed to help you find what you need quickly." %}
{%- set description = "Clarify campaign finance legal requirements on the new fec.gov. Search across advisory opinions, closed Matters Under Review, statutes, and regulations all at once, with search results designed to help you find what you need quickly." %}
{% else %}
{% set description = "Explore current and historic federal campaign finance data on the new fec.gov. Look at totals and trends, and see how candidates and committees raise and spend money. When you find what you need, export results and save custom links." %}
{%- set description = "Explore current and historic federal campaign finance data on the new fec.gov. Look at totals and trends, and see how candidates and committees raise and spend money. When you find what you need, export results and save custom links." %}
{% endif %}

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="{{ description }}">

<!-- Mobile Specific Metas
================================================== -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5">

<!-- Twitter
================================================== -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ title | trim }} - FEC.gov">
<meta name="twitter:description" content="{{ description }}">
<meta name="twitter:image" content="{{ get_social_image_path(social_image_identifier) }}">

<!-- Facebook
================================================== -->
<meta property="og:type" content="website">
<meta property="og:url" content="{{ CANONICAL_BASE }}{{ request.path }}">
<meta property="og:title" content="{{ title | trim }} - FEC.gov">
<meta property="og:site_name" content="FEC.gov">
<meta property="og:description" content="{{ description }}">
<meta property="og:image" content="{{ get_social_image_path(social_image_identifier) }}">

<!-- Google
================================================== -->
<link rel="canonical" href="{{ CANONICAL_BASE }}">

<!-- Favicons
================================================== -->
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="{{ static('img/favicon/data/apple-touch-icon-57x57.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="{{ static('img/favicon/data/apple-touch-icon-72x72.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="{{ static('img/favicon/data/apple-touch-icon-114x114.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="{{ static('img/favicon/data/apple-touch-icon-120x120.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="{{ static('img/favicon/data/apple-touch-icon-144x144.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="{{ static('img/favicon/data/apple-touch-icon-152x152.png') }}">

<link rel="icon" type="image/png" href="{{ static('img/favicon/favicon-32x32.png') }}" sizes="32x32">
<link rel="icon" type="image/png" href="{{ static('img/favicon/favicon-16x16.png') }}" sizes="16x16">

<meta name="application-name" content="&nbsp;">
<meta name="msapplication-TileColor" content="#FFFFFF">
<meta name="msapplication-TileImage" href="{{ static('img/favicon/data/mstile-144x144.png') }}">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="{{ description }}">

{# Mobile Specific Metas
================================================== -#}
patphongs marked this conversation as resolved.
Show resolved Hide resolved
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5">

{# Twitter
================================================== -#}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ title | trim }} - FEC.gov">
<meta name="twitter:description" content="{{ description }}">
<meta name="twitter:image" content="{{ get_social_image_path(social_image_identifier) }}">

{# Facebook
================================================== -#}
<meta property="og:type" content="website">
<meta property="og:url" content="{{ CANONICAL_BASE }}{{ request.path }}">
<meta property="og:title" content="{{ title | trim }} - FEC.gov">
<meta property="og:site_name" content="FEC.gov">
<meta property="og:description" content="{{ description }}">
<meta property="og:image" content="{{ get_social_image_path(social_image_identifier) }}">

{# Google
================================================== -#}
<link rel="canonical" href="{{ CANONICAL_BASE }}">

{# Favicons
================================================== -#}
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="{{ static('img/favicon/data/apple-touch-icon-57x57.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="{{ static('img/favicon/data/apple-touch-icon-72x72.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="{{ static('img/favicon/data/apple-touch-icon-114x114.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="{{ static('img/favicon/data/apple-touch-icon-120x120.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="{{ static('img/favicon/data/apple-touch-icon-144x144.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="{{ static('img/favicon/data/apple-touch-icon-152x152.png') }}">

<link rel="icon" type="image/png" href="{{ static('img/favicon/favicon-32x32.png') }}" sizes="32x32">
<link rel="icon" type="image/png" href="{{ static('img/favicon/favicon-16x16.png') }}" sizes="16x16">

<meta name="application-name" content="&nbsp;">
<meta name="msapplication-TileColor" content="#FFFFFF">
<meta name="msapplication-TileImage" href="{{ static('img/favicon/data/mstile-144x144.png') }}">
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{% extends 'partials/filters.jinja' %}

{% import 'macros/filters/text.jinja' as text %}
{% import 'macros/filters/typeahead-filter.jinja' as typeahead %}

{% import 'macros/filters/contributor-states.jinja' as states %}
{% import 'macros/filters/date.jinja' as date %}
{% import 'macros/filters/years.jinja' as years %}
{% import 'macros/filters/range.jinja' as range %}

{% import 'macros/filters/dropdown-json.jinja' as dropdown %}
{% import 'macros/filters/committee-types.jinja' as committee_type %}


{% block heading %}
Filter national party account disbursements
{% endblock %}

{% block filters %}
<div class="filters__inner">
{{ typeahead.field('committee_id', 'Spender name or ID') }}
{{ text.field('recipient_name', 'Recipient name or ID') }}
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be a typeahead.field so that they can select a committee if it's there. Or just search by the name without selecting from the list.

{{ years.cycles('two_year_transaction_period', 'Report time period', show_tooltip=True) }}
patphongs marked this conversation as resolved.
Show resolved Hide resolved
{{ date.field('disbursement_date', 'Disbursement date range') }}
</div>
<div class="js-accordion accordion--neutral restricted-fields" data-content-prefix="filter" data-open-first="false">
<button type="button" class="js-accordion-trigger accordion__button">Recipient details</button>
<div class="accordion__content">
{{ text.field('recipient_city', 'City') }}
{{ states.field('recipient_state') }}
{{ text.field(name = 'recipient_zip', title = 'ZIP code', attrs = {'maxlength':5}, minor_label_text = True, helper_text = 'Limit 10 ZIP codes') }}
{{ text.field('image_number', 'CANT: Image number') }}
patphongs marked this conversation as resolved.
Show resolved Hide resolved
</div>
<button type="button" class="js-accordion-trigger accordion__button">Recipient committee type</button>
<div class="accordion__content">
{{ committee_type.field(committee_type='recipient_committee_type', organization_type='recipient_committee_org', designation='spender_committee_designation', display_authorized_committee_filter=True, display_default_other_committees_filter=True, display_parties_only_filter=False) }}
</div>
<button type="button" class="js-accordion-trigger accordion__button">Disbursement details</button>
<div class="accordion__content">
{{ range.amount('disbursement_amount', 'Disbursement amount') }}
{{ dropdown.select_json( 'line_number', 'Line number', keys=constants.national_party_account_keys, options=constants.national_party_account_dropdowns.disbursements_line_numbers, default='false') }}
{{ dropdown.select_json( 'disbursement_type', 'National party account disbursement type', keys=constants.national_party_account_keys, options=constants.national_party_account_dropdowns.disbursements_types, default='false') }}
{{ dropdown.select_json( 'party_account_type', 'National party account', keys=constants.national_party_account_keys, options=constants.national_party_account_dropdowns.account_types, default='false') }}
</div>
</div>
{% endblock %}
Loading