diff --git a/rowers/templates/otwsetpower.html b/rowers/templates/otwsetpower.html index 7a997bed..d9b56935 100644 --- a/rowers/templates/otwsetpower.html +++ b/rowers/templates/otwsetpower.html @@ -1,75 +1,74 @@ -{% extends "base.html" %} +{% extends "newbase.html" %} {% load staticfiles %} {% load rowerfilters %} {% block title %}Advanced Features {% endblock %} -{% block content %} -
+{% block main %} +

Run OTW Power Calculations

+
    +
  • +

    + For the advanced OTW power and wind correction calculation, + we need to know the boat type and the average weight per crew member. + Currently only 1x (single) is implemented. Setting the value to + 2x (double) will still run the calculations for a single. + We use FISA minimum boat weight and standard rigging for our calculations. +

    -

    Run OTW Power Calculations

    -
    -

    - Edit Workout -

    -
    -
    -

    - Workflow View -

    +

    The Quick calculation option potentially speeds up the calculation, + at the cost of a slight reduction in accuracy. It is recommended + to keep this option selected.

    -
    -
    -

    - Advanced Edit -

    - -
    -
    -

    - For the advanced OTW power and wind correction calculation, - we need to know the boat type and the average weight per crew member. - Currently only 1x (single) is implemented. Setting the value to - 2x (double) will still run the calculations for a single. - We use FISA minimum boat weight and standard rigging for our calculations. -

    - -

    The Quick calculation option potentially speeds up the calculation, - at the cost of a slight reduction in accuracy. It is recommended - to keep this option selected.

    +

    + The power calculations take wind and stream as inputs. +

    +

    + Set wind strength and direction +

    + +

    + + Set river stream strength + +

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

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

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

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

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

- Start the calculations to get power values for your row. + Start the calculations to get power values for your row. +
-
- - - - -
-
- -
-
- The Rowsandall Physics Department at work. -
-
- + + +
  • +
    + +
    +
    + The Rowsandall Physics Department at work. +
    +
  • + {% endblock %} + +{% block sidebar %} +{% include 'menu_workout.html' %} +{% endblock %} diff --git a/rowers/views.py b/rowers/views.py index 156702e1..c00d72df 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -7129,9 +7129,10 @@ def workout_stream_view(request,id=0,message="",successmessage=""): # Form to set average crew weight and boat type, then run power calcs @user_passes_test(ispromember, login_url="/",redirect_field_name=None) def workout_otwsetpower_view(request,id=0,message="",successmessage=""): - row = get_workout(id) + w = get_workout(id) + r = getrower(request.user) - if (checkworkoutuser(request.user,row)==False): + if (checkworkoutuser(request.user,w)==False): message = "You are not allowed to edit this workout" messages.error(request,message) url = reverse(workouts_view) @@ -7147,13 +7148,13 @@ def workout_otwsetpower_view(request,id=0,message="",successmessage=""): quick_calc = form.cleaned_data['quick_calc'] boattype = form.cleaned_data['boattype'] weightvalue = form.cleaned_data['weightvalue'] - row.boattype = boattype - row.weightvalue = weightvalue - row.save() + w.boattype = boattype + w.weightvalue = weightvalue + w.save() # load row data & create power/wind/bearing columns if not set - f1 = row.csvfilename + f1 = w.csvfilename rowdata = rdata(f1) if rowdata == 0: return HttpResponse("Error: CSV Data File Not Found") @@ -7220,13 +7221,33 @@ def workout_otwsetpower_view(request,id=0,message="",successmessage=""): response = HttpResponseRedirect(url) else: - form = AdvancedWorkoutForm(instance=row) + form = AdvancedWorkoutForm(instance=w) + breadcrumbs = [ + { + 'url':'/rowers/list-workouts', + 'name':'Workouts' + }, + { + 'url':get_workout_default_page(request,id), + 'name': str(w.id) + }, + { + 'url':reverse(workout_otwsetpower_view,kwargs={'id':id}), + 'name': 'OTW Power' + } + + ] + + messages.error(request,message) messages.info(request,successmessage) return render(request, 'otwsetpower.html', - {'workout':row, + {'workout':w, + 'rower':w, + 'active':'nav-workouts', + 'breadcrumbs':breadcrumbs, 'teams':get_my_teams(request.user), 'form':form, })