diff --git a/rowers/dataprep.py b/rowers/dataprep.py index fdc6d471..9e099622 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -1297,7 +1297,6 @@ def new_workout_from_file(r, f2, makeprivate=False, notes=''): message = None - print('noot',notes) try: fileformat = get_file_type(f2) except (IOError,UnicodeDecodeError): diff --git a/rowers/forms.py b/rowers/forms.py index f07fd400..18434a88 100644 --- a/rowers/forms.py +++ b/rowers/forms.py @@ -163,7 +163,7 @@ class DocumentsForm(forms.Form): label = "Boat Type") - notes = forms.CharField(initial='these are notes',required=False, + notes = forms.CharField(required=False, widget=forms.Textarea) offline = forms.BooleanField(initial=False,required=False, diff --git a/rowers/templates/document_form.html b/rowers/templates/document_form.html index f285de40..b5dd35ba 100644 --- a/rowers/templates/document_form.html +++ b/rowers/templates/document_form.html @@ -39,7 +39,9 @@ {{ form.as_table }} {% csrf_token %} - +
+ +
@@ -201,9 +203,15 @@ $('#id_workouttype').change(); if ($(this).attr('id') == 'id_file') { data.set("file",this.files[0]); } - console.log($(this).attr('name'),$(this).val()); + console.log($(this).attr('id'),$(this).attr('name'),$(this).val()); }; - });}); + });}); + + $('textarea').each(function( i ) { + $(this).change(function() { + data.set($(this).attr('name'),$(this).val()); + console.log($(this).attr('id'),$(this).attr('name'),$(this).val()); + });}); $('select').each(function( i ) { console.log($(this).attr('name'),$(this).val()); @@ -213,7 +221,7 @@ $('#id_workouttype').change(); }); }); - frm.submit(function() { + frm.submit(function() { console.log("Form submission"); $(data.values()).each(function(value) { console.log(value); diff --git a/rowers/urls.py b/rowers/urls.py index 5720d27a..d9ff16ef 100644 --- a/rowers/urls.py +++ b/rowers/urls.py @@ -111,7 +111,6 @@ def response_error_handler(request, exception=None): return HttpResponse('Error handler content', status=403) def filenotfound_handler(request, exception=None): - print('noot') return HttpResponse('Error handler content', status=404) handler403 = views.error403_view diff --git a/rowers/views/workoutviews.py b/rowers/views/workoutviews.py index f8d0f49e..ad68a439 100644 --- a/rowers/views/workoutviews.py +++ b/rowers/views/workoutviews.py @@ -3900,6 +3900,11 @@ def workout_upload_view(request, except KeyError: boattype = '1x' + try: + notes = docformoptions['notes'] + except KeyError: + notes = '' + try: workoutsource = uploadoptions['workoutsource'] except KeyError: @@ -3981,8 +3986,6 @@ def workout_upload_view(request, notes = form.cleaned_data['notes'] offline = form.cleaned_data['offline'] - print('aap',form.cleaned_data) - race = None if optionsform.is_valid(): make_plot = optionsform.cleaned_data['make_plot'] @@ -4023,7 +4026,6 @@ def workout_upload_view(request, f2 = res[1] # file name incl media directory if not offline: - print('noot',notes) id,message,f2 = dataprep.new_workout_from_file( r,f2, workouttype=workouttype,