{% extends "id_creator/id_creator_base.html" %}
{% load dc_forms %}

{% block form_tag_extra %}class="large_legends inline_radios"{% endblock form_tag_extra %}

{% block form_page_header %}
<h1>Election Organisation</h1>

<p>Enter the organisation(s) holding <strong>{{ all_data.election_type }}</strong>
    on <strong>{{ all_data.date|date }}</strong></p>

{% endblock form_page_header %}


{% block extra_javascript %}
{{ block.super }}
<script>
fallback.ready(function() {

    $("<button type=button class=button>Mark all seats as contested (can't be undone)</button>")
    .insertAfter(".inline_radios .form-group h2").on('click', function() {
        $('input[value=seats_contested]').prop("checked", true);
        $('input[value=seats_contested]').parent().addClass("selected");
        $('input[value=no_seats]').parent().removeClass("selected");
        $('input[value=by_election]').parent().removeClass("selected");
    });
});

// });

</script>
{% endblock extra_javascript %}

{% extends "id_creator/id_creator_base.html" %}
{% load dc_forms %}

{% block form_tag_extra %}class="large_legends inline_radios"{% endblock form_tag_extra %}

{% block form_page_header %}
<h1>Election Organisation</h1>

<p>Enter the organisation(s) holding <strong>{{ all_data.election_type }}</strong>
    on <strong>{{ all_data.date|date }}</strong></p>

{% endblock form_page_header %}


{% block extra_javascript %}
{{ block.super }}
<script>
fallback.ready(function() {

    $("form").prepend(
      $("<button type='button' class='button'>Mark all seats as contested (can't be undone)</button>")
        .on('click', function() {
          $('input[value=seats_contested]').prop("checked", true);
          $('input[value=seats_contested]').parent().addClass("selected");
          $('input[value=no_seats]').parent().removeClass("selected");
          $('input[value=by_election]').parent().removeClass("selected");
        })
    );

});

</script>
{% endblock extra_javascript %}

Fix 'Mark all seats as contested' buttons
Fix 'Mark all seats as contested' buttons
