diff --git a/fec/data/templates/datatable.jinja b/fec/data/templates/datatable.jinja index 6ae5894e92..a4d098c238 100644 --- a/fec/data/templates/datatable.jinja +++ b/fec/data/templates/datatable.jinja @@ -58,9 +58,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/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/helpers.js b/fec/fec/static/js/modules/helpers.js index 66689869fd..0c540c83c7 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,13 +254,8 @@ 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 08dc278b93..23ca95226f 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'; @@ -13,7 +24,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'; @@ -120,7 +131,7 @@ export function getCycle(value, meta) { * * @param {*} order * @param {*} column - * @returns + * @returns {string} */ export function mapSort(order, column) { return _map(order, function(item) { @@ -132,6 +143,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 @@ -167,19 +183,19 @@ function identity(value) { return value; } -/** Selector class name for the modal trigger */ -export const MODAL_TRIGGER_CLASS = 'js-panel-trigger'; +/** Selector class name for the details trigger */ +export const DETAILS_TRIGGER_CLASS = 'js-dt-details-trigger'; /** String of html that becomes the 'Toggle details' button */ export const MODAL_TRIGGER_HTML = - ``; + ``; /** * Adds MODAL_TRIGGER_CLASS and `row--has-panel` classes to the given element * @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'); } /** @@ -193,18 +209,13 @@ 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 $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) { @@ -216,66 +227,47 @@ export function modalRenderFactory(template, fetch) { if ($target.is('a')) { return true; } + if (!$target.closest('td').hasClass('dataTables_empty')) { - const index = api.row($row).index(); + 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; + } + $.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'); + 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}`); + const newChildRowPdfButton = $row.next().find('.js-pdf_url'); + if (fetched.pdf_url) + newChildRowPdfButton.attr('href', fetched.pdf_url); + else + newChildRowPdfButton.remove(); }); } } }; $table.on( 'click keypress', - '.js-panel-toggle tr.' + MODAL_TRIGGER_CLASS, + `.js-panel-toggle tr.${DETAILS_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 @@ -323,7 +315,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; @@ -853,7 +844,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 ( @@ -1117,7 +1108,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 @@ -1127,8 +1118,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]; @@ -1361,3 +1352,19 @@ 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) { + return `
+
+ Open image +
+
+ ${contents} +
+
`; +} 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/allocated-federal-nonfederal-disbursements.hbs b/fec/fec/static/js/templates/allocated-federal-nonfederal-disbursements.hbs index 48841b15cc..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 3d89a03697..55d88fa5a2 100644 --- a/fec/fec/static/js/templates/candidates.hbs +++ b/fec/fec/static/js/templates/candidates.hbs @@ -1,104 +1,101 @@ -
-

- {{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"~}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} {{#if committees.authorized}} - {{#panelRow "Authorized campaign committees"}} - {{#each committees.authorized}} + {{#dtDetailsTableRow "Authorized campaign committees"~}} + {{#each committees.authorized~}}
  • - {{ this.name}} + {{this.name}}
  • {{/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)}} + {{#if (gte this 1980)~}} {{this}}{{#unless @last}}, {{/unless}} - {{else}} + {{else~}} {{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 22354aacc2..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"}} - {{#each sponsor_candidate_list}} + {{#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 39dab05812..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"}} - {{ currency transaction_amount }} - {{/panelRow}} - {{#panelRow "Report year"}} - {{ report_year }} - {{/panelRow}} - {{#panelRow "Transaction date"}} - {{ datetime transaction_date format=pretty }} - {{/panelRow}} - {{#panelRow "Transaction type"}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Amount"~}} + {{currency transaction_amount}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Report year"~}} + {{report_year}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Transaction date"~}} + {{datetime transaction_date format=pretty}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Transaction type"~}} {{transaction_type}} - {{/panelRow}} - {{#panelRow "Communication class"}} - {{ communication_class }} - {{/panelRow}} - {{#panelRow "Communication type"}} - {{ communication_type }} - {{/panelRow}} - {{#panelRow "Purpose"}} - {{ purpose }} - {{/panelRow}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Communication class"~}} + {{communication_class}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Communication type"~}} + {{communication_type}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Purpose"~}} + {{purpose}} + {{/dtDetailsTableRow}}
    Disbursement information
    -
    -

    Candidate information

    +
    - {{#panelRow "Candidate"}} + + {{#dtDetailsTableRow "Candidate"~}} {{candidate_name}} ({{decodeSupportOppose support_oppose_indicator}}) - {{/panelRow}} - {{#panelRow "Party"}} - {{ decodeParty candidate_party_affiliation }} - {{/panelRow}} - {{#panelRow "Office"}} - {{ decodeOffice candidate_office }} - {{/panelRow}} - {{#if candidate_office_state }} - {{#panelRow "State"}} - {{ decodeState candidate_office_state }} - {{/panelRow}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Party"~}} + {{decodeParty candidate_party_affiliation}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Office"~}} + {{decodeOffice candidate_office}} + {{/dtDetailsTableRow}} + {{#if candidate_office_state}} + {{#dtDetailsTableRow "State"~}} + {{decodeState candidate_office_state}} + {{/dtDetailsTableRow}} {{/if}} {{#if candidate_office_district}} - {{#panelRow "District"}} - {{ candidate_office_district }} - {{/panelRow}} + {{#dtDetailsTableRow "District"~}} + {{candidate_office_district}} + {{/dtDetailsTableRow}} {{/if}}
    Candidate information
    diff --git a/fec/fec/static/js/templates/debts.hbs b/fec/fec/static/js/templates/debts.hbs index 43f358324f..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 7248f797f7..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"}} - {{#if recipient}} + + {{#dtDetailsTableRow "Recipient name"~}} + {{#if recipient~}} {{recipient.name}} - {{else}} + {{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"}} - {{{ report_year }}} - {{/panelRow}} - {{#panelRow "Filing date"}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Report year"~}} + {{{report_year}}} + {{/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"}} - Form {{formNumber filing_form }} on line {{line_number}} - {{/panelRow}} - {{#if election_type_full }} - {{#panelRow "Election type"}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Reported on"~}} + Form {{formNumber filing_form}} on line {{line_number}} + {{/dtDetailsTableRow}} + {{#if election_type_full}} + {{#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 39f0bd9822..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"}} - {{ currency disbursement_amount }} - {{/panelRow}} - {{#panelRow "Number of candidates mentioned"}} - {{ number_of_candidates }} - {{/panelRow}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Amount"~}} + {{currency disbursement_amount}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Number of candidates mentioned"~}} + {{number_of_candidates}} + {{/dtDetailsTableRow}} - - {{#panelRow "Report year"}} - {{ report_year }} - {{/panelRow}} - {{#panelRow "Disbursement date"}} - {{ datetime disbursement_date format=pretty }} - {{/panelRow}} - {{#panelRow "Communication date"}} - {{ datetime communication_date format=pretty }} - {{/panelRow}} - {{#panelRow "Purpose description"}} - {{ purpose_description }} - {{/panelRow}} + {{#dtDetailsTableRow "Report year"~}} + {{report_year}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Disbursement date"~}} + {{datetime disbursement_date format=pretty}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Communication date"~}} + {{datetime communication_date format=pretty}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Purpose description"~}} + {{purpose_description}} + {{/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 }} + + + {{currency calculated_candidate_share}}
    -
    -

    Candidate information

    +
    - {{#panelRow "Candidate"}} + + {{#dtDetailsTableRow "Candidate"~}} {{candidate_name}} - {{/panelRow}} - {{#panelRow "Office"}} - {{ decodeOffice candidate_office }} - {{/panelRow}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Office"~}} + {{decodeOffice candidate_office}} + {{/dtDetailsTableRow}} {{#if candidate_state}} - {{#panelRow "State"}} + {{#dtDetailsTableRow "State"~}} {{decodeState candidate_state}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}} - {{#unless (eq candidate_district '00') }} - {{#panelRow "District"}} + {{#unless (eq candidate_district '00')}} + {{#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 e64cb109a0..ee4c9022e6 100644 --- a/fec/fec/static/js/templates/independent-expenditures.hbs +++ b/fec/fec/static/js/templates/independent-expenditures.hbs @@ -1,91 +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"}} - {{#if candidate_id}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Candidate"~}} + {{#if candidate_id~}} {{candidate_name}} - {{else}} + {{else~}} {{candidate_name}} {{/if}} - ({{decodeSupportOppose support_oppose_indicator}}) - {{/panelRow}} - {{#panelRow "Description"}} + ({{decodeSupportOppose support_oppose_indicator}}) + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Description"~}} {{expenditure_description}} - {{/panelRow}} - {{#panelRow "Payee"}} - {{payee_name}}
    - {{payee_city}}, {{payee_state}} - {{/panelRow}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Payee"~}} + {{payee_name}}
    {{payee_city}}, {{payee_state}} + {{/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"}} - {{#if candidate_id}} + + {{#dtDetailsTableRow "Candidate"~}} + {{#if candidate_id~}} {{candidate_name}} - {{else}} + {{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 78b47f466b..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"}} - {{#if 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 d60ebc6ea8..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"}} - {{#if recipient_committee_id}} + + {{#dtDetailsTableRow "Name"~}} + {{#if recipient_committee_id~}} {{recipient_name}} - {{else}} + {{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 c92b073325..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,76 +1,76 @@ {{!-- -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}} - {{#if (stringsMatch entity_type 'IND')}}{{! If this is an individual and not a committee }} + + {{#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, }} + {{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"}} + {{/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 c403028cd6..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"}} - {{#each sponsor_candidate_list}} - {{ sponsor_candidate_name }} ({{ sponsor_candidate_id }}){{#unless @last}};
    {{/unless}} + {{#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"}} - {{ treasurer_name }} - {{/panelRow}} - {{#panelRow "State"}} - {{ committee_state }} - {{/panelRow}} - {{#panelRow "Filing frequency"}} - {{ filing_frequency_full }} - {{/panelRow}} - {{#panelRow "Registration date"}} - {{ datetime first_f1_date format="pretty" }} - {{/panelRow}} - {{#if (eq committee_designation_full "Joint fundraising committee") }} - {{#panelRow "Joint fundraising participants"}} + {{#dtDetailsTableRow "Most recent treasurer"~}} + {{treasurer_name}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "State"~}} + {{committee_state}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Filing frequency"~}} + {{filing_frequency_full}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Registration date"~}} + {{datetime first_f1_date format="pretty"}} + {{/dtDetailsTableRow}} + {{#if (eq committee_designation_full "Joint fundraising committee")}} + {{#dtDetailsTableRow "Joint fundraising participants"~}} Full list of current participants - {{/panelRow}} + {{/dtDetailsTableRow}} {{/if}}
    Committee information
    -
    -

    - Financial totals for {{ format_range cycle }} -

    +
    - {{#panelRow "Coverage end date"}} - {{ datetime coverage_end_date format="pretty" }} - {{/panelRow}} - {{#panelRow "Receipts"}} - {{ currency receipts }} - {{/panelRow}} + + {{#dtDetailsTableRow "Coverage end date"~}} + {{datetime coverage_end_date format="pretty"}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Receipts"~}} + {{currency receipts}} + {{/dtDetailsTableRow}} - - {{#panelRow "Disbursements"}} - {{ currency disbursements }} - {{/panelRow}} + {{#dtDetailsTableRow "Disbursements"~}} + {{currency disbursements}} + {{/dtDetailsTableRow}} - - {{#panelRow "Debts owed by committee"}} - {{ currency last_debts_owed_by_committee }} - {{/panelRow}} + {{#dtDetailsTableRow "Debts owed by committee"~}} + {{currency last_debts_owed_by_committee}} + {{/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 }} + + + {{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 }} + + + {{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..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"}} - {{#if payee_name}} + + {{#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 942010db49..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}} - - {{#if contributor}} - {{#if (isEarmarked receipt_type) }} - {{#panelRow "Earmarked by"}} + {{else~}} + {{contributor_name}} + {{/if}} + {{/dtDetailsTableRow}} + {{#if contributor~}} + {{#if (isEarmarked receipt_type)~}} + {{#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"}} - {{{ report_year }}} - {{/panelRow}} - {{#panelRow "Memo"}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Report year"~}} + {{{report_year}}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Memo"~}} {{memo_text}} - {{/panelRow}} + {{/dtDetailsTableRow}} {{#if filing_form}} - {{#panelRow "Reported on"}} - Form {{formNumber filing_form }} on line {{line_number}} - {{/panelRow}} + {{#dtDetailsTableRow "Reported on"~}} + Form {{formNumber filing_form}} on line {{line_number}} + {{/dtDetailsTableRow}} {{/if}} - {{#panelRow "Election type"}} + {{#dtDetailsTableRow "Election type"~}} {{fec_election_type_desc}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    Receipt information
    -
    -

    Recipient information

    +
    - {{#panelRow "Committee"}} - {{ committee.name }} - {{/panelRow}} - {{#panelRow "Political party"}} + + {{#dtDetailsTableRow "Committee"~}} + {{committee.name}} + {{/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 de21213840..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,134 +12,134 @@ {{{amendment_version}}}

    - {{#panelRow "Filer"}} - {{ committee_name }} - {{/panelRow}} - {{#panelRow "FEC file number"}} - {{ fec_file_id }} - {{/panelRow}} - {{#panelRow "Report coverage"}} + {{#dtDetailsTableRow "Filer"~}} + {{committee_name}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "FEC file number"~}} + {{fec_file_id}} + {{/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"}} - {{ decodeMeans means_filed}} - {{/panelRow}} - {{#panelRow "Read report"}} - {{#if html_url}} - Webpage | + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Filing method"~}} + {{decodeMeans means_filed}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Read report"~}} + {{#if html_url~}} + Webpage | {{/if}} - {{#if csv_url}} - .csv | + {{#if csv_url~}} + .csv | {{/if}} - {{#if pdf_url }} - .pdf + {{#if pdf_url~}} + .pdf {{/if}} - {{#if fec_url}} - | .fec + {{#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 d5095949c3..900761f902 100644 --- a/fec/fec/static/js/templates/reports/ie-only.hbs +++ b/fec/fec/static/js/templates/reports/ie-only.hbs @@ -1,55 +1,57 @@ -
    -
    -

    {{document_description}} - {{#if is_amended}} +
    +
    +

    {{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"}} - {{ committee_name }} - {{/panelRow}} - {{#panelRow "FEC file number"}} - {{ fec_file_id }} - {{/panelRow}} - {{#panelRow "Report coverage"}} + {{#dtDetailsTableRow "Filer"~}} + {{committee_name}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "FEC file number"~}} + {{fec_file_id}} + {{/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"}} - {{ decodeMeans means_filed}} - {{/panelRow}} - {{#panelRow "Read report"}} - {{#if html_url}} - Webpage | + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Filing method"~}} + {{decodeMeans means_filed}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Read report"~}} + {{#if html_url~}} + Webpage | {{/if}} - {{#if csv_url}} - .csv | + {{#if csv_url~}} + .csv | {{/if}} - {{#if pdf_url }} - .pdf + {{#if pdf_url~}} + .pdf {{/if}} - {{#if fec_url}} - | .fec + {{#if fec_url~}} + | .fec {{/if}} - {{/panelRow}} + {{/dtDetailsTableRow}}
    -
    + +{{!-- TODO: should this table have a title? I don't like the wider layout --}} +
    - {{#panelRow "Total contributions"}} - {{{currency independent_contributions_period }}} - {{/panelRow}} - {{#panelRow "Total independent expenditures"}} - {{{currency independent_expenditures_period }}} - {{/panelRow}} + {{#dtDetailsTableRow "Total contributions"~}} + {{{currency independent_contributions_period}}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Total independent expenditures"~}} + {{{currency independent_expenditures_period}}} + {{/dtDetailsTableRow}}
    diff --git a/fec/fec/static/js/templates/reports/pac.hbs b/fec/fec/static/js/templates/reports/pac.hbs index f663b333fb..dbfdc37581 100644 --- a/fec/fec/static/js/templates/reports/pac.hbs +++ b/fec/fec/static/js/templates/reports/pac.hbs @@ -1,6 +1,6 @@ -
    -
    -

    {{document_description}} +
    +
    +

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

    - {{#panelRow "Filer"}} - {{ committee_name }} - {{/panelRow}} - {{#panelRow "FEC file number"}} - {{ fec_file_id }} - {{/panelRow}} - {{#panelRow "Report coverage"}} + {{#dtDetailsTableRow "Filer"~}} + {{committee_name}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "FEC file number"~}} + {{fec_file_id}} + {{/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"}} - {{ decodeMeans means_filed}} - {{/panelRow}} - {{#panelRow "Read report"}} - {{#if html_url}} - Webpage | + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Filing method"~}} + {{decodeMeans means_filed}} + {{/dtDetailsTableRow}} + {{#dtDetailsTableRow "Read report"~}} + {{#if html_url~}} + Webpage | {{/if}} - {{#if csv_url}} - .csv | + {{#if csv_url~}} + .csv | {{/if}} - {{#if pdf_url }} - .pdf + {{#if pdf_url~}} + .pdf {{/if}} {{#if fec_url}} - | .fec + | .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 caa7adfd51..2779d9799a 100644 --- a/fec/fec/static/scss/components/_buttons.scss +++ b/fec/fec/static/scss/components/_buttons.scss @@ -439,9 +439,15 @@ padding: 0; } -.button--panel { +.button--dt-details { + background-position-y: 5%; background-size: 90%; - @include u-icon($arrow-right-circle, $gray, 2rem, 2rem, contain); + @include u-icon($plus-circle, $primary, 2rem, 2rem, contain); +} +tr.dt-hasChild .button--dt-details { + background-position-y: 5%; + background-size: 90%; + @include u-icon($minus-circle, $primary, 2rem, 2rem, contain); } .button--nav-panel { 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..30ac9a6daf --- /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) { + &.odd { + border-right: 1px solid #f1f1f1; + padding-right: 1rem; + } + &.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 deleted file mode 100644 index ef8f3b15f2..0000000000 --- a/fec/fec/static/scss/components/_datatable-panel.scss +++ /dev/null @@ -1,286 +0,0 @@ -// Datatable Panel -// - -.panel__main { - left: 0; - clear: both; - position: relative; - width: 200%; - z-index: $z1; - @include clearfix; - - .data-table { - float: left; - width: 50% !important; - } -} - -.results-info { - position: relative; -} - -// modal -.panel__overlay { - background-color: $inverse; - overflow: hidden; - padding: u(1rem); - float: right; - width: 50%; - opacity: 0; - @include transition(opacity 0.2s); -} - -// 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, 0.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: -0.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: -0.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 { - border-bottom: 1px solid $gray-lightest; - padding: u(0 0 1rem 0); - text-align: right; - @include clearfix; -} - -.panel__link { - float: right; -} - -.panel__close { - background-position: 0 50%; - background-size: u(1.5rem); - border: none; - cursor: pointer; - float: left; - padding-left: u(3rem); - @include u-icon-bg($arrow-left-border, $primary); - - &::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, 0.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(0.6rem 2rem); - text-align: left; - margin-bottom: 0; - } - - .panel__link { - float: left; - } - - .panel__close { - background-size: u(2rem); - position: absolute; - right: 0; - top: 0; - @include u-icon($x, $primary); - - &::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 { - width: 50% !important; - @include transform(translateX(0)); - } - - .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(0.3rem 0); - white-space: pre-wrap; - overflow: visible; - - &:first-child { - font-weight: bold; - } - } -} - -#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 3e0ac44e1e..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); } @@ -235,8 +235,9 @@ } // Special styles for rows that trigger panels -.row--has-panel { +.row--has-details { cursor: pointer; + @include transition(border-left-width, 0.2s); } 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); } } diff --git a/fec/fec/static/scss/datatables.scss b/fec/fec/static/scss/datatables.scss index 051653976c..7c325d8365 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 1b5191621a..52d7bef5a1 100644 --- a/fec/fec/static/scss/entity.scss +++ b/fec/fec/static/scss/entity.scss @@ -2,15 +2,12 @@ @import 'base'; @import 'common'; -@import 'components/entity-header'; +@import 'components/callouts'; @import 'components/candidate-page'; +@import 'components/committee-snapshot'; @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/entity-header'; @import 'components/results-info'; -@import 'components/callouts'; -@import 'components/committee-snapshot'; +@import 'components/table-styles'; diff --git a/fec/fec/tests/js/tables.js b/fec/fec/tests/js/tables.js index a6013466b7..1d3baaefb9 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';