{# templates/office/office_held_edit.html #} {% extends "template_base.html" %} {% block title %}{% if office_held %}{{ office_held.office_held_name }} {% if office_held.district_id %} - District {{ office_held.district_id }} {% endif %} {% if office_held.state_code %} - {{ office_held.state_code }} {% endif %} {% else %}Create New Office Held{% endif %}{% endblock %} {% block content %} {% load template_filters %}

{% if office_held %}Edit {{ office_held.office_held_name|default_if_none:"" }} {% if office_held.district_id %} - District {{ office_held.district_id }} {% endif %} {% if office_held.state_code %} - {{ office_held.state_code }} {% endif %} {% else %} Create New Office Held{% endif %}

{% csrf_token %} {% if office_held %}

cancel {% else %}

cancel {% endif %}  

{% if office_held %}{{ office_held.we_vote_id }}{% else %}{{ we_vote_id }}{% endif %}
Years with data: {% if office_held.year_with_data_2023 %}2023 {% endif %} {% if office_held.year_with_data_2024 %}2024 {% endif %} {% if office_held.year_with_data_2025 %}2025 {% endif %} {% if office_held.year_with_data_2026 %}2026 {% endif %}
{% include "office_held/is_battleground_race_year_checkboxes.html" with office_held=office_held %}
{% if office_held.primary_party %}
{% if office_held %}{{ office_held.primary_party|default_if_none:"" }}{% else %}{{ primary_party|default_if_none:"" }}{% endif %}
{% endif %}
{% if office_held %}

cancel {% else %}

cancel {% endif %}  

{% if office_held_list %}

Existing Offices Held

{% for office_held in office_held_list %} {% endfor %}
ID We Vote ID Office Held Name State # of Candidates
{{ office_held.id }} {{ office_held.we_vote_id }} {{ office_held.office_held_name }} {% if office_held.district_id %} - District {{ office_held.district_id }} {% endif %} {% if office_held.state_code %} - {{ office_held.state_code }} {% endif %} {{ office_held.state_code }} {{ office_held.candidate_count }}
{% endif %} {% endblock %}