Skip to content
Draft
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
6 changes: 3 additions & 3 deletions fec/data/templates/partials/browse-data/candidates.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="content__section--indent-left">
<h4><a href="/data/candidates/?has_raised_funds=true&is_active_candidate=true">All candidates</a></h4>
<p class ="u-margin--bottom">Search candidates for president, Senate and House for all years by location, party and more.</p>
<a class="button--cta button--go" href="/data/browse-data/?tab=bulk-data">Download this data as .CSV to use on your own</a>
<a class="button--cta button--go js-remote-tabpanel js-remote-accordion" href="https://www.fec.gov/data/browse-data/?tab=bulk-data#candidates-content-6">Download this data as .CSV to use on your own</a>
</div>
</li>
<li>
Expand Down Expand Up @@ -57,7 +57,7 @@
</a>
</div>
</div>
<a class="button--cta button--go" href="/data/browse-data/?tab=bulk-data">Presidential candidate map exports</a>
<a class="button--cta button--go js-remote-tabpanel js-remote-accordion" href="https://www.fec.gov/data/browse-data/?tab=bulk-data#candidates-content-3">Presidential candidate map exports</a>
</li>
<li>
<i class="icon i-magnifying-glass icon--absolute--left"></i>
Expand Down Expand Up @@ -112,7 +112,7 @@
<div class="content__section--indent-left">
<h4><a href="/data/filings/?form_type=F2">Most recent Statements of Candidacy (Form 2)</a></h4>
<p class="u-margin--bottom">Statements of Candidacy (Form 2) contain basic information about individuals running for federal office, including their names, addresses and authorized campaign committees.</p>
<a class="button--cta button--go" href="/data/browse-data/?tab=bulk-data">Download this data as .CSV to use on your own</a>
<a class="button--cta button--go js-remote-tabpanel js-remote-accordion" href="https://www.fec.gov/data/browse-data/?tab=bulk-data#candidates-content-4">Download this data as .CSV to use on your own</a>
</div>
</li>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions fec/data/templates/partials/browse-data/filings-reports.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<div class="content__section--indent-left">
<h4><a href="/data/reports/house-senate/">House and Senate committee reports</a></h4>
<p class ="u-margin--bottom">Search financial disclosure reports filed by House and Senate committees on the Form 3. Search by committee name, candidate, amount of financial activity and report name.</p>
<a class="button--cta button--go" href="/data/browse-data/?tab=bulk-data">Download this data as .CSV to use on your own</a>
<a class="button--cta button--go js-remote-tabpanel js-remote-accordion" href="/data/browse-data/?tab=bulk-data#other-content-4">Download this data as .CSV to use on your own</a>
</div>
</li>
<li>
Expand All @@ -51,7 +51,7 @@
<li>
<div class="content__section--indent-left">
<h4>False and fictitious filings</h4>
<a class="button--cta button--go" href="/data/browse-data/?tab=bulk-data">Download this data as .CSV to use on your own</a>
<a class="button--cta button--go js-remote-tabpanel js-remote-accordion" href="/data/browse-data/?tab=bulk-data#other-content-0">Download this data as .CSV to use on your own</a>
</div>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion fec/data/templates/partials/browse-data/raising.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<div class="content__section--indent-left">
<h4>Lobbyist bundled contributions</h4>
<div class="js-accordion accordion--neutral" data-content-prefix="lobbyist_bundled_contributions">
<a class="button--cta button--go" href="/data/browse-data/?tab=bulk-data">Download this data as .CSV to use on your own</a>
<a class="button--cta button--go js-remote-tabpanel js-remote-accordion" href="/data/browse-data/?tab=bulk-data#transactions-content-6">Download this data as .CSV to use on your own</a>
</div>
</div>
</li>
Expand Down
6 changes: 3 additions & 3 deletions fec/data/templates/partials/browse-data/spending.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="content__section--indent-left">
<h4><a href="/data/independent-expenditures/">Independent expenditures</a></h4>
<p class ="u-margin--bottom">Search <span class="term" data-term="independent expenditure" title="Click to define" tabindex="0">independent expenditures</span> to find specific spenders, candidates mentioned and transaction information.</p>
<a class="button--cta button--go" href="/data/browse-data/?tab=bulk-data">Download this data as .CSV to use on your own</a>
<a class="button--cta button--go js-remote-tabpanel js-remote-accordion" href="https://www.fec.gov/data/browse-data/?tab=bulk-data#transactions-content-5">Download this data as .CSV to use on your own</a>
</div>
</li>
<li>
Expand Down Expand Up @@ -51,15 +51,15 @@
<div class="content__section--indent-left">
<h4><a href="/data/electioneering-communications/">Electioneering communications</a></h4>
<p class ="u-margin--bottom">Search <span class="term" data-term="electioneering communication">electioneering communications</span> by the spender, candidate mentioned, date, or amount spent.</p>
<a class="button--cta button--go" href="/data/browse-data/?tab=bulk-data">Download this data as .CSV to use on your own</a>
<a class="button--cta button--go js-remote-tabpanel js-remote-accordion" href="https://www.fec.gov/data/browse-data/?tab=bulk-data#transactions-content-4">Download this data as .CSV to use on your own</a>
</div>
</li>
<li>
<i class="icon i-magnifying-glass icon--absolute--left"></i>
<div class="content__section--indent-left">
<h4><a href="/data/communication-costs/">Communication costs</a></h4>
<p class ="u-margin--bottom">Search communication costs for communications that support or oppose specific candidates. Search by date and amount spent.</p>
<a class="button--cta button--go" href="/data/browse-data/?tab=bulk-data">Download this data as .CSV to use on your own</a>
<a class="button--cta button--go js-remote-tabpanel js-remote-accordion" href="https://www.fec.gov/data/browse-data/?tab=bulk-data#transactions-content-1">Download this data as .CSV to use on your own</a>
</div>
</li>
<li>
Expand Down
20 changes: 20 additions & 0 deletions fec/fec/static/js/pages/data-browse-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,23 @@ $(function() {
new PlotChart('.js-spent-overview', 'spent', 2).init();
});
});

/**
* Add event listeners for buttons that want to remote trigger tabs and/or accordions
*/
const remoteEls = document.querySelectorAll('.js-remote-tabpanel, .js-remote-accordion');
remoteEls.forEach((el) => {
el.addEventListener('click', handleRemoteClick.bind(this));
});

function handleRemoteClick(e) {
e.preventDefault();

const targetHref = new URL(e.target.getAttribute('href'));
const targetTabId = targetHref.searchParams.get('tab');
const targetAccordionId = targetHref.hash.substring(1); // (.hash also returns the #, so remove it)

$(`[role="tab"][data-name="${targetTabId}"]`).trigger('click'); // trigger the tab click
$(`[aria-controls="${targetAccordionId}"][aria-expanded="false"]`).trigger('click'); // trigger the accordion click
if (targetAccordionId) location.hash = `#${targetAccordionId}`; // Jump to the accordion
}
1 change: 0 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ 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]'),
('feature', lambda _, branch: branch == 'feature/6338-7097-bulk-downloads'),
)


Expand Down