Private
Public Access
1
0

document upload

This commit is contained in:
Sander Roosendaal
2018-10-08 17:46:34 +02:00
parent e787204e79
commit b9ea9a0e59
3 changed files with 74 additions and 147 deletions

View File

@@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "newbase.html" %}
{% load staticfiles %}
{% load rowerfilters %}
@@ -15,64 +15,65 @@
</script>
{% endblock %}
{% block content %}
<div id="id_dropregion" class="grid_12 alpha watermark invisible">
<p>Drag and drop files here </p>
</div>
<div id="id_drop-files" class="grid_12 alpha drop-files">
<form id="file_form" enctype="multipart/form-data" action="{{ formloc }}" method="post">
<div id="left" class="grid_6 alpha">
<h1>Upload Workout File</h1>
{% if user.is_authenticated and user|is_manager %}
<p>Looking for <a href="/rowers/workout/upload/team/">Team Manager
Upload?</a></p>
{% endif %}
{% if form.errors %}
<p style="color: red;">
Please correct the error{{ form.errors|pluralize }} below.
{% block main %}
<div id="id_main">
<ul class="main-content">
<li class="grid_2">
<div id="id_dropregion" class="watermark invisible">
<p>Drag and drop files here </p>
</div>
<div id="id_drop-files" class="drop-files">
<form id="file_form" enctype="multipart/form-data" action="{{ formloc }}" method="post">
<h1>Upload Workout File</h1>
{% if user.is_authenticated and user|is_manager %}
<p>Looking for <a href="/rowers/workout/upload/team/">Team Manager
Upload?</a></p>
{% endif %}
{% if form.errors %}
<p style="color: red;">
Please correct the error{{ form.errors|pluralize }} below.
</p>
{% endif %}
{% endif %}
<table>
{{ form.as_table }}
{{ form.as_table }}
</table>
{% csrf_token %}
<div id="formbutton" class="grid_1 prefix_4 suffix_1">
<input class="button green" type="submit" value="Submit">
</div>
</div>
<div id="right" class="grid_6 omega">
<h1>Optional extra actions</h1>
<p>
<table>
{{ optionsform.as_table }}
</table>
</p>
<p>
You can select one static plot to be generated immediately for
this workout. You can select to export to major fitness
platforms automatically.
If you check "make private", this workout will not be visible to your followers and will not show up in your teams' workouts list. With the Landing Page option, you can select to which (workout related) page you will be
taken after a successfull upload.
</p>
<p>
If you don't have a workout file but have written down the splits,
you can create a workout file yourself from <a href="/static/dummy_workout_template.xls">this template</a>
</p>
<p><b>Select Files with the File button or drag them on the marked area</b></p>
</div>
</form>
</div>
</li>
<li class="grid_2">
<h1>Optional extra actions</h1>
<p>
<table>
{{ optionsform.as_table }}
</table>
</p>
<p>
You can select one static plot to be generated immediately for
this workout. You can select to export to major fitness
platforms automatically.
If you check "make private", this workout will not be visible to your followers and will not show up in your teams' workouts list. With the Landing Page option, you can select to which (workout related) page you will be
taken after a successfull upload.
</p>
<p>
If you don't have a workout file but have written down the splits,
you can create a workout file yourself from <a href="/static/dummy_workout_template.xls">this template</a>
</p>
<p><b>Select Files with the File button or drag them on the marked area</b></p>
</li>
</form>
</ul>
</div>
{% endblock %}
{% block scripts %}
@@ -221,8 +222,8 @@ $('#id_workouttype').change();
console.log(value);
});
$("#id_drop-files").replaceWith(
'<div id="id_waiting"><img src="/static/img/rowingtimer.gif" width="120" height="100">'
$("#id_main").replaceWith(
'<div id="id_waiting"><img src="/static/img/rowingtimer.gif" width="120" height="100" style="width:120px">'
);
$.ajax({
data: data,
@@ -310,3 +311,8 @@ $('#id_workouttype').change();
};
</script>
{% endblock %}
{% block sidebar %}
{% include 'menu_workouts.html' %}
{% endblock %}