diff options
-rw-r--r-- | nop/site_media/nowplaying_form.js | 6 | ||||
-rw-r--r-- | nop/templates/nop_form.html | 2 | ||||
-rw-r--r-- | nop/views.py | 7 |
3 files changed, 8 insertions, 7 deletions
diff --git a/nop/site_media/nowplaying_form.js b/nop/site_media/nowplaying_form.js index 86656d5..ce3d2aa 100644 --- a/nop/site_media/nowplaying_form.js +++ b/nop/site_media/nowplaying_form.js @@ -1,9 +1,9 @@ -$(document).ready(function() { - $("#nop_date").dateinput({ +jQuery(document).ready(function() { + jQuery("#nop_date").dateinput({ format: 'yyyy-mm-dd', firstDay: 1 }); - $("#nop_time").AnyTime_picker({ + jQuery("#nop_time").AnyTime_picker({ format: "%H:%i", labelTitle: "Zeit", labelHour: "Stunde", diff --git a/nop/templates/nop_form.html b/nop/templates/nop_form.html index 98b000d..e3b32e9 100644 --- a/nop/templates/nop_form.html +++ b/nop/templates/nop_form.html @@ -12,7 +12,7 @@ <body> <div id="content-main" class="show-detail"> - <form action="" method="post">{% csrf_token %} + <form action="/nop" method="get"> {{ form.as_table }} <input type="submit" value="senden" /> </form> diff --git a/nop/views.py b/nop/views.py index 6a88607..712be84 100644 --- a/nop/views.py +++ b/nop/views.py @@ -118,11 +118,12 @@ def get(request, year=None, month=None, day=None, hour=None, minute=None): def nop_form(request): context = {} - context.update(csrf(request)) + # currently no csrf security for nicier forms + #context.update(csrf(request)) # in django template: {% csrf_token %} date = None time = None - if request.method == 'POST': - form = NopForm(request.POST) + if request.method == 'GET': + form = NopForm(request.GET) if form.is_valid(): date = form.cleaned_data['date'] time = form.cleaned_data['time'] |