{% extends "newbase.html" %}

{% block title %}Change Charts Settings {% endblock %}

{% block main %}
<h1>Static Charts Settings of {{ rower.user.first_name }} {{ rower.user.last_name }}</h1>

<p>
  Use this form to change some of the characteristics of the static charts. The grid option
  overlays grid lines over the charts. The fastest and slowest pace determine cutoff values for
  pace. 
</p>

<p>
<form method="post">
  {% csrf_token %}
  <table with=100%>
    {{ staticchartform.as_table }}
  </table>
  <input type="submit" value="Save" class="button"/>
</form>
</p>


<h1>Change Favorite Charts of {{ rower.user.first_name }} {{ rower.user.last_name }}</h1>

<form method="post">
<ul class="main-content">
  {% csrf_token %}
  <li class="grid_4">
    <div class="fav-form-header">
      <p><input type="submit" value="Update Favorites" class="button"/></p>
    </div>
  {{ favorites_formset.management_form }}
  </li>

  {% for favorites_form in favorites_formset %}
  <li>
    <div class="fav-formset rounder">
      <h2>Chart {{ forloop.counter }}</h2>
      <table width=100%>
        {{ favorites_form.as_table }}
      </table>
    </div>
  </li>
  {% endfor %}
</ul>
</form>

<!-- Include formset plugin - including jQuery dependency -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="/static/js/jquery.formset.js"></script>
<script>
    $('.fav-formset').formset({
        addText: '<div>&nbsp;</div><div class="button green small">add chart</div>',
        deleteText: '<div><p>&nbsp;</p></div><div class="button red small">remove</div>'
    });
</script>


{% endblock %}

{% block sidebar %}
{% include 'menu_profile.html' %}
{% endblock %}
