From 94991b9bb6ab00ce768a6c04991422d57c54a8f1 Mon Sep 17 00:00:00 2001 From: Daniel Steglich Date: Thu, 5 Mar 2015 21:48:30 +0100 Subject: [PATCH] changed form manipulation from plain javascript to jquerry and removed javascript from python file --- plinth/modules/dynamicdns/dynamicdns.py | 13 +- .../templates/dynamicdns_configure.html | 185 ++++++++---------- 2 files changed, 86 insertions(+), 112 deletions(-) diff --git a/plinth/modules/dynamicdns/dynamicdns.py b/plinth/modules/dynamicdns/dynamicdns.py index a347645ed..24ffe05dd 100644 --- a/plinth/modules/dynamicdns/dynamicdns.py +++ b/plinth/modules/dynamicdns/dynamicdns.py @@ -103,17 +103,14 @@ class ConfigureForm(forms.Form): ('1', 'GnuDIP'), ('2', 'noip.com'), ('3', 'selfhost.bz'), - ('4', 'other Update URL')) + ('4', 'other update URL')) enabled = forms.BooleanField(label=_('Enable Dynamic DNS'), - required=False, widget=forms.CheckboxInput - (attrs={'onclick': 'mod_form();'})) + required=False) service_type = forms.ChoiceField(label=_('Service type'), help_text=_(hlp_services), - choices=provider_choices, - widget=forms.Select(attrs={'onChange': - 'dropdown()'})) + choices=provider_choices) dynamicdns_server = TrimmedCharField( label=_('GnudIP Server Address'), @@ -153,9 +150,7 @@ class ConfigureForm(forms.Form): help_text=_(hlp_secret)) showpw = forms.BooleanField(label=_('show password'), - required=False, - widget=forms.CheckboxInput - (attrs={'onclick': 'show_pass();'})) + required=False) dynamicdns_ipurl = TrimmedCharField( label=_('IP check URL'), diff --git a/plinth/modules/dynamicdns/templates/dynamicdns_configure.html b/plinth/modules/dynamicdns/templates/dynamicdns_configure.html index df0538ba5..a0cb0d7f5 100644 --- a/plinth/modules/dynamicdns/templates/dynamicdns_configure.html +++ b/plinth/modules/dynamicdns/templates/dynamicdns_configure.html @@ -24,40 +24,14 @@
{% csrf_token %} - - {% include 'bootstrapform/field.html' with field=form.enabled %} - -
- -

Dynamic DNS type

-
- You have disabled Javascript. Dynamic form mode is disabled and - some helper functions may not work
(but the main functionality should work) -

-
- -
- {% include 'bootstrapform/field.html' with field=form.dynamicdns_server %} -
- -
- {% include 'bootstrapform/field.html' with field=form.dynamicdns_update_url %} - {% include 'bootstrapform/field.html' with field=form.disable_SSL_cert_check %} - {% include 'bootstrapform/field.html' with field=form.use_http_basic_auth %} -
- -

Account Information

- {% include 'bootstrapform/field.html' with field=form.dynamicdns_domain %} - {% include 'bootstrapform/field.html' with field=form.dynamicdns_user %} - {% include 'bootstrapform/field.html' with field=form.dynamicdns_secret %} - {% include 'bootstrapform/field.html' with field=form.showpw %} - -

IP check URL

- {% include 'bootstrapform/field.html' with field=form.dynamicdns_ipurl %} +
+ You have disabled Javascript. Dynamic form mode is disabled and + some helper functions may not work
(but the main functionality should work) +

+ {{ form|bootstrap }} + @@ -65,80 +39,85 @@ {% endblock %} {% block page_js %} - {% endblock %}