{# templates/election/election_list.html #} {% extends "template_base.html" %} {% block title %}{% if is_national_election %}{{ national_election.election_name }}{% else %}Elections{% endif %}{% endblock %} {% block content %} {% load template_filters %} {% load humanize %}

{% if is_national_election %}{{ national_election.election_name }} — {{ national_election.election_day_text }}{% else %}Elections{% endif %}

Retrieve All Elections from Master API Server (Meta information only)     Refresh States

{#Pinging API Server .#} {% if is_national_election %} {# ############## List of states under one National Election ############## #} Back to Elections 
{% csrf_token %}    
{% else %}
{% csrf_token %} {% if election_search %} clear search  {% endif %}     {# Default to showing only upcoming elections #} {% if years_available %} {% endif %}{# End of if years_available #}                    
{% endif %} {% if election_list %} {% for election in election_list %} {% if forloop.counter == 1 or forloop.counter|divisibleby:21 %} {# Show the header every 20 lines #} {% if not is_national_election %} {% endif %} {% if not is_national_election %} {% endif %} {% if is_national_election or show_election_statistics %} {# #} {# #} {% endif %} {% if show_election_statistics %} {% endif %} {% if not is_national_election %} {% endif %} {% endif %} {% if not is_national_election %} {% endif %} {% if not is_national_election %} {% endif %} {% if is_national_election or show_election_statistics %} {# Last Retrieve / Refresh #} {# #} {# #} {% endif %} {% if show_election_statistics %} {% endif %} {% if not is_national_election %} {% endif %} {% endfor %}
Live? {% if is_national_election %}Notes{% else %}Election Name{% endif %}DateState(s)Election ID Offices {% if show_election_statistics %}
(w/o Candidates) {% endif %}
Last Refresh Refresh Added to QueueLast ElectionNext ElectionCandidates
(w/o Photos)
Measures Ballot Locations
(To Process)
Voter Guides
(Public Positions)
 
{{ forloop.counter }} {% if election.include_in_list_for_voters %}Yes{% endif %}{% if election.include_in_list_for_voters and election.election_preparation_finished %}, {% endif %} {% if election.election_preparation_finished %}DATA{% endif %}{% if election.include_in_list_for_voters or election.election_preparation_finished and election.candidate_photos_finished %}, {% endif %} {% if election.candidate_photos_finished %}PHOTOS{% endif %} {% if not is_national_election %} {{ election.election_name }} {% if election.vote_usa_same_day_election_suffix_list %} ({{ election.vote_usa_same_day_election_suffix_list }}) {% endif %} {% endif %} {% if election.internal_notes %}
{{ election.internal_notes|default_if_none:""|truncatechars:50 }} {% endif %}
{{ election.election_day_text }} {% if election.days_until_election > 0 %} (in {{ election.days_until_election }} days){% endif %} {% if election.is_national_election and not is_national_election %}
{% if election.state_code_list_raw %} {{ election.state_code_list_raw }} {% else %} see all states {% endif %}
{% else %} {{ election.state_code }}    {% endif %}
{{ election.google_civic_election_id }} {% if election.vote_usa_election_id %} / {{ election.vote_usa_election_id }}{% endif %} {% if not show_election_statistics and election.office_count %} {{ election.office_count|default_if_none:"" }} {% endif %} {% if election.offices_with_candidates_count %} {{ election.offices_with_candidates_count|default_if_none:"" }} {% endif %} {% if election.offices_without_candidates_count %} ({{ election.offices_without_candidates_count|default_if_none:"" }}) {% endif %} {# {% if election.retrieve_date_completed %}#} {# retrieve: {{ election.retrieve_date_completed }}#} {# {% elif election.retrieve_date_started %}#} {# retrieve start: {{ election.retrieve_date_completed }}#} {# {% endif %}#} {##} {# {% if election.retrieve_date_completed or election.retrieve_date_started and election.refresh_date_completed or election.refresh_date_started %}#} {# /#} {# {% endif %}#} {% if election.refresh_date_completed %} {{ election.refresh_date_completed }} {% elif election.refresh_date_started %} start: {{ election.refresh_date_started }} {% elif election.retrieve_date_completed %} {{ election.retrieve_date_completed }} {% elif election.retrieve_date_started %} start: {{ election.retrieve_date_started }} {% endif %} {% if election.refresh_date_added_to_queue %} {{ election.refresh_date_added_to_queue }} {% endif %} #} {# {% if election.prior_election_in_state and election.prior_election_in_state.election_day_text %}#} {# {{ election.prior_election_in_state_date|date:"N j, Y" }}#} {# {% endif %}#} {# #} {# {% if election.next_election_in_state and election.next_election_in_state.election_day_text %}#} {# {% if election.next_election_in_state.election_day_text == election.election_day_text %}#} {# #} {# This election#} {# #} {# {% else %}#} {# {{ election.next_election_in_state_date|date:"N j, Y" }}#} {# {% endif %}#} {# {% endif %}#} {# {% if election.candidate_count %} {{ election.candidate_count|default_if_none:"" }} {% endif %} {% if election.candidates_without_photo_count %} ({{ election.candidates_without_photo_count|default_if_none:"" }} {% if election.candidates_without_photo_percentage %} : {{ election.candidates_without_photo_percentage|floatformat:"0" }}%{% endif %}) {% endif %} {% if election.candidate_count %}
open json {% endif %}
{% if election.measure_count %} {{ election.measure_count|default_if_none:"" }} {% endif %} {% if election.ballot_returned_count %}{{ election.ballot_returned_count|default_if_none:"" }} {% if election.ballot_location_display_option_on_count %} / {{ election.ballot_location_display_option_on_count|default_if_none:"" }}{% endif %} {% endif %} {% if election.batches_not_processed %} {% if election.batches_not_processed_batch_set_id %} ({{ election.batches_not_processed|default_if_none:"" }}) {% else %} ({{ election.batches_not_processed|default_if_none:"" }}) {% endif %} {% endif %} {% if election.voter_guides_count %} {{ election.voter_guides_count|default_if_none:"" }} {% endif %} {% if election.public_positions_count %} ({{ election.public_positions_count|default_if_none:"" }}) {% endif %} (edit)

{% else %}

(no elections found)

{% endif %} {# ############## List of many election dates ############## #}

Preview 'upcoming elections API' response from: CTCL, Vote USA

Retrieve upcoming elections from: CTCL, Google Civic, or Vote USA

Add Upcoming Election Manually

{% endblock %}