From 62e73de872e5b67a31aa5f9b720d26170ee299ce Mon Sep 17 00:00:00 2001 From: goose-life <32566441+goose-life@users.noreply.github.com> Date: Wed, 20 Jan 2021 12:55:36 +0200 Subject: [PATCH 1/7] add no_publication_document_text to PlaceSettings --- ...acesettings_no_publication_document_text.py | 18 ++++++++++++++++++ indigo_api/models/places.py | 1 + 2 files changed, 19 insertions(+) create mode 100644 indigo_api/migrations/0004_placesettings_no_publication_document_text.py diff --git a/indigo_api/migrations/0004_placesettings_no_publication_document_text.py b/indigo_api/migrations/0004_placesettings_no_publication_document_text.py new file mode 100644 index 000000000..acf1aad9d --- /dev/null +++ b/indigo_api/migrations/0004_placesettings_no_publication_document_text.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.12 on 2021-01-20 10:31 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('indigo_api', '0003_alter_taxonomies'), + ] + + operations = [ + migrations.AddField( + model_name='placesettings', + name='no_publication_document_text', + field=models.CharField(default='Note: The original publication document is not available and this content could not be verified.', max_length=1024), + ), + ] diff --git a/indigo_api/models/places.py b/indigo_api/models/places.py index c57bebd3a..3796f4299 100644 --- a/indigo_api/models/places.py +++ b/indigo_api/models/places.py @@ -173,6 +173,7 @@ class PlaceSettings(models.Model): spreadsheet_url = models.URLField(null=True, blank=True) as_at_date = models.DateField(null=True, blank=True) styleguide_url = models.URLField(null=True, blank=True) + no_publication_document_text = models.CharField(max_length=1024, default='Note: The original publication document is not available and this content could not be verified.') @property def place(self): From 266e9ba85978e6480f7d9030a94eebe94d40891c Mon Sep 17 00:00:00 2001 From: goose-life <32566441+goose-life@users.noreply.github.com> Date: Wed, 20 Jan 2021 12:56:04 +0200 Subject: [PATCH 2/7] add no_publication_document_text to PlaceSettingsForm --- indigo_app/forms.py | 2 +- indigo_app/templates/place/settings.html | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/indigo_app/forms.py b/indigo_app/forms.py index 8dbbfdf15..d84156e72 100644 --- a/indigo_app/forms.py +++ b/indigo_app/forms.py @@ -561,7 +561,7 @@ def clean(self): class PlaceSettingsForm(forms.ModelForm): class Meta: model = PlaceSettings - fields = ('spreadsheet_url', 'as_at_date', 'styleguide_url') + fields = ('spreadsheet_url', 'as_at_date', 'styleguide_url', 'no_publication_document_text') spreadsheet_url = forms.URLField(required=False, validators=[ URLValidator( diff --git a/indigo_app/templates/place/settings.html b/indigo_app/templates/place/settings.html index 096f6c8b2..504142396 100644 --- a/indigo_app/templates/place/settings.html +++ b/indigo_app/templates/place/settings.html @@ -52,6 +52,19 @@

Settings

{% endif %} +
+ + +

The text to display on a document's coverpage when no Gazette (or publication document) is associated with the work.

+ {% if form.no_publication_document_text.errors %} +
+ {% for error in form.no_publication_document_text.errors %} +

{{ error }}

+ {% endfor %} +
+ {% endif %} +
+