{% extends "layout.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "_helpers.html" as macros %}
{% block title %}FLL Score Form{% endblock %}
{% block pageContent %}
  <h1>FLL Score Entry</h1>
  <script>window.jQuery || document.write('<script src="{{url_for('static', filename='js/libs/jquery-1.11.3.min.js') }}">\x3C/script>')</script>
  <script type="text/javascript">
    // TODO move this to score-specific JS file
    $( document ).ready(function() {
      updateTotal();
    });

    $(function() {
      $('.scoreForm').change(function() {
        console.log("form changed");
        updateTotal();
      });
    });

    function updateTotal() {
      $.getJSON('/scores/_add_numbers', {
        tree_branch_is_closer: $("input[name='tree_branch_is_closer']:checked").val(),
        tree_branch_is_intact: $("input[name='tree_branch_is_intact']:checked").val(),
        cargo_plane_location: $("input[name='cargo_plane_location']:checked").val()
      }, function(data) {
        $("#result").text(data.result);
      });
      return false;
    }
  </script>
  <h4>Total: <span id="result">0</span></h4>
  {% if team_id and round_number %}
    <p>Team: {{ team_id }}</p>
    <p>Round: {{ round_number }}<p>
  {% endif %}
  {{ macros.render_form(form, class_="scoreForm") }}
{% endblock %}

{% extends "layout.html" %}
{% import "_helpers.html" as macros %}
{% block title %}FLL Score Form{% endblock %}
{% block pageContent %}
  <h1>FLL Score Entry</h1>
  <script>window.jQuery || document.write('<script src="{{url_for('static', filename='js/libs/jquery-1.11.3.min.js') }}">\x3C/script>')</script>
  <script type="text/javascript">
    // TODO move this to score-specific JS file
    $( document ).ready(function() {
      updateTotal();
    });

    $(function() {
      $('.scoreForm').change(function() {
        console.log("form changed");
        updateTotal();
      });
    });

    function updateTotal() {
      $.getJSON('/scores/_add_numbers', {
        tree_branch_is_closer: $("input[name='tree_branch_is_closer']:checked").val(),
        tree_branch_is_intact: $("input[name='tree_branch_is_intact']:checked").val(),
        cargo_plane_location: $("input[name='cargo_plane_location']:checked").val()
      }, function(data) {
        $("#result").text(data.result);
      });
      return false;
    }
  </script>
  <h4>Total: <span id="result">0</span></h4>
  {% if team_id and round_number %}
    <p>Team: {{ team_id }}</p>
    <p>Round: {{ round_number }}<p>
  {% endif %}
  {{ macros.render_form(form, class_="scoreForm") }}
{% endblock %}

Remove old import from score form
Remove old import from score form
