From e787204e799106c389a33155aabb9765fddc9e63 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 8 Oct 2018 17:09:00 +0200 Subject: [PATCH] team upload --- rowers/templates/team_document_form.html | 152 +++++++++++++---------- rowers/views.py | 17 +++ 2 files changed, 102 insertions(+), 67 deletions(-) diff --git a/rowers/templates/team_document_form.html b/rowers/templates/team_document_form.html index ddf81fba..4db8e2fb 100644 --- a/rowers/templates/team_document_form.html +++ b/rowers/templates/team_document_form.html @@ -1,82 +1,100 @@ -{% extends "base.html" %} +{% extends "newbase.html" %} {% load staticfiles %} {% block title %}File loading{% endblock %} {% block meta %} - - - + + + {% endblock %} -{% block content %} +{% block main %} +
    +
  • +

    Upload Workout File

    -
    -

    Upload Workout File

    - {% if form.errors %} -

    - Please correct the error{{ form.errors|pluralize }} below. -

    - {% endif %} + {% if form.errors %} +

    + Please correct the error{{ form.errors|pluralize }} below. +

    + {% endif %} - - {{ rowerform.as_table }} - {{ form.as_table }} -
    - {% csrf_token %} -
    + + {{ rowerform.as_table }} + {{ form.as_table }} +
    + {% csrf_token %} +
    -
    -
    -
    -

    Optional extra actions

    -

    - - {{ optionsform.as_table }} -
    -

    -

    - You can select one static plot to be generated immediately for this workout. You can select to upload to Concept2 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. -

    - -

    - Valid file types are: -

      -
    • Painsled iOS Stroke Export (CSV)
    • -
    • Painsled desktop version Stroke Export (CSV)
    • -
    • A TCX file with location data (lat,long) - with or without Heart Rate value, for example from RiM or CrewNerd
    • -
    • RowPro CSV export
    • -
    • SpeedCoach GPS and SpeedCoach GPS 2 CSV export
    • -
    • ErgData CSV export
    • -
    • ErgStick CSV export
    • -
    • BoatCoach CSV export
    • -
    • A FIT file with location data (experimental)
    • -
    -

    -
    +
  • +
  • +

    Optional extra actions

    +

    + + {{ optionsform.as_table }} +
    +

    +

    + You can select one static plot to be generated immediately for this workout. You can select to upload to Concept2 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. +

    + +
  • +
{% endblock %} + +{% block sidebar %} +{% include 'menu_workouts.html' %} +{% endblock %} + +{% block scripts %} + + + +{% endblock %} diff --git a/rowers/views.py b/rowers/views.py index cb28d7a7..738f484c 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -10301,6 +10301,17 @@ def team_workout_upload_view(request,message="", else: request.session['uploadoptions'] = uploadoptions + breadcrumbs = [ + { + 'url':'/rowers/list-workouts', + 'name':'Workouts' + }, + { + 'url': reverse(team_workout_upload_view), + 'name': 'Team Upload' + } + ] + myteams = Team.objects.filter(manager=request.user) @@ -10320,6 +10331,7 @@ def team_workout_upload_view(request,message="", res = handle_uploaded_file(f) t = form.cleaned_data['title'] offline = form.cleaned_data['offline'] + boattype = form.cleaned_data['boattype'] if rowerform.is_valid(): u = rowerform.cleaned_data['user'] if u: @@ -10424,6 +10436,8 @@ def team_workout_upload_view(request,message="", 'team_document_form.html', {'form':form, 'teams':get_my_teams(request.user), + 'active': 'nav-workouts', + 'breadcrumbs':breadcrumbs, 'optionsform': optionsform, 'rowerform': rowerform, }) @@ -10439,6 +10453,9 @@ def team_workout_upload_view(request,message="", {'form':form, 'teams':get_my_teams(request.user), 'optionsform': optionsform, + 'active': 'nav-workouts', + 'breadcrumbs':breadcrumbs, + 'rower':r, 'rowerform':rowerform, })