favorites on ote flex - need to do otw flex
This commit is contained in:
35
rowers/templates/favoritecharts.html
Normal file
35
rowers/templates/favoritecharts.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Change Favorite Charts{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ favorites_formset.management_form }}
|
||||
|
||||
{% for favorites_form in favorites_formset %}
|
||||
<div class="fav-formset grid_6 alpha">
|
||||
<h2>Chart {{ forloop.counter }}</h2>
|
||||
<table>
|
||||
{{ favorites_form.as_table }}
|
||||
</table>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="grid_12 alpha">
|
||||
<div class="grid_2">
|
||||
<p><input type="submit" value="Update Favorites" class="button green small"/></p>
|
||||
</div>
|
||||
</div>
|
||||
</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 class="grid_12"> </div><div class="button grid_2 green small">add chart</div>',
|
||||
deleteText: '<div class="grid_12"><p> </p></div><div class="button grid_1 red small">remove</div>'
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
@@ -163,6 +163,37 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div id="favorites" class="grid_12 alpha">
|
||||
<div class="grid_2 suffix_4 alpha">
|
||||
{% if maxfav >= 0 %}
|
||||
<a class="button gray small" href="/rowers/me/favoritecharts">Manage Favorites</a>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_1">
|
||||
{% if favoritenr > 0 %}
|
||||
<a class="button blue small" href="/rowers/workout/{{ id }}/flexchart?favoritechart={{ favoritenr|add:-1 }}"><</a>
|
||||
{% else %}
|
||||
<p> </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_2">
|
||||
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
|
||||
{% csrf_token %}
|
||||
<input class="grid_2 alpha button blue small" type="hidden" name="savefavorite" value="True">
|
||||
<input class="grid_2 alpha button blue small" value="Make Favorite" type="Submit">
|
||||
</form>
|
||||
</div>
|
||||
<div class="grid_1">
|
||||
{% if favoritenr < maxfav %}
|
||||
<a class="button blue small" href="/rowers/workout/{{ id }}/flexchart?favoritechart={{ favoritenr|add:1 }}">></a>
|
||||
{% else %}
|
||||
<p> </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
{% endlocaltime %}
|
||||
|
||||
Reference in New Issue
Block a user