Skip to content

Commit

Permalink
Merge pull request #6273 from fecgov/feature/6179-6180-national-party…
Browse files Browse the repository at this point in the history
…-account

PR: 6179, 6180 national party account
  • Loading branch information
patphongs authored May 31, 2024
2 parents 11552e4 + 8624a77 commit e20a3e4
Show file tree
Hide file tree
Showing 25 changed files with 697 additions and 127 deletions.
58 changes: 55 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,51 @@
},
}

national_party_account_dropdowns = {
'account_types': OrderedDict([
('CONVENTION', 'Convention'),
('HEADQUARTERS', 'Headquarters'),
('RECOUNT', 'Recount'),
]),
'disbursements_types': OrderedDict([
('40', '40: CONVENTION ACCOUNT DISBURSEMENT'),
('40T', '40T: CONVENTION ACCOUNT REFUND - TRIBAL'),
('40Y', '40: CONVENTION ACCOUNT REFUND - INDIVIDUAL'),
('40Z', '40: CONVENTION ACCOUNT REFUND - REGISTERED FILER'),
('41', '41: HEADQUARTERS ACCOUNT DISBURSEMENT'),
('41T', '41T: HEADQUARTERS ACCOUNT REFUND - TRIBAL'),
('41Y', '41Y: HEADQUARTERS ACCOUNT REFUND - INDIVIDUAL'),
('41Z', '41Z: HEADQUARTERS ACCOUNT REFUND - REGISTERED FILER'),
('42', '42: RECOUNT ACCOUNT DISBURSEMENT'),
('42T', '42T: RECOUNT ACCOUNT REFUND - TRIBAL'),
('42Y', '42Y: RECOUNT ACCOUNT REFUND - INDIVIDUAL'),
('42Z', '42Z: RECOUNT ACCOUNT REFUND - REGISTERED FILER'),
]),
'receipt_types': OrderedDict([
('30', '30: CONVENTION ACCOUNT RECEIPT - INDIVIDUAL'),
('30E', '30E: EARMARKED - CONVENTION'),
('30F', '30F: MEMO RECEIPT FROM REGISTERED FILER - JF CONVENTION ACCOUNT'),
('30G', '30G: TRANSFER IN - CONVENTION ACCOUNT'),
('30J', '30J: MEMO RECEIPT FROM INDIVIDUAL - JF CONVENTION ACCOUNT'),
('30K', '30K: CONVENTION ACCOUNT RECEIPT - REGISTERED FILER'),
('30T', '30T: CONVENTION ACCOUNT RECEIPT - TRIBAL'),
('31', '31: HEADQUARTERS ACCOUNT RECEIPT - INDIVIDUAL'),
('31E', '31E: EARMARKED - HEADQUARTERS'),
('31F', '31F: MEMO RECEIPT FROM REGISTERED FILER - JF HEADQUARTERS ACCOUNT'),
('31G', '31G: TRANSFER IN - HEADQUARTERS ACCOUNT'),
('31J', '31J: MEMO RECEIPT FROM INDIVIDUAL - JF HEADQUARTERS ACCOUNT'),
('31K', '31K: HEADQUARTERS ACCOUNT RECEIPT - REGISTERED FILER'),
('31T', '31T: HEADQUARTERS ACCOUNT RECEIPT - TRIBAL'),
('32', '32: RECOUNT ACCOUNT RECEIPT - INDIVIDUAL'),
('32E', '32E: EARMARKED - RECOUNT'),
('32F', '32F: MEMO RECEIPT FROM REGISTERED FILER - JF RECOUNT ACCOUNT'),
('32G', '32G: TRANSFER IN - RECOUNT ACCOUNT'),
('32J', '32J: MEMO RECEIPT FROM INDIVIDUAL - JF RECOUNT ACCOUNT'),
('32K', '32K: RECOUNT ACCOUNT RECEIPT - REGISTERED FILER'),
('32T', '32T: 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 +756,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() -%}

{% 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
30 changes: 29 additions & 1 deletion fec/data/templates/macros/filters/dropdown-json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@ data-validate="false" data-modifies-filter="{{ name }}" data-required-default="{
</div>
{% endmacro %}


{#
@param {string} name - Used in <label for="{name}"><input id="{name}" name="{name}"
@param {string} label - Used in <label>{label}</label> and <label>Limit 1 {label}</label>
@param {list} options[] - The data used for <optgroup label="{}">
@param {list} options[][] - The data used for <optgroup><option value="{}" data-line-type="{}">{}</option>
@param {*} [default=none] - unused
@param {*} [selected={}] - unused
@param {string} [title_prefix=''] - Used in <optgroup label="{title_prefix} …">
@param {list} [forms=[]] - Used in <optgroup label="… {forms[loop.index-1]}"></optgroup>
#}
{% macro select_single(name, label, options={}, default=none, selected={}, title_prefix='', forms=[]) %}
<div class="filter js-filter js-filter-control" data-filter="select" data-name="{{ name }}" data-validate="false" data-modifies-filter="{{ name }}">
<label for="{{ name }}" class="label">{{ label }}</label>
Expand All @@ -40,3 +49,22 @@ data-validate="false" data-modifies-filter="{{ name }}" data-required-default="{
</select>
</div>
{% endmacro %}

{#
@param {string} name - Used in <label for="{name}"><input id="{name}" name="{name}"
@param {string} label - Used in <label>{label}</label> and <label>Limit 1 {label}</label>
@param {list} options[] - The data used for <option value="{}">{}</option>
#}
{% macro select_single_flat_list(name, label, options={}) %}
<div class="filter js-filter js-filter-control" data-filter="select" data-name="{{ name }}" data-validate="false" data-modifies-filter="{{ name }}">
<label for="{{ name }}" class="label">{{ label }}</label>
<label class="label--help u-margin--top">Limit 1 {{ label | lower }}</label>
<select id={{ name }} name="{{ name }}" data-filter-change="true" data-removeable-filter="true">
<option value=''>More</option>
{% for itemValue, itemLabel in options.items() %}
<option value={{itemValue}} data-line-type="">{{ itemLabel }}</option>
{% endfor %}
</optgroup>
</select>
</div>
{% endmacro %}
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
================================================== -#}
<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') }}">
Loading

0 comments on commit e20a3e4

Please sign in to comment.