Add Do Not Track support

This commit is contained in:
R. Miles McCain
2020-04-22 13:18:25 -04:00
parent 3d10ddf711
commit c2f4724b11
7 changed files with 36 additions and 8 deletions

View File

@@ -7,14 +7,16 @@ from core.models import Service
class ServiceForm(forms.ModelForm):
class Meta:
model = Service
fields = ["name", "link", "origins", "collaborators"]
fields = ["name", "link", "origins", "respect_dnt", "collaborators"]
widgets = {
"name": forms.TextInput(),
"origins": forms.TextInput(),
"collaborators": forms.CheckboxSelectMultiple(),
"respect_dnt": forms.RadioSelect(choices=[(True, "Yes"), (False, "No")])
}
labels = {
"origins": "Allowed Hostnames",
"respect_dnt": "Respect DNT",
}
help_texts = {
"name": _("What should the service be called?"),
@@ -22,4 +24,5 @@ class ServiceForm(forms.ModelForm):
"origins": _(
"At what hostnames does the service operate? This sets CORS headers, so use '*' if you're not sure (or don't care)."
),
"respect_dnt": "Should visitors who have enabled <a href='https://en.wikipedia.org/wiki/Do_Not_Track'>Do Not Track</a> be excluded from all data?"
}