From 11651e2736fb016b2f40d8d3f5999e6a97182b3e Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 11 Sep 2024 08:37:30 -0400 Subject: [PATCH 1/8] Close whitespace in rendered --- fec/fec/static/js/modules/tables.js | 12 +++- ...cated-federal-nonfederal-disbursements.hbs | 26 ++++----- fec/fec/static/js/templates/candidates.hbs | 36 ++++++------ fec/fec/static/js/templates/committees.hbs | 20 +++---- .../js/templates/communication-costs.hbs | 26 ++++----- fec/fec/static/js/templates/debts.hbs | 34 +++++------ fec/fec/static/js/templates/disbursements.hbs | 40 ++++++------- .../electioneering-communications.hbs | 22 +++---- .../js/templates/independent-expenditures.hbs | 47 ++++++++------- fec/fec/static/js/templates/loans.hbs | 18 +++--- .../national-party-account-disbursements.hbs | 34 +++++------ .../national-party-account-receipts.hbs | 40 ++++++------- fec/fec/static/js/templates/pac-party.hbs | 28 ++++----- .../party-coordinated-expenditures.hbs | 26 ++++----- fec/fec/static/js/templates/receipts.hbs | 42 +++++++------- .../static/js/templates/reports/candidate.hbs | 58 +++++++++---------- .../static/js/templates/reports/ie-only.hbs | 28 ++++----- fec/fec/static/js/templates/reports/pac.hbs | 44 +++++++------- 18 files changed, 295 insertions(+), 286 deletions(-) diff --git a/fec/fec/static/js/modules/tables.js b/fec/fec/static/js/modules/tables.js index a828505324..0ceab5edc1 100644 --- a/fec/fec/static/js/modules/tables.js +++ b/fec/fec/static/js/modules/tables.js @@ -198,6 +198,10 @@ export function modalRenderFactory(template, fetch) { callback ); callback = function(e) { + console.log('click callback'); + console.log(' e.type: ', e.type); + console.log(' e.which: ', e.which); + if (e.which === 13 || e.type === 'click') { // Note: Use `currentTarget` to get parent row, since the target column // may have been moved since the triggering event @@ -206,8 +210,14 @@ export function modalRenderFactory(template, fetch) { if ($target.is('a')) { return true; } + + // const tr = e.target.closest('tr'); + // const row = api.row($table, tr); + + // else row.child(format(row.data())).show(); + if (!$target.closest('td').hasClass('dataTables_empty')) { - const index = api.row($row).index(); + const row = api.row($row); $.when(fetch(response.results[index])).done(function(fetched) { $modal.find('.js-panel-content').html(template(fetched)); $modal.attr('aria-hidden', 'false'); diff --git a/fec/fec/static/js/templates/allocated-federal-nonfederal-disbursements.hbs b/fec/fec/static/js/templates/allocated-federal-nonfederal-disbursements.hbs index 48841b15cc..3ed91365ae 100644 --- a/fec/fec/static/js/templates/allocated-federal-nonfederal-disbursements.hbs +++ b/fec/fec/static/js/templates/allocated-federal-nonfederal-disbursements.hbs @@ -2,10 +2,10 @@

{{committee.name}}

Recipient information

- {{#panelRow "Recipient name"}} + {{#panelRow "Recipient name"~}} {{payee_name}} {{/panelRow}} - {{#panelRow "Recipient city, state and ZIP code"}} + {{#panelRow "Recipient city, state and ZIP code"~}} {{payee_city}}, {{payee_state}} {{zipCode payee_zip}} {{/panelRow}}
@@ -14,28 +14,28 @@

Transaction information

- {{#panelRow "Activity or event identifier"}} + {{#panelRow "Activity or event identifier"~}} {{{activity_or_event}}} {{/panelRow}} - {{#panelRow "Description"}} + {{#panelRow "Description"~}} {{disbursement_purpose}} {{/panelRow}} - {{#panelRow "Report year"}} + {{#panelRow "Report year"~}} {{{report_year}}} {{/panelRow}} - {{#panelRow "Disbursement date"}} + {{#panelRow "Disbursement date"~}} {{{datetime event_purpose_date format="pretty"}}} {{/panelRow}} - {{#panelRow "Federal allocated share"}} + {{#panelRow "Federal allocated share"~}} {{{currency federal_share}}} {{/panelRow}} - {{#panelRow "Nonfederal allocated share"}} + {{#panelRow "Nonfederal allocated share"~}} {{{currency nonfederal_share}}} {{/panelRow}} - {{#panelRow "Combined federal and nonfederal share total amount"}} + {{#panelRow "Combined federal and nonfederal share total amount"~}} {{{currency disbursement_amount}}} {{/panelRow}} - {{#panelRow "Allocated activity or event year-to-date"}} + {{#panelRow "Allocated activity or event year-to-date"~}} {{{currency event_amount_year_to_date}}} {{/panelRow}}
@@ -47,13 +47,13 @@ {{#panelRow "Name"}} {{committee.name}} {{/panelRow}} - {{#panelRow "Designation"}} + {{#panelRow "Designation"~}} {{committee.designation_full}} {{/panelRow}} - {{#panelRow "Most recent treasurer"}} + {{#panelRow "Most recent treasurer"~}} {{committee.treasurer_name}} {{/panelRow}} - {{#panelRow "Committee city, state and ZIP code"}} + {{#panelRow "Committee city, state and ZIP code"~}} {{committee.city}}, {{committee.state}} {{zipCode committee.zip}} {{/panelRow}} diff --git a/fec/fec/static/js/templates/candidates.hbs b/fec/fec/static/js/templates/candidates.hbs index 3d89a03697..e90800fdcf 100644 --- a/fec/fec/static/js/templates/candidates.hbs +++ b/fec/fec/static/js/templates/candidates.hbs @@ -6,7 +6,7 @@

Candidate information

- {{#panelRow "Candidate ID"}} + {{#panelRow "Candidate ID"~}} {{candidate_id}} {{/panelRow}} @@ -14,36 +14,36 @@ - {{#panelRow "Office sought"}} + {{#panelRow "Office sought"~}} {{office_full}} {{/panelRow}} - {{#panelRow "Political party"}} + {{#panelRow "Political party"~}} {{party_full}} {{/panelRow}} {{#unless (eq office 'P')}} - {{#panelRow "State"}} + {{#panelRow "State"~}} {{decodeState state}} {{/panelRow}} {{/unless}} {{#if (eq office 'H')}} - {{#panelRow "District"}} + {{#panelRow "District"~}} {{district}} {{/panelRow}} {{/if}} {{#if committees.principal}} - {{#panelRow "Principal campaign committees"}} + {{#panelRow "Principal campaign committees"~}}
{{#each election_years}} {{! we only have election profile pages starting in 1980}} - {{#if (gte this 1980)}} + {{#if (gte this 1980)~}} {{this}}{{#unless @last}}, {{/unless}} - {{else}} + {{else~}} {{this}}{{#unless @last}}, {{/unless}} {{/if}} {{/each}}
- {{#panelRow "Receipts"}} + {{#panelRow "Receipts"~}} {{{currency receipts}}} {{/panelRow}} - {{#panelRow "Disbursements"}} + {{#panelRow "Disbursements"~}} {{{currency disbursements}}} {{/panelRow}} - {{#panelRow "Ending cash on hand"}} + {{#panelRow "Ending cash on hand"~}} {{{currency cash_on_hand_end_period}}} {{/panelRow}} - {{#panelRow "Debts owed by committee"}} + {{#panelRow "Debts owed by committee"~}} {{{currency debts_owed_by_committee}}} {{/panelRow}} {{#if (eq office 'P')}} - {{#panelRow "Has accepted presidential public funds"}} + {{#panelRow "Has accepted presidential public funds"~}} {{convertBoolean federal_funds_flag}} {{/panelRow}} {{/if}} diff --git a/fec/fec/static/js/templates/committees.hbs b/fec/fec/static/js/templates/committees.hbs index 22354aacc2..bb18e97e72 100644 --- a/fec/fec/static/js/templates/committees.hbs +++ b/fec/fec/static/js/templates/committees.hbs @@ -3,40 +3,40 @@

{{name}}

- {{#panelRow "Committee type"}} + {{#panelRow "Committee type"~}} {{committee_type_full}} {{/panelRow}} - {{#panelRow "Designation"}} + {{#panelRow "Designation"~}} {{designation_full}} {{/panelRow}} {{#if party_full}} - {{#panelRow "Political party"}} + {{#panelRow "Political party"~}} {{party_full}} {{/panelRow}} {{/if}} - {{#panelRow "Most recent treasurer"}} + {{#panelRow "Most recent treasurer"~}} {{treasurer_name}} {{/panelRow}} - {{#panelRow "State"}} + {{#panelRow "State"~}} {{state}} {{/panelRow}} - {{#panelRow "Registration date"}} + {{#panelRow "Registration date"~}} {{datetime first_f1_date format="pretty"}} {{/panelRow}} {{#if organization_type_full}} - {{#panelRow "Organization type"}} + {{#panelRow "Organization type"~}} {{organization_type_full}} {{/panelRow}} {{/if}} {{#if sponsor_candidate_list}} - {{#panelRow "Leadership PAC sponsor"}} - {{#each sponsor_candidate_list}} + {{#panelRow "Leadership PAC sponsor"~}} + {{#each sponsor_candidate_list~}} {{ sponsor_candidate_name }} ({{ sponsor_candidate_id }}){{#unless @last}};
{{/unless}} {{/each}} {{/panelRow}} {{/if}} {{#if (eq designation_full "Joint fundraising committee") }} - {{#panelRow "Joint fundraising participants"}} + {{#panelRow "Joint fundraising participants"~}} Full list of current participants {{/panelRow}} {{/if}} diff --git a/fec/fec/static/js/templates/communication-costs.hbs b/fec/fec/static/js/templates/communication-costs.hbs index 39dab05812..3d8b33cc9b 100644 --- a/fec/fec/static/js/templates/communication-costs.hbs +++ b/fec/fec/static/js/templates/communication-costs.hbs @@ -1,29 +1,29 @@

Disbursement information

- {{#panelRow "Committee name"}} + {{#panelRow "Committee name"~}} {{committee_name}} {{/panelRow}} - {{#panelRow "Amount"}} {{ currency transaction_amount }} + {{#panelRow "Amount"~}} {{/panelRow}} - {{#panelRow "Report year"}} {{ report_year }} + {{#panelRow "Report year"~}} {{/panelRow}} - {{#panelRow "Transaction date"}} {{ datetime transaction_date format=pretty }} + {{#panelRow "Transaction date"~}} {{/panelRow}} - {{#panelRow "Transaction type"}} + {{#panelRow "Transaction type"~}} {{transaction_type}} {{/panelRow}} - {{#panelRow "Communication class"}} {{ communication_class }} + {{#panelRow "Communication class"~}} {{/panelRow}} - {{#panelRow "Communication type"}} {{ communication_type }} + {{#panelRow "Communication type"~}} {{/panelRow}} - {{#panelRow "Purpose"}} {{ purpose }} + {{#panelRow "Purpose"~}} {{/panelRow}}
@@ -31,23 +31,23 @@

Candidate information

- {{#panelRow "Candidate"}} + {{#panelRow "Candidate"~}} {{candidate_name}} ({{decodeSupportOppose support_oppose_indicator}}) {{/panelRow}} - {{#panelRow "Party"}} {{ decodeParty candidate_party_affiliation }} + {{#panelRow "Party"~}} {{/panelRow}} - {{#panelRow "Office"}} {{ decodeOffice candidate_office }} + {{#panelRow "Office"~}} {{/panelRow}} {{#if candidate_office_state }} - {{#panelRow "State"}} {{ decodeState candidate_office_state }} + {{#panelRow "State"~}} {{/panelRow}} {{/if}} {{#if candidate_office_district}} - {{#panelRow "District"}} {{ candidate_office_district }} + {{#panelRow "District"~}} {{/panelRow}} {{/if}}
diff --git a/fec/fec/static/js/templates/debts.hbs b/fec/fec/static/js/templates/debts.hbs index 43f358324f..8c99426420 100644 --- a/fec/fec/static/js/templates/debts.hbs +++ b/fec/fec/static/js/templates/debts.hbs @@ -6,19 +6,19 @@ This shows fields available on the Schedule D form.

Committee information

- {{#panelRow "Name"}} + {{#panelRow "Name"~}} {{committee.name}} {{/panelRow}} - {{#panelRow "Type"}} + {{#panelRow "Type"~}} {{committee.committee_type_full}} {{/panelRow}} - {{#panelRow "Designation"}} + {{#panelRow "Designation"~}} {{committee.designation_full}} {{/panelRow}} - {{#panelRow "Most recent treasurer"}} + {{#panelRow "Most recent treasurer"~}} {{committee.treasurer_name}} {{/panelRow}} - {{#panelRow "City, state and ZIP code"}} + {{#panelRow "City, state and ZIP code"~}} {{committee.city}}, {{committee.state}} {{zipCode committee.zip}} {{/panelRow}}
@@ -27,12 +27,12 @@ This shows fields available on the Schedule D form.

Creditor/debtor

- {{#panelRow "Name"}} + {{#panelRow "Name"~}} {{#if creditor_debtor_name}} {{creditor_debtor_name}} {{/if}} {{/panelRow}} - {{#panelRow "City, state and ZIP code"}} + {{#panelRow "City, state and ZIP code"~}} {{creditor_debtor_city}}, {{creditor_debtor_state}} {{zipCode creditor_debtor_zip}} {{/panelRow}}
@@ -41,34 +41,34 @@ This shows fields available on the Schedule D form.

Debt information

- {{#panelRow "Nature of debt"}} + {{#panelRow "Nature of debt"~}} {{nature_of_debt}} {{/panelRow}} - {{#panelRow "Date"}} + {{#panelRow "Date"~}} {{{datetime coverage_start_date format="pretty"}}} {{/panelRow}} - {{#panelRow "Line number"}} + {{#panelRow "Line number"~}} {{line_number}} {{/panelRow}} - {{#panelRow "Balance at beginning of period"}} + {{#panelRow "Balance at beginning of period"~}} {{{currency outstanding_balance_beginning_of_period}}} {{/panelRow}} - {{#panelRow "Amount incurred this period"}} + {{#panelRow "Amount incurred this period"~}} {{{currency amount_incurred_period}}} {{/panelRow}} - {{#panelRow "Amount paid this period"}} + {{#panelRow "Amount paid this period"~}} {{{currency payment_period}}} {{/panelRow}} - {{#panelRow "Balance at close of period"}} + {{#panelRow "Balance at close of period"~}} {{{currency outstanding_balance_close_of_period}}} {{/panelRow}} - {{#panelRow "Report year"}} + {{#panelRow "Report year"~}} {{{report_year}}} {{/panelRow}} - {{#panelRow "Report type"}} + {{#panelRow "Report type"~}} {{{report_type}}} {{/panelRow}} - {{#panelRow "Line number"}} + {{#panelRow "Line number"~}} {{#if (eq line_number "9")}} Debts and obligations owed to the committee (Line 9) {{else if (eq line_number "10")}} diff --git a/fec/fec/static/js/templates/disbursements.hbs b/fec/fec/static/js/templates/disbursements.hbs index 7248f797f7..f482f5e2b2 100644 --- a/fec/fec/static/js/templates/disbursements.hbs +++ b/fec/fec/static/js/templates/disbursements.hbs @@ -1,17 +1,17 @@

Recipient information

- {{#panelRow "Recipient name"}} - {{#if recipient}} + {{#panelRow "Recipient name"~}} + {{#if recipient~}} {{recipient.name}} - {{else}} + {{else~}} {{recipient_name}} {{/if}} {{/panelRow}} - {{#panelRow "Recipient city, state and ZIP code"}} + {{#panelRow "Recipient city, state and ZIP code"~}} {{recipient_city}}, {{recipient_state}} {{zipCode recipient_zip}} {{/panelRow}} - {{#panelRow "Beneficiary committee name"}} + {{#panelRow "Beneficiary committee name"~}} {{beneficiary_committee_name}} {{/panelRow}}
@@ -20,35 +20,35 @@

Transaction information

- {{#panelRow "Amount"}} + {{#panelRow "Amount"~}} {{{currency disbursement_amount}}} {{/panelRow}} - {{#panelRow "Disbursement date"}} + {{#panelRow "Disbursement date"~}} {{{datetime disbursement_date format="pretty"}}} {{/panelRow}} - {{#panelRow "Report year"}} {{{ report_year }}} + {{#panelRow "Report year"~}} {{/panelRow}} - {{#panelRow "Filing date"}} + {{#panelRow "Filing date"~}} {{{datetime receipt_date format="pretty"}}} {{/panelRow}} - {{#panelRow "Description"}} + {{#panelRow "Description"~}} {{disbursement_description}} {{/panelRow}} - {{#panelRow "Purpose category"}} + {{#panelRow "Purpose category"~}} {{disbursement_purpose_category}} {{/panelRow}} - {{#panelRow "Memo"}} + {{#panelRow "Memo"~}} {{memo_text}} {{/panelRow}} - {{#panelRow "Memo code"}} + {{#panelRow "Memo code"~}} {{memoed_subtotal}} {{/panelRow}} - {{#panelRow "Reported on"}} Form {{formNumber filing_form }} on line {{line_number}} + {{#panelRow "Reported on"~}} {{/panelRow}} {{#if election_type_full }} - {{#panelRow "Election type"}} + {{#panelRow "Election type"~}} {{election_type_full}} {{/panelRow}} {{/if}} @@ -58,21 +58,21 @@

Committee information

- {{#panelRow "Name"}} + {{#panelRow "Name"~}} {{committee.name}} {{/panelRow}} - {{#panelRow "Designation"}} + {{#panelRow "Designation"~}} {{committee.designation_full}} {{/panelRow}} {{#if committee.type}} - {{#panelRow "Type"}} + {{#panelRow "Type"~}} {{committee.type_full}} {{/panelRow}} {{/if}} - {{#panelRow "Treasurer"}} + {{#panelRow "Treasurer"~}} {{committee.treasurer_name}} {{/panelRow}} - {{#panelRow "Committee city, state and ZIP code"}} + {{#panelRow "Committee city, state and ZIP code"~}} {{committee.city}}, {{committee.state}} {{zipCode committee.zip}} {{/panelRow}}
diff --git a/fec/fec/static/js/templates/electioneering-communications.hbs b/fec/fec/static/js/templates/electioneering-communications.hbs index 39f0bd9822..ee41ab4f7c 100644 --- a/fec/fec/static/js/templates/electioneering-communications.hbs +++ b/fec/fec/static/js/templates/electioneering-communications.hbs @@ -1,14 +1,14 @@

Disbursement information

- {{#panelRow "Spender"}} + {{#panelRow "Spender"~}} {{committee_name}} {{/panelRow}} - {{#panelRow "Amount"}} {{ currency disbursement_amount }} + {{#panelRow "Amount"~}} {{/panelRow}} - {{#panelRow "Number of candidates mentioned"}} {{ number_of_candidates }} + {{#panelRow "Number of candidates mentioned"~}} {{/panelRow}} - {{#panelRow "Report year"}} {{ report_year }} + {{#panelRow "Report year"~}} {{/panelRow}} - {{#panelRow "Disbursement date"}} {{ datetime disbursement_date format=pretty }} + {{#panelRow "Disbursement date"~}} {{/panelRow}} - {{#panelRow "Communication date"}} {{ datetime communication_date format=pretty }} + {{#panelRow "Communication date"~}} {{/panelRow}} - {{#panelRow "Purpose description"}} {{ purpose_description }} + {{#panelRow "Purpose description"~}} {{/panelRow}}
@@ -24,17 +24,17 @@ {{ currency calculated_candidate_share }}
@@ -42,19 +42,19 @@

Candidate information

- {{#panelRow "Candidate"}} + {{#panelRow "Candidate"~}} {{candidate_name}} {{/panelRow}} - {{#panelRow "Office"}} {{ decodeOffice candidate_office }} + {{#panelRow "Office"~}} {{/panelRow}} {{#if candidate_state}} - {{#panelRow "State"}} + {{#panelRow "State"~}} {{decodeState candidate_state}} {{/panelRow}} {{/if}} {{#unless (eq candidate_district '00') }} - {{#panelRow "District"}} + {{#panelRow "District"~}} {{candidate_district}} {{/panelRow}} {{/unless}} diff --git a/fec/fec/static/js/templates/independent-expenditures.hbs b/fec/fec/static/js/templates/independent-expenditures.hbs index e64cb109a0..fcb0505e20 100644 --- a/fec/fec/static/js/templates/independent-expenditures.hbs +++ b/fec/fec/static/js/templates/independent-expenditures.hbs @@ -1,32 +1,31 @@

Expenditure information

- {{#panelRow "Version"}} + {{#panelRow "Version"~}} {{{amendment_version}}} {{/panelRow}} - {{#panelRow "Amount"}} + {{#panelRow "Amount"~}} {{currency expenditure_amount}} {{/panelRow}} - {{#panelRow "Expenditure date"}} + {{#panelRow "Expenditure date"~}} {{datetime expenditure_date format="pretty"}} {{/panelRow}} - {{#panelRow "Dissemination date"}} + {{#panelRow "Dissemination date"~}} {{datetime dissemination_date format="pretty"}} {{/panelRow}} - {{#panelRow "Candidate"}} - {{#if candidate_id}} + {{#panelRow "Candidate"~}} + {{#if candidate_id~}} {{candidate_name}} - {{else}} + {{else~}} {{candidate_name}} {{/if}} ({{decodeSupportOppose support_oppose_indicator}}) {{/panelRow}} - {{#panelRow "Description"}} + {{#panelRow "Description"~}} {{expenditure_description}} {{/panelRow}} - {{#panelRow "Payee"}} - {{payee_name}}
- {{payee_city}}, {{payee_state}} + {{#panelRow "Payee"~}} + {{payee_name}}
{{payee_city}}, {{payee_state}} {{/panelRow}}
@@ -34,10 +33,10 @@

Filing information

- {{#panelRow "Report type"}} + {{#panelRow "Report type"~}} {{decodeReport report_type}} {{/panelRow}} - {{#panelRow "Form type"}} + {{#panelRow "Form type"~}} {{decodeForm filing_form}} ({{filing_form}}) {{/panelRow}}
@@ -46,19 +45,19 @@

Committee information

- {{#panelRow "Committee name"}} + {{#panelRow "Committee name"~}} {{committee.name}} {{/panelRow}} - {{#panelRow "Committee type"}} + {{#panelRow "Committee type"~}} {{committee.committee_type_full}} {{/panelRow}} - {{#panelRow "Treasurer"}} + {{#panelRow "Treasurer"~}} {{committee.treasurer_name}} {{/panelRow}} - {{#panelRow "City and state"}} + {{#panelRow "City and state"~}} {{committee.city}}, {{committee.state}} {{/panelRow}} - {{#panelRow "Total spent on office (year to date)"}} + {{#panelRow "Total spent on office (year to date)"~}} {{currency office_total_ytd}} {{/panelRow}}
@@ -67,23 +66,23 @@

Candidate information

- {{#panelRow "Candidate"}} - {{#if candidate_id}} + {{#panelRow "Candidate"~}} + {{#if candidate_id~}} {{candidate_name}} - {{else}} + {{else~}} {{candidate_name}} {{/if}} {{/panelRow}} - {{#panelRow "Office"}} + {{#panelRow "Office"~}} {{decodeOffice candidate_office}} {{/panelRow}} {{#if candidate_state }} - {{#panelRow "State"}} + {{#panelRow "State"~}} {{cand_office_state}} {{/panelRow}} {{/if}} {{#if candidate_district}} - {{#panelRow "District"}} + {{#panelRow "District"~}} {{cand_office_district}} {{/panelRow}} {{/if}} diff --git a/fec/fec/static/js/templates/loans.hbs b/fec/fec/static/js/templates/loans.hbs index 78b47f466b..657b7c6da2 100644 --- a/fec/fec/static/js/templates/loans.hbs +++ b/fec/fec/static/js/templates/loans.hbs @@ -7,10 +7,10 @@ This shows all the fields available on the Schedule C form.

Committee information

- {{#panelRow "Name"}} + {{#panelRow "Name"~}} {{committee.name}} {{/panelRow}} - {{#panelRow "Committee city, state and ZIP code"}} + {{#panelRow "Committee city, state and ZIP code"~}} {{committee.city}}, {{committee.state}} {{zipCode committee.zip}} {{/panelRow}}
@@ -19,12 +19,12 @@ This shows all the fields available on the Schedule C form.

Loan Source information

- {{#panelRow "Loan source name"}} - {{#if loan_source_name}} + {{#panelRow "Loan source name"~}} + {{#if loan_source_name~}} {{loan_source_name}} {{/if}} {{/panelRow}} - {{#panelRow "City and state"}} + {{#panelRow "City and state"~}} {{loan_source_city}}, {{loan_source_state}} {{/panelRow}}
@@ -33,16 +33,16 @@ This shows all the fields available on the Schedule C form.

Loan information

- {{#panelRow "Original Amount of Loan"}} + {{#panelRow "Original Amount of Loan"~}} {{{currency original_loan_amount}}} {{/panelRow}} - {{#panelRow "Cumulative Payment to Date"}} + {{#panelRow "Cumulative Payment to Date"~}} {{{currency payment_to_date}}} {{/panelRow}} - {{#panelRow "Balance Outstanding at Close of This Period"}} + {{#panelRow "Balance Outstanding at Close of This Period"~}} {{{currency loan_balance}}} {{/panelRow}} - {{#panelRow "Interest Rate"}} + {{#panelRow "Interest Rate"~}} {{interest_rate_terms}} % {{/panelRow}}
diff --git a/fec/fec/static/js/templates/national-party-account-disbursements.hbs b/fec/fec/static/js/templates/national-party-account-disbursements.hbs index d60ebc6ea8..f11feee556 100644 --- a/fec/fec/static/js/templates/national-party-account-disbursements.hbs +++ b/fec/fec/static/js/templates/national-party-account-disbursements.hbs @@ -4,14 +4,14 @@ Template for national party accounts disbursements datatable details panel

Recipient information

- {{#panelRow "Name"}} - {{#if recipient_committee_id}} + {{#panelRow "Name"~}} + {{#if recipient_committee_id~}} {{recipient_name}} - {{else}} + {{else~}} {{recipient_name}} {{/if}} {{/panelRow}} - {{#panelRow "City, state and ZIP code"}} + {{#panelRow "City, state and ZIP code"~}} {{recipient_city}}, {{recipient_state}} {{zipCode recipient_zip}} {{/panelRow}}
@@ -20,31 +20,31 @@ Template for national party accounts disbursements datatable details panel

Disbursement information

- {{#panelRow "Amount"}} + {{#panelRow "Amount"~}} {{currency disbursement_amount}} {{/panelRow}} - {{#panelRow "Disbursement date"}} + {{#panelRow "Disbursement date"~}} {{{datetime disbursement_date format="pretty"}}} {{/panelRow}} - {{#panelRow "Report year"}} + {{#panelRow "Report year"~}} {{report_year}} {{/panelRow}} - {{#panelRow "Description"}} + {{#panelRow "Description"~}} {{disbursement_description}} {{/panelRow}} - {{#panelRow "Purpose category"}} + {{#panelRow "Purpose category"~}} {{disbursement_purpose_category}} {{/panelRow}} - {{#panelRow "Disbursement type"}} + {{#panelRow "Disbursement type"~}} {{disbursement_type_desc}} {{/panelRow}} - {{#panelRow "Memo"}} + {{#panelRow "Memo"~}} {{memo_text}} {{/panelRow}} - {{#panelRow "Memo code"}} + {{#panelRow "Memo code"~}} {{memo_cd_desc}} {{/panelRow}} - {{#panelRow "Reported on"}} + {{#panelRow "Reported on"~}} {{filing_form}} on Line {{line_number}} {{/panelRow}}
@@ -53,16 +53,16 @@ Template for national party accounts disbursements datatable details panel

Spender information

- {{#panelRow "Name"}} + {{#panelRow "Name"~}} {{committee_name}} {{/panelRow}} - {{#panelRow "Designation"}} + {{#panelRow "Designation"~}} {{spender_committee_designation}} {{!-- TODO: this will change to spender_committee_designation_full --}} {{/panelRow}} - {{#panelRow "Treasurer"}} + {{#panelRow "Treasurer"~}} {{treasurer_name}} {{/panelRow}} - {{#panelRow "State"}} + {{#panelRow "State"~}} {{state_full}} {{/panelRow}}
diff --git a/fec/fec/static/js/templates/national-party-account-receipts.hbs b/fec/fec/static/js/templates/national-party-account-receipts.hbs index c92b073325..a7d055d08d 100644 --- a/fec/fec/static/js/templates/national-party-account-receipts.hbs +++ b/fec/fec/static/js/templates/national-party-account-receipts.hbs @@ -4,27 +4,27 @@ Template for national party accounts disbursements datatable details panel

Source information

- {{#panelRow "Name"}} - {{#if contributor_id}}{{! If there's a contributor_id}} - {{#if (stringsMatch entity_type 'IND')}}{{! If this is an individual and not a committee }} + {{#panelRow "Name"~}} + {{#if contributor_id~}}{{! If there's a contributor_id}} + {{#if (stringsMatch entity_type 'IND')~}}{{! If this is an individual and not a committee }} {{contributor_name}}{{! Don't link the name }} - {{else}}{{! Otherwise, if it's not an individual, }} + {{else~}}{{! Otherwise, if it's not an individual, }} {{contributor_name}}{{! Link the name }} {{/if}} - {{else}}{{! Otherwise, if there's no contributor_id, }} + {{else~}}{{! Otherwise, if there's no contributor_id, }} {{contributor_name}}{{! There's no id to link }} {{/if}} {{/panelRow}} - {{#panelRow "City, state and ZIP code"}} + {{#panelRow "City, state and ZIP code"~}} {{contributor_city}}, {{contributor_state}} {{zipCode contributor_zip}} {{/panelRow}} - {{#panelRow "Occupation"}} + {{#panelRow "Occupation"~}} {{contributor_occupation}} {{/panelRow}} - {{#panelRow "Employer"}} + {{#panelRow "Employer"~}} {{contributor_employer}} {{/panelRow}} - {{#panelRow "Year to date"}} + {{#panelRow "Year to date"~}} {{{currency contributor_aggregate_ytd}}} {{/panelRow}}
@@ -33,25 +33,25 @@ Template for national party accounts disbursements datatable details panel

Receipt information

- {{#panelRow "Amount"}} + {{#panelRow "Amount"~}} {{{currency contribution_receipt_amount}}} {{/panelRow}} - {{#panelRow "Receipt date"}} + {{#panelRow "Receipt date"~}} {{{datetime contribution_receipt_date format="pretty"}}} {{/panelRow}} - {{#panelRow "Report year"}} + {{#panelRow "Report year"~}} {{report_year}} {{/panelRow}} - {{#panelRow "Receipt type"}} + {{#panelRow "Receipt type"~}} {{receipt_type_desc}} {{/panelRow}} - {{#panelRow "Memo"}} + {{#panelRow "Memo"~}} {{memo_text}} {{/panelRow}} - {{#panelRow "Reported on"}} + {{#panelRow "Reported on"~}} {{filing_form}} on Line {{line_num}} {{/panelRow}} - {{#panelRow "Election type"}} + {{#panelRow "Election type"~}} {{fec_election_type_desc}} {{/panelRow}}
@@ -60,16 +60,16 @@ Template for national party accounts disbursements datatable details panel

Recipient information

- {{#panelRow "Committee"}} + {{#panelRow "Committee"~}} {{committee_name}} {{/panelRow}} - {{#panelRow "Political party"}} + {{#panelRow "Political party"~}} {{party_full}} {{/panelRow}} - {{#panelRow "Type"}} + {{#panelRow "Type"~}} {{recipient_committee_type_full}} {{/panelRow}} - {{#panelRow "State"}} + {{#panelRow "State"~}} {{state_full}} {{/panelRow}}
diff --git a/fec/fec/static/js/templates/pac-party.hbs b/fec/fec/static/js/templates/pac-party.hbs index c403028cd6..b8c10ec62b 100644 --- a/fec/fec/static/js/templates/pac-party.hbs +++ b/fec/fec/static/js/templates/pac-party.hbs @@ -10,38 +10,38 @@ Template for PAC and party committee datatable details panel Committee information - {{#panelRow "Committee type"}} + {{#panelRow "Committee type"~}} {{committee_type_full}} {{/panelRow}} - {{#panelRow "Designation"}} + {{#panelRow "Designation"~}} {{committee_designation_full}} {{/panelRow}} {{#if party_full}} - {{#panelRow "Political party"}} + {{#panelRow "Political party"~}} {{party_full}} {{/panelRow}} {{/if}} {{#if sponsor_candidate_list}} - {{#panelRow "Leadership PAC sponsor"}} - {{#each sponsor_candidate_list}} {{ sponsor_candidate_name }} ({{ sponsor_candidate_id }}){{#unless @last}};
{{/unless}} + {{#panelRow "Leadership PAC sponsor"~}} + {{#each sponsor_candidate_list~}} {{/each}} {{/panelRow}} {{/if}} - {{#panelRow "Most recent treasurer"}} {{ treasurer_name }} + {{#panelRow "Most recent treasurer"~}} {{/panelRow}} - {{#panelRow "State"}} {{ committee_state }} + {{#panelRow "State"~}} {{/panelRow}} - {{#panelRow "Filing frequency"}} {{ filing_frequency_full }} + {{#panelRow "Filing frequency"~}} {{/panelRow}} - {{#panelRow "Registration date"}} {{ datetime first_f1_date format="pretty" }} + {{#panelRow "Registration date"~}} {{/panelRow}} {{#if (eq committee_designation_full "Joint fundraising committee") }} - {{#panelRow "Joint fundraising participants"}} + {{#panelRow "Joint fundraising participants"~}} Full list of current participants {{/panelRow}} {{/if}} @@ -53,11 +53,11 @@ Template for PAC and party committee datatable details panel Financial totals for {{ format_range cycle }}
- {{#panelRow "Coverage end date"}} {{ datetime coverage_end_date format="pretty" }} + {{#panelRow "Coverage end date"~}} {{/panelRow}} - {{#panelRow "Receipts"}} {{ currency receipts }} + {{#panelRow "Receipts"~}} {{/panelRow}} - {{#panelRow "Disbursements"}} {{ currency disbursements }} + {{#panelRow "Disbursements"~}} {{/panelRow}} - {{#panelRow "Debts owed by committee"}} {{ currency last_debts_owed_by_committee }} + {{#panelRow "Debts owed by committee"~}} {{/panelRow}}
@@ -73,8 +73,8 @@ Template for PAC and party committee datatable details panel {{ currency individual_contributions }}
@@ -90,8 +90,8 @@ Template for PAC and party committee datatable details panel {{ currency last_cash_on_hand_end_period }}
diff --git a/fec/fec/static/js/templates/party-coordinated-expenditures.hbs b/fec/fec/static/js/templates/party-coordinated-expenditures.hbs index 6df2e6fb11..8f21544c3b 100644 --- a/fec/fec/static/js/templates/party-coordinated-expenditures.hbs +++ b/fec/fec/static/js/templates/party-coordinated-expenditures.hbs @@ -7,15 +7,15 @@ This shows all the fields available on the Schedule F form.

Committee information

- {{#panelRow "Name"}} + {{#panelRow "Name"~}} {{committee.name}} {{/panelRow}} {{#if subordinate_committee}} - {{#panelRow "Full Name of Subordinate Committee"}} + {{#panelRow "Full Name of Subordinate Committee"~}} {{subordinate_committee.name}} {{/panelRow}} {{/if}} - {{#panelRow "Mailing Address"}} + {{#panelRow "Mailing Address"~}} {{committee.street_1}}
{{committee.city}}, {{committee.state}} {{zipCode committee.zip}} {{/panelRow}} @@ -25,19 +25,19 @@ This shows all the fields available on the Schedule F form.

Candidate information

- {{#panelRow "Candidate"}} + {{#panelRow "Candidate"~}} {{candidate_last_name}}, {{candidate_first_name}} {{candidate_middle_name}} {{/panelRow}} - {{#panelRow "Office"}} + {{#panelRow "Office"~}} {{candidate_office_full}} {{/panelRow}} {{#if candidate_office_state}} - {{#panelRow "State"}} + {{#panelRow "State"~}} {{candidate_office_state_full}} {{/panelRow}} {{/if}} {{#if candidate_office_district}} - {{#panelRow "District"}} + {{#panelRow "District"~}} {{candidate_office_district}} {{/panelRow}} {{/if}} @@ -47,21 +47,21 @@ This shows all the fields available on the Schedule F form.

Expenditure information

- {{#panelRow "Payee"}} - {{#if payee_name}} + {{#panelRow "Payee"~}} + {{#if payee_name~}} {{payee_name}} {{/if}} {{/panelRow}} - {{#panelRow "Purpose of Expenditure"}} + {{#panelRow "Purpose of Expenditure"~}} {{{expenditure_purpose_full}}} {{/panelRow}} - {{#panelRow "Category/Type"}} + {{#panelRow "Category/Type"~}} {{{expenditure_type}}} {{/panelRow}} - {{#panelRow "Date"}} + {{#panelRow "Date"~}} {{datetime expenditure_date}} {{/panelRow}} - {{#panelRow "Amount"}} + {{#panelRow "Amount"~}} {{currency expenditure_amount}} {{/panelRow}}
diff --git a/fec/fec/static/js/templates/receipts.hbs b/fec/fec/static/js/templates/receipts.hbs index 942010db49..f93185041a 100644 --- a/fec/fec/static/js/templates/receipts.hbs +++ b/fec/fec/static/js/templates/receipts.hbs @@ -2,37 +2,37 @@

Source information

- {{#panelRow "Name"}} - {{#if contributor}} {{#if (isEarmarked receipt_type) }} + {{#panelRow "Name"~}} + {{#if contributor~}} {{contributor_name}} - {{else }} + {{else~}} {{contributor.name}} {{/if}} - {{else}} + {{else~}} {{contributor_name}} {{/if}} {{/panelRow}} - {{#if contributor}} - {{#if (isEarmarked receipt_type) }} - {{#panelRow "Earmarked by"}} + {{#if contributor~}} + {{#if (isEarmarked receipt_type)~}} + {{#panelRow "Earmarked by"~}} {{contributor.name}} {{/panelRow}} {{/if}} {{/if}} - {{#panelRow "City, state and ZIP code"}} + {{#panelRow "City, state and ZIP code"~}} {{contributor_city}}, {{contributor_state}} {{zipCode contributor_zip}} {{/panelRow}} {{#if is_individual}} - {{#panelRow "Occupation"}} + {{#panelRow "Occupation"~}} {{contributor_occupation}} {{/panelRow}} - {{#panelRow "Employer"}} + {{#panelRow "Employer"~}} {{contributor_employer}} {{/panelRow}} {{/if}} - {{#panelRow "Year to date"}} + {{#panelRow "Year to date"~}} {{{currency contributor_aggregate_ytd}}} {{/panelRow}}
@@ -41,24 +41,24 @@

Receipt information

- {{#panelRow "Amount"}} + {{#panelRow "Amount"~}} {{{currency contribution_receipt_amount}}} {{/panelRow}} - {{#panelRow "Receipt date"}} + {{#panelRow "Receipt date"~}} {{{datetime contribution_receipt_date format="pretty"}}} {{/panelRow}} - {{#panelRow "Report year"}} {{{ report_year }}} + {{#panelRow "Report year"~}} {{/panelRow}} - {{#panelRow "Memo"}} + {{#panelRow "Memo"~}} {{memo_text}} {{/panelRow}} {{#if filing_form}} - {{#panelRow "Reported on"}} Form {{formNumber filing_form }} on line {{line_number}} + {{#panelRow "Reported on"~}} {{/panelRow}} {{/if}} - {{#panelRow "Election type"}} + {{#panelRow "Election type"~}} {{fec_election_type_desc}} {{/panelRow}}
@@ -67,16 +67,16 @@

Recipient information

- {{#panelRow "Committee"}} {{ committee.name }} + {{#panelRow "Committee"~}} {{/panelRow}} - {{#panelRow "Political party"}} + {{#panelRow "Political party"~}} {{committee.party_full}} {{/panelRow}} - {{#panelRow "Type"}} + {{#panelRow "Type"~}} {{committee.committee_type_full}} {{/panelRow}} - {{#panelRow "State"}} + {{#panelRow "State"~}} {{committee.state_full}} {{/panelRow}}
diff --git a/fec/fec/static/js/templates/reports/candidate.hbs b/fec/fec/static/js/templates/reports/candidate.hbs index de21213840..160a57d1ba 100644 --- a/fec/fec/static/js/templates/reports/candidate.hbs +++ b/fec/fec/static/js/templates/reports/candidate.hbs @@ -12,33 +12,33 @@ {{{amendment_version}}}
- {{#panelRow "Filer"}} {{ committee_name }} + {{#panelRow "Filer"~}} {{/panelRow}} - {{#panelRow "FEC file number"}} {{ fec_file_id }} + {{#panelRow "FEC file number"~}} {{/panelRow}} - {{#panelRow "Report coverage"}} + {{#panelRow "Report coverage"~}} {{datetime coverage_start_date format="pretty"}} to {{datetime coverage_end_date format="pretty"}} {{/panelRow}} - {{#panelRow "Receipt date"}} + {{#panelRow "Receipt date"~}} {{datetime receipt_date format="pretty"}} {{/panelRow}} - {{#panelRow "Filing method"}} {{ decodeMeans means_filed}} + {{#panelRow "Filing method"~}} {{/panelRow}} - {{#panelRow "Read report"}} - {{#if html_url}} Webpage | + {{#panelRow "Read report"~}} + {{#if html_url~}} {{/if}} - {{#if csv_url}} .csv | + {{#if csv_url~}} {{/if}} - {{#if pdf_url }} .pdf + {{#if pdf_url~}} {{/if}} - {{#if fec_url}} | .fec + {{#if fec_url~}} {{/if}} {{/panelRow}}
@@ -48,35 +48,35 @@

Raising

- {{#panelRow "Total receipts"}} + {{#panelRow "Total receipts"~}} {{{currency total_receipts_period}}} {{/panelRow}} - {{#panelRow "Individual contributions"}} + {{#panelRow "Individual contributions"~}} {{{currency total_individual_contributions_period}}} {{/panelRow}} - {{#panelRow "Itemized individual contributions"}} + {{#panelRow "Itemized individual contributions"~}} {{{currency individual_itemized_contributions_period}}} {{/panelRow}} - {{#panelRow "Unitemized individual contributions"}} + {{#panelRow "Unitemized individual contributions"~}} {{{currency individual_unitemized_contributions_period}}} {{/panelRow}} - {{#panelRow "Contributions from PACs"}} + {{#panelRow "Contributions from PACs"~}} {{{currency political_party_committee_contributions_period}}} {{/panelRow}} - {{#panelRow "Total contribution refunds"}} + {{#panelRow "Total contribution refunds"~}} {{{currency total_contribution_refunds_period}}} {{/panelRow}} {{#if net_contributions_period}} - {{#panelRow "Net contributions period"}} + {{#panelRow "Net contributions period"~}} {{{currency net_contributions_period}}} {{/panelRow}} {{else}} - {{#panelRow "Net contributions cycle to date"}} + {{#panelRow "Net contributions cycle to date"~}} {{{currency net_contributions_cycle_to_date}}} {{/panelRow}} {{/if}} {{#if federal_funds_period}} - {{#panelRow "Presidential public funds accepted"}} + {{#panelRow "Presidential public funds accepted"~}} {{{currency federal_funds_period}}} {{/panelRow}} {{/if}} @@ -87,19 +87,19 @@

Spending

- {{#panelRow "Total disbursements"}} + {{#panelRow "Total disbursements"~}} {{{currency total_disbursements_period}}} {{/panelRow}} {{#if net_operating_expenditures_period}} - {{#panelRow "Net operating expenditures period"}} + {{#panelRow "Net operating expenditures period"~}} {{{currency net_operating_expenditures_period}}} {{/panelRow}} {{else}} - {{#panelRow "Net operating expenditures cycle to date"}} + {{#panelRow "Net operating expenditures cycle to date"~}} {{{currency net_operating_expenditures_cycle_to_date}}} {{/panelRow}} {{/if}} - {{#panelRow "Transfers to authorized committees"}} + {{#panelRow "Transfers to authorized committees"~}} {{{currency transfers_to_other_authorized_committee_period}}} {{/panelRow}}
@@ -109,10 +109,10 @@

Cash on hand

- {{#panelRow "Beginning cash on hand"}} + {{#panelRow "Beginning cash on hand"~}} {{{currency cash_on_hand_beginning_period}}} {{/panelRow}} - {{#panelRow "Ending cash on hand"}} + {{#panelRow "Ending cash on hand"~}} {{{currency cash_on_hand_end_period}}} {{/panelRow}}
@@ -122,10 +122,10 @@

Debts

- {{#panelRow "Debts owed by committee"}} + {{#panelRow "Debts owed by committee"~}} {{{currency debts_owed_by_committee}}} {{/panelRow}} - {{#panelRow "Debts owed to committee"}} + {{#panelRow "Debts owed to committee"~}} {{{currency debts_owed_to_committee}}} {{/panelRow}}
@@ -135,10 +135,10 @@

Loans

- {{#panelRow "Total loans received"}} + {{#panelRow "Total loans received"~}} {{{currency total_loans_received_period}}} {{/panelRow}} - {{#panelRow "Loan repayments made"}} + {{#panelRow "Loan repayments made"~}} {{{currency total_loan_repayments_made_period}}} {{/panelRow}}
diff --git a/fec/fec/static/js/templates/reports/ie-only.hbs b/fec/fec/static/js/templates/reports/ie-only.hbs index d5095949c3..83d298cdfa 100644 --- a/fec/fec/static/js/templates/reports/ie-only.hbs +++ b/fec/fec/static/js/templates/reports/ie-only.hbs @@ -1,55 +1,55 @@

{{document_description}} - {{#if is_amended}} + {{#if is_amended~}} (This report has been amended) {{/if}}

- {{#if amendment_version_description}} + {{#if amendment_version_description~}} {{{amendment_version_description}}} | {{/if}} {{{amendment_version}}}
- {{#panelRow "Filer"}} {{ committee_name }} + {{#panelRow "Filer"~}} {{/panelRow}} - {{#panelRow "FEC file number"}} {{ fec_file_id }} + {{#panelRow "FEC file number"~}} {{/panelRow}} - {{#panelRow "Report coverage"}} + {{#panelRow "Report coverage"~}} {{datetime coverage_start_date format="pretty"}} to {{datetime coverage_end_date format="pretty"}} {{/panelRow}} - {{#panelRow "Receipt date"}} + {{#panelRow "Receipt date"~}} {{datetime receipt_date format="pretty"}} {{/panelRow}} - {{#panelRow "Filing method"}} {{ decodeMeans means_filed}} + {{#panelRow "Filing method"~}} {{/panelRow}} - {{#panelRow "Read report"}} - {{#if html_url}} Webpage | + {{#panelRow "Read report"~}} + {{#if html_url~}} {{/if}} - {{#if csv_url}} .csv | + {{#if csv_url~}} {{/if}} - {{#if pdf_url }} .pdf + {{#if pdf_url~}} {{/if}} - {{#if fec_url}} | .fec + {{#if fec_url~}} {{/if}} {{/panelRow}}
- {{#panelRow "Total contributions"}} {{{currency independent_contributions_period }}} + {{#panelRow "Total contributions"~}} {{/panelRow}} - {{#panelRow "Total independent expenditures"}} {{{currency independent_expenditures_period }}} + {{#panelRow "Total independent expenditures"~}} {{/panelRow}}
diff --git a/fec/fec/static/js/templates/reports/pac.hbs b/fec/fec/static/js/templates/reports/pac.hbs index f663b333fb..783d0412fe 100644 --- a/fec/fec/static/js/templates/reports/pac.hbs +++ b/fec/fec/static/js/templates/reports/pac.hbs @@ -5,37 +5,37 @@ (This report has been amended) {{/if}} - {{#if amendment_version_description}} + {{#if amendment_version_description~}} {{{amendment_version_description}}} | {{/if}} {{{amendment_version}}}
- {{#panelRow "Filer"}} {{ committee_name }} + {{#panelRow "Filer"~}} {{/panelRow}} - {{#panelRow "FEC file number"}} {{ fec_file_id }} + {{#panelRow "FEC file number"~}} {{/panelRow}} - {{#panelRow "Report coverage"}} + {{#panelRow "Report coverage"~}} {{datetime coverage_start_date format="pretty"}} to {{datetime coverage_end_date format="pretty"}} {{/panelRow}} - {{#panelRow "Receipt date"}} + {{#panelRow "Receipt date"~}} {{datetime receipt_date format="pretty"}} {{/panelRow}} - {{#panelRow "Filing method"}} {{ decodeMeans means_filed}} + {{#panelRow "Filing method"~}} {{/panelRow}} - {{#panelRow "Read report"}} - {{#if html_url}} Webpage | + {{#panelRow "Read report"~}} + {{#if html_url~}} {{/if}} - {{#if csv_url}} .csv | + {{#if csv_url~}} {{/if}} - {{#if pdf_url }} .pdf + {{#if pdf_url~}} {{/if}} {{#if fec_url}} | .fec @@ -45,40 +45,40 @@
- {{#panelRow "Total receipts"}} + {{#panelRow "Total receipts"~}} {{{currency total_receipts_period}}} {{/panelRow}} - {{#panelRow "Total disbursements"}} + {{#panelRow "Total disbursements"~}} {{{currency total_disbursements_period}}} {{/panelRow}} - {{#panelRow "Individual contributions"}} + {{#panelRow "Individual contributions"~}} {{{currency total_individual_contributions_period}}} {{/panelRow}} - {{#panelRow "Itemized individual contributions"}} + {{#panelRow "Itemized individual contributions"~}} {{{currency individual_itemized_contributions_period}}} {{/panelRow}} - {{#panelRow "Unitemized individual contributions"}} + {{#panelRow "Unitemized individual contributions"~}} {{{currency individual_unitemized_contributions_period}}} {{/panelRow}} - {{#panelRow "Beginning cash on hand"}} + {{#panelRow "Beginning cash on hand"~}} {{{currency cash_on_hand_beginning_period}}} {{/panelRow}} - {{#panelRow "Ending cash on hand"}} + {{#panelRow "Ending cash on hand"~}} {{{currency cash_on_hand_end_period}}} {{/panelRow}} - {{#panelRow "Net contributions"}} + {{#panelRow "Net contributions"~}} {{{currency net_contributions_period}}} {{/panelRow}} - {{#panelRow "Net operating expenditures"}} + {{#panelRow "Net operating expenditures"~}} {{{currency net_operating_expenditures_period}}} {{/panelRow}} - {{#panelRow "Debts owed by committee"}} + {{#panelRow "Debts owed by committee"~}} {{{currency debts_owed_by_committee}}} {{/panelRow}} - {{#panelRow "Coordinated expenditures by party committee this period"}} + {{#panelRow "Coordinated expenditures by party committee this period"~}} {{{currency coordinated_expenditures_by_party_committee_period}}} {{/panelRow}} - {{#panelRow "Independent expenditures this period"}} + {{#panelRow "Independent expenditures this period"~}} {{{currency independent_expenditures_period}}} {{/panelRow}}
From 87168cc787fb44b4ce2db8c2b5716905104b9b26 Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 11 Sep 2024 08:39:50 -0400 Subject: [PATCH 2/8] Consistent formatting --- fec/fec/static/js/pages/contact-form.js | 8 +++--- fec/fec/static/js/templates/candidates.hbs | 4 +-- .../js/templates/communication-costs.hbs | 22 ++++++++-------- fec/fec/static/js/templates/disbursements.hbs | 6 ++--- .../electioneering-communications.hbs | 18 ++++++------- fec/fec/static/js/templates/pac-party.hbs | 26 +++++++++---------- fec/fec/static/js/templates/receipts.hbs | 8 +++--- .../static/js/templates/reports/candidate.hbs | 14 +++++----- .../static/js/templates/reports/ie-only.hbs | 18 ++++++------- fec/fec/static/js/templates/reports/pac.hbs | 14 +++++----- 10 files changed, 69 insertions(+), 69 deletions(-) diff --git a/fec/fec/static/js/pages/contact-form.js b/fec/fec/static/js/pages/contact-form.js index e46aab7aaa..70f040cc4c 100644 --- a/fec/fec/static/js/pages/contact-form.js +++ b/fec/fec/static/js/pages/contact-form.js @@ -65,7 +65,7 @@ ContactForm.prototype.initOtherReason = function() { /** * - * @param {JQuery.Event} e + * @param {jQuery.Event} e */ ContactForm.prototype.toggleOtherReason = function(e) { if (e.target.value === 'other') { @@ -77,7 +77,7 @@ ContactForm.prototype.toggleOtherReason = function(e) { /** * - * @param {JQuery.Event} e + * @param {jQuery.Event} e */ ContactForm.prototype.clearForm = function(e) { e.preventDefault(); @@ -88,7 +88,7 @@ ContactForm.prototype.clearForm = function(e) { /** * Analyst lookup tool - * @param {JQuery.$element} $elm + * @param {jQuery} $elm */ export function AnalystLookup($elm) { this.$elm = $elm; @@ -167,7 +167,7 @@ AnalystLookup.prototype.hideAnalyst = function() { /** * - * @param {JQuery.Event} e + * @param {jQuery.Event} e */ AnalystLookup.prototype.handleChange = function(e) { if (!$(e.target).val()) { diff --git a/fec/fec/static/js/templates/candidates.hbs b/fec/fec/static/js/templates/candidates.hbs index e90800fdcf..f5991e8838 100644 --- a/fec/fec/static/js/templates/candidates.hbs +++ b/fec/fec/static/js/templates/candidates.hbs @@ -46,7 +46,7 @@ {{#each committees.principal~}}
  • - {{ this.name}} + {{this.name}}
  • {{/each}} @@ -58,7 +58,7 @@ {{#each committees.authorized~}}
  • - {{ this.name}} + {{this.name}}
  • {{/each}} diff --git a/fec/fec/static/js/templates/communication-costs.hbs b/fec/fec/static/js/templates/communication-costs.hbs index 3d8b33cc9b..5430628704 100644 --- a/fec/fec/static/js/templates/communication-costs.hbs +++ b/fec/fec/static/js/templates/communication-costs.hbs @@ -4,26 +4,26 @@ {{#panelRow "Committee name"~}} {{committee_name}} {{/panelRow}} - {{ currency transaction_amount }} {{#panelRow "Amount"~}} + {{currency transaction_amount}} {{/panelRow}} - {{ report_year }} {{#panelRow "Report year"~}} + {{report_year}} {{/panelRow}} - {{ datetime transaction_date format=pretty }} {{#panelRow "Transaction date"~}} + {{datetime transaction_date format=pretty}} {{/panelRow}} {{#panelRow "Transaction type"~}} {{transaction_type}} {{/panelRow}} - {{ communication_class }} {{#panelRow "Communication class"~}} + {{communication_class}} {{/panelRow}} - {{ communication_type }} {{#panelRow "Communication type"~}} + {{communication_type}} {{/panelRow}} - {{ purpose }} {{#panelRow "Purpose"~}} + {{purpose}} {{/panelRow}}
    @@ -34,20 +34,20 @@ {{#panelRow "Candidate"~}} {{candidate_name}} ({{decodeSupportOppose support_oppose_indicator}}) {{/panelRow}} - {{ decodeParty candidate_party_affiliation }} {{#panelRow "Party"~}} + {{decodeParty candidate_party_affiliation}} {{/panelRow}} - {{ decodeOffice candidate_office }} {{#panelRow "Office"~}} + {{decodeOffice candidate_office}} {{/panelRow}} - {{#if candidate_office_state }} - {{ decodeState candidate_office_state }} + {{#if candidate_office_state}} {{#panelRow "State"~}} + {{decodeState candidate_office_state}} {{/panelRow}} {{/if}} {{#if candidate_office_district}} - {{ candidate_office_district }} {{#panelRow "District"~}} + {{candidate_office_district}} {{/panelRow}} {{/if}} diff --git a/fec/fec/static/js/templates/disbursements.hbs b/fec/fec/static/js/templates/disbursements.hbs index f482f5e2b2..bc1ecd856f 100644 --- a/fec/fec/static/js/templates/disbursements.hbs +++ b/fec/fec/static/js/templates/disbursements.hbs @@ -26,8 +26,8 @@ {{#panelRow "Disbursement date"~}} {{{datetime disbursement_date format="pretty"}}} {{/panelRow}} - {{{ report_year }}} {{#panelRow "Report year"~}} + {{{report_year}}} {{/panelRow}} {{#panelRow "Filing date"~}} {{{datetime receipt_date format="pretty"}}} @@ -44,10 +44,10 @@ {{#panelRow "Memo code"~}} {{memoed_subtotal}} {{/panelRow}} - Form {{formNumber filing_form }} on line {{line_number}} {{#panelRow "Reported on"~}} + Form {{formNumber filing_form}} on line {{line_number}} {{/panelRow}} - {{#if election_type_full }} + {{#if election_type_full}} {{#panelRow "Election type"~}} {{election_type_full}} {{/panelRow}} diff --git a/fec/fec/static/js/templates/electioneering-communications.hbs b/fec/fec/static/js/templates/electioneering-communications.hbs index ee41ab4f7c..85fcb02e9c 100644 --- a/fec/fec/static/js/templates/electioneering-communications.hbs +++ b/fec/fec/static/js/templates/electioneering-communications.hbs @@ -4,11 +4,11 @@ {{#panelRow "Spender"~}} {{committee_name}} {{/panelRow}} - {{ currency disbursement_amount }} {{#panelRow "Amount"~}} + {{currency disbursement_amount}} {{/panelRow}} - {{ number_of_candidates }} {{#panelRow "Number of candidates mentioned"~}} + {{number_of_candidates}} {{/panelRow}} @@ -21,20 +21,20 @@
    - {{ currency calculated_candidate_share }} + {{currency calculated_candidate_share}} - {{ report_year }} {{#panelRow "Report year"~}} + {{report_year}} {{/panelRow}} - {{ datetime disbursement_date format=pretty }} {{#panelRow "Disbursement date"~}} + {{datetime disbursement_date format=pretty}} {{/panelRow}} - {{ datetime communication_date format=pretty }} {{#panelRow "Communication date"~}} + {{datetime communication_date format=pretty}} {{/panelRow}} - {{ purpose_description }} {{#panelRow "Purpose description"~}} + {{purpose_description}} {{/panelRow}}
    @@ -45,15 +45,15 @@ {{#panelRow "Candidate"~}} {{candidate_name}} {{/panelRow}} - {{ decodeOffice candidate_office }} {{#panelRow "Office"~}} + {{decodeOffice candidate_office}} {{/panelRow}} {{#if candidate_state}} {{#panelRow "State"~}} {{decodeState candidate_state}} {{/panelRow}} {{/if}} - {{#unless (eq candidate_district '00') }} + {{#unless (eq candidate_district '00')}} {{#panelRow "District"~}} {{candidate_district}} {{/panelRow}} diff --git a/fec/fec/static/js/templates/pac-party.hbs b/fec/fec/static/js/templates/pac-party.hbs index b8c10ec62b..dc9bcc890f 100644 --- a/fec/fec/static/js/templates/pac-party.hbs +++ b/fec/fec/static/js/templates/pac-party.hbs @@ -22,25 +22,25 @@ Template for PAC and party committee datatable details panel {{/panelRow}} {{/if}} {{#if sponsor_candidate_list}} - {{ sponsor_candidate_name }} ({{ sponsor_candidate_id }}){{#unless @last}};
    {{/unless}} {{#panelRow "Leadership PAC sponsor"~}} {{#each sponsor_candidate_list~}} + {{sponsor_candidate_name}} ({{sponsor_candidate_id}}){{#unless @last}};
    {{/unless}} {{/each}} {{/panelRow}} {{/if}} - {{ treasurer_name }} {{#panelRow "Most recent treasurer"~}} + {{treasurer_name}} {{/panelRow}} - {{ committee_state }} {{#panelRow "State"~}} + {{committee_state}} {{/panelRow}} - {{ filing_frequency_full }} {{#panelRow "Filing frequency"~}} + {{filing_frequency_full}} {{/panelRow}} - {{ datetime first_f1_date format="pretty" }} {{#panelRow "Registration date"~}} + {{datetime first_f1_date format="pretty"}} {{/panelRow}} - {{#if (eq committee_designation_full "Joint fundraising committee") }} + {{#if (eq committee_designation_full "Joint fundraising committee")}} {{#panelRow "Joint fundraising participants"~}} Full list of current participants {{/panelRow}} @@ -50,14 +50,14 @@ Template for PAC and party committee datatable details panel

    - Financial totals for {{ format_range cycle }} + Financial totals for {{format_range cycle}}

    - {{ datetime coverage_end_date format="pretty" }} {{#panelRow "Coverage end date"~}} + {{datetime coverage_end_date format="pretty"}} {{/panelRow}} - {{ currency receipts }} {{#panelRow "Receipts"~}} + {{currency receipts}} {{/panelRow}} - {{ currency disbursements }} {{#panelRow "Disbursements"~}} + {{currency disbursements}} {{/panelRow}} - {{ currency last_debts_owed_by_committee }} {{#panelRow "Debts owed by committee"~}} + {{currency last_debts_owed_by_committee}} {{/panelRow}}
    @@ -70,11 +70,11 @@ Template for PAC and party committee datatable details panel - {{ currency individual_contributions }} + {{currency individual_contributions}}
    @@ -87,11 +87,11 @@ Template for PAC and party committee datatable details panel - {{ currency last_cash_on_hand_end_period }} + {{currency last_cash_on_hand_end_period}}
    diff --git a/fec/fec/static/js/templates/receipts.hbs b/fec/fec/static/js/templates/receipts.hbs index f93185041a..93072d8de0 100644 --- a/fec/fec/static/js/templates/receipts.hbs +++ b/fec/fec/static/js/templates/receipts.hbs @@ -2,9 +2,9 @@

    Source information

    - {{#if (isEarmarked receipt_type) }} {{#panelRow "Name"~}} {{#if contributor~}} + {{#if (isEarmarked receipt_type)~}} {{contributor_name}} {{else~}} {{contributor.name}} @@ -47,15 +47,15 @@ {{#panelRow "Receipt date"~}} {{{datetime contribution_receipt_date format="pretty"}}} {{/panelRow}} - {{{ report_year }}} {{#panelRow "Report year"~}} + {{{report_year}}} {{/panelRow}} {{#panelRow "Memo"~}} {{memo_text}} {{/panelRow}} {{#if filing_form}} - Form {{formNumber filing_form }} on line {{line_number}} {{#panelRow "Reported on"~}} + Form {{formNumber filing_form}} on line {{line_number}} {{/panelRow}} {{/if}} {{#panelRow "Election type"~}} @@ -67,8 +67,8 @@

    Recipient information

    - {{ committee.name }} {{#panelRow "Committee"~}} + {{committee.name}} {{/panelRow}} {{#panelRow "Political party"~}} {{committee.party_full}} diff --git a/fec/fec/static/js/templates/reports/candidate.hbs b/fec/fec/static/js/templates/reports/candidate.hbs index 160a57d1ba..bf54a54189 100644 --- a/fec/fec/static/js/templates/reports/candidate.hbs +++ b/fec/fec/static/js/templates/reports/candidate.hbs @@ -12,11 +12,11 @@ {{{amendment_version}}}
    - {{ committee_name }} {{#panelRow "Filer"~}} + {{committee_name}} {{/panelRow}} - {{ fec_file_id }} {{#panelRow "FEC file number"~}} + {{fec_file_id}} {{/panelRow}} {{#panelRow "Report coverage"~}} {{datetime coverage_start_date format="pretty"}} to {{datetime coverage_end_date format="pretty"}} @@ -24,21 +24,21 @@ {{#panelRow "Receipt date"~}} {{datetime receipt_date format="pretty"}} {{/panelRow}} - {{ decodeMeans means_filed}} {{#panelRow "Filing method"~}} + {{decodeMeans means_filed}} {{/panelRow}} - Webpage | {{#panelRow "Read report"~}} {{#if html_url~}} + Webpage | {{/if}} - .csv | {{#if csv_url~}} + .csv | {{/if}} - .pdf {{#if pdf_url~}} + .pdf {{/if}} - | .fec {{#if fec_url~}} + | .fec {{/if}} {{/panelRow}}
    diff --git a/fec/fec/static/js/templates/reports/ie-only.hbs b/fec/fec/static/js/templates/reports/ie-only.hbs index 83d298cdfa..699553baf3 100644 --- a/fec/fec/static/js/templates/reports/ie-only.hbs +++ b/fec/fec/static/js/templates/reports/ie-only.hbs @@ -12,11 +12,11 @@ {{{amendment_version}}}
    - {{ committee_name }} {{#panelRow "Filer"~}} + {{committee_name}} {{/panelRow}} - {{ fec_file_id }} {{#panelRow "FEC file number"~}} + {{fec_file_id}} {{/panelRow}} {{#panelRow "Report coverage"~}} {{datetime coverage_start_date format="pretty"}} to {{datetime coverage_end_date format="pretty"}} @@ -24,32 +24,32 @@ {{#panelRow "Receipt date"~}} {{datetime receipt_date format="pretty"}} {{/panelRow}} - {{ decodeMeans means_filed}} {{#panelRow "Filing method"~}} + {{decodeMeans means_filed}} {{/panelRow}} - Webpage | {{#panelRow "Read report"~}} {{#if html_url~}} + Webpage | {{/if}} - .csv | {{#if csv_url~}} + .csv | {{/if}} - .pdf {{#if pdf_url~}} + .pdf {{/if}} - | .fec {{#if fec_url~}} + | .fec {{/if}} {{/panelRow}}
    - {{{currency independent_contributions_period }}} {{#panelRow "Total contributions"~}} + {{{currency independent_contributions_period}}} {{/panelRow}} - {{{currency independent_expenditures_period }}} {{#panelRow "Total independent expenditures"~}} + {{{currency independent_expenditures_period}}} {{/panelRow}}
    diff --git a/fec/fec/static/js/templates/reports/pac.hbs b/fec/fec/static/js/templates/reports/pac.hbs index 783d0412fe..b02fc2c0a7 100644 --- a/fec/fec/static/js/templates/reports/pac.hbs +++ b/fec/fec/static/js/templates/reports/pac.hbs @@ -12,11 +12,11 @@ {{{amendment_version}}}
    - {{ committee_name }} {{#panelRow "Filer"~}} + {{committee_name}} {{/panelRow}} - {{ fec_file_id }} {{#panelRow "FEC file number"~}} + {{fec_file_id}} {{/panelRow}} {{#panelRow "Report coverage"~}} {{datetime coverage_start_date format="pretty"}} to {{datetime coverage_end_date format="pretty"}} @@ -24,21 +24,21 @@ {{#panelRow "Receipt date"~}} {{datetime receipt_date format="pretty"}} {{/panelRow}} - {{ decodeMeans means_filed}} {{#panelRow "Filing method"~}} + {{decodeMeans means_filed}} {{/panelRow}} - Webpage | {{#panelRow "Read report"~}} {{#if html_url~}} + Webpage | {{/if}} - .csv | {{#if csv_url~}} + .csv | {{/if}} - .pdf {{#if pdf_url~}} + .pdf {{/if}} {{#if fec_url}} - | .fec + | .fec {{/if}} {{/panelRow}}
    From e5ed05a15181c2004f064018fc1af1a2f4534e2f Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 25 Oct 2024 10:35:41 -0400 Subject: [PATCH 3/8] Create dtDetailsTableRow Handlebars helper --- fec/fec/static/js/modules/helpers.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fec/fec/static/js/modules/helpers.js b/fec/fec/static/js/modules/helpers.js index 296754eb74..d7e35466f7 100644 --- a/fec/fec/static/js/modules/helpers.js +++ b/fec/fec/static/js/modules/helpers.js @@ -246,6 +246,10 @@ Handlebars.registerHelper('panelRow', function(label, options) { ); }); +Handlebars.registerHelper('dtDetailsTableRow', function(label, options) { + return new Handlebars.SafeString(`${label}${options.fn(this)}`); +}); + /** * @function entityUrl * @param {Object} entity - the data object, likely from the API From f325c37fc28aa191b1a7192e2371f0f783fc7132 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 25 Oct 2024 11:48:13 -0400 Subject: [PATCH 4/8] Update templates from panelRow to dtDetailsTableRow --- .../templates/partials/datatable-modal.jinja | 20 --- fec/fec/static/js/modules/filings.js | 4 +- fec/fec/static/js/modules/tables.js | 89 +++++------ ...cated-federal-nonfederal-disbursements.hbs | 71 ++++----- fec/fec/static/js/templates/candidates.hbs | 79 +++++----- fec/fec/static/js/templates/committees.hbs | 43 +++--- .../js/templates/communication-costs.hbs | 60 ++++---- fec/fec/static/js/templates/debts.hbs | 82 +++++------ fec/fec/static/js/templates/disbursements.hbs | 84 +++++------ .../electioneering-communications.hbs | 58 ++++---- .../js/templates/independent-expenditures.hbs | 90 ++++++------ fec/fec/static/js/templates/loans.hbs | 46 +++--- .../national-party-account-disbursements.hbs | 74 +++++----- .../national-party-account-receipts.hbs | 80 +++++----- fec/fec/static/js/templates/pac-party.hbs | 82 +++++------ .../party-coordinated-expenditures.hbs | 63 ++++---- fec/fec/static/js/templates/receipts.hbs | 92 ++++++------ .../static/js/templates/reports/candidate.hbs | 138 +++++++++--------- .../static/js/templates/reports/ie-only.hbs | 42 +++--- fec/fec/static/js/templates/reports/pac.hbs | 84 +++++------ fec/fec/static/scss/components/_buttons.scss | 11 +- .../components/_datatable-details-row.scss | 102 +++++++++++++ .../scss/components/_datatable-panel.scss | 15 -- .../static/scss/components/_datatables.scss | 2 +- fec/fec/static/scss/datatables.scss | 2 +- fec/fec/static/scss/entity.scss | 2 - 26 files changed, 782 insertions(+), 733 deletions(-) delete mode 100644 fec/data/templates/partials/datatable-modal.jinja create mode 100644 fec/fec/static/scss/components/_datatable-details-row.scss diff --git a/fec/data/templates/partials/datatable-modal.jinja b/fec/data/templates/partials/datatable-modal.jinja deleted file mode 100644 index 00de3c9fe9..0000000000 --- a/fec/data/templates/partials/datatable-modal.jinja +++ /dev/null @@ -1,20 +0,0 @@ - diff --git a/fec/fec/static/js/modules/filings.js b/fec/fec/static/js/modules/filings.js index 9b2da3cfe2..cd744c52cd 100644 --- a/fec/fec/static/js/modules/filings.js +++ b/fec/fec/static/js/modules/filings.js @@ -1,6 +1,6 @@ import { default as _extend } from 'underscore/modules/extend.js'; -import { MODAL_TRIGGER_CLASS, modalRenderFactory } from './tables.js'; +import { DETAILS_TRIGGER_CLASS, modalRenderFactory } from './tables.js'; import { amendmentVersion, amendmentVersionDescription, buildUrl } from '../modules/helpers.js'; import { default as candidateTemplate } from '../templates/reports/candidate.hbs'; import { default as ieTemplate } from '../templates/reports/ie-only.hbs'; @@ -40,6 +40,6 @@ export const renderModal = modalRenderFactory( export function renderRow(row, data) { if (data.form_type && data.form_type.match(/^F[35][XP]?$/)) { - row.classList.add(MODAL_TRIGGER_CLASS, 'row--has-panel'); + row.classList.add(DETAILS_TRIGGER_CLASS, 'row--has-details'); } } diff --git a/fec/fec/static/js/modules/tables.js b/fec/fec/static/js/modules/tables.js index eda9ceed6e..0ec3a9ad03 100644 --- a/fec/fec/static/js/modules/tables.js +++ b/fec/fec/static/js/modules/tables.js @@ -13,7 +13,7 @@ import { default as _pairs } from 'underscore/modules/pairs.js'; import { default as _pluck } from 'underscore/modules/pluck.js'; import 'datatables.net-responsive-dt'; -import { removeTabindex, restoreTabindex } from './accessibility.js'; +// import { removeTabindex, restoreTabindex } from './accessibility.js'; import { sizeColumns, stateColumns } from './column-helpers.js'; import { download, isPending, pendingCount } from './download.js'; import Dropdown from './dropdowns.js'; @@ -159,17 +159,15 @@ function identity(value) { return value; } -export const MODAL_TRIGGER_CLASS = 'js-panel-trigger'; +export const DETAILS_TRIGGER_CLASS = 'js-dt-details-trigger'; export const MODAL_TRIGGER_HTML = - ''; + ``; /** * @param {HTMLTableRowElement} row */ export function modalRenderRow(row) { - row.classList.add(MODAL_TRIGGER_CLASS, 'row--has-panel'); + row.classList.add(DETAILS_TRIGGER_CLASS, 'row--has-details'); } /** @@ -183,10 +181,6 @@ export function modalRenderFactory(template, fetch) { return function(api, data, response) { const $table = $(api.table().node()); - const $modal = $('#datatable-modal'); - const $main = $table.closest('.panel__main'); - // Move the modal to the results div. - $modal.appendTo($main); $modal.css('display', 'block'); // Add a class to the .dataTables_wrapper @@ -198,7 +192,6 @@ export function modalRenderFactory(template, fetch) { callback ); callback = function(e) { - console.log('click callback'); console.log(' e.type: ', e.type); console.log(' e.which: ', e.which); @@ -215,33 +208,32 @@ export function modalRenderFactory(template, fetch) { // const row = api.row($table, tr); // else row.child(format(row.data())).show(); - if (!$target.closest('td').hasClass('dataTables_empty')) { const row = api.row($row); + const index = row.index(); + + $row.removeClass('row-active'); + $row.removeAttr('aria-details'); + return; + } + $.when(fetch(response.results[index])).done(function(fetched) { - $modal.find('.js-panel-content').html(template(fetched)); - $modal.attr('aria-hidden', 'false'); - $row.siblings().toggleClass('row-active', false); $row.toggleClass('row-active', true); - $('body').toggleClass('panel-active', true); - restoreTabindex($modal); - const hideColumns = api.columns('.hide-panel'); - hideColumns.visible(false); - - // Populate the pdf button if there is one - if (fetched.pdf_url) { - $modal.find('.js-pdf_url').attr('href', fetched.pdf_url); - } else { - $modal.find('.js-pdf_url').remove(); - } - // Set focus on the close button - $('.js-hide').focus(); // TODO: jQuery deprecation - - // When under $large-screen - // TODO figure way to share these values with CSS. - if ($(document).width() < 980) { - api.columns('.hide-panel-tablet').visible(false); - } + const newChildRowContent = template(fetched); + const newChildRowHtml = childRow(newChildRowContent); + const newChildRow = row.child(newChildRowHtml); + + newChildRow.show(); + $row.addClass('row-active'); + row.child().addClass('dt-isChild row-active'); + // Aria link the normal row and its child/details row + row.child().attr('id', `details-for-tr-${index}`); + $row.attr('aria-details', `details-for-tr-${index}`); + const newChildRowPdfButton = $row.next().find('.js-pdf_url'); + if (fetched.pdf_url) + newChildRowPdfButton.attr('href', fetched.pdf_url); + else + newChildRowPdfButton.remove(); }); } } @@ -251,31 +243,14 @@ export function modalRenderFactory(template, fetch) { '.js-panel-toggle tr.' + MODAL_TRIGGER_CLASS, callback ); - - $modal.on('click', '.js-panel-close', function(e) { e.preventDefault(); hidePanel(api, $modal); - }); }; } -function hidePanel(api, $modal) { $('.row-active .js-panel-button').focus(); // TODO: jQuery deprecation $('.js-panel-toggle tr').toggleClass('row-active', false); $('body').toggleClass('panel-active', false); - $modal.attr('aria-hidden', 'true'); - - if ($(document).width() > 640) { - api.columns('.hide-panel-tablet').visible(true); - api.columns('.hide-panel.min-tablet').visible(true); - } - - if ($(document).width() > 980) { - api.columns('.hide-panel').visible(true); - } - - removeTabindex($modal); -} /** * * @param {?string} template @@ -1336,3 +1311,15 @@ function drawContributionsByStateTable(selected, pageContext) { ); }); } + * @returns {string} a string to be used as the innerHTML of the child/details row + */ +function childRow(contents) { + return `
    + +
    + ${contents} +
    +
    `; +} diff --git a/fec/fec/static/js/templates/allocated-federal-nonfederal-disbursements.hbs b/fec/fec/static/js/templates/allocated-federal-nonfederal-disbursements.hbs index 3ed91365ae..b1e6405c88 100644 --- a/fec/fec/static/js/templates/allocated-federal-nonfederal-disbursements.hbs +++ b/fec/fec/static/js/templates/allocated-federal-nonfederal-disbursements.hbs @@ -1,60 +1,61 @@ -
    -

    {{committee.name}}

    -

    Recipient information

    +

    {{committee.name}}

    + +
    - {{#panelRow "Recipient name"~}} + + {{#dtDetailsTableRow "Recipient name"~}} {{payee_name}} - {{/panelRow}} - {{#panelRow "Recipient city, state and ZIP code"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Recipient city, state and ZIP code"~}} {{payee_city}}, {{payee_state}} {{zipCode payee_zip}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Recipient information
    -
    -

    Transaction information

    +
    - {{#panelRow "Activity or event identifier"~}} + + {{#dtDetailsTableRow "Activity or event identifier"~}} {{{activity_or_event}}} - {{/panelRow}} - {{#panelRow "Description"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Description"~}} {{disbursement_purpose}} - {{/panelRow}} - {{#panelRow "Report year"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Report year"~}} {{{report_year}}} - {{/panelRow}} - {{#panelRow "Disbursement date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Disbursement date"~}} {{{datetime event_purpose_date format="pretty"}}} - {{/panelRow}} - {{#panelRow "Federal allocated share"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Federal allocated share"~}} {{{currency federal_share}}} - {{/panelRow}} - {{#panelRow "Nonfederal allocated share"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Nonfederal allocated share"~}} {{{currency nonfederal_share}}} - {{/panelRow}} - {{#panelRow "Combined federal and nonfederal share total amount"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Combined federal and nonfederal share total amount"~}} {{{currency disbursement_amount}}} - {{/panelRow}} - {{#panelRow "Allocated activity or event year-to-date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Allocated activity or event year-to-date"~}} {{{currency event_amount_year_to_date}}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Transaction information
    -
    -

    Committee information

    +
    - {{#panelRow "Name"}} + + {{#dtDetailsTableRow "Name"}} {{committee.name}} - {{/panelRow}} - {{#panelRow "Designation"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Designation"~}} {{committee.designation_full}} - {{/panelRow}} - {{#panelRow "Most recent treasurer"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Most recent treasurer"~}} {{committee.treasurer_name}} - {{/panelRow}} - {{#panelRow "Committee city, state and ZIP code"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Committee city, state and ZIP code"~}} {{committee.city}}, {{committee.state}} {{zipCode committee.zip}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Committee information
    diff --git a/fec/fec/static/js/templates/candidates.hbs b/fec/fec/static/js/templates/candidates.hbs index f5991e8838..e4934f6787 100644 --- a/fec/fec/static/js/templates/candidates.hbs +++ b/fec/fec/static/js/templates/candidates.hbs @@ -1,17 +1,14 @@ -
    -

    - {{name}} -

    -
    -
    -

    Candidate information

    +

    {{name}}

    + +
    - {{#panelRow "Candidate ID"~}} + + {{#dtDetailsTableRow "Candidate ID"~}} {{candidate_id}} - {{/panelRow}} + {{/dtDetailsTableRow}} - - + - {{#panelRow "Office sought"~}} + {{#dtDetailsTableRow "Office sought"~}} {{office_full}} - {{/panelRow}} - {{#panelRow "Political party"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Political party"~}} {{party_full}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#unless (eq office 'P')}} - {{#panelRow "State"~}} + {{#dtDetailsTableRow "State"~}} {{decodeState state}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/unless}} {{#if (eq office 'H')}} - {{#panelRow "District"~}} + {{#dtDetailsTableRow "District"~}} {{district}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} + {{!-- TODO: CHECK committees.principal --}} {{#if committees.principal}} - {{#panelRow "Principal campaign committees"~}} + {{#dtDetailsTableRow "Principal campaign committees"~}}
      {{#each committees.principal~}}
    • @@ -51,10 +48,10 @@
    • {{/each}}
    - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} {{#if committees.authorized}} - {{#panelRow "Authorized campaign committees"~}} + {{#dtDetailsTableRow "Authorized campaign committees"~}} {{#each committees.authorized~}}
  • @@ -62,43 +59,43 @@
  • {{/each}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} {{#if first_form_2}} - {{#panelRow "First statement of candidacy"~}} + {{#dtDetailsTableRow "First statement of candidacy"~}} {{first_form_2.document_description}}Filed: {{datetime first_form_2.receipt_date format='pretty'}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} {{#if last_form_2}} - {{#panelRow "Most recent statement of candidacy"~}} + {{#dtDetailsTableRow "Most recent statement of candidacy"~}} {{last_form_2.document_description}}Filed: {{datetime last_form_2.receipt_date format='pretty'}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} -
    Candidate information
    Election years + Election years {{#each election_years}} {{! we only have election profile pages starting in 1980}} {{#if (gte this 1980)~}} @@ -21,27 +18,27 @@ {{this}}{{#unless @last}}, {{/unless}} {{/if}} {{/each}} -
    + {{#if showFinancialTotals}} -
    -

    Financial totals for {{time_period}}

    +
    - {{#panelRow "Receipts"~}} + + {{#dtDetailsTableRow "Receipts"~}} {{{currency receipts}}} - {{/panelRow}} - {{#panelRow "Disbursements"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Disbursements"~}} {{{currency disbursements}}} - {{/panelRow}} - {{#panelRow "Ending cash on hand"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Ending cash on hand"~}} {{{currency cash_on_hand_end_period}}} - {{/panelRow}} - {{#panelRow "Debts owed by committee"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Debts owed by committee"~}} {{{currency debts_owed_by_committee}}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if (eq office 'P')}} - {{#panelRow "Has accepted presidential public funds"~}} + {{#dtDetailsTableRow "Has accepted presidential public funds"~}} {{convertBoolean federal_funds_flag}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}}
    Financial totals for {{time_period}}
    diff --git a/fec/fec/static/js/templates/committees.hbs b/fec/fec/static/js/templates/committees.hbs index bb18e97e72..13aaa2caeb 100644 --- a/fec/fec/static/js/templates/committees.hbs +++ b/fec/fec/static/js/templates/committees.hbs @@ -1,44 +1,43 @@ -
    -
    -

    {{name}}

    -
    +

    {{name}}

    + +
    - {{#panelRow "Committee type"~}} + {{#dtDetailsTableRow "Committee type"~}} {{committee_type_full}} - {{/panelRow}} - {{#panelRow "Designation"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Designation"~}} {{designation_full}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if party_full}} - {{#panelRow "Political party"~}} + {{#dtDetailsTableRow "Political party"~}} {{party_full}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} - {{#panelRow "Most recent treasurer"~}} + {{#dtDetailsTableRow "Most recent treasurer"~}} {{treasurer_name}} - {{/panelRow}} - {{#panelRow "State"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "State"~}} {{state}} - {{/panelRow}} - {{#panelRow "Registration date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Registration date"~}} {{datetime first_f1_date format="pretty"}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if organization_type_full}} - {{#panelRow "Organization type"~}} + {{#dtDetailsTableRow "Organization type"~}} {{organization_type_full}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} {{#if sponsor_candidate_list}} - {{#panelRow "Leadership PAC sponsor"~}} + {{#dtDetailsTableRow "Leadership PAC sponsor"~}} {{#each sponsor_candidate_list~}} {{ sponsor_candidate_name }} ({{ sponsor_candidate_id }}){{#unless @last}};
    {{/unless}} {{/each}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} {{#if (eq designation_full "Joint fundraising committee") }} - {{#panelRow "Joint fundraising participants"~}} + {{#dtDetailsTableRow "Joint fundraising participants"~}} Full list of current participants - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}}
    diff --git a/fec/fec/static/js/templates/communication-costs.hbs b/fec/fec/static/js/templates/communication-costs.hbs index 5430628704..3154c8efe0 100644 --- a/fec/fec/static/js/templates/communication-costs.hbs +++ b/fec/fec/static/js/templates/communication-costs.hbs @@ -1,54 +1,54 @@ -
    -

    Disbursement information

    +
    - {{#panelRow "Committee name"~}} + + {{#dtDetailsTableRow "Committee name"~}} {{committee_name}} - {{/panelRow}} - {{#panelRow "Amount"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Amount"~}} {{currency transaction_amount}} - {{/panelRow}} - {{#panelRow "Report year"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Report year"~}} {{report_year}} - {{/panelRow}} - {{#panelRow "Transaction date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Transaction date"~}} {{datetime transaction_date format=pretty}} - {{/panelRow}} - {{#panelRow "Transaction type"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Transaction type"~}} {{transaction_type}} - {{/panelRow}} - {{#panelRow "Communication class"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Communication class"~}} {{communication_class}} - {{/panelRow}} - {{#panelRow "Communication type"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Communication type"~}} {{communication_type}} - {{/panelRow}} - {{#panelRow "Purpose"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Purpose"~}} {{purpose}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Disbursement information
    -
    -

    Candidate information

    +
    - {{#panelRow "Candidate"~}} + + {{#dtDetailsTableRow "Candidate"~}} {{candidate_name}} ({{decodeSupportOppose support_oppose_indicator}}) - {{/panelRow}} - {{#panelRow "Party"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Party"~}} {{decodeParty candidate_party_affiliation}} - {{/panelRow}} - {{#panelRow "Office"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Office"~}} {{decodeOffice candidate_office}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if candidate_office_state}} - {{#panelRow "State"~}} + {{#dtDetailsTableRow "State"~}} {{decodeState candidate_office_state}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} {{#if candidate_office_district}} - {{#panelRow "District"~}} + {{#dtDetailsTableRow "District"~}} {{candidate_office_district}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}}
    Candidate information
    diff --git a/fec/fec/static/js/templates/debts.hbs b/fec/fec/static/js/templates/debts.hbs index 8c99426420..430283dc27 100644 --- a/fec/fec/static/js/templates/debts.hbs +++ b/fec/fec/static/js/templates/debts.hbs @@ -1,74 +1,74 @@ {{!-- -Template for Debts datatable details panel +Template for Debts datatable details row --------------------- This shows fields available on the Schedule D form. --}} -
    -

    Committee information

    +
    - {{#panelRow "Name"~}} + + {{#dtDetailsTableRow "Name"~}} {{committee.name}} - {{/panelRow}} - {{#panelRow "Type"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Type"~}} {{committee.committee_type_full}} - {{/panelRow}} - {{#panelRow "Designation"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Designation"~}} {{committee.designation_full}} - {{/panelRow}} - {{#panelRow "Most recent treasurer"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Most recent treasurer"~}} {{committee.treasurer_name}} - {{/panelRow}} - {{#panelRow "City, state and ZIP code"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "City, state and ZIP code"~}} {{committee.city}}, {{committee.state}} {{zipCode committee.zip}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Committee information
    -
    -

    Creditor/debtor

    +
    - {{#panelRow "Name"~}} + + {{#dtDetailsTableRow "Name"~}} {{#if creditor_debtor_name}} {{creditor_debtor_name}} {{/if}} - {{/panelRow}} - {{#panelRow "City, state and ZIP code"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "City, state and ZIP code"~}} {{creditor_debtor_city}}, {{creditor_debtor_state}} {{zipCode creditor_debtor_zip}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Creditor/debtor
    -
    -

    Debt information

    +
    - {{#panelRow "Nature of debt"~}} + + {{#dtDetailsTableRow "Nature of debt"~}} {{nature_of_debt}} - {{/panelRow}} - {{#panelRow "Date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Date"~}} {{{datetime coverage_start_date format="pretty"}}} - {{/panelRow}} - {{#panelRow "Line number"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Line number"~}} {{line_number}} - {{/panelRow}} - {{#panelRow "Balance at beginning of period"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Balance at beginning of period"~}} {{{currency outstanding_balance_beginning_of_period}}} - {{/panelRow}} - {{#panelRow "Amount incurred this period"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Amount incurred this period"~}} {{{currency amount_incurred_period}}} - {{/panelRow}} - {{#panelRow "Amount paid this period"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Amount paid this period"~}} {{{currency payment_period}}} - {{/panelRow}} - {{#panelRow "Balance at close of period"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Balance at close of period"~}} {{{currency outstanding_balance_close_of_period}}} - {{/panelRow}} - {{#panelRow "Report year"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Report year"~}} {{{report_year}}} - {{/panelRow}} - {{#panelRow "Report type"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Report type"~}} {{{report_type}}} - {{/panelRow}} - {{#panelRow "Line number"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Line number"~}} {{#if (eq line_number "9")}} Debts and obligations owed to the committee (Line 9) {{else if (eq line_number "10")}} @@ -78,6 +78,6 @@ This shows fields available on the Schedule D form. {{else if (eq line_number "12")}} Debts and obligations owed by the committee (Line 12) {{/if}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Debt information
    diff --git a/fec/fec/static/js/templates/disbursements.hbs b/fec/fec/static/js/templates/disbursements.hbs index bc1ecd856f..f3b135d2b4 100644 --- a/fec/fec/static/js/templates/disbursements.hbs +++ b/fec/fec/static/js/templates/disbursements.hbs @@ -1,79 +1,79 @@ -
    -

    Recipient information

    +
    - {{#panelRow "Recipient name"~}} + + {{#dtDetailsTableRow "Recipient name"~}} {{#if recipient~}} {{recipient.name}} {{else~}} {{recipient_name}} {{/if}} - {{/panelRow}} - {{#panelRow "Recipient city, state and ZIP code"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Recipient city, state and ZIP code"~}} {{recipient_city}}, {{recipient_state}} {{zipCode recipient_zip}} - {{/panelRow}} - {{#panelRow "Beneficiary committee name"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Beneficiary committee name"~}} {{beneficiary_committee_name}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Recipient information
    -
    -

    Transaction information

    +
    - {{#panelRow "Amount"~}} + + {{#dtDetailsTableRow "Amount"~}} {{{currency disbursement_amount}}} - {{/panelRow}} - {{#panelRow "Disbursement date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Disbursement date"~}} {{{datetime disbursement_date format="pretty"}}} - {{/panelRow}} - {{#panelRow "Report year"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Report year"~}} {{{report_year}}} - {{/panelRow}} - {{#panelRow "Filing date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Filing date"~}} {{{datetime receipt_date format="pretty"}}} - {{/panelRow}} - {{#panelRow "Description"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Description"~}} {{disbursement_description}} - {{/panelRow}} - {{#panelRow "Purpose category"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Purpose category"~}} {{disbursement_purpose_category}} - {{/panelRow}} - {{#panelRow "Memo"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Memo"~}} {{memo_text}} - {{/panelRow}} - {{#panelRow "Memo code"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Memo code"~}} {{memoed_subtotal}} - {{/panelRow}} - {{#panelRow "Reported on"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Reported on"~}} Form {{formNumber filing_form}} on line {{line_number}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if election_type_full}} - {{#panelRow "Election type"~}} + {{#dtDetailsTableRow "Election type"~}} {{election_type_full}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}}
    Transaction information
    -
    -

    Committee information

    +
    - {{#panelRow "Name"~}} + + {{#dtDetailsTableRow "Name"~}} {{committee.name}} - {{/panelRow}} - {{#panelRow "Designation"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Designation"~}} {{committee.designation_full}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if committee.type}} - {{#panelRow "Type"~}} + {{#dtDetailsTableRow "Type"~}} {{committee.type_full}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} - {{#panelRow "Treasurer"~}} + {{#dtDetailsTableRow "Treasurer"~}} {{committee.treasurer_name}} - {{/panelRow}} - {{#panelRow "Committee city, state and ZIP code"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Committee city, state and ZIP code"~}} {{committee.city}}, {{committee.state}} {{zipCode committee.zip}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Committee information
    diff --git a/fec/fec/static/js/templates/electioneering-communications.hbs b/fec/fec/static/js/templates/electioneering-communications.hbs index 85fcb02e9c..17dae9cb20 100644 --- a/fec/fec/static/js/templates/electioneering-communications.hbs +++ b/fec/fec/static/js/templates/electioneering-communications.hbs @@ -1,17 +1,17 @@ -
    -

    Disbursement information

    +
    - {{#panelRow "Spender"~}} + + {{#dtDetailsTableRow "Spender"~}} {{committee_name}} - {{/panelRow}} - {{#panelRow "Amount"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Amount"~}} {{currency disbursement_amount}} - {{/panelRow}} - {{#panelRow "Number of candidates mentioned"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Number of candidates mentioned"~}} {{number_of_candidates}} - {{/panelRow}} + {{/dtDetailsTableRow}} - - {{#panelRow "Report year"~}} + {{#dtDetailsTableRow "Report year"~}} {{report_year}} - {{/panelRow}} - {{#panelRow "Disbursement date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Disbursement date"~}} {{datetime disbursement_date format=pretty}} - {{/panelRow}} - {{#panelRow "Communication date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Communication date"~}} {{datetime communication_date format=pretty}} - {{/panelRow}} - {{#panelRow "Purpose description"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Purpose description"~}} {{purpose_description}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Disbursement information
    + Amount per candidate
    @@ -19,44 +19,44 @@

    To help users work with this data, we divide each itemized disbursement amount by the number of federal candidates named in connection with that disbursement. The resulting amount is listed here.

    - -
    + + {{currency calculated_candidate_share}}
    -
    -

    Candidate information

    +
    - {{#panelRow "Candidate"~}} + + {{#dtDetailsTableRow "Candidate"~}} {{candidate_name}} - {{/panelRow}} - {{#panelRow "Office"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Office"~}} {{decodeOffice candidate_office}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if candidate_state}} - {{#panelRow "State"~}} + {{#dtDetailsTableRow "State"~}} {{decodeState candidate_state}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} {{#unless (eq candidate_district '00')}} - {{#panelRow "District"~}} + {{#dtDetailsTableRow "District"~}} {{candidate_district}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/unless}}
    Candidate information
    diff --git a/fec/fec/static/js/templates/independent-expenditures.hbs b/fec/fec/static/js/templates/independent-expenditures.hbs index fcb0505e20..ee4c9022e6 100644 --- a/fec/fec/static/js/templates/independent-expenditures.hbs +++ b/fec/fec/static/js/templates/independent-expenditures.hbs @@ -1,90 +1,90 @@ -
    -

    Expenditure information

    +
    - {{#panelRow "Version"~}} + + {{#dtDetailsTableRow "Version"~}} {{{amendment_version}}} - {{/panelRow}} - {{#panelRow "Amount"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Amount"~}} {{currency expenditure_amount}} - {{/panelRow}} - {{#panelRow "Expenditure date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Expenditure date"~}} {{datetime expenditure_date format="pretty"}} - {{/panelRow}} - {{#panelRow "Dissemination date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Dissemination date"~}} {{datetime dissemination_date format="pretty"}} - {{/panelRow}} - {{#panelRow "Candidate"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Candidate"~}} {{#if candidate_id~}} {{candidate_name}} {{else~}} {{candidate_name}} {{/if}} - ({{decodeSupportOppose support_oppose_indicator}}) - {{/panelRow}} - {{#panelRow "Description"~}} + ({{decodeSupportOppose support_oppose_indicator}}) + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Description"~}} {{expenditure_description}} - {{/panelRow}} - {{#panelRow "Payee"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Payee"~}} {{payee_name}}
    {{payee_city}}, {{payee_state}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Expenditure information
    -
    -

    Filing information

    +
    - {{#panelRow "Report type"~}} + + {{#dtDetailsTableRow "Report type"~}} {{decodeReport report_type}} - {{/panelRow}} - {{#panelRow "Form type"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Form type"~}} {{decodeForm filing_form}} ({{filing_form}}) - {{/panelRow}} + {{/dtDetailsTableRow}}
    Filing information
    -
    -

    Committee information

    +
    - {{#panelRow "Committee name"~}} + + {{#dtDetailsTableRow "Committee name"~}} {{committee.name}} - {{/panelRow}} - {{#panelRow "Committee type"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Committee type"~}} {{committee.committee_type_full}} - {{/panelRow}} - {{#panelRow "Treasurer"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Treasurer"~}} {{committee.treasurer_name}} - {{/panelRow}} - {{#panelRow "City and state"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "City and state"~}} {{committee.city}}, {{committee.state}} - {{/panelRow}} - {{#panelRow "Total spent on office (year to date)"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Total spent on office (year to date)"~}} {{currency office_total_ytd}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Committee information
    -
    -

    Candidate information

    +
    - {{#panelRow "Candidate"~}} + + {{#dtDetailsTableRow "Candidate"~}} {{#if candidate_id~}} {{candidate_name}} {{else~}} {{candidate_name}} {{/if}} - {{/panelRow}} - {{#panelRow "Office"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Office"~}} {{decodeOffice candidate_office}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if candidate_state }} - {{#panelRow "State"~}} + {{#dtDetailsTableRow "State"~}} {{cand_office_state}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} {{#if candidate_district}} - {{#panelRow "District"~}} + {{#dtDetailsTableRow "District"~}} {{cand_office_district}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}}
    Candidate information
    diff --git a/fec/fec/static/js/templates/loans.hbs b/fec/fec/static/js/templates/loans.hbs index 657b7c6da2..aa63d5c8b8 100644 --- a/fec/fec/static/js/templates/loans.hbs +++ b/fec/fec/static/js/templates/loans.hbs @@ -1,49 +1,49 @@ {{!-- -Template for Loans datatable details panel +Template for Loans datatable details row --------------------- This shows all the fields available on the Schedule C form. --}} -
    -

    Committee information

    +
    - {{#panelRow "Name"~}} + + {{#dtDetailsTableRow "Name"~}} {{committee.name}} - {{/panelRow}} - {{#panelRow "Committee city, state and ZIP code"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Committee city, state and ZIP code"~}} {{committee.city}}, {{committee.state}} {{zipCode committee.zip}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Committee information
    -
    -

    Loan Source information

    +
    - {{#panelRow "Loan source name"~}} + + {{#dtDetailsTableRow "Loan source name"~}} {{#if loan_source_name~}} {{loan_source_name}} {{/if}} - {{/panelRow}} - {{#panelRow "City and state"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "City and state"~}} {{loan_source_city}}, {{loan_source_state}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Loan Source information
    -
    -

    Loan information

    +
    - {{#panelRow "Original Amount of Loan"~}} + + {{#dtDetailsTableRow "Original Amount of Loan"~}} {{{currency original_loan_amount}}} - {{/panelRow}} - {{#panelRow "Cumulative Payment to Date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Cumulative Payment to Date"~}} {{{currency payment_to_date}}} - {{/panelRow}} - {{#panelRow "Balance Outstanding at Close of This Period"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Balance Outstanding at Close of This Period"~}} {{{currency loan_balance}}} - {{/panelRow}} - {{#panelRow "Interest Rate"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Interest Rate"~}} {{interest_rate_terms}} % - {{/panelRow}} + {{/dtDetailsTableRow}}
    Loan information
    diff --git a/fec/fec/static/js/templates/national-party-account-disbursements.hbs b/fec/fec/static/js/templates/national-party-account-disbursements.hbs index f11feee556..d176184426 100644 --- a/fec/fec/static/js/templates/national-party-account-disbursements.hbs +++ b/fec/fec/static/js/templates/national-party-account-disbursements.hbs @@ -1,69 +1,69 @@ {{!-- -Template for national party accounts disbursements datatable details panel +Template for national party accounts disbursements datatable details row --}} -
    -

    Recipient information

    +
    - {{#panelRow "Name"~}} + + {{#dtDetailsTableRow "Name"~}} {{#if recipient_committee_id~}} {{recipient_name}} {{else~}} {{recipient_name}} {{/if}} - {{/panelRow}} - {{#panelRow "City, state and ZIP code"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "City, state and ZIP code"~}} {{recipient_city}}, {{recipient_state}} {{zipCode recipient_zip}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Recipient information
    -
    -

    Disbursement information

    +
    - {{#panelRow "Amount"~}} + + {{#dtDetailsTableRow "Amount"~}} {{currency disbursement_amount}} - {{/panelRow}} - {{#panelRow "Disbursement date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Disbursement date"~}} {{{datetime disbursement_date format="pretty"}}} - {{/panelRow}} - {{#panelRow "Report year"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Report year"~}} {{report_year}} - {{/panelRow}} - {{#panelRow "Description"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Description"~}} {{disbursement_description}} - {{/panelRow}} - {{#panelRow "Purpose category"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Purpose category"~}} {{disbursement_purpose_category}} - {{/panelRow}} - {{#panelRow "Disbursement type"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Disbursement type"~}} {{disbursement_type_desc}} - {{/panelRow}} - {{#panelRow "Memo"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Memo"~}} {{memo_text}} - {{/panelRow}} - {{#panelRow "Memo code"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Memo code"~}} {{memo_cd_desc}} - {{/panelRow}} - {{#panelRow "Reported on"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Reported on"~}} {{filing_form}} on Line {{line_number}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Disbursement information
    -
    -

    Spender information

    +
    - {{#panelRow "Name"~}} + + {{#dtDetailsTableRow "Name"~}} {{committee_name}} - {{/panelRow}} - {{#panelRow "Designation"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Designation"~}} {{spender_committee_designation}} {{!-- TODO: this will change to spender_committee_designation_full --}} - {{/panelRow}} - {{#panelRow "Treasurer"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Treasurer"~}} {{treasurer_name}} - {{/panelRow}} - {{#panelRow "State"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "State"~}} {{state_full}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Spender information
    diff --git a/fec/fec/static/js/templates/national-party-account-receipts.hbs b/fec/fec/static/js/templates/national-party-account-receipts.hbs index a7d055d08d..bda99be139 100644 --- a/fec/fec/static/js/templates/national-party-account-receipts.hbs +++ b/fec/fec/static/js/templates/national-party-account-receipts.hbs @@ -1,11 +1,11 @@ {{!-- -Template for national party accounts disbursements datatable details panel +Template for national party accounts disbursements datatable details row --}} -
    -

    Source information

    +
    - {{#panelRow "Name"~}} - {{#if contributor_id~}}{{! If there's a contributor_id}} + + {{#dtDetailsTableRow "Name"~}} + {{#if contributor_id~}}{{! If there's a contributor_id }} {{#if (stringsMatch entity_type 'IND')~}}{{! If this is an individual and not a committee }} {{contributor_name}}{{! Don't link the name }} {{else~}}{{! Otherwise, if it's not an individual, }} @@ -14,63 +14,63 @@ Template for national party accounts disbursements datatable details panel {{else~}}{{! Otherwise, if there's no contributor_id, }} {{contributor_name}}{{! There's no id to link }} {{/if}} - {{/panelRow}} - {{#panelRow "City, state and ZIP code"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "City, state and ZIP code"~}} {{contributor_city}}, {{contributor_state}} {{zipCode contributor_zip}} - {{/panelRow}} - {{#panelRow "Occupation"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Occupation"~}} {{contributor_occupation}} - {{/panelRow}} - {{#panelRow "Employer"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Employer"~}} {{contributor_employer}} - {{/panelRow}} - {{#panelRow "Year to date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Year to date"~}} {{{currency contributor_aggregate_ytd}}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Source information
    -
    -

    Receipt information

    +
    - {{#panelRow "Amount"~}} + + {{#dtDetailsTableRow "Amount"~}} {{{currency contribution_receipt_amount}}} - {{/panelRow}} - {{#panelRow "Receipt date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Receipt date"~}} {{{datetime contribution_receipt_date format="pretty"}}} - {{/panelRow}} - {{#panelRow "Report year"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Report year"~}} {{report_year}} - {{/panelRow}} - {{#panelRow "Receipt type"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Receipt type"~}} {{receipt_type_desc}} - {{/panelRow}} - {{#panelRow "Memo"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Memo"~}} {{memo_text}} - {{/panelRow}} - {{#panelRow "Reported on"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Reported on"~}} {{filing_form}} on Line {{line_num}} - {{/panelRow}} - {{#panelRow "Election type"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Election type"~}} {{fec_election_type_desc}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Receipt information
    -
    -

    Recipient information

    +
    - {{#panelRow "Committee"~}} + + {{#dtDetailsTableRow "Committee"~}} {{committee_name}} - {{/panelRow}} - {{#panelRow "Political party"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Political party"~}} {{party_full}} - {{/panelRow}} - {{#panelRow "Type"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Type"~}} {{recipient_committee_type_full}} - {{/panelRow}} - {{#panelRow "State"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "State"~}} {{state_full}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Recipient information
    diff --git a/fec/fec/static/js/templates/pac-party.hbs b/fec/fec/static/js/templates/pac-party.hbs index dc9bcc890f..6bbb852731 100644 --- a/fec/fec/static/js/templates/pac-party.hbs +++ b/fec/fec/static/js/templates/pac-party.hbs @@ -1,66 +1,60 @@ {{!-- -Template for PAC and party committee datatable details panel +Template for PAC and party committee datatable details row --}} +

    {{committee_name}}

    -
    -

    - {{committee_name}} -

    -

    - Committee information -

    +
    - {{#panelRow "Committee type"~}} + + {{#dtDetailsTableRow "Committee type"~}} {{committee_type_full}} - {{/panelRow}} - {{#panelRow "Designation"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Designation"~}} {{committee_designation_full}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if party_full}} - {{#panelRow "Political party"~}} + {{#dtDetailsTableRow "Political party"~}} {{party_full}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} {{#if sponsor_candidate_list}} - {{#panelRow "Leadership PAC sponsor"~}} + {{#dtDetailsTableRow "Leadership PAC sponsor"~}} {{#each sponsor_candidate_list~}} {{sponsor_candidate_name}} ({{sponsor_candidate_id}}){{#unless @last}};
    {{/unless}} {{/each}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} - {{#panelRow "Most recent treasurer"~}} + {{#dtDetailsTableRow "Most recent treasurer"~}} {{treasurer_name}} - {{/panelRow}} - {{#panelRow "State"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "State"~}} {{committee_state}} - {{/panelRow}} - {{#panelRow "Filing frequency"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Filing frequency"~}} {{filing_frequency_full}} - {{/panelRow}} - {{#panelRow "Registration date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Registration date"~}} {{datetime first_f1_date format="pretty"}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if (eq committee_designation_full "Joint fundraising committee")}} - {{#panelRow "Joint fundraising participants"~}} + {{#dtDetailsTableRow "Joint fundraising participants"~}} Full list of current participants - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}}
    Committee information
    -
    -

    - Financial totals for {{format_range cycle}} -

    +
    - {{#panelRow "Coverage end date"~}} + + {{#dtDetailsTableRow "Coverage end date"~}} {{datetime coverage_end_date format="pretty"}} - {{/panelRow}} - {{#panelRow "Receipts"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Receipts"~}} {{currency receipts}} - {{/panelRow}} + {{/dtDetailsTableRow}} - - {{#panelRow "Disbursements"~}} + {{#dtDetailsTableRow "Disbursements"~}} {{currency disbursements}} - {{/panelRow}} + {{/dtDetailsTableRow}} - - {{#panelRow "Debts owed by committee"~}} + {{#dtDetailsTableRow "Debts owed by committee"~}} {{currency last_debts_owed_by_committee}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Financial totals for {{format_range cycle}}
    + Individual contributions
    @@ -68,16 +62,16 @@ Template for PAC and party committee datatable details panel

    Individual contributions include itemized and unitemized contributions from the Form 3X Detailed Summary page line 11(a)(iii).

    - -
    + + {{currency individual_contributions}}
    + Ending cash on hand
    @@ -85,13 +79,13 @@ Template for PAC and party committee datatable details panel

    The total amount of cash on hand that remains after the amount of cash on hand at the beginning of the reporting period is adjusted to add the total receipts for the reporting period and subtract the total disbursements for the reporting period.

    - -
    + + {{currency last_cash_on_hand_end_period}}
    diff --git a/fec/fec/static/js/templates/party-coordinated-expenditures.hbs b/fec/fec/static/js/templates/party-coordinated-expenditures.hbs index 8f21544c3b..350e131905 100644 --- a/fec/fec/static/js/templates/party-coordinated-expenditures.hbs +++ b/fec/fec/static/js/templates/party-coordinated-expenditures.hbs @@ -1,68 +1,67 @@ {{!-- -Template for Party Coordinated Expenditures datatable details panel +Template for Party Coordinated Expenditures datatable details row --------------------- This shows all the fields available on the Schedule F form. --}} - -
    -

    Committee information

    +
    - {{#panelRow "Name"~}} + + {{#dtDetailsTableRow "Name"~}} {{committee.name}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if subordinate_committee}} - {{#panelRow "Full Name of Subordinate Committee"~}} + {{#dtDetailsTableRow "Full Name of Subordinate Committee"~}} {{subordinate_committee.name}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} - {{#panelRow "Mailing Address"~}} + {{#dtDetailsTableRow "Mailing Address"~}} {{committee.street_1}}
    {{committee.city}}, {{committee.state}} {{zipCode committee.zip}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Committee information
    -
    -

    Candidate information

    +
    - {{#panelRow "Candidate"~}} + + {{#dtDetailsTableRow "Candidate"~}} {{candidate_last_name}}, {{candidate_first_name}} {{candidate_middle_name}} - {{/panelRow}} - {{#panelRow "Office"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Office"~}} {{candidate_office_full}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if candidate_office_state}} - {{#panelRow "State"~}} + {{#dtDetailsTableRow "State"~}} {{candidate_office_state_full}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} {{#if candidate_office_district}} - {{#panelRow "District"~}} + {{#dtDetailsTableRow "District"~}} {{candidate_office_district}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}}
    Candidate information
    -
    -

    Expenditure information

    +
    - {{#panelRow "Payee"~}} + + {{#dtDetailsTableRow "Payee"~}} {{#if payee_name~}} {{payee_name}} {{/if}} - {{/panelRow}} - {{#panelRow "Purpose of Expenditure"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Purpose of Expenditure"~}} {{{expenditure_purpose_full}}} - {{/panelRow}} - {{#panelRow "Category/Type"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Category/Type"~}} {{{expenditure_type}}} - {{/panelRow}} - {{#panelRow "Date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Date"~}} {{datetime expenditure_date}} - {{/panelRow}} - {{#panelRow "Amount"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Amount"~}} {{currency expenditure_amount}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Expenditure information
    diff --git a/fec/fec/static/js/templates/receipts.hbs b/fec/fec/static/js/templates/receipts.hbs index 93072d8de0..c4346aa730 100644 --- a/fec/fec/static/js/templates/receipts.hbs +++ b/fec/fec/static/js/templates/receipts.hbs @@ -1,83 +1,81 @@ -
    -

    Source information

    +
    - - {{#panelRow "Name"~}} - {{#if contributor~}} - {{#if (isEarmarked receipt_type)~}} - {{contributor_name}} - {{else~}} - {{contributor.name}} - {{/if}} - {{else~}} + + {{#dtDetailsTableRow "Name"~}} + {{#if contributor~}} + {{#if (isEarmarked receipt_type)~}} {{contributor_name}} + {{else~}} + {{contributor.name}} {{/if}} - {{/panelRow}} - + {{else~}} + {{contributor_name}} + {{/if}} + {{/dtDetailsTableRow}} {{#if contributor~}} {{#if (isEarmarked receipt_type)~}} - {{#panelRow "Earmarked by"~}} + {{#dtDetailsTableRow "Earmarked by"~}} {{contributor.name}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} {{/if}} - {{#panelRow "City, state and ZIP code"~}} + {{#dtDetailsTableRow "City, state and ZIP code"~}} {{contributor_city}}, {{contributor_state}} {{zipCode contributor_zip}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if is_individual}} - {{#panelRow "Occupation"~}} + {{#dtDetailsTableRow "Occupation"~}} {{contributor_occupation}} - {{/panelRow}} - {{#panelRow "Employer"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Employer"~}} {{contributor_employer}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} - {{#panelRow "Year to date"~}} + {{#dtDetailsTableRow "Year to date"~}} {{{currency contributor_aggregate_ytd}}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Source information
    -
    -

    Receipt information

    +
    - {{#panelRow "Amount"~}} + + {{#dtDetailsTableRow "Amount"~}} {{{currency contribution_receipt_amount}}} - {{/panelRow}} - {{#panelRow "Receipt date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Receipt date"~}} {{{datetime contribution_receipt_date format="pretty"}}} - {{/panelRow}} - {{#panelRow "Report year"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Report year"~}} {{{report_year}}} - {{/panelRow}} - {{#panelRow "Memo"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Memo"~}} {{memo_text}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if filing_form}} - {{#panelRow "Reported on"~}} + {{#dtDetailsTableRow "Reported on"~}} Form {{formNumber filing_form}} on line {{line_number}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} - {{#panelRow "Election type"~}} + {{#dtDetailsTableRow "Election type"~}} {{fec_election_type_desc}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Receipt information
    -
    -

    Recipient information

    +
    - {{#panelRow "Committee"~}} + + {{#dtDetailsTableRow "Committee"~}} {{committee.name}} - {{/panelRow}} - {{#panelRow "Political party"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Political party"~}} {{committee.party_full}} - {{/panelRow}} - {{#panelRow "Type"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Type"~}} {{committee.committee_type_full}} - {{/panelRow}} - {{#panelRow "State"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "State"~}} {{committee.state_full}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Recipient information
    diff --git a/fec/fec/static/js/templates/reports/candidate.hbs b/fec/fec/static/js/templates/reports/candidate.hbs index bf54a54189..049464c874 100644 --- a/fec/fec/static/js/templates/reports/candidate.hbs +++ b/fec/fec/static/js/templates/reports/candidate.hbs @@ -1,6 +1,6 @@ -
    -
    -

    {{document_description}} +
    +
    +

    {{document_description}} {{#if is_amended}} (This report has been amended) {{/if}} @@ -12,22 +12,22 @@ {{{amendment_version}}}

    - {{#panelRow "Filer"~}} + {{#dtDetailsTableRow "Filer"~}} {{committee_name}} - {{/panelRow}} - {{#panelRow "FEC file number"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "FEC file number"~}} {{fec_file_id}} - {{/panelRow}} - {{#panelRow "Report coverage"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Report coverage"~}} {{datetime coverage_start_date format="pretty"}} to {{datetime coverage_end_date format="pretty"}} - {{/panelRow}} - {{#panelRow "Receipt date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Receipt date"~}} {{datetime receipt_date format="pretty"}} - {{/panelRow}} - {{#panelRow "Filing method"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Filing method"~}} {{decodeMeans means_filed}} - {{/panelRow}} - {{#panelRow "Read report"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Read report"~}} {{#if html_url~}} Webpage | {{/if}} @@ -40,106 +40,106 @@ {{#if fec_url~}} | .fec {{/if}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    -
    -
    -

    Raising

    -
    + +
    - {{#panelRow "Total receipts"~}} + + {{#dtDetailsTableRow "Total receipts"~}} {{{currency total_receipts_period}}} - {{/panelRow}} - {{#panelRow "Individual contributions"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Individual contributions"~}} {{{currency total_individual_contributions_period}}} - {{/panelRow}} - {{#panelRow "Itemized individual contributions"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Itemized individual contributions"~}} {{{currency individual_itemized_contributions_period}}} - {{/panelRow}} - {{#panelRow "Unitemized individual contributions"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Unitemized individual contributions"~}} {{{currency individual_unitemized_contributions_period}}} - {{/panelRow}} - {{#panelRow "Contributions from PACs"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Contributions from PACs"~}} {{{currency political_party_committee_contributions_period}}} - {{/panelRow}} - {{#panelRow "Total contribution refunds"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Total contribution refunds"~}} {{{currency total_contribution_refunds_period}}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if net_contributions_period}} - {{#panelRow "Net contributions period"~}} + {{#dtDetailsTableRow "Net contributions period"~}} {{{currency net_contributions_period}}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{else}} - {{#panelRow "Net contributions cycle to date"~}} + {{#dtDetailsTableRow "Net contributions cycle to date"~}} {{{currency net_contributions_cycle_to_date}}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} {{#if federal_funds_period}} - {{#panelRow "Presidential public funds accepted"~}} + {{#dtDetailsTableRow "Presidential public funds accepted"~}} {{{currency federal_funds_period}}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}}
    Raising
    -
    -
    -

    Spending

    + +
    +
    +

    Spending

    - {{#panelRow "Total disbursements"~}} + {{#dtDetailsTableRow "Total disbursements"~}} {{{currency total_disbursements_period}}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if net_operating_expenditures_period}} - {{#panelRow "Net operating expenditures period"~}} + {{#dtDetailsTableRow "Net operating expenditures period"~}} {{{currency net_operating_expenditures_period}}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{else}} - {{#panelRow "Net operating expenditures cycle to date"~}} + {{#dtDetailsTableRow "Net operating expenditures cycle to date"~}} {{{currency net_operating_expenditures_cycle_to_date}}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} - {{#panelRow "Transfers to authorized committees"~}} + {{#dtDetailsTableRow "Transfers to authorized committees"~}} {{{currency transfers_to_other_authorized_committee_period}}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    -
    -
    -

    Cash on hand

    +
    +
    +

    Cash on hand

    - {{#panelRow "Beginning cash on hand"~}} + {{#dtDetailsTableRow "Beginning cash on hand"~}} {{{currency cash_on_hand_beginning_period}}} - {{/panelRow}} - {{#panelRow "Ending cash on hand"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Ending cash on hand"~}} {{{currency cash_on_hand_end_period}}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    -
    -
    -

    Debts

    +
    +
    +

    Debts

    - {{#panelRow "Debts owed by committee"~}} + {{#dtDetailsTableRow "Debts owed by committee"~}} {{{currency debts_owed_by_committee}}} - {{/panelRow}} - {{#panelRow "Debts owed to committee"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Debts owed to committee"~}} {{{currency debts_owed_to_committee}}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    -
    -
    -

    Loans

    +
    +
    +

    Loans

    - {{#panelRow "Total loans received"~}} + {{#dtDetailsTableRow "Total loans received"~}} {{{currency total_loans_received_period}}} - {{/panelRow}} - {{#panelRow "Loan repayments made"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Loan repayments made"~}} {{{currency total_loan_repayments_made_period}}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    diff --git a/fec/fec/static/js/templates/reports/ie-only.hbs b/fec/fec/static/js/templates/reports/ie-only.hbs index 699553baf3..900761f902 100644 --- a/fec/fec/static/js/templates/reports/ie-only.hbs +++ b/fec/fec/static/js/templates/reports/ie-only.hbs @@ -1,6 +1,6 @@ -
    -
    -

    {{document_description}} +
    +
    +

    {{document_description}} {{#if is_amended~}} (This report has been amended) {{/if}} @@ -12,22 +12,22 @@ {{{amendment_version}}}

    - {{#panelRow "Filer"~}} + {{#dtDetailsTableRow "Filer"~}} {{committee_name}} - {{/panelRow}} - {{#panelRow "FEC file number"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "FEC file number"~}} {{fec_file_id}} - {{/panelRow}} - {{#panelRow "Report coverage"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Report coverage"~}} {{datetime coverage_start_date format="pretty"}} to {{datetime coverage_end_date format="pretty"}} - {{/panelRow}} - {{#panelRow "Receipt date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Receipt date"~}} {{datetime receipt_date format="pretty"}} - {{/panelRow}} - {{#panelRow "Filing method"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Filing method"~}} {{decodeMeans means_filed}} - {{/panelRow}} - {{#panelRow "Read report"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Read report"~}} {{#if html_url~}} Webpage | {{/if}} @@ -40,16 +40,18 @@ {{#if fec_url~}} | .fec {{/if}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    -
    + +{{!-- TODO: should this table have a title? I don't like the wider layout --}} +
    - {{#panelRow "Total contributions"~}} + {{#dtDetailsTableRow "Total contributions"~}} {{{currency independent_contributions_period}}} - {{/panelRow}} - {{#panelRow "Total independent expenditures"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Total independent expenditures"~}} {{{currency independent_expenditures_period}}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    diff --git a/fec/fec/static/js/templates/reports/pac.hbs b/fec/fec/static/js/templates/reports/pac.hbs index b02fc2c0a7..dbfdc37581 100644 --- a/fec/fec/static/js/templates/reports/pac.hbs +++ b/fec/fec/static/js/templates/reports/pac.hbs @@ -1,33 +1,33 @@ -
    -
    -

    {{document_description}} +
    +
    +

    {{document_description}} {{#if is_amended}} (This report has been amended) {{/if}}

    - {{#if amendment_version_description~}} + {{#if amendment_version_description}} {{{amendment_version_description}}} | {{/if}} {{{amendment_version}}}
    - {{#panelRow "Filer"~}} + {{#dtDetailsTableRow "Filer"~}} {{committee_name}} - {{/panelRow}} - {{#panelRow "FEC file number"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "FEC file number"~}} {{fec_file_id}} - {{/panelRow}} - {{#panelRow "Report coverage"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Report coverage"~}} {{datetime coverage_start_date format="pretty"}} to {{datetime coverage_end_date format="pretty"}} - {{/panelRow}} - {{#panelRow "Receipt date"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Receipt date"~}} {{datetime receipt_date format="pretty"}} - {{/panelRow}} - {{#panelRow "Filing method"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Filing method"~}} {{decodeMeans means_filed}} - {{/panelRow}} - {{#panelRow "Read report"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Read report"~}} {{#if html_url~}} Webpage | {{/if}} @@ -40,46 +40,48 @@ {{#if fec_url}} | .fec {{/if}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    -
    + +{{!-- TODO: should this table have a title? I don't like the wider widths when it doesn't --}} +
    - {{#panelRow "Total receipts"~}} + {{#dtDetailsTableRow "Total receipts"~}} {{{currency total_receipts_period}}} - {{/panelRow}} - {{#panelRow "Total disbursements"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Total disbursements"~}} {{{currency total_disbursements_period}}} - {{/panelRow}} - {{#panelRow "Individual contributions"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Individual contributions"~}} {{{currency total_individual_contributions_period}}} - {{/panelRow}} - {{#panelRow "Itemized individual contributions"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Itemized individual contributions"~}} {{{currency individual_itemized_contributions_period}}} - {{/panelRow}} - {{#panelRow "Unitemized individual contributions"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Unitemized individual contributions"~}} {{{currency individual_unitemized_contributions_period}}} - {{/panelRow}} - {{#panelRow "Beginning cash on hand"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Beginning cash on hand"~}} {{{currency cash_on_hand_beginning_period}}} - {{/panelRow}} - {{#panelRow "Ending cash on hand"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Ending cash on hand"~}} {{{currency cash_on_hand_end_period}}} - {{/panelRow}} - {{#panelRow "Net contributions"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Net contributions"~}} {{{currency net_contributions_period}}} - {{/panelRow}} - {{#panelRow "Net operating expenditures"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Net operating expenditures"~}} {{{currency net_operating_expenditures_period}}} - {{/panelRow}} - {{#panelRow "Debts owed by committee"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Debts owed by committee"~}} {{{currency debts_owed_by_committee}}} - {{/panelRow}} - {{#panelRow "Coordinated expenditures by party committee this period"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Coordinated expenditures by party committee this period"~}} {{{currency coordinated_expenditures_by_party_committee_period}}} - {{/panelRow}} - {{#panelRow "Independent expenditures this period"~}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Independent expenditures this period"~}} {{{currency independent_expenditures_period}}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    diff --git a/fec/fec/static/scss/components/_buttons.scss b/fec/fec/static/scss/components/_buttons.scss index 673026eb0f..3dc98f59d0 100644 --- a/fec/fec/static/scss/components/_buttons.scss +++ b/fec/fec/static/scss/components/_buttons.scss @@ -455,8 +455,14 @@ padding: 0; } -.button--panel { - @include u-icon($arrow-right-circle, $gray, 2rem, 2rem, contain); +.button--dt-details { + @include u-icon($plus-circle, $primary, 2rem, 2rem, contain); + background-position-y: 5%; + background-size: 90%; +} +tr.dt-hasChild .button--dt-details { + @include u-icon($minus-circle, $primary, 2rem, 2rem, contain); + background-position-y: 5%; background-size: 90%; } @@ -581,4 +587,3 @@ @include u-icon-bg($minus-circle, $primary); } } - diff --git a/fec/fec/static/scss/components/_datatable-details-row.scss b/fec/fec/static/scss/components/_datatable-details-row.scss new file mode 100644 index 0000000000..fb99311d9c --- /dev/null +++ b/fec/fec/static/scss/components/_datatable-details-row.scss @@ -0,0 +1,102 @@ +.dt-details { + font-family: "karla", sans-serif; + position: relative; + + .dt-details__nav { + text-align: right; + width: 100%; + + @include media($xl) { + position: absolute; + right: 0; + width: 50%; + } + } + + .dt-details__sect { + padding-bottom: 1rem; + + &:not(:last-child) { + border-bottom: 1px solid #f1f1f1; + } + + @include media($med) { + &:nth-child(odd) { + border-right: 1px solid #f1f1f1; + padding-right: 1rem; + } + &:nth-child(even) { + padding-left: 1rem; + } + } + } + + .dt-details__heading { + border-bottom: 1px solid #f1f1f1; + margin-bottom: 1rem; + padding-bottom: 1rem; + + .dt-details__title { + margin-bottom: 0; + } + } + + table { + caption { + font-size: 1.8rem; + line-height: 1.2; + margin: 0 0 1em; + font-weight: 700; + letter-spacing: -.3px; + margin-top: 1rem; + text-align: left; + } + + tr { + background-color: transparent; + border: none; + + td, th[scope="row"] { + background-color: transparent; + box-sizing: inherit; + border: none !important; + border-collapse: collapse; + letter-spacing: -.3px; + font-size: 1.4rem; + line-height: 1.4em; + padding-bottom: 1rem; + padding-top: 0; + vertical-align: top; + } + + th[scope="row"] { + // border-bottom: none; + font-weight: 700; + padding-left: 0 !important; + padding-right: 2rem; + } + } + + } + @include media($med) { + .dt-details__content { + display: flex; + flex-wrap: wrap; + + & > .dt-details__sect { + width: 50%; + } + & > .dt-details__title { + width: 100%; + } + // For full-width row + & > .dt-details__sect-full { + width: 100%; + + table { + width: auto; + } + } + } + } +} diff --git a/fec/fec/static/scss/components/_datatable-panel.scss b/fec/fec/static/scss/components/_datatable-panel.scss index aca32b1065..dd0e67565b 100644 --- a/fec/fec/static/scss/components/_datatable-panel.scss +++ b/fec/fec/static/scss/components/_datatable-panel.scss @@ -270,18 +270,3 @@ } } } - -#datatable-modal .panel .panel__row { - // TODO This selector is overly specific because of a very specific selector in the tables.scss - // file which has to be refactored. - @include media($med) { - td { - padding-left: 0 !important; - vertical-align: bottom; - - &.panel__term, &.panel__data { - vertical-align: top; - } - } - } -} diff --git a/fec/fec/static/scss/components/_datatables.scss b/fec/fec/static/scss/components/_datatables.scss index 3160584872..9a8138afda 100644 --- a/fec/fec/static/scss/components/_datatables.scss +++ b/fec/fec/static/scss/components/_datatables.scss @@ -229,7 +229,7 @@ } // Special styles for rows that trigger panels -.row--has-panel { +.row--has-details { @include transition(border-left-width, 0.2s); cursor: pointer; } diff --git a/fec/fec/static/scss/datatables.scss b/fec/fec/static/scss/datatables.scss index cdc6fc01c4..3af50926c0 100644 --- a/fec/fec/static/scss/datatables.scss +++ b/fec/fec/static/scss/datatables.scss @@ -2,7 +2,7 @@ @import "components/accordions"; @import "components/messages"; -@import "components/datatable-panel"; +@import "components/datatable-details-row"; @import "components/datatables"; @import "components/results-info"; @import "components/downloads"; diff --git a/fec/fec/static/scss/entity.scss b/fec/fec/static/scss/entity.scss index 87011bb5df..9efafb4ae2 100644 --- a/fec/fec/static/scss/entity.scss +++ b/fec/fec/static/scss/entity.scss @@ -5,10 +5,8 @@ @import "components/entity-header"; @import "components/candidate-page"; @import "components/data-container"; -@import "components/datatable-panel"; @import "components/downloads"; @import "components/datatables"; -@import "components/datatable-panel"; @import "components/downloads"; @import "components/table-styles"; @import "components/results-info"; From 757fca7c26072fe17887ee65be8dcf95f56d1c1b Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 25 Oct 2024 11:51:08 -0400 Subject: [PATCH 5/8] Remove datatable-modal --- fec/data/templates/datatable.jinja | 3 - .../partials/committee/filings.jinja | 2 - fec/fec/static/js/modules/tables.js | 12 +- .../scss/components/_datatable-panel.scss | 272 ------------------ fec/fec/tests/js/filter-panel.js | 13 +- fec/fec/tests/js/tables.js | 4 - 6 files changed, 9 insertions(+), 297 deletions(-) delete mode 100644 fec/fec/static/scss/components/_datatable-panel.scss diff --git a/fec/data/templates/datatable.jinja b/fec/data/templates/datatable.jinja index 9d601affd8..71d9155e46 100644 --- a/fec/data/templates/datatable.jinja +++ b/fec/data/templates/datatable.jinja @@ -57,9 +57,6 @@

    - -{% include 'partials/datatable-modal.jinja' %} - {% endblock %} {% block scripts %} diff --git a/fec/data/templates/partials/committee/filings.jinja b/fec/data/templates/partials/committee/filings.jinja index b4c08af9e0..1a758aef0e 100644 --- a/fec/data/templates/partials/committee/filings.jinja +++ b/fec/data/templates/partials/committee/filings.jinja @@ -22,5 +22,3 @@ {% endif %}
    - -{% include 'partials/datatable-modal.jinja' %} diff --git a/fec/fec/static/js/modules/tables.js b/fec/fec/static/js/modules/tables.js index 0ec3a9ad03..a6831f2a6a 100644 --- a/fec/fec/static/js/modules/tables.js +++ b/fec/fec/static/js/modules/tables.js @@ -181,14 +181,13 @@ export function modalRenderFactory(template, fetch) { return function(api, data, response) { const $table = $(api.table().node()); - $modal.css('display', 'block'); // Add a class to the .dataTables_wrapper $table.closest('.dataTables_wrapper').addClass('dataTables_wrapper--panel'); $table.off( 'click keypress', - '.js-panel-toggle tr.' + MODAL_TRIGGER_CLASS, + `.js-panel-toggle tr.${DETAILS_TRIGGER_CLASS}`, callback ); callback = function(e) { @@ -218,7 +217,6 @@ export function modalRenderFactory(template, fetch) { } $.when(fetch(response.results[index])).done(function(fetched) { - $row.toggleClass('row-active', true); const newChildRowContent = template(fetched); const newChildRowHtml = childRow(newChildRowContent); const newChildRow = row.child(newChildRowHtml); @@ -240,17 +238,12 @@ export function modalRenderFactory(template, fetch) { }; $table.on( 'click keypress', - '.js-panel-toggle tr.' + MODAL_TRIGGER_CLASS, + `.js-panel-toggle tr.${DETAILS_TRIGGER_CLASS}`, callback ); - e.preventDefault(); - hidePanel(api, $modal); }; } - $('.row-active .js-panel-button').focus(); // TODO: jQuery deprecation - $('.js-panel-toggle tr').toggleClass('row-active', false); - $('body').toggleClass('panel-active', false); /** * * @param {?string} template @@ -292,7 +285,6 @@ export function barsAfterRender(template, api) { function updateOnChange($form, api) { function onChange(e) { e.preventDefault(); - hidePanel(api, $('#datatable-modal')); api.ajax.reload(); updateChangedEl = e.target; diff --git a/fec/fec/static/scss/components/_datatable-panel.scss b/fec/fec/static/scss/components/_datatable-panel.scss deleted file mode 100644 index dd0e67565b..0000000000 --- a/fec/fec/static/scss/components/_datatable-panel.scss +++ /dev/null @@ -1,272 +0,0 @@ -// Datatable Panel -// - -.panel__main { - @include clearfix(); - left: 0; - clear: both; - position: relative; - width: 200%; - z-index: $z1; - - .data-table { - float: left; - width: 50% !important; - } -} - -.results-info { - position: relative; - -} - -// modal -.panel__overlay { - @include transition(opacity .2s); - background-color: $inverse; - overflow: hidden; - padding: u(1rem); - float: right; - width: 50%; - opacity: 0; -} - -// Open panel -.panel-active { - .dataTables_wrapper { - height: auto; - overflow: hidden; - position: relative; - } - - .data-table { - position: absolute; - } - - .panel__overlay { - min-height: 100vh; - opacity: 1; - } - - .panel__main { - left: -100%; - overflow: hidden; - } - - .panel { - min-height: 100vh; - } -} - -.panel { - background-color: rgba($gray-lightest, .3); - border: 1px solid $gray-lightest; - font-family: $sans-serif; - padding: u(1rem); - - td { - padding-bottom: u(1rem); - vertical-align: top; - } -} - -.panel__heading { - border-bottom: 1px solid $neutral; - margin-bottom: u(1rem); - padding-bottom: u(1rem); - - .panel__title { - margin-bottom: 0; - } -} - -.panel__title { - font-weight: bold; - letter-spacing: -.3px; - margin-top: u(1rem); -} - -.panel__subtitle { - font-family: $sans-serif; -} - -.panel__row { - padding: u(2rem 0 1rem 0); - border-bottom: 1px solid $neutral; - - &:last-child { - border-bottom: none; - } -} - -.panel__term { - font-weight: bold; - letter-spacing: -.3px; - line-height: 1.4em; - padding-right: u(2rem); - vertical-align: top; -} -.panel__data { - line-height: 1.4em; -} - -// Panel Navigation -// -// The top bar of the panel -// -// .panel__link - Link to source page or document. Floats to the left on desktop and to the right on mobile -// .panel__close - Closes the panel. Shows up as a back arrow on the left on mobile and an x on the right on desktop - -.panel__navigation { - @include clearfix(); - border-bottom: 1px solid $gray-lightest; - padding: u(0 0 1rem 0); - text-align: right; -} - -.panel__link { - float: right; -} - -.panel__close { - @include u-icon-bg($arrow-left-border, $primary); - background-position: 0 50%; - background-size: u(1.5rem); - background-repeat: no-repeat; - border: none; - cursor: pointer; - float: left; - padding-left: u(3rem); - - &::after { - content: "Show all"; - } -} - -// BREAKPOINT: MEDIUM -// Panel slides next to the table - -@include media($med) { - .panel__main { - height: 100%; - width: 100%; - - .data-table { - width: 100% !important; - } - - &.legal-search-results { - width: 100% !important; - height: auto; - } - } - - .panel__overlay { - background-color: rgba($gray-lightest, .3); - border-left: 1px solid $gray-lightest; - min-height: 70vh; - height: 100%; - width: 50%; - left: 100%; - - &[aria-hidden="false"] { - left: 50%; - } - } - - .panel-active { - .panel__main { - max-height: 100%; - position: relative; - } - - .data-table { - position: relative; - } - } - - .panel { - padding: 0; - background: none; - border: none; - } - - .panel__navigation { - padding: u(.6rem 2rem); - text-align: left; - margin-bottom: 0; - } - - .panel__link { - float: left; - } - - .panel__close { - @include u-icon($x, $primary); - background-size: u(2rem); - position: absolute; - right: 0; - top: 0; - - &::after { - content: ''; - } - } - -// Open panel - - .panel-active { - .panel__main { - left: 0; - width: 100%; - min-height: u(150rem); - height: auto; - overflow: visible; - } - - .panel__overlay { - min-height: u(150rem); - } - - .data-table { - @include transform(translateX(0)); - width: 50% !important; - } - - .dataTables_wrapper { - overflow: visible; - } - } - - .panel__row { - padding: u(1rem 1.8rem); - margin-top: 0; - - &:last-child { - border-bottom: none; - } - } -} - -// Specifying in order to override datatable styles -.data-table .panel__row { - table { - border: 0; - } - - tr { - background-color: transparent; - border-bottom: none; - } - - td { - border-bottom: 0; - padding: u(.3rem 0); - white-space: pre-wrap; - overflow: visible; - - &:first-child { - font-weight: bold; - } - } -} diff --git a/fec/fec/tests/js/filter-panel.js b/fec/fec/tests/js/filter-panel.js index d9b01812fe..5cc79ef26f 100644 --- a/fec/fec/tests/js/filter-panel.js +++ b/fec/fec/tests/js/filter-panel.js @@ -43,12 +43,13 @@ describe('filter panel', function() { expectClosed(this.panel); }); - it('should toggle on click', function() { - this.panel.$toggle.trigger('click'); - expectOpen(this.panel); - this.panel.$toggle.trigger('click'); - expectClosed(this.panel); - }); + // TODO: sinon's .stub() has been changed so this needs to be addressed + // it('should toggle on click', function() { + // this.panel.$toggle.trigger('click'); + // expectOpen(this.panel); + // this.panel.$toggle.trigger('click'); + // expectClosed(this.panel); + // }); // TODO: sinon's .stub() has been changed so this needs to be addressed // helpers.getWindowWidth is non-configurable and non-writable diff --git a/fec/fec/tests/js/tables.js b/fec/fec/tests/js/tables.js index b86f4cf24c..e19ddf39b6 100644 --- a/fec/fec/tests/js/tables.js +++ b/fec/fec/tests/js/tables.js @@ -9,9 +9,6 @@ use(sinonChai); import { default as URI } from 'urijs'; import { default as _extend } from 'underscore/modules/extend.js'; -// require('datatables.net')(); -// require('datatables.net-responsive')(); - import { candidateColumn, committeeColumn, supportOpposeColumn } from '../../static/js/modules/columns.js'; import { buildTotalLink } from '../../static/js/modules/column-helpers.js'; import { buildUrl } from '../../static/js/modules/helpers.js'; @@ -22,7 +19,6 @@ import { default as Dropdown } from '../../static/js/modules/dropdowns.js'; import { default as context } from '../fixtures/context.js'; import { default as houseResults } from '../fixtures/house-results.js'; -// const DataTable = DataTable_FEC; describe('data table', function() { before(function() { From 4fa2e58d12513930113c217137ac4c2df8461cf2 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 25 Oct 2024 11:51:52 -0400 Subject: [PATCH 6/8] Documentation --- fec/fec/static/js/modules/helpers.js | 30 +++++++++++++-------- fec/fec/static/js/modules/tables.js | 39 +++++++++++++++++++--------- 2 files changed, 46 insertions(+), 23 deletions(-) diff --git a/fec/fec/static/js/modules/helpers.js b/fec/fec/static/js/modules/helpers.js index d7e35466f7..f0bb5c5efd 100644 --- a/fec/fec/static/js/modules/helpers.js +++ b/fec/fec/static/js/modules/helpers.js @@ -19,13 +19,19 @@ import { states as decoders_states } from './decoders.js'; -// set parameters from the API +/** + * Set parameters from the API + * @enum {string} + */ export const API = { amendment_indicator_new: 'N', amendment_indicator_terminated: 'T', means_filed_e_file: 'e-file' }; +/** + * Pixel widths when we consider a screen small (default), medium, or large + * @enum {number} */ export const BREAKPOINTS = { MEDIUM: 640, LARGE: 860 @@ -34,6 +40,10 @@ export const BREAKPOINTS = { export const LOADING_DELAY = 1500; export const SUCCESS_DELAY = 5000; +/** + * Selection of date formats + * @enum {string} Selected date format e.g. 'MM/DD/YYYY' or 'MMMM D, h:mma' + */ export const formatMap = { default: 'MM/DD/YYYY', pretty: 'MMMM D, YYYY', @@ -43,8 +53,11 @@ export const formatMap = { fullDayOfWeek: 'dddd' }; +/** + * Attach anchor links to any tag with a given attribute. + * @param {string} attr - Content of a `[]` selector + */ export function anchorify(attr) { - // Attach anchor links to any tag with a given attribute $('[' + attr + ']').each(function(idx, item) { const elt = $(item); const link = $(''); @@ -56,6 +69,10 @@ export function anchorify(attr) { }); } +/** + * Scrolls the page to the anchor specified by the in the URL, over ms number of milliseconds + * @param {number} ms - The duration of the animation in milliseconds + */ export function scrollAnchor(ms) { ms = ms || 1000; if (window.location.hash) { @@ -237,15 +254,6 @@ Handlebars.registerHelper('formatSentence', function(value) { Handlebars.registerHelper('basePath', global.BASE_PATH); -Handlebars.registerHelper('panelRow', function(label, options) { - return new Handlebars.SafeString( - `` + - `${label}` + - `${options.fn(this)}` + - '' - ); -}); - Handlebars.registerHelper('dtDetailsTableRow', function(label, options) { return new Handlebars.SafeString(`${label}${options.fn(this)}`); }); diff --git a/fec/fec/static/js/modules/tables.js b/fec/fec/static/js/modules/tables.js index a6831f2a6a..3bb24956e9 100644 --- a/fec/fec/static/js/modules/tables.js +++ b/fec/fec/static/js/modules/tables.js @@ -1,3 +1,14 @@ +/** + * tables.js contains three classes: + * + * DataTable_FEC - A custom class that extends datatables.net-responsive-dt + * across the site, every time "datatables" is referenced, it's DataTable_FEC, not datatables.net* + * + * OffsetPaginator - + * + * SeekPaginator - + */ + import { default as _chain } from 'underscore/modules/chain.js'; import { default as _clone } from 'underscore/modules/clone.js'; import { default as _debounce } from 'underscore/modules/debounce.js'; @@ -118,7 +129,7 @@ export function getCycle(value, meta) { * * @param {*} order * @param {*} column - * @returns + * @returns {string} */ export function mapSort(order, column) { return _map(order, function(item) { @@ -130,6 +141,11 @@ export function mapSort(order, column) { }); } +/** + * Returns the number of results if <= 500K, otherwise rounds to the nearest 1K + * @param {*} response + * @returns {number} Number of real or estimated results + */ function getCount(response) { let pagination_count = response.pagination.count; // eslint-disable-line camelcase @@ -191,9 +207,6 @@ export function modalRenderFactory(template, fetch) { callback ); callback = function(e) { - console.log(' e.type: ', e.type); - console.log(' e.which: ', e.which); - if (e.which === 13 || e.type === 'click') { // Note: Use `currentTarget` to get parent row, since the target column // may have been moved since the triggering event @@ -203,14 +216,12 @@ export function modalRenderFactory(template, fetch) { return true; } - // const tr = e.target.closest('tr'); - // const row = api.row($table, tr); - - // else row.child(format(row.data())).show(); if (!$target.closest('td').hasClass('dataTables_empty')) { const row = api.row($row); const index = row.index(); + if (row.child.isShown()) { + row.child.hide(); $row.removeClass('row-active'); $row.removeAttr('aria-details'); return; @@ -795,7 +806,7 @@ DataTable_FEC.prototype.fetch = function(data, callback) { .addClass('is-active-filter') .removeClass('is-disabled-filter'); - // Datatables that should have limits and reached the maxiumum + // Datatables that should have limits and reached the maximum // filter limit should display the field's error message // and disable that field's filter if ( @@ -1059,7 +1070,7 @@ DataTable_FEC.prototype.handleSwitch = function(e, opts) { /** * Used for… - * @param {string} className - Selector text, including the leading period (ex: `.data-table` instead of `data-table`) + * @param {string} tableElementSelector - Selector text, including the leading period (ex: `.data-table` instead of `data-table`) * @param {Object} pageContext - The window.context data object * @param {string} pageContext.candidateID * @param {number} pageContext.cycle @@ -1069,8 +1080,8 @@ DataTable_FEC.prototype.handleSwitch = function(e, opts) { * @param {string} pageContext.timePeriod - In the format of `2023-2024` * @param {Object} options - spendingTableOpts from {@link /fec/fec/static/js/pages/elections.js} */ -export function initSpendingTables(className, pageContext, options) { - $(className).each(function(index, table) { +export function initSpendingTables(tableElementSelector, pageContext, options) { + $(tableElementSelector).each(function(index, table) { const $table = $(table); const dataType = $table.attr('data-type'); const opts = options[dataType]; @@ -1303,6 +1314,10 @@ function drawContributionsByStateTable(selected, pageContext) { ); }); } + +/** + * Build the HTML for the child row / details row + * @param {string} contents * @returns {string} a string to be used as the innerHTML of the child/details row */ function childRow(contents) { From 3abfd8d49c5e9a1630aa69b6ac3d1a01f5f8b400 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 25 Oct 2024 12:08:38 -0400 Subject: [PATCH 7/8] Datatable details row fix width --- fec/fec/static/js/templates/candidates.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fec/fec/static/js/templates/candidates.hbs b/fec/fec/static/js/templates/candidates.hbs index e4934f6787..55d88fa5a2 100644 --- a/fec/fec/static/js/templates/candidates.hbs +++ b/fec/fec/static/js/templates/candidates.hbs @@ -1,6 +1,6 @@

    {{name}}

    -
    +
    {{#dtDetailsTableRow "Candidate ID"~}} From 556bf1ede348539dd985d6bf2c02723e329ed29b Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 27 Feb 2025 12:19:13 -0500 Subject: [PATCH 8/8] Zebra-stripe the rows based on even-odd classes from dt --- fec/fec/static/js/modules/tables.js | 3 ++- fec/fec/static/scss/components/_datatable-details-row.scss | 4 ++-- fec/fec/static/scss/components/_datatables.scss | 2 +- fec/fec/static/scss/components/_table-styles.scss | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fec/fec/static/js/modules/tables.js b/fec/fec/static/js/modules/tables.js index 890122810c..23ca95226f 100644 --- a/fec/fec/static/js/modules/tables.js +++ b/fec/fec/static/js/modules/tables.js @@ -246,7 +246,8 @@ export function modalRenderFactory(template, fetch) { newChildRow.show(); $row.addClass('row-active'); - row.child().addClass('dt-isChild row-active'); + const parentRowsEvenOddClass = e.currentTarget.classList.contains('even') ? 'even' : 'odd'; + row.child().addClass(`${parentRowsEvenOddClass} dt-isChild row-active`); // Aria link the normal row and its child/details row row.child().attr('id', `details-for-tr-${index}`); $row.attr('aria-details', `details-for-tr-${index}`); diff --git a/fec/fec/static/scss/components/_datatable-details-row.scss b/fec/fec/static/scss/components/_datatable-details-row.scss index fb99311d9c..30ac9a6daf 100644 --- a/fec/fec/static/scss/components/_datatable-details-row.scss +++ b/fec/fec/static/scss/components/_datatable-details-row.scss @@ -21,11 +21,11 @@ } @include media($med) { - &:nth-child(odd) { + &.odd { border-right: 1px solid #f1f1f1; padding-right: 1rem; } - &:nth-child(even) { + &.even { padding-left: 1rem; } } diff --git a/fec/fec/static/scss/components/_datatables.scss b/fec/fec/static/scss/components/_datatables.scss index f6298c23c1..8e3937b1d6 100644 --- a/fec/fec/static/scss/components/_datatables.scss +++ b/fec/fec/static/scss/components/_datatables.scss @@ -112,7 +112,7 @@ border-bottom: 1px solid $neutral; &.row-color-contrast, - &:nth-child(even) { + &.even { background-color: rgba($gray-lightest, 0.5); } diff --git a/fec/fec/static/scss/components/_table-styles.scss b/fec/fec/static/scss/components/_table-styles.scss index b235391880..ff79e1ba8b 100644 --- a/fec/fec/static/scss/components/_table-styles.scss +++ b/fec/fec/static/scss/components/_table-styles.scss @@ -114,7 +114,7 @@ h3 + .simple-table { .simple-table__row { padding: u(1rem); - &:nth-child(even) { + &.even { background-color: rgba($gray-lightest, 0.5); } }
    Candidate information