From e693406114145cbbc620a0ac19503c66cb3760fa Mon Sep 17 00:00:00 2001 From: "R. Miles McCain" Date: Fri, 24 Apr 2020 14:06:59 -0400 Subject: [PATCH] Add advanced settings area --- shynet/dashboard/forms.py | 3 +-- .../templates/dashboard/includes/service_form.html | 12 ++++++++++++ .../templates/dashboard/pages/service_create.html | 2 +- .../templates/dashboard/pages/service_update.html | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 shynet/dashboard/templates/dashboard/includes/service_form.html diff --git a/shynet/dashboard/forms.py b/shynet/dashboard/forms.py index d6c71ca..dff31d3 100644 --- a/shynet/dashboard/forms.py +++ b/shynet/dashboard/forms.py @@ -8,7 +8,7 @@ from allauth.account.admin import EmailAddress class ServiceForm(forms.ModelForm): class Meta: model = Service - fields = ["name", "link", "respect_dnt", "collaborators"] + fields = ["name", "link", "respect_dnt", "origins", "collaborators"] widgets = { "name": forms.TextInput(), "origins": forms.TextInput(), @@ -29,7 +29,6 @@ class ServiceForm(forms.ModelForm): collaborators = forms.CharField(help_text="Which users should have read-only access to this service? (Comma separated list of emails.)", required=False) - def clean_collaborators(self): collaborators = [] for collaborator_email in self.cleaned_data["collaborators"].split(","): diff --git a/shynet/dashboard/templates/dashboard/includes/service_form.html b/shynet/dashboard/templates/dashboard/includes/service_form.html new file mode 100644 index 0000000..59312d5 --- /dev/null +++ b/shynet/dashboard/templates/dashboard/includes/service_form.html @@ -0,0 +1,12 @@ +{% load a17t_tags %} + +{{form.name|a17t}} +{{form.link|a17t}} +{{form.collaborators|a17t}} + +
+ Advanced settings +
+ {{form.respect_dnt|a17t}} + {{form.origins|a17t}} +
\ No newline at end of file diff --git a/shynet/dashboard/templates/dashboard/pages/service_create.html b/shynet/dashboard/templates/dashboard/pages/service_create.html index 9942348..86d06f1 100644 --- a/shynet/dashboard/templates/dashboard/pages/service_create.html +++ b/shynet/dashboard/templates/dashboard/pages/service_create.html @@ -10,7 +10,7 @@
{% csrf_token %}
- {{form|a17t}} + {% include 'dashboard/includes/service_form.html' %}
diff --git a/shynet/dashboard/templates/dashboard/pages/service_update.html b/shynet/dashboard/templates/dashboard/pages/service_update.html index ff0a534..488949b 100644 --- a/shynet/dashboard/templates/dashboard/pages/service_update.html +++ b/shynet/dashboard/templates/dashboard/pages/service_update.html @@ -23,7 +23,7 @@ {% csrf_token %}
- {{form|a17t}} + {% include 'dashboard/includes/service_form.html' %}