Private
Public Access
1
0

menu_analytics and boxplot-select

This commit is contained in:
Sander Roosendaal
2018-10-04 12:56:37 +02:00
parent d8c1248442
commit 4721d817c2
5 changed files with 164 additions and 173 deletions

View File

@@ -1,10 +1,10 @@
{% extends "base.html" %}
{% extends "newbase.html" %}
{% load staticfiles %}
{% load rowerfilters %}
{% block title %}Workouts{% endblock %}
{% block content %}
{% block main %}
<script>
function toggle(source) {
checkboxes = document.querySelectorAll("input[name='workouts']");
@@ -18,7 +18,7 @@
$(function() {
// Get the form fields and hidden div
var checkbox = $("#id_water");
var modality = $("#id_modality");
var hidden = $("#id_waterboattype");
@@ -28,14 +28,16 @@
hidden.hide();
// Setup an event listener for when the state of the
// checkbox changes.
checkbox.change(function() {
modality.change(function() {
// Check to see if the checkbox is checked.
// If it is, show the fields and populate the input.
// If not, hide the fields.
if (checkbox.is(':checked')) {
// If not, hide the fields.
var Value = modality.val();
if (Value=='water') {
// Show the hidden fields.
hidden.show();
} else {
@@ -53,95 +55,23 @@
// $("#hidden_field").val("");
}
});
});
});
</script>
{% if team %}
<div class="grid_12 alpha">
{% include "teambuttons.html" with teamid=team.id team=team %}
</div>
{% if theuser %}
<h1>Select {{ theuser.first_name }}'s Workouts for BoxPlot</h1>
{% else %}
<h1>Select {{ user.first_name }}'s Workouts for BoxPlot</h1>
{% endif %}
<div class="grid_12 alpha">
<div class="grid_4 alpha">
{% if theuser %}
<h3>{{ theuser.first_name }}'s Workouts</h3>
{% else %}
<h3>{{ user.first_name }}'s Workouts</h3>
{% endif %}
</div>
<div class="grid_2 prefix_6 omega">
{% if user.is_authenticated and user|is_manager %}
<div class="grid_2 alpha dropdown">
<button class="grid_2 alpha button green small dropbtn">
{{ theuser.first_name }} {{ theuser.last_name }}
</button>
<div class="dropdown-content">
{% for member in user|team_members %}
<a class="button green small" href="/rowers/user-boxplot-select/user/{{ member.id }}/">{{ member.first_name }} {{ member.last_name }}</a>
{% endfor %}
</div>
{% else %}
&nbsp;
{% endif %}
</div>
</div>
<div class="grid_12 alpha">
<div class="grid_6 alpha">
{% if theuser %}
<form enctype="multipart/form-data" action="/rowers/user-boxplot-select/user/{{ theuser.id }}/" method="post">
{% else %}
<form enctype="multipart/form-data" action="/rowers/user-boxplot-select/" method="post">
{% endif %}
<div class="grid_4 alpha">
<table>
{{ dateform.as_table }}
</table>
{% csrf_token %}
</div>
<div class="grid_2 omega">
<input name='daterange' class="button green" type="submit" value="Submit">
</div>
</form>
{% if theuser %}
<form enctype="multipart/form-data" action="/rowers/user-boxplot-select/user/{{ theuser.id }}/" method="post">
{% else %}
<form enctype="multipart/form-data" action="/rowers/user-boxplot-select/" method="post">
{% endif %}
<div class="grid_4 alpha">
<table>
{{ optionsform.as_table }}
</table>
{% csrf_token %}
</div>
<div class="grid_2 omega">
<input name='optionsform' class="button green" type="submit" value="Submit">
</div>
</form>
</div>
<div class="grid_5 prefix_1 omega">
<form id="searchform" action=""
method="get" accept-charset="utf-8">
<div class="grid_3 prefix_1 alpha">
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
</div>
<div class="grid_1 omega">
<button class="button blue small" type="submit">
Search
</button>
</div>
</form>
</div>
</div>
<form enctype="multipart/form-data" action="/rowers/user-boxplot/{{ theuser.id }}" method="post">
<div id="workouts_table" class="grid_8 alpha">
<ul class="main-content">
<li class="grid_2 maxheight">
<form enctype="multipart/form-data" action="/rowers/user-boxplot/{{ theuser.id }}" method="post">
{% if workouts %}
@@ -149,31 +79,70 @@
<table width="100%" class="listtable">
{{ form.as_table }}
</table>
{% else %}
<p> No workouts found </p>
{% endif %}
</div>
<div id="form_settings" class="grid_4 alpha">
<p><b>Warning: You are on an experimental part of the site. Use at your own risk.</b></p>
<p>Select two or more workouts on the left, set your plot settings below,
and press submit"</p>
{% csrf_token %}
<table>
{{ chartform.as_table }}
</table>
<div class="grid_1 prefix_2 suffix_1">
{% else %}
<p> No workouts found </p>
{% endif %}
</li>
<li class="grid_2">
<p>Select two or more workouts, set your plot settings below,
and press submit
</p>
{% csrf_token %}
<table>
{{ chartform.as_table }}
</table>
<p>
<input name='workoutselectform' class="button green" type="submit" value="Submit">
</p>
</div>
<div class="grid_4">
<p>You can use the date and search forms above to search through all
workouts from this team.</p>
<p>TIP: Agree with your team members to put tags (e.g. '8x500m') in the notes section of
your workouts. That makes it easy to search.</p>
</div>
</div>
</form>
</p>
</form>
</li>
<li class="grid_2">
{% if theuser %}
<form enctype="multipart/form-data" action="/rowers/user-boxplot-select/user/{{ theuser.id }}/" method="post">
{% else %}
<form enctype="multipart/form-data" action="/rowers/user-boxplot-select/" method="post">
{% endif %}
<table>
{{ dateform.as_table }}
</table>
{% csrf_token %}
<input name='daterange' class="button green" type="submit" value="Submit">
</form>
</li>
<li class="grid_2">
{% if theuser %}
<form enctype="multipart/form-data" action="/rowers/user-boxplot-select/user/{{ theuser.id }}/" method="post">
{% else %}
<form enctype="multipart/form-data" action="/rowers/user-boxplot-select/" method="post">
{% endif %}
<table>
{{ optionsform.as_table }}
</table>
{% csrf_token %}
<input name='optionsform' class="button green" type="submit" value="Submit">
</form>
</li>
<li class="grid_2">
<form id="searchform" action=""
method="get" accept-charset="utf-8">
<input class="searchfield" id="searchbox" name="q" type="text" placeholder="Search">
<button class="button blue small" type="submit">
Search
</button>
</form>
</li>
<li>
<p>You can use the date and search forms above to search through all
workouts from this team.</p>
<p>TIP: Agree with your team members to put tags (e.g. '8x500m') in the notes section of
your workouts. That makes it easy to search.</p>
</li>
</ul>
{% endblock %}
{% block sidebar %}
{% include 'menu_analytics.html' %}
{% endblock %}