This repository has been archived by the owner on Dec 23, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Feature/hide amendments candidate #527
Merged
noahmanger
merged 5 commits into
fecgov:develop
from
jmcarp:feature/hide-amendments-candidate
Aug 26, 2015
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,175 @@ | ||
states = { | ||
'AK': 'Alaska', | ||
'AL': 'Alabama', | ||
'AR': 'Arkansas', | ||
'AS': 'American Samoa', | ||
'AZ': 'Arizona', | ||
'CA': 'California', | ||
'CO': 'Colorado', | ||
'CT': 'Connecticut', | ||
'DC': 'District of Columbia', | ||
'DE': 'Delaware', | ||
'FL': 'Florida', | ||
'GA': 'Georgia', | ||
'GU': 'Guam', | ||
'HI': 'Hawaii', | ||
'IA': 'Iowa', | ||
'ID': 'Idaho', | ||
'IL': 'Illinois', | ||
'IN': 'Indiana', | ||
'KS': 'Kansas', | ||
'KY': 'Kentucky', | ||
'LA': 'Louisiana', | ||
'MA': 'Massachusetts', | ||
'MD': 'Maryland', | ||
'ME': 'Maine', | ||
'MI': 'Michigan', | ||
'MN': 'Minnesota', | ||
'MO': 'Missouri', | ||
'MP': 'Northern Mariana Islands', | ||
'MS': 'Mississippi', | ||
'MT': 'Montana', | ||
'NA': 'National', | ||
'NC': 'North Carolina', | ||
'ND': 'North Dakota', | ||
'NE': 'Nebraska', | ||
'NH': 'New Hampshire', | ||
'NJ': 'New Jersey', | ||
'NM': 'New Mexico', | ||
'NV': 'Nevada', | ||
'NY': 'New York', | ||
'OH': 'Ohio', | ||
'OK': 'Oklahoma', | ||
'OR': 'Oregon', | ||
'PA': 'Pennsylvania', | ||
'PR': 'Puerto Rico', | ||
'RI': 'Rhode Island', | ||
'SC': 'South Carolina', | ||
'SD': 'South Dakota', | ||
'TN': 'Tennessee', | ||
'TX': 'Texas', | ||
'UT': 'Utah', | ||
'VA': 'Virginia', | ||
'VI': 'Virgin Islands', | ||
'VT': 'Vermont', | ||
'WA': 'Washington', | ||
'WI': 'Wisconsin', | ||
'WV': 'West Virginia', | ||
'WY': 'Wyoming' | ||
} | ||
from collections import OrderedDict | ||
|
||
states = OrderedDict([ | ||
('AK', 'Alaska'), | ||
('AL', 'Alabama'), | ||
('AR', 'Arkansas'), | ||
('AS', 'American Samoa'), | ||
('AZ', 'Arizona'), | ||
('CA', 'California'), | ||
('CO', 'Colorado'), | ||
('CT', 'Connecticut'), | ||
('DC', 'District of Columbia'), | ||
('DE', 'Delaware'), | ||
('FL', 'Florida'), | ||
('GA', 'Georgia'), | ||
('GU', 'Guam'), | ||
('HI', 'Hawaii'), | ||
('IA', 'Iowa'), | ||
('ID', 'Idaho'), | ||
('IL', 'Illinois'), | ||
('IN', 'Indiana'), | ||
('KS', 'Kansas'), | ||
('KY', 'Kentucky'), | ||
('LA', 'Louisiana'), | ||
('MA', 'Massachusetts'), | ||
('MD', 'Maryland'), | ||
('ME', 'Maine'), | ||
('MI', 'Michigan'), | ||
('MN', 'Minnesota'), | ||
('MO', 'Missouri'), | ||
('MP', 'Northern Mariana Islands'), | ||
('MS', 'Mississippi'), | ||
('MT', 'Montana'), | ||
('NA', 'National'), | ||
('NC', 'North Carolina'), | ||
('ND', 'North Dakota'), | ||
('NE', 'Nebraska'), | ||
('NH', 'New Hampshire'), | ||
('NJ', 'New Jersey'), | ||
('NM', 'New Mexico'), | ||
('NV', 'Nevada'), | ||
('NY', 'New York'), | ||
('OH', 'Ohio'), | ||
('OK', 'Oklahoma'), | ||
('OR', 'Oregon'), | ||
('PA', 'Pennsylvania'), | ||
('PR', 'Puerto Rico'), | ||
('RI', 'Rhode Island'), | ||
('SC', 'South Carolina'), | ||
('SD', 'South Dakota'), | ||
('TN', 'Tennessee'), | ||
('TX', 'Texas'), | ||
('UT', 'Utah'), | ||
('VA', 'Virginia'), | ||
('VI', 'Virgin Islands'), | ||
('VT', 'Vermont'), | ||
('WA', 'Washington'), | ||
('WI', 'Wisconsin'), | ||
('WV', 'West Virginia'), | ||
('WY', 'Wyoming'), | ||
]) | ||
|
||
parties = OrderedDict([ | ||
('DEM', 'Democratic Party'), | ||
('REP', 'Republican Party'), | ||
]) | ||
parties_extended = OrderedDict([ | ||
('AIC', 'American Independent Conservative'), | ||
('AIP', 'American Independent Party'), | ||
('AMP', 'American Party'), | ||
('APF', "American People's Freedom Party"), | ||
('CIT', "Citizens' Party"), | ||
('CMP', 'Commonwealth Party of the U.S.'), | ||
('COM', 'Communist Party'), | ||
('CRV', 'Conservative Party'), | ||
('CST', 'Constitutional'), | ||
('D/C', 'Democratic/Conservative'), | ||
('DFL', 'Democratic-Farm-Labor'), | ||
('FLP', 'Freedom Labor Party'), | ||
('GRE', 'Green Party'), | ||
('GWP', 'George Wallace Party'), | ||
('HRP', 'Human Rights Party'), | ||
('IAP', 'Independent American Party'), | ||
('ICD', 'Independent Conserv. Democratic'), | ||
('IGD', 'Industrial Government Party'), | ||
('IND', 'Independent'), | ||
('LAB', 'U.S. Labor Party'), | ||
('LBL', 'Liberal Party'), | ||
('LBR', 'Labor Party'), | ||
('LBU', 'Liberty Union Party'), | ||
('LFT', 'Less Federal Taxes'), | ||
('LIB', 'Libertarian'), | ||
('LRU', 'La Raza Unida'), | ||
('NAP', 'Prohibition Party'), | ||
('NDP', 'National Democratic Party'), | ||
('NLP', 'Natural Law Party'), | ||
('PAF', 'Peace and Freedom'), | ||
('PFD', 'Peace Freedom Party'), | ||
('POP', 'People Over Politics'), | ||
('PPD', 'Protest, Progress, Dignity'), | ||
('PPY', "People's Party"), | ||
('REF', 'Reform Party'), | ||
('RTL', 'Right to Life'), | ||
('SLP', 'Socialist Labor Party'), | ||
('SUS', 'Socialist Party U.S.A.'), | ||
('SWP', 'Socialist Workers Party'), | ||
('THD', 'Theo-Dem'), | ||
('TWR', 'Taxpayers Without Representation'), | ||
('TX', 'Taxpayers'), | ||
('USP', "U.S. People's Party"), | ||
]) | ||
|
||
report_types = OrderedDict([ | ||
('CA', 'COMPREHENSIVE AMEND'), | ||
('ADJ', 'COMP ADJUST AMEND'), | ||
('10D', 'PRE-ELECTION'), | ||
('10G', 'PRE-GENERAL'), | ||
('10P', 'PRE-PRIMARY'), | ||
('10R', 'PRE-RUN-OFF'), | ||
('10S', 'PRE-SPECIAL'), | ||
('12C', 'Pre-Convention'), | ||
('12G', 'Pre-General'), | ||
('12P', 'Pre-Primary'), | ||
('12R', 'Pre-Runoff'), | ||
('12S', 'Pre-Special'), | ||
('30D', 'POST-ELECTION'), | ||
('30G', 'Post-General'), | ||
('30P', 'POST-PRIMARY'), | ||
('30R', 'Post-Runoff'), | ||
('30S', 'Post-Special'), | ||
('60D', '60 Day Post Convention of a Presidential Host Committee'), | ||
('90D', '90 Day Post Inaugural Report by an Inaugural Committee'), | ||
('90S', 'Supplement to a 90D Inaugural Report'), | ||
('M1', 'JANUARY MONTHLY'), | ||
('M2', 'February Monthly'), | ||
('M3', 'March Monthly'), | ||
('M4', 'April Monthly'), | ||
('M5', 'May Monthly'), | ||
('M6', 'June Monthly'), | ||
('M7', 'July Monthly'), | ||
('M8', 'August Monthly'), | ||
('M9', 'September Monthly'), | ||
('M10', 'October Monthly'), | ||
('M11', 'November Monthly'), | ||
('M12', 'December Monthly'), | ||
('MY', 'Mid-year Report'), | ||
('Q1', 'April Quarterly'), | ||
('Q2', 'July Quarterly'), | ||
('Q3', 'October Quarterly'), | ||
('YE', 'Year-end'), | ||
('MYE', 'Monthly Year-end'), | ||
('TER', 'Termination Report'), | ||
('24', '24-Hour Report'), | ||
('48', '48-Hour Report'), | ||
('Q2S', 'July 15 (Q2) report and Semi-annual'), | ||
('QSA', 'Semi-Annual only'), | ||
('QYS', 'Jan 31 Year End (YE) report and Semi-Annual'), | ||
('QYE', 'Semi-Annual only'), | ||
('QMS', 'July 31 Mid-Year (MY) reportand Semi-annual'), | ||
('M7S', 'July 20 (M7) Monthly report and Semi-Annual'), | ||
('MSA', 'Semi-Annual only'), | ||
('MYS', 'Jan 31 Year End (MYE) report and Semi-annual'), | ||
('MSY', 'Semi-Annual only'), | ||
]) | ||
|
||
amendment_indicators = OrderedDict([ | ||
('N', 'New'), | ||
('A', 'Amended'), | ||
]) | ||
amendment_indicators_extended = OrderedDict([ | ||
('T', 'Terminated'), | ||
('C', 'Consolidated'), | ||
('M', 'Multi-Candidate'), | ||
('S', 'Secondary'), | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% import 'macros/filters/checkbox.html' as checkbox %} | ||
|
||
{% macro amendment_indicator(options=True) %} | ||
{{ checkbox.checkbox_dropdown( | ||
'amendment_indicator', | ||
'Amendment Indicator', | ||
selected=constants.amendment_indicators, | ||
options=constants.amendment_indicators_extended if options else {}, | ||
) }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{% macro checkbox(name, value, label) %} | ||
<li class="dropdown__item"> | ||
<input id="{{ name }}-{{ value }}" name="{{ name }}" type="checkbox" value="{{ value }}"> | ||
<label class="dropdown__value" for="{{ name }}-{{ value }}">{{ label }}</label> | ||
</li> | ||
{% endmacro %} | ||
|
||
{% macro checkbox_list(name, options, css_class='dropdown__list') %} | ||
<ul class="{{ css_class }}"> | ||
{% for value, label in options.items() %} | ||
{{ checkbox(name, value, label) }} | ||
{% endfor %} | ||
</ul> | ||
{% endmacro %} | ||
|
||
{% macro checkbox_options(name, options) %} | ||
<div class="dropdown"> | ||
<button class="dropdown__button button--neutral">More</button> | ||
<div id="{{ name }}-dropdown" class="dropdown__panel" aria-hidden="true"> | ||
{{ checkbox_list(name, options) }} | ||
</div> | ||
</div> | ||
{% endmacro %} | ||
|
||
{% macro checkbox_dropdown(name, label, selected={}, options={}) %} | ||
<div class="filter"> | ||
<fieldset class="js-dropdown"> | ||
<legend class="label" for="{{ name }}">{{ label }}<span class="any" aria-hidden="true">(Any)</span></legend> | ||
{{ checkbox_list(name, selected, css_class='dropdown__selected') }} | ||
{% if options %} | ||
{{ checkbox_options(name, options) }} | ||
{% endif %} | ||
</fieldset> | ||
</div> | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not actually making use of this
.any
span anymore, so we can remove it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it--updated.