diff --git a/rowers/dataprep.py b/rowers/dataprep.py index 1285bc35..8f4307cc 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -821,6 +821,7 @@ from utils import totaltime_sec_to_string # Processes painsled CSV file to database def save_workout_database(f2, r, dosmooth=True, workouttype='rower', + boattype='1x', dosummary=True, title='Workout', workoutsource='unknown', notes='', totaldist=0, totaltime=0, @@ -1001,6 +1002,7 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower', w = Workout(user=r, name=title, date=workoutdate, workouttype=workouttype, + boattype=boattype, duration=duration, distance=totaldist, weightcategory=r.weightcategory, starttime=workoutstarttime, @@ -1229,6 +1231,7 @@ def handle_nonpainsled(f2, fileformat, summary=''): def new_workout_from_file(r, f2, workouttype='rower', title='Workout', + boattype='1x', makeprivate=False, notes=''): message = None @@ -1325,6 +1328,7 @@ def new_workout_from_file(r, f2, id, message = save_workout_database( f2, r, workouttype=workouttype, + boattype=boattype, makeprivate=makeprivate, dosummary=dosummary, workoutsource=fileformat, @@ -1450,6 +1454,7 @@ def new_workout_from_df(r, df, oarlength = parent.oarlength inboard = parent.inboard workouttype = parent.workouttype + boattype = parent.boattype notes = parent.notes summary = parent.summary if parent.privacy == 'hidden': @@ -1494,6 +1499,7 @@ def new_workout_from_df(r, df, id, message = save_workout_database(csvfilename, r, workouttype=workouttype, + boattype=boattype, title=title, notes=notes, oarlength=oarlength, diff --git a/rowers/forms.py b/rowers/forms.py index 27b7ce35..7e9fff79 100644 --- a/rowers/forms.py +++ b/rowers/forms.py @@ -78,14 +78,19 @@ class DocumentsForm(forms.Form): workouttype = forms.ChoiceField(required=True, choices=Workout.workouttypes) -# initial='rower') + + boattype = forms.ChoiceField(required=True, + choices=types.boattypes, + label = "Boat Type") + + notes = forms.CharField(required=False, widget=forms.Textarea) offline = forms.BooleanField(initial=False,required=False, label='Process in Background') class Meta: - fields = ['title','file','workouttype','fileformat','offline'] + fields = ['title','file','workouttype','boattype','fileformat','offline'] def __init__(self, *args, **kwargs): from django.forms.widgets import HiddenInput diff --git a/rowers/templates/document_form.html b/rowers/templates/document_form.html index 08d6431a..8ca2c488 100644 --- a/rowers/templates/document_form.html +++ b/rowers/templates/document_form.html @@ -134,7 +134,6 @@ var data = new FormData(frm[0]); - $('#id_file').on('change', function(evt) { var f = this.files[0]; console.log(f); diff --git a/rowers/templates/virtualevent.html b/rowers/templates/virtualevent.html index 95081e27..9d8cacba 100644 --- a/rowers/templates/virtualevent.html +++ b/rowers/templates/virtualevent.html @@ -170,7 +170,7 @@