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

Summary data tables #4088

Merged
merged 15 commits into from
Oct 13, 2020
Merged

Summary data tables #4088

merged 15 commits into from
Oct 13, 2020

Conversation

johnnyporkchops
Copy link
Contributor

@johnnyporkchops johnnyporkchops commented Sep 30, 2020

Summary

  • Implement filterable campaign finance data summary section and committee type tables.
  • Create filter capability based on two year period and data summary segment
  • Should be able to click on a link to come to a pre-filtered table by two year period and data summary segment
  • The latest available time-period for the current year(this year) is set by putting the selected attribute on that segment select option in each Wagtail page. Any later time-period options will then be visibly disabled for the current year.
  • Resolves Implement filterable campaign finance data summaries  #3943
  • Creates new option to conditionally load JS when publishing a Wagtail CustomPage (This could be repurposed for Admin-fines.js which gets loaded in Base template now, and also for FullWidth page template that always loads reporting-dates.js script now)

Blocking: #3958

Related PR: #4018

Impacted areas of the application

new file: fec/static/js/pages/statistical-summary.js
new file: home/migrations/0110_auto_20200930_1419.py
modified: home/models.py
modified: home/templates/home/custom_page.html
modified: fec/static/scss/components/_table-styles.scss
modified: fec/fec/constants.py
reverted: tasks.py

Screenshots

Screen Shot 2020-10-06 at 9 54 51 PM

Related PRs

WIP #4079

How to test

Content team
This is on feature:
https://fec-feature-cms.app.cloud.gov/campaign-finance-data/congressional-candidate-data-summary-tables
You can test building a Wagtail page using the instructions below.

Developers:

  • checkout feature/3943-summary-data-tables
  • npm run build
  • ./manage.py migrate
  • ./manage.py runserver
  • Login to Wagtail locally http://localhost:8000/admin -or- 127.0.0.1:8000/admin/
  • Navigate to Pages > Campaign finance data on left hand nav in Wagtail explorer
  • Create a child CustomPage
  • Go to Settings tab and choose statistical_summary.js for Conditional_JS dropdown
  • Build the Summary data table page using three html blocks using the sections provided below
    --OR-- use a page on feature as a model. Example: https://fec-feature-cms.app.cloud.gov/admin/pages/11032/edit/
  • Publish the page and test
    Suggested tests:
    • Confirm that statistical-summary.js does not get included in other pages using CustomPage template.
    • Confirm URL querystring parameters are correct for each year or time-period select
    • Confirm sharable link feature works by copy-pasting a link into another browser
    • check the URLs of the EXCEL and PDF links to make sure they work and are valid
    • Test back/ forward button
    • Could also test the current year(this year) latest-available-option by changing the selected attribute on the time-period select in Wagtail and confirm that later time-periods options become disabled for this year. If you are on another year with a later time-period selected, and switch back to this year, you should see an alert under the selects.

Three html blocks for Wagtail CustomPage:

Selects

<div class="filter-controls">
<div class="filter_year">
<label for="year" class="label">Two-year period</label>
<select id="year" name="year"> 
        <option selected value="2020">2019-2020</option>
	<option value="2018">2017-2018</option>
	<option value="2016">2015-2016</option>
	<option value="2014">2013-2014</option>
	<option value="2012">2011-2012</option>
        <option value="2010">2009-2010</option>
	<option value="2008">2007-2008</option>
	<option value="2006">2005-2006</option>
        <option value="2004">2003-2004</option>
	<option value="2002">2001-2002</option>
	<option value="2000">1999-2000</option>
	<option value="1998">1997-1998</option>
	<option value="1996">1995-1996</option>
	<option value="1994">1993-1994</option>
	<option value="1992">1991-1992</option>
	<option value="1990">1989-1990</option>
</select>
</div>
<div class="filter_segment">
<label for="segment" class="label">Coverage period</label>
<select id="segment" name="segment">
        <option value="24">24 Month</option>
        <option value="21">21 Month</option>
        <option  selected value="18">18 Month</option>
        <option  value="15">15 Month</option>
        <option value="12">12 Month</option>
        <option value="6">6 Month</option>
</select>
</div>
</div>
<span  class="u-no-margin-bottom" id="js-latest-segment-alert"></span>

Table 1
<table id="type_1" data-summary="congressional">
    <thead>
	<tr>
		<td colspan="4">
          <h3 class="tableTitle">2019-2020 18M Election Cycle Data Summaries</h3>
		  <span class="press-link"></span>
		</td>
	</tr>
     </thead>
    <thead>
       <tr class="column-headers">
        <td><strong>Table</strong></td>
        <td width="75%"><strong>Description</strong></td>
        <td colspan="2"><i class="icon i-download icon--absolute--left"></i><strong>Export</strong></td>
      </tr>
    </thead>
  <tbody>
    <tr>
      <td>1</td>
      <td>House and Senate Financial Activity</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand1_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand1_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>2</td>
      <td>Financial Activity of Senate Candidates</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand2_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand2_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>3</td>
      <td>Financial Activity of House Candidates</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand3_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand3_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>4</td>
      <td>Median Activity of Senate and House Candidates</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand4_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand4_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>5</td>
      <td>Six-Year Financial Summary of Senate Campaigns</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand5_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand5_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>6a</td>
      <td>Top 50 Senate Campaigns by Receipts</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand6a_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand6a_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>6b</td>
      <td>Top 50 Senate Campaigns by Contributions from Individuals</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand6b_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand6b_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>6c</td>
      <td>Top 50 Senate Campaigns by Contributions from PACs and Other Committees</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand6c_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand6c_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>6d</td>
      <td>Top 50 Senate Campaigns by Contributions and Loans from the Candidate</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand6d_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand6d_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>6e</td>
      <td>Top 50 Senate Campaigns by Disbursements</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand6e_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand6e_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>6f</td>
      <td>Top 50 Senate Campaigns by Cash on Hand</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand6f_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand6f_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>6g</td>
      <td>Top 50 Senate Campaigns by Debt Owed</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand6g_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand6g_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>7</td>
      <td>House Campaign Activity by State and District</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand7_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand7_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>8a</td>
      <td>Top 50 House Campaigns by Receipts</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand8a_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand8a_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>8b</td>
      <td>Top 50 House Campaigns by Contributions from Individuals</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand8b_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand8b_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>8c</td>
      <td>Top 50 House Campaigns by Contributions from PACs and Other Committees</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand8c_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand8c_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>8d</td>
      <td>Top 50 House Campaigns by Contributions and Loans from the Candidate</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand8d_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand8d_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>8e</td>
      <td>Top 50 House Campaigns by Disbursements</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand8e_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand8e_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>8f</td>
      <td>Top 50 House Campaigns by Cash on Hand</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand8f_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand8f_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>8g</td>
      <td>Top 50 House Campaigns by Debt Owed</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand8g_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand8g_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>9a</td>
      <td>Top 50 House IncumbentCampaigns by Receipts</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand9a_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand9a_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>9b</td>
      <td>Top 50 House IncumbentCampaigns by Contributions from Individuals</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand9b_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand9b_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>9c</td>
      <td>Top 50 House IncumbentCampaigns by Contributions from PACs and Other Committees</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand9c_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand9c_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>9d</td>
      <td>Top 50 House IncumbentCampaigns by Contributions and Loans from the Candidate</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand9d_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand9d_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>9e</td>
      <td>Top 50 House IncumbentCampaigns by Disbursements</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand9e_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand9e_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>9f</td>
      <td>Top 50 House IncumbentCampaigns by Cash on Hand</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand9f_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand9f_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>9g</td>
      <td>Top 50 House IncumbentCampaigns by Debt Owed</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand9g_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand9g_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>10a</td>
      <td>Top 50 House ChallengerCampaigns by Receipts</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand10a_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand10a_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>10b</td>
      <td>Top 50 House ChallengerCampaigns by Contributions from Individuals</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand10b_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand10b_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>10c</td>
      <td>Top 50 House ChallengerCampaigns by Contributions from PACs and Other Committees</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand10c_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand10c_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>10d</td>
      <td>Top 50 House ChallengerCampaigns by Contributions and Loans from the Candidate</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand10d_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand10d_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>10e</td>
      <td>Top 50 House ChallengerCampaigns by Disbursements</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand10e_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand10e_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>10f</td>
      <td>Top 50 House ChallengerCampaigns by Cash on Hand</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand10f_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand10f_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>10g</td>
      <td>Top 50 House ChallengerCampaigns by Debt Owed</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand10g_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand10g_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>11a</td>
      <td>Top 50 House Open SeatCampaigns by Receipts</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand11a_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand11a_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>11b</td>
      <td>Top 50 House Open Seat Campaigns by Contributions from Individuals</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand11b_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand11b_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>11c</td>
      <td>Top 50 House Open Seat Campaigns by Contributions from PACs and Other Committees</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand11c_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand11c_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>11d</td>
      <td>Top 50 House Open Seat Campaigns by Contributions and Loans from the Candidate</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand11d_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand11d_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>11e</td>
      <td>Top 50 House Open Seat Campaigns by Disbursements</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand11e_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand11e_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>11f</td>
      <td>Top 50 House Open Seat Campaigns by Cash on Hand</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand11f_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand11f_2020_15m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>11g</td>
      <td>Top 50 House Open Seat Campaigns by Debt Owed</td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand11g_2020_15m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2020/tables/congressional/ConCand11g_2020_15m.pdf">pdf</a></td>
    </tr>
  </tbody>
</table>

Table 2
<table id="type_2" data-summary="congressional">
    <thead>
	<tr>
		<td colspan="4">
			<h3 class="tableTitle">2009-2010 24M Election Cycle Data Summaries</h3>
		    <span class="press-link"></span>
		</td>
	</tr>
     </thead>
    <thead>
       <tr class="column-headers">
        <td><strong>Table</strong></td>
        <td width="75%"><strong>Description</strong></td>
        <td colspan="2"><i class="icon i-download icon--absolute--left"></i><strong>Export</strong></td>
      </tr>
    </thead>
  <tbody>
    <tr>
      <td>1</td>
      <td>House and Senate Financial Activity</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand1_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand1_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>2</td>
      <td>Senate Campaign Financial Activity by State</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand2_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand2_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>3a</td>
      <td>Top 50 Senate Campaigns by Receipts</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand3a_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand3a_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>3b</td>
      <td>Top 50 Senate Campaigns by Contributions from Individuals</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand3b_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand3b_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>3c</td>
      <td>Top 50 Senate Campaigns by Contributions from PACs and Other Committees</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand3c_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand3c_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>3d</td>
      <td>Top 50 Senate Campaigns by Contributions and Loans from the Candidate</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand3d_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand3d_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>3e</td>
      <td>Top 50 Senate Campaigns by Disbursements</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand3e_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand3e_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>3f</td>
      <td>Top 50 Senate Campaigns by Cash on Hand</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand3f_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand3f_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>3g</td>
      <td>Top 50 Senate Campaigns by Debt Owed</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand3g_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand3g_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>4</td>
      <td>House Campaign Financial Activity by State and District</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand4_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand4_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>5a</td>
      <td>Top 50 House Campaigns by Receipts</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand5a_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand5a_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>5b</td>
      <td>Top 50 House Campaigns by Contributions from Individuals</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand5b_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand5b_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>5c</td>
      <td>Top 50 House Campaigns by Contributions from PACs and Other Committees</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand5c_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand5c_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>5d</td>
      <td>Top 50 House Campaigns by Contributions and Loans from the Candidate</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand5d_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand5d_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>5e</td>
      <td>Top 50 House Campaigns by Disbursements</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand5e_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand5e_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>5f</td>
      <td>Top 50 House Campaigns by Cash on Hand</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand5f_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand5f_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>5g</td>
      <td>Top 50 House Campaigns by Debt Owed</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand5g_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand5g_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>6a</td>
      <td>Top 50 House IncumbentCampaigns by Receipts</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand6a_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand6a_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>6b</td>
      <td>Top 50 House IncumbentCampaigns by Contributions from Individuals</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand6b_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand6b_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>6c</td>
      <td>Top 50 House IncumbentCampaigns by Contributions from PACs and Other Committees</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand6c_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand6c_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>6d</td>
      <td>Top 50 House IncumbentCampaigns by Contributions and Loans from the Candidate</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand6d_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand6d_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>6e</td>
      <td>Top 50 House IncumbentCampaigns by Disbursements</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand6e_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand6e_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>6f</td>
      <td>Top 50 House IncumbentCampaigns by Cash on Hand</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand6f_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand6f_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>6g</td>
      <td>Top 50 House IncumbentCampaigns by Debt Owed</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand6g_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand6g_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>7a</td>
      <td>Top 50 House ChallengerCampaigns by Receipts</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand7a_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand7a_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>7b</td>
      <td>Top 50 House ChallengerCampaigns by Contributions from Individuals</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand7b_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand7b_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>7c</td>
      <td>Top 50 House ChallengerCampaigns by Contributions from PACs and Other Committees</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand7c_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand7c_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>7d</td>
      <td>Top 50 House ChallengerCampaigns by Contributions and Loans from the Candidate</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand7d_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand7d_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>7e</td>
      <td>Top 50 House ChallengerCampaigns by Disbursements</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand7e_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand7e_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>7f</td>
      <td>Top 50 House ChallengerCampaigns by Cash on Hand</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand7f_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand7f_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>7g</td>
      <td>Top 50 House ChallengerCampaigns by Debt Owed</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand7g_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand7g_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>8a</td>
      <td>Top 50 House Open SeatCampaigns by Receipts</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand8a_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand8a_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>8b</td>
      <td>Top 50 House Open Seat Campaigns by Contributions from Individuals</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand8b_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand8b_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>8c</td>
      <td>Top 50 House Open Seat Campaigns by Contributions from PACs and Other Committees</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand8c_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand8c_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>8d</td>
      <td>Top 50 House Open Seat Campaigns by Contributions and Loans from the Candidate</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand8d_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand8d_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>8e</td>
      <td>Top 50 House Open Seat Campaigns by Disbursements</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand8e_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand8e_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>8f</td>
      <td>Top 50 House Open Seat Campaigns by Cash on Hand</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand8f_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand8f_2010_24m.pdf">pdf</a></td>
    </tr>
    <tr>
      <td>8g</td>
      <td>Top 50 House Open Seat Campaigns by Debt Owed</td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand8g_2010_24m.xlsx">excel</a></td>
      <td><a href="https://transition.fec.gov/press/summaries/2010/tables/congressional/ConCand8g_2010_24m.pdf">pdf</a></td>
    </tr>
  </tbody>
</table>


@JonellaCulmer
Copy link
Contributor

@johnnyporkchops Please see my thoughts based on previous screenshots you provided. Happy to discuss this with you further or talk through any potential problems or blockers to what I suggested.
Screen Shot 2020-09-30 at 4 01 51 PM

Copy link
Contributor

@rfultz rfultz left a comment

Choose a reason for hiding this comment

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

Awesome—I couldn't break it! :)

Couple questions but I think it's good

StatisticalSummary.prototype.handlePushState = function() {
///PUSH STATE 2////
const data = { year: this.chosenYear, segment: this.chosenSegment };
//const title = '';
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason to keep this?

let pressReleaseLinkClean;

//Ugly but necessary conditionals for the inconsistent/incomplete press-release history
if (this.chosenYear >= 2018 || this.chosenYear == 2014) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add notes anywhere else in the repo, linking this to other places that deal with the same issue? Would help us find places when/if the rules are no longer necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, this is the first time we have had to attempt to generate a link based on parameters

@@ -663,3 +663,43 @@ h3 + .simple-table {
.breakdowns-home {
width: 100%;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Will the linting rules trip on the indentations?

@@ -76,7 +76,7 @@ def _detect_space(repo, branch=None, yes=False):
('dev', lambda _, branch: branch == 'develop'),
# Uncomment below and adjust branch name to deploy desired feature branch to the feature space
# ('feature', lambda _, branch: branch == '[BRANCH NAME]'),
)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Will the linter hate this?

@codecov-io
Copy link

codecov-io commented Oct 7, 2020

Codecov Report

Merging #4088 into develop will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4088      +/-   ##
===========================================
- Coverage    75.47%   75.46%   -0.02%     
===========================================
  Files          121      121              
  Lines         7412     7413       +1     
  Branches       596      596              
===========================================
  Hits          5594     5594              
- Misses        1818     1819       +1     
Impacted Files Coverage Δ
fec/home/models.py 87.34% <100.00%> (+0.03%) ⬆️
fec/fec/static/js/modules/calendar.js 91.91% <0.00%> (-0.74%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 017055e...c5db3c9. Read the comment docs.

@johnnyporkchops
Copy link
Contributor Author

johnnyporkchops commented Oct 7, 2020

@JonellaCulmer: Style/text changes have been made and this is ready for final review. cc: @patphongs, @rfultz

I can build the draft pages on production. Once this is deployed to prod, all we have to do is choose the conditional_js setting and publish. Also have to coordinate with #3958 (cc: @kathycarothers)

Copy link
Member

@patphongs patphongs left a comment

Choose a reason for hiding this comment

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

Looks great @johnnyporkchops, thank you for all your work on this!

}

//Update state upon back or forward button click
StatisticalSummary.prototype.handlePopState = function(e) {
Copy link
Member

Choose a reason for hiding this comment

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

Nice job handling this!

if (this.chosenSegment > parseInt(latestAvailable)) {
this.latest_segment_alert.textContent =
latestAvailableOption.text +
' is the latest available option for ' +
Copy link
Member

Choose a reason for hiding this comment

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

I like how you handled this for when someone tries to access an unavailable coverage period

@johnnyporkchops johnnyporkchops removed the request for review from dorothyyeager October 8, 2020 15:52
@johnnyporkchops
Copy link
Contributor Author

johnnyporkchops commented Oct 8, 2020

@patphongs , @rfultz I added one more change to move the choices for conditional_js choices to constants.py, so one would not have to make a change to models.py and a new migration to add a choice. Before, If I added a choice inside models.py , it showed a migration when running ./manage.py makemigrations --dry-run --verbosity 3

Also, surprisingly, making this last change (choices=constants.conditional_js.items()) also did not trigger a migration. Point being that there is no new migration for this PR.

@kathycarothers
Copy link
Contributor

kathycarothers commented Oct 8, 2020

@johnnyporkchops I just finished the Party Summary page review and this is what I noticed:

  • The right sidebar "Other Summary Tables" for Political action committees the "c" for committees needs to be lower case. This will need to be changed on the Political action committee summary page too.
  • Remove the comma in the first sentence between ... years, and quarterly.... to be ......years and quarterly....
  • In the summary paragraph change out Political party data to National party committee data (this was the wording used on the transition page) Please ignore if this was discussed to be as it is.
  • All links on the page have been tested and are working

I was able to build a page too by copying and pasting from the suggested page listed above. No problems.

I am looking at the candidate summary page now.

@kathycarothers
Copy link
Contributor

I finished going through the rest of the categories.

  • All links seem to be working along with changing out the years and months.
  • We don't need the comma in the opening sentence on each page. The comma is located ...years, and quarterly....
  • On the congressional, party, and communication pages the left-hand sidebar entitled "Other Summary Tables" the "c" in committees for PACs needs to be lower case.

The pages look really clean and nice. I was able to create a draft page and copy blocks over to the new page.

Copy link
Contributor

@kathycarothers kathycarothers left a comment

Choose a reason for hiding this comment

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

I have added my comments to the main ticket.

@jason-upchurch
Copy link
Contributor

@johnnyporkchops is it okay for me to merge this? Thank you!

@johnnyporkchops
Copy link
Contributor Author

johnnyporkchops commented Oct 12, 2020

Are we missing anything?

@JonellaCulmer JonellaCulmer added this to the Sprint 13.6 milestone Oct 13, 2020
Copy link
Contributor

@JonellaCulmer JonellaCulmer left a comment

Choose a reason for hiding this comment

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

Looks great. Ran it locally and it worked perfectly. Thanks, John!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement filterable campaign finance data summaries
7 participants