app: Implement toggle button in app page

- revamp the old form submission model to enable/disable apps into a
  simple toggle button
- provide backwards compatibility when javascript is disabled

Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
This commit is contained in:
Alice Kile authored and Joseph Nuthalapati committed 2019-11-19 00:02:16 +05:30
1 parent 1504e182e4
commit ec62f331b8
4 files changed
+97 -21

No files matched your search

+1
View File
@@ -35,6 +35,7 @@ import plinth
class AppForm(forms.Form):
"""Generic configuration form for an app."""
is_enabled = forms.BooleanField(
widget=CheckboxInput(attrs={'id': 'app-toggle-input'}),
label=_('Enable application'), required=False)