From 3a1c32824b93efd5e8a27abcfed7a48a764b90ab Mon Sep 17 00:00:00 2001 From: Lucas Date: Tue, 4 Jun 2024 15:54:01 +0000 Subject: [PATCH 01/26] chant edit: preserve proofreader fields for contributor changes --- .../cantusdb_project/main_app/views/chant.py | 46 ++++++++++++++++--- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/django/cantusdb_project/main_app/views/chant.py b/django/cantusdb_project/main_app/views/chant.py index 0d023fde5..01da2f73e 100644 --- a/django/cantusdb_project/main_app/views/chant.py +++ b/django/cantusdb_project/main_app/views/chant.py @@ -22,9 +22,11 @@ ) from django.core.exceptions import PermissionDenied from django.contrib.auth.mixins import LoginRequiredMixin -from django.http import Http404 +from django.http import Http404, HttpResponse from django.contrib.auth.mixins import UserPassesTestMixin +from django.contrib.auth import get_user_model + from main_app.forms import ( ChantCreateForm, @@ -1103,12 +1105,42 @@ def get_chants_with_folios(chants_in_feast): def form_valid(self, form): if form.is_valid(): - form.instance.last_updated_by = self.request.user - messages.success( - self.request, - "Chant updated successfully!", - ) - return super().form_valid(form) + user = self.request.user + chant: Chant = form.instance + + if not user_can_proofread_chant(user, chant): + # Preserve the original values for proofreader-specific fields + original_chant: Chant = Chant.objects.get(pk=chant.pk) + chant.chant_range = original_chant.chant_range + chant.volpiano_proofread = original_chant.volpiano_proofread + chant.manuscript_full_text_std_proofread = ( + original_chant.manuscript_full_text_std_proofread + ) + chant.manuscript_full_text_proofread = ( + original_chant.manuscript_full_text_proofread + ) + proofreaders: list[Optional[get_user_model]] = list( + original_chant.proofread_by.all() + ) + + # Handle proofreader checkboxes + if "volpiano" in form.changed_data: + chant.volpiano_proofread = False + if "manuscript_full_text_std_spelling" in form.changed_data: + chant.manuscript_full_text_std_proofread = False + if "manuscript_full_text" in form.changed_data: + chant.manuscript_full_text_proofread = False + + chant.last_updated_by = user + return_response: HttpResponse = super().form_valid(form) + + # The many-to-many `proofread_by` field is reset when the + # parent class's `form_valid` method calls `save()` on the model instance. + if not user_can_proofread_chant(user, chant): + for user in proofreaders: + chant.proofread_by.add(user) + messages.success(self.request, "Chant updated successfully!") + return return_response else: return super().form_invalid(form) From ea46ca4705af0752bb2fd6f648100fda7e2b7922 Mon Sep 17 00:00:00 2001 From: Lucas Date: Tue, 4 Jun 2024 16:04:20 +0000 Subject: [PATCH 02/26] chant edit: edit typing --- django/cantusdb_project/main_app/views/chant.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django/cantusdb_project/main_app/views/chant.py b/django/cantusdb_project/main_app/views/chant.py index 01da2f73e..c60a534d5 100644 --- a/django/cantusdb_project/main_app/views/chant.py +++ b/django/cantusdb_project/main_app/views/chant.py @@ -41,6 +41,7 @@ Sequence, Office, ) +from users.models import User from main_app.permissions import ( user_can_edit_chants_in_source, user_can_proofread_chant, @@ -1119,7 +1120,7 @@ def form_valid(self, form): chant.manuscript_full_text_proofread = ( original_chant.manuscript_full_text_proofread ) - proofreaders: list[Optional[get_user_model]] = list( + proofreaders: list[Optional[User]] = list( original_chant.proofread_by.all() ) From 3b3391d7613804b8006b77c39d356d60f37d61e5 Mon Sep 17 00:00:00 2001 From: Lucas Date: Tue, 4 Jun 2024 16:14:31 +0000 Subject: [PATCH 03/26] chant edit: change chant object retrieval --- django/cantusdb_project/main_app/views/chant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/cantusdb_project/main_app/views/chant.py b/django/cantusdb_project/main_app/views/chant.py index c60a534d5..1fa3f2039 100644 --- a/django/cantusdb_project/main_app/views/chant.py +++ b/django/cantusdb_project/main_app/views/chant.py @@ -1111,7 +1111,7 @@ def form_valid(self, form): if not user_can_proofread_chant(user, chant): # Preserve the original values for proofreader-specific fields - original_chant: Chant = Chant.objects.get(pk=chant.pk) + original_chant: Chant = self.get_object() chant.chant_range = original_chant.chant_range chant.volpiano_proofread = original_chant.volpiano_proofread chant.manuscript_full_text_std_proofread = ( From 9c6481091cdf6b4dac174794f150ed941a207214 Mon Sep 17 00:00:00 2001 From: Lucas Date: Tue, 4 Jun 2024 16:21:30 +0000 Subject: [PATCH 04/26] chant view: remove unused import --- django/cantusdb_project/main_app/views/chant.py | 1 - 1 file changed, 1 deletion(-) diff --git a/django/cantusdb_project/main_app/views/chant.py b/django/cantusdb_project/main_app/views/chant.py index 1fa3f2039..0a85f7759 100644 --- a/django/cantusdb_project/main_app/views/chant.py +++ b/django/cantusdb_project/main_app/views/chant.py @@ -25,7 +25,6 @@ from django.http import Http404, HttpResponse from django.contrib.auth.mixins import UserPassesTestMixin -from django.contrib.auth import get_user_model from main_app.forms import ( From fda5cc0da3f6c6f115c7fe81919f3ddccd1cd06c Mon Sep 17 00:00:00 2001 From: Dylan Hillerbrand Date: Wed, 5 Jun 2024 08:22:56 -0400 Subject: [PATCH 05/26] Update manage.sh --- cron/management/manage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cron/management/manage.sh b/cron/management/manage.sh index 0419f28fa..0dabc8e94 100644 --- a/cron/management/manage.sh +++ b/cron/management/manage.sh @@ -7,4 +7,4 @@ DOCKER_COMPOSE_FILE=$1 # This is the path to the docker-compose file. COMMAND=$2 # This is the command to execute. -/usr/local/bin/docker compose -f $DOCKER_COMPOSE_FILE exec -T django python manage.py $COMMAND +/usr/bin/docker compose -f $DOCKER_COMPOSE_FILE exec -T django python manage.py $COMMAND From ef589debee11591c8d848f4ffe54f5b0914315be Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 5 Jun 2024 13:13:49 +0000 Subject: [PATCH 06/26] edit chant: add typing for user --- django/cantusdb_project/main_app/views/chant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/cantusdb_project/main_app/views/chant.py b/django/cantusdb_project/main_app/views/chant.py index 0a85f7759..b8c6dde34 100644 --- a/django/cantusdb_project/main_app/views/chant.py +++ b/django/cantusdb_project/main_app/views/chant.py @@ -1105,7 +1105,7 @@ def get_chants_with_folios(chants_in_feast): def form_valid(self, form): if form.is_valid(): - user = self.request.user + user: User = self.request.user chant: Chant = form.instance if not user_can_proofread_chant(user, chant): From 38fbd3c3d17068beed935457f1bdbe2f1155b63f Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 5 Jun 2024 13:29:02 +0000 Subject: [PATCH 07/26] my sources: fix ordering of sources in list and sidebar --- django/cantusdb_project/main_app/views/user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/cantusdb_project/main_app/views/user.py b/django/cantusdb_project/main_app/views/user.py index e703c0c26..28c784458 100644 --- a/django/cantusdb_project/main_app/views/user.py +++ b/django/cantusdb_project/main_app/views/user.py @@ -94,7 +94,7 @@ def get_context_data(self, **kwargs): # | Q(proofreaders=self.request.user) # | Q(other_editors=self.request.user) ) - .order_by("-date_created") + .order_by("-date_updated") .distinct() ) @@ -104,7 +104,7 @@ def get_context_data(self, **kwargs): user_created_sources = ( Source.objects.filter(created_by=self.request.user) - .order_by("-date_updated") + .order_by("-date_created") .distinct() ) user_created_paginator = Paginator(user_created_sources, 6) From 4f3311db3fc970268e31d2e00ba4afa016d50ded Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 5 Jun 2024 13:29:18 +0000 Subject: [PATCH 08/26] tests: black formatting --- .../main_app/tests/test_assign_chants_to_segments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/cantusdb_project/main_app/tests/test_assign_chants_to_segments.py b/django/cantusdb_project/main_app/tests/test_assign_chants_to_segments.py index b0b113db0..6a66daa1e 100644 --- a/django/cantusdb_project/main_app/tests/test_assign_chants_to_segments.py +++ b/django/cantusdb_project/main_app/tests/test_assign_chants_to_segments.py @@ -34,4 +34,4 @@ def test_assign_chants_to_segments(self): for chant in source_2_chants: self.assertEqual(chant.segment_id, segment_2.id) for sequence in sequence_source_sequences: - self.assertEqual(sequence.segment_id, segment_2.id) \ No newline at end of file + self.assertEqual(sequence.segment_id, segment_2.id) From 3dbbf0b548f4d00264184ab75409c0b6fd0e3f47 Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 5 Jun 2024 14:45:28 +0000 Subject: [PATCH 09/26] chant edit: simplify with set() method --- django/cantusdb_project/main_app/views/chant.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/django/cantusdb_project/main_app/views/chant.py b/django/cantusdb_project/main_app/views/chant.py index b8c6dde34..7c743ee2e 100644 --- a/django/cantusdb_project/main_app/views/chant.py +++ b/django/cantusdb_project/main_app/views/chant.py @@ -1137,8 +1137,7 @@ def form_valid(self, form): # The many-to-many `proofread_by` field is reset when the # parent class's `form_valid` method calls `save()` on the model instance. if not user_can_proofread_chant(user, chant): - for user in proofreaders: - chant.proofread_by.add(user) + chant.proofread_by.set(proofreaders) messages.success(self.request, "Chant updated successfully!") return return_response else: From 228eb456d3985b3f74c8f0f969e6cf98a62fee60 Mon Sep 17 00:00:00 2001 From: Andrew Hankinson Date: Thu, 6 Jun 2024 14:05:49 +0200 Subject: [PATCH 10/26] Fixed: Add a migration for changes to Source model Fixes #1511 --- ...12_alter_source_date_alter_source_title.py | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 django/cantusdb_project/main_app/migrations/0012_alter_source_date_alter_source_title.py diff --git a/django/cantusdb_project/main_app/migrations/0012_alter_source_date_alter_source_title.py b/django/cantusdb_project/main_app/migrations/0012_alter_source_date_alter_source_title.py new file mode 100644 index 000000000..7eae069bf --- /dev/null +++ b/django/cantusdb_project/main_app/migrations/0012_alter_source_date_alter_source_title.py @@ -0,0 +1,30 @@ +# Generated by Django 4.1.6 on 2024-06-06 12:04 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("main_app", "0011_chant_cm_melody_id_chant_incipit_of_refrain_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="source", + name="date", + field=models.CharField( + blank=True, + help_text='Date of the source (e.g. "1200s", "1300-1350", etc.)', + max_length=63, + null=True, + ), + ), + migrations.AlterField( + model_name="source", + name="title", + field=models.CharField( + help_text="Full Source Identification (City, Archive, Shelf-mark)", + max_length=255, + ), + ), + ] From bea8ded5a495fc6fd1a45d2c7683f558235bb1be Mon Sep 17 00:00:00 2001 From: Andrew Hankinson Date: Thu, 6 Jun 2024 15:34:34 +0200 Subject: [PATCH 11/26] Fixed: Add institution models - alters the source model for storing a reference to the holding institution - Adds the institution identifiers models Fixes #1505 --- .../cantusdb_project/main_app/identifiers.py | 26 ++++++ .../main_app/migrations/0013_institution.py | 67 ++++++++++++++ .../migrations/0014_institutionidentifier.py | 92 +++++++++++++++++++ .../0015_source_holding_institution.py | 24 +++++ .../main_app/models/__init__.py | 2 + .../main_app/models/institution.py | 12 +++ .../main_app/models/institution_identifier.py | 12 +++ .../main_app/models/source.py | 6 ++ 8 files changed, 241 insertions(+) create mode 100644 django/cantusdb_project/main_app/identifiers.py create mode 100644 django/cantusdb_project/main_app/migrations/0013_institution.py create mode 100644 django/cantusdb_project/main_app/migrations/0014_institutionidentifier.py create mode 100644 django/cantusdb_project/main_app/migrations/0015_source_holding_institution.py create mode 100644 django/cantusdb_project/main_app/models/institution.py create mode 100644 django/cantusdb_project/main_app/models/institution_identifier.py diff --git a/django/cantusdb_project/main_app/identifiers.py b/django/cantusdb_project/main_app/identifiers.py new file mode 100644 index 000000000..844ddcc50 --- /dev/null +++ b/django/cantusdb_project/main_app/identifiers.py @@ -0,0 +1,26 @@ +class ExternalIdentifiers: + RISM = 1 + VIAF = 2 + WIKIDATA = 3 + GND = 4 + BNF = 5 + LC = 6 + + +IDENTIFIER_TYPES = ( + (ExternalIdentifiers.RISM, "RISM Online"), + (ExternalIdentifiers.VIAF, "VIAF"), + (ExternalIdentifiers.WIKIDATA, "Wikidata"), + (ExternalIdentifiers.GND, "GND (Gemeinsame Normdatei)"), + (ExternalIdentifiers.BNF, "Bibliothèque national de France"), + (ExternalIdentifiers.LC, "Library of Congress") +) + +TYPE_PREFIX = { + ExternalIdentifiers.RISM: ("rism", "https://rism.online/"), + ExternalIdentifiers.VIAF: ("viaf", "https://viaf.org/viaf/"), + ExternalIdentifiers.WIKIDATA: ("wkp", "https://www.wikidata.org/wiki/"), + ExternalIdentifiers.GND: ("dnb", "https://d-nb.info/gnd/"), + ExternalIdentifiers.BNF: ("bnf", "https://catalogue.bnf.fr/ark:/12148/cb"), + ExternalIdentifiers.LC: ("lc", "https://id.loc.gov/authorities/") +} diff --git a/django/cantusdb_project/main_app/migrations/0013_institution.py b/django/cantusdb_project/main_app/migrations/0013_institution.py new file mode 100644 index 000000000..b206c5342 --- /dev/null +++ b/django/cantusdb_project/main_app/migrations/0013_institution.py @@ -0,0 +1,67 @@ +# Generated by Django 4.1.6 on 2024-06-06 12:06 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ("main_app", "0012_alter_source_date_alter_source_title"), + ] + + operations = [ + migrations.CreateModel( + name="Institution", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "date_created", + models.DateTimeField( + auto_now_add=True, help_text="The date this entry was created" + ), + ), + ( + "date_updated", + models.DateTimeField( + auto_now=True, help_text="The date this entry was updated" + ), + ), + ("name", models.CharField(default="s.n.", max_length=255)), + ("siglum", models.CharField(default="XX-Nn", max_length=32)), + ("city", models.CharField(blank=True, max_length=64, null=True)), + ( + "created_by", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="%(class)s_created_by_user", + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "last_updated_by", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="%(class)s_last_updated_by_user", + to=settings.AUTH_USER_MODEL, + ), + ), + ], + options={ + "abstract": False, + }, + ), + ] diff --git a/django/cantusdb_project/main_app/migrations/0014_institutionidentifier.py b/django/cantusdb_project/main_app/migrations/0014_institutionidentifier.py new file mode 100644 index 000000000..f544fd859 --- /dev/null +++ b/django/cantusdb_project/main_app/migrations/0014_institutionidentifier.py @@ -0,0 +1,92 @@ +# Generated by Django 4.1.6 on 2024-06-06 12:16 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ("main_app", "0013_institution"), + ] + + operations = [ + migrations.CreateModel( + name="InstitutionIdentifier", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "date_created", + models.DateTimeField( + auto_now_add=True, help_text="The date this entry was created" + ), + ), + ( + "date_updated", + models.DateTimeField( + auto_now=True, help_text="The date this entry was updated" + ), + ), + ( + "identifier", + models.CharField( + help_text="Do not provide the full URL here; only the identifier.", + max_length=512, + ), + ), + ( + "identifier_type", + models.IntegerField( + choices=[ + (1, "RISM Online"), + (2, "VIAF"), + (3, "Wikidata"), + (4, "GND (Gemeinsame Normdatei)"), + (5, "Bibliothèque national de France"), + (6, "Library of Congress"), + ] + ), + ), + ( + "created_by", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="%(class)s_created_by_user", + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "institution", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="identifiers", + to="main_app.institution", + ), + ), + ( + "last_updated_by", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="%(class)s_last_updated_by_user", + to=settings.AUTH_USER_MODEL, + ), + ), + ], + options={ + "abstract": False, + }, + ), + ] diff --git a/django/cantusdb_project/main_app/migrations/0015_source_holding_institution.py b/django/cantusdb_project/main_app/migrations/0015_source_holding_institution.py new file mode 100644 index 000000000..2de78ae33 --- /dev/null +++ b/django/cantusdb_project/main_app/migrations/0015_source_holding_institution.py @@ -0,0 +1,24 @@ +# Generated by Django 4.2.11 on 2024-06-06 13:05 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ("main_app", "0014_institutionidentifier"), + ] + + operations = [ + migrations.AddField( + model_name="source", + name="holding_institution", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.PROTECT, + to="main_app.institution", + ), + ), + ] diff --git a/django/cantusdb_project/main_app/models/__init__.py b/django/cantusdb_project/main_app/models/__init__.py index 67d135611..fad179093 100644 --- a/django/cantusdb_project/main_app/models/__init__.py +++ b/django/cantusdb_project/main_app/models/__init__.py @@ -11,3 +11,5 @@ from main_app.models.sequence import Sequence from main_app.models.rism_siglum import RismSiglum from main_app.models.source import Source +from main_app.models.institution import Institution +from main_app.models.institution_identifier import InstitutionIdentifier \ No newline at end of file diff --git a/django/cantusdb_project/main_app/models/institution.py b/django/cantusdb_project/main_app/models/institution.py new file mode 100644 index 000000000..f8b85c522 --- /dev/null +++ b/django/cantusdb_project/main_app/models/institution.py @@ -0,0 +1,12 @@ +from django.db import models + +from main_app.models import BaseModel + + +class Institution(BaseModel): + name = models.CharField(max_length=255, default="s.n.") + siglum = models.CharField(max_length=32, default="XX-Nn") + city = models.CharField(max_length=64, blank=True, null=True) + + def __str__(self): + return f"{self.name} ({self.siglum})" diff --git a/django/cantusdb_project/main_app/models/institution_identifier.py b/django/cantusdb_project/main_app/models/institution_identifier.py new file mode 100644 index 000000000..51da6e920 --- /dev/null +++ b/django/cantusdb_project/main_app/models/institution_identifier.py @@ -0,0 +1,12 @@ +from django.db import models + +from main_app.identifiers import IDENTIFIER_TYPES +from main_app.models import BaseModel + + +class InstitutionIdentifier(BaseModel): + identifier = models.CharField(max_length=512, help_text="Do not provide the full URL here; only the identifier.") + identifier_type = models.IntegerField(choices=IDENTIFIER_TYPES) + institution = models.ForeignKey("Institution", + related_name="identifiers", + on_delete=models.CASCADE) diff --git a/django/cantusdb_project/main_app/models/source.py b/django/cantusdb_project/main_app/models/source.py index 6d0efe68b..e49363306 100644 --- a/django/cantusdb_project/main_app/models/source.py +++ b/django/cantusdb_project/main_app/models/source.py @@ -44,6 +44,12 @@ class Source(BaseModel): null=True, blank=True, ) + holding_institution = models.ForeignKey( + "Institution", + on_delete=models.PROTECT, + null=True, + blank=True, + ) provenance = models.ForeignKey( "Provenance", on_delete=models.PROTECT, From f9c0994f19ca69f31645ac020bec409ab2a02bf2 Mon Sep 17 00:00:00 2001 From: Andrew Hankinson Date: Thu, 6 Jun 2024 15:56:33 +0200 Subject: [PATCH 12/26] Fixed: Break up admin.py - Moves each model admin to its own file - Creates a shared base_admin file for the base model admin Fixes #110 --- django/cantusdb_project/main_app/admin.py | 236 ------------------ .../main_app/admin/__init__.py | 12 + .../main_app/admin/base_admin.py | 27 ++ .../main_app/admin/century.py | 11 + .../cantusdb_project/main_app/admin/chant.py | 53 ++++ .../main_app/admin/differentia.py | 12 + .../cantusdb_project/main_app/admin/feast.py | 20 ++ .../cantusdb_project/main_app/admin/genre.py | 11 + .../main_app/admin/institution.py | 5 + .../main_app/admin/institution_identifier.py | 5 + .../main_app/admin/notation.py | 11 + .../cantusdb_project/main_app/admin/office.py | 11 + .../main_app/admin/provenance.py | 11 + .../main_app/admin/rism_siglum.py | 11 + .../main_app/admin/segment.py | 11 + .../main_app/admin/sequence.py | 38 +++ .../cantusdb_project/main_app/admin/source.py | 54 ++++ 17 files changed, 303 insertions(+), 236 deletions(-) delete mode 100644 django/cantusdb_project/main_app/admin.py create mode 100644 django/cantusdb_project/main_app/admin/__init__.py create mode 100644 django/cantusdb_project/main_app/admin/base_admin.py create mode 100644 django/cantusdb_project/main_app/admin/century.py create mode 100644 django/cantusdb_project/main_app/admin/chant.py create mode 100644 django/cantusdb_project/main_app/admin/differentia.py create mode 100644 django/cantusdb_project/main_app/admin/feast.py create mode 100644 django/cantusdb_project/main_app/admin/genre.py create mode 100644 django/cantusdb_project/main_app/admin/institution.py create mode 100644 django/cantusdb_project/main_app/admin/institution_identifier.py create mode 100644 django/cantusdb_project/main_app/admin/notation.py create mode 100644 django/cantusdb_project/main_app/admin/office.py create mode 100644 django/cantusdb_project/main_app/admin/provenance.py create mode 100644 django/cantusdb_project/main_app/admin/rism_siglum.py create mode 100644 django/cantusdb_project/main_app/admin/segment.py create mode 100644 django/cantusdb_project/main_app/admin/sequence.py create mode 100644 django/cantusdb_project/main_app/admin/source.py diff --git a/django/cantusdb_project/main_app/admin.py b/django/cantusdb_project/main_app/admin.py deleted file mode 100644 index e23b07503..000000000 --- a/django/cantusdb_project/main_app/admin.py +++ /dev/null @@ -1,236 +0,0 @@ -from django.contrib import admin -from reversion.admin import VersionAdmin -from main_app.models import * -from main_app.forms import ( - AdminCenturyForm, - AdminChantForm, - AdminFeastForm, - AdminGenreForm, - AdminNotationForm, - AdminOfficeForm, - AdminProvenanceForm, - AdminRismSiglumForm, - AdminSegmentForm, - AdminSequenceForm, - AdminSourceForm, -) - -# these fields should not be editable by all classes -EXCLUDE = ("json_info",) - -READ_ONLY = ( - "created_by", - "last_updated_by", - "date_created", - "date_updated", -) - - -class BaseModelAdmin(VersionAdmin): - exclude = EXCLUDE - readonly_fields = READ_ONLY - - # if an object is created in the admin interface, assign the user to the created_by field - # else if an object is updated in the admin interface, assign the user to the last_updated_by field - def save_model(self, request, obj, form, change): - if change: - obj.last_updated_by = request.user - else: - obj.created_by = request.user - super().save_model(request, obj, form, change) - - -class CenturyAdmin(BaseModelAdmin): - search_fields = ("name",) - form = AdminCenturyForm - - -class ChantAdmin(BaseModelAdmin): - @admin.display(description="Source Siglum") - def get_source_siglum(self, obj): - if obj.source: - return obj.source.siglum - - list_display = ( - "incipit", - "get_source_siglum", - "genre", - ) - search_fields = ( - "title", - "incipit", - "cantus_id", - "id", - ) - - readonly_fields = READ_ONLY + ("incipit",) - - list_filter = ( - "genre", - "office", - ) - exclude = EXCLUDE + ( - "col1", - "col2", - "col3", - "next_chant", - "s_sequence", - "is_last_chant_in_feast", - "visible_status", - "date", - "volpiano_notes", - "volpiano_intervals", - "title", - "differentiae_database", - ) - form = AdminChantForm - raw_id_fields = ( - "source", - "feast", - ) - ordering = ("source__siglum",) - - -class DifferentiaAdmin(BaseModelAdmin): - search_fields = ( - "differentia_id", - "id", - ) - - -class FeastAdmin(BaseModelAdmin): - search_fields = ( - "name", - "feast_code", - ) - list_display = ( - "name", - "month", - "day", - "feast_code", - ) - form = AdminFeastForm - - -class GenreAdmin(BaseModelAdmin): - search_fields = ("name",) - form = AdminGenreForm - - -class NotationAdmin(BaseModelAdmin): - search_fields = ("name",) - form = AdminNotationForm - - -class OfficeAdmin(BaseModelAdmin): - search_fields = ("name",) - form = AdminOfficeForm - - -class ProvenanceAdmin(BaseModelAdmin): - search_fields = ("name",) - form = AdminProvenanceForm - - -class RismSiglumAdmin(BaseModelAdmin): - search_fields = ("name",) - form = AdminRismSiglumForm - - -class SegmentAdmin(BaseModelAdmin): - search_fields = ("name",) - form = AdminSegmentForm - - -class SequenceAdmin(BaseModelAdmin): - @admin.display(description="Source Siglum") - def get_source_siglum(self, obj): - if obj.source: - return obj.source.siglum - - search_fields = ( - "title", - "incipit", - "cantus_id", - "id", - ) - exclude = EXCLUDE + ( - "c_sequence", - "next_chant", - "is_last_chant_in_feast", - "visible_status", - ) - list_display = ("incipit", "get_source_siglum", "genre") - list_filter = ( - "genre", - "office", - ) - raw_id_fields = ( - "source", - "feast", - ) - readonly_fields = READ_ONLY + ("incipit",) - ordering = ("source__siglum",) - form = AdminSequenceForm - - -class SourceAdmin(BaseModelAdmin): - exclude = EXCLUDE + ("source_status",) - - # These search fields are also available on the user-source inline relationship in the user admin page - search_fields = ( - "siglum", - "title", - "id", - ) - readonly_fields = READ_ONLY + ( - "number_of_chants", - "number_of_melodies", - "date_created", - "date_updated", - ) - # from the Django docs: - # Adding a ManyToManyField to this list will instead use a nifty unobtrusive JavaScript “filter” interface - # that allows searching within the options. The unselected and selected options appear in two boxes side by side. - filter_horizontal = ( - "century", - "notation", - "current_editors", - "inventoried_by", - "full_text_entered_by", - "melodies_entered_by", - "proofreaders", - "other_editors", - ) - - list_display = ( - "title", - "siglum", - "id", - ) - - list_filter = ( - "full_source", - "segment", - "source_status", - "published", - "century", - ) - - ordering = ("siglum",) - - form = AdminSourceForm - - -admin.site.register(Century, CenturyAdmin) -admin.site.register(Chant, ChantAdmin) -admin.site.register(Differentia, DifferentiaAdmin) -admin.site.register(Feast, FeastAdmin) -admin.site.register(Genre, GenreAdmin) -admin.site.register(Notation, NotationAdmin) -admin.site.register(Office, OfficeAdmin) -admin.site.register(Provenance, ProvenanceAdmin) -admin.site.register(RismSiglum, RismSiglumAdmin) -admin.site.register(Segment, SegmentAdmin) -admin.site.register(Sequence, SequenceAdmin) -admin.site.register(Source, SourceAdmin) diff --git a/django/cantusdb_project/main_app/admin/__init__.py b/django/cantusdb_project/main_app/admin/__init__.py new file mode 100644 index 000000000..15f8792fb --- /dev/null +++ b/django/cantusdb_project/main_app/admin/__init__.py @@ -0,0 +1,12 @@ +from main_app.admin.century import CenturyAdmin +from main_app.admin.chant import ChantAdmin +from main_app.admin.differentia import DifferentiaAdmin +from main_app.admin.feast import FeastAdmin +from main_app.admin.genre import GenreAdmin +from main_app.admin.notation import NotationAdmin +from main_app.admin.office import OfficeAdmin +from main_app.admin.provenance import ProvenanceAdmin +from main_app.admin.rism_siglum import RismSiglumAdmin +from main_app.admin.segment import SegmentAdmin +from main_app.admin.sequence import SequenceAdmin +from main_app.admin.source import SourceAdmin diff --git a/django/cantusdb_project/main_app/admin/base_admin.py b/django/cantusdb_project/main_app/admin/base_admin.py new file mode 100644 index 000000000..98963f68e --- /dev/null +++ b/django/cantusdb_project/main_app/admin/base_admin.py @@ -0,0 +1,27 @@ +from reversion.admin import VersionAdmin + + +# these fields should not be editable by all classes +EXCLUDE = ("json_info",) + + +READ_ONLY = ( + "created_by", + "last_updated_by", + "date_created", + "date_updated", +) + + +class BaseModelAdmin(VersionAdmin): + exclude = EXCLUDE + readonly_fields = READ_ONLY + + # if an object is created in the admin interface, assign the user to the created_by field + # else if an object is updated in the admin interface, assign the user to the last_updated_by field + def save_model(self, request, obj, form, change): + if change: + obj.last_updated_by = request.user + else: + obj.created_by = request.user + super().save_model(request, obj, form, change) diff --git a/django/cantusdb_project/main_app/admin/century.py b/django/cantusdb_project/main_app/admin/century.py new file mode 100644 index 000000000..31dc76c20 --- /dev/null +++ b/django/cantusdb_project/main_app/admin/century.py @@ -0,0 +1,11 @@ +from django.contrib import admin + +from main_app.admin.base_admin import BaseModelAdmin +from main_app.forms import AdminCenturyForm +from main_app.models import Century + + +@admin.register(Century) +class CenturyAdmin(BaseModelAdmin): + search_fields = ("name",) + form = AdminCenturyForm diff --git a/django/cantusdb_project/main_app/admin/chant.py b/django/cantusdb_project/main_app/admin/chant.py new file mode 100644 index 000000000..ce2c8b775 --- /dev/null +++ b/django/cantusdb_project/main_app/admin/chant.py @@ -0,0 +1,53 @@ +from django.contrib import admin + +from main_app.admin.base_admin import EXCLUDE, READ_ONLY, BaseModelAdmin +from main_app.forms import AdminChantForm +from main_app.models import Chant + + +@admin.register(Chant) +class ChantAdmin(BaseModelAdmin): + + @admin.display(description="Source Siglum") + def get_source_siglum(self, obj): + if obj.source: + return obj.source.siglum + + list_display = ( + "incipit", + "get_source_siglum", + "genre", + ) + search_fields = ( + "title", + "incipit", + "cantus_id", + "id", + ) + + readonly_fields = READ_ONLY + ("incipit",) + + list_filter = ( + "genre", + "office", + ) + exclude = EXCLUDE + ( + "col1", + "col2", + "col3", + "next_chant", + "s_sequence", + "is_last_chant_in_feast", + "visible_status", + "date", + "volpiano_notes", + "volpiano_intervals", + "title", + "differentiae_database", + ) + form = AdminChantForm + raw_id_fields = ( + "source", + "feast", + ) + ordering = ("source__siglum",) diff --git a/django/cantusdb_project/main_app/admin/differentia.py b/django/cantusdb_project/main_app/admin/differentia.py new file mode 100644 index 000000000..7d823d5ae --- /dev/null +++ b/django/cantusdb_project/main_app/admin/differentia.py @@ -0,0 +1,12 @@ +from django.contrib import admin + +from main_app.admin.base_admin import BaseModelAdmin +from main_app.models import Differentia + + +@admin.register(Differentia) +class DifferentiaAdmin(BaseModelAdmin): + search_fields = ( + "differentia_id", + "id", + ) diff --git a/django/cantusdb_project/main_app/admin/feast.py b/django/cantusdb_project/main_app/admin/feast.py new file mode 100644 index 000000000..81a070ef0 --- /dev/null +++ b/django/cantusdb_project/main_app/admin/feast.py @@ -0,0 +1,20 @@ +from django.contrib import admin + +from main_app.admin.base_admin import BaseModelAdmin +from main_app.forms import AdminFeastForm +from main_app.models import Feast + + +@admin.register(Feast) +class FeastAdmin(BaseModelAdmin): + search_fields = ( + "name", + "feast_code", + ) + list_display = ( + "name", + "month", + "day", + "feast_code", + ) + form = AdminFeastForm diff --git a/django/cantusdb_project/main_app/admin/genre.py b/django/cantusdb_project/main_app/admin/genre.py new file mode 100644 index 000000000..86f7ba84a --- /dev/null +++ b/django/cantusdb_project/main_app/admin/genre.py @@ -0,0 +1,11 @@ +from django.contrib import admin + +from main_app.admin.base_admin import BaseModelAdmin +from main_app.forms import AdminGenreForm +from main_app.models import Genre + + +@admin.register(Genre) +class GenreAdmin(BaseModelAdmin): + search_fields = ("name",) + form = AdminGenreForm diff --git a/django/cantusdb_project/main_app/admin/institution.py b/django/cantusdb_project/main_app/admin/institution.py new file mode 100644 index 000000000..f1523a262 --- /dev/null +++ b/django/cantusdb_project/main_app/admin/institution.py @@ -0,0 +1,5 @@ +from django.contrib import admin + + +class InstitutionAdmin(admin.ModelAdmin): + pass diff --git a/django/cantusdb_project/main_app/admin/institution_identifier.py b/django/cantusdb_project/main_app/admin/institution_identifier.py new file mode 100644 index 000000000..f0d89c07b --- /dev/null +++ b/django/cantusdb_project/main_app/admin/institution_identifier.py @@ -0,0 +1,5 @@ +from django.contrib import admin + + +class InstitutionIdentifierAdmin(admin.ModelAdmin): + pass diff --git a/django/cantusdb_project/main_app/admin/notation.py b/django/cantusdb_project/main_app/admin/notation.py new file mode 100644 index 000000000..c257b2d35 --- /dev/null +++ b/django/cantusdb_project/main_app/admin/notation.py @@ -0,0 +1,11 @@ +from django.contrib import admin + +from main_app.admin.base_admin import BaseModelAdmin +from main_app.forms import AdminNotationForm +from main_app.models import Notation + + +@admin.register(Notation) +class NotationAdmin(BaseModelAdmin): + search_fields = ("name",) + form = AdminNotationForm diff --git a/django/cantusdb_project/main_app/admin/office.py b/django/cantusdb_project/main_app/admin/office.py new file mode 100644 index 000000000..d31d56534 --- /dev/null +++ b/django/cantusdb_project/main_app/admin/office.py @@ -0,0 +1,11 @@ +from django.contrib import admin + +from main_app.admin.base_admin import BaseModelAdmin +from main_app.forms import AdminOfficeForm +from main_app.models import Office + + +@admin.register(Office) +class OfficeAdmin(BaseModelAdmin): + search_fields = ("name",) + form = AdminOfficeForm diff --git a/django/cantusdb_project/main_app/admin/provenance.py b/django/cantusdb_project/main_app/admin/provenance.py new file mode 100644 index 000000000..130b35eca --- /dev/null +++ b/django/cantusdb_project/main_app/admin/provenance.py @@ -0,0 +1,11 @@ +from django.contrib import admin + +from main_app.admin.base_admin import BaseModelAdmin +from main_app.forms import AdminProvenanceForm +from main_app.models import Provenance + + +@admin.register(Provenance) +class ProvenanceAdmin(BaseModelAdmin): + search_fields = ("name",) + form = AdminProvenanceForm diff --git a/django/cantusdb_project/main_app/admin/rism_siglum.py b/django/cantusdb_project/main_app/admin/rism_siglum.py new file mode 100644 index 000000000..36113bec8 --- /dev/null +++ b/django/cantusdb_project/main_app/admin/rism_siglum.py @@ -0,0 +1,11 @@ +from django.contrib import admin + +from main_app.admin.base_admin import BaseModelAdmin +from main_app.forms import AdminRismSiglumForm +from main_app.models import RismSiglum + + +@admin.register(RismSiglum) +class RismSiglumAdmin(BaseModelAdmin): + search_fields = ("name",) + form = AdminRismSiglumForm diff --git a/django/cantusdb_project/main_app/admin/segment.py b/django/cantusdb_project/main_app/admin/segment.py new file mode 100644 index 000000000..b8a16a6b0 --- /dev/null +++ b/django/cantusdb_project/main_app/admin/segment.py @@ -0,0 +1,11 @@ +from django.contrib import admin + +from main_app.admin.base_admin import BaseModelAdmin +from main_app.forms import AdminSegmentForm +from main_app.models import Segment + + +@admin.register(Segment) +class SegmentAdmin(BaseModelAdmin): + search_fields = ("name",) + form = AdminSegmentForm diff --git a/django/cantusdb_project/main_app/admin/sequence.py b/django/cantusdb_project/main_app/admin/sequence.py new file mode 100644 index 000000000..9c7868e4d --- /dev/null +++ b/django/cantusdb_project/main_app/admin/sequence.py @@ -0,0 +1,38 @@ +from django.contrib import admin + +from main_app.admin.base_admin import BaseModelAdmin, EXCLUDE, READ_ONLY +from main_app.forms import AdminSequenceForm +from main_app.models import Sequence + + +@admin.register(Sequence) +class SequenceAdmin(BaseModelAdmin): + @admin.display(description="Source Siglum") + def get_source_siglum(self, obj): + if obj.source: + return obj.source.siglum + + search_fields = ( + "title", + "incipit", + "cantus_id", + "id", + ) + exclude = EXCLUDE + ( + "c_sequence", + "next_chant", + "is_last_chant_in_feast", + "visible_status", + ) + list_display = ("incipit", "get_source_siglum", "genre") + list_filter = ( + "genre", + "office", + ) + raw_id_fields = ( + "source", + "feast", + ) + readonly_fields = READ_ONLY + ("incipit",) + ordering = ("source__siglum",) + form = AdminSequenceForm diff --git a/django/cantusdb_project/main_app/admin/source.py b/django/cantusdb_project/main_app/admin/source.py new file mode 100644 index 000000000..d047d518d --- /dev/null +++ b/django/cantusdb_project/main_app/admin/source.py @@ -0,0 +1,54 @@ +from django.contrib import admin + +from main_app.admin.base_admin import BaseModelAdmin, EXCLUDE, READ_ONLY +from main_app.forms import AdminSourceForm +from main_app.models import Source + + +@admin.register(Source) +class SourceAdmin(BaseModelAdmin): + exclude = EXCLUDE + ("source_status",) + + # These search fields are also available on the user-source inline relationship in the user admin page + search_fields = ( + "siglum", + "title", + "id", + ) + readonly_fields = READ_ONLY + ( + "number_of_chants", + "number_of_melodies", + "date_created", + "date_updated", + ) + # from the Django docs: + # Adding a ManyToManyField to this list will instead use a nifty unobtrusive JavaScript “filter” interface + # that allows searching within the options. The unselected and selected options appear in two boxes side by side. + filter_horizontal = ( + "century", + "notation", + "current_editors", + "inventoried_by", + "full_text_entered_by", + "melodies_entered_by", + "proofreaders", + "other_editors", + ) + + list_display = ( + "title", + "siglum", + "id", + ) + + list_filter = ( + "full_source", + "segment", + "source_status", + "published", + "century", + ) + + ordering = ("siglum",) + + form = AdminSourceForm From 44623599f500425fa84bc744929976468f24fa9b Mon Sep 17 00:00:00 2001 From: Andrew Hankinson Date: Thu, 6 Jun 2024 16:05:32 +0200 Subject: [PATCH 13/26] Fixed: Add institutions to the new admin layout Also runs black on the files to make them fit the formatting --- django/cantusdb_project/main_app/admin/__init__.py | 2 ++ django/cantusdb_project/main_app/admin/institution.py | 6 +++++- .../main_app/admin/institution_identifier.py | 6 +++++- django/cantusdb_project/main_app/identifiers.py | 4 ++-- django/cantusdb_project/main_app/models/__init__.py | 2 +- .../main_app/models/institution_identifier.py | 11 +++++++---- 6 files changed, 22 insertions(+), 9 deletions(-) diff --git a/django/cantusdb_project/main_app/admin/__init__.py b/django/cantusdb_project/main_app/admin/__init__.py index 15f8792fb..6839ad2d8 100644 --- a/django/cantusdb_project/main_app/admin/__init__.py +++ b/django/cantusdb_project/main_app/admin/__init__.py @@ -10,3 +10,5 @@ from main_app.admin.segment import SegmentAdmin from main_app.admin.sequence import SequenceAdmin from main_app.admin.source import SourceAdmin +from main_app.admin.institution import InstitutionAdmin +from main_app.admin.institution_identifier import InstitutionIdentifierAdmin diff --git a/django/cantusdb_project/main_app/admin/institution.py b/django/cantusdb_project/main_app/admin/institution.py index f1523a262..99cb914b1 100644 --- a/django/cantusdb_project/main_app/admin/institution.py +++ b/django/cantusdb_project/main_app/admin/institution.py @@ -1,5 +1,9 @@ from django.contrib import admin +from main_app.admin.base_admin import BaseModelAdmin +from main_app.models import Institution -class InstitutionAdmin(admin.ModelAdmin): + +@admin.register(Institution) +class InstitutionAdmin(BaseModelAdmin): pass diff --git a/django/cantusdb_project/main_app/admin/institution_identifier.py b/django/cantusdb_project/main_app/admin/institution_identifier.py index f0d89c07b..eacc06c0f 100644 --- a/django/cantusdb_project/main_app/admin/institution_identifier.py +++ b/django/cantusdb_project/main_app/admin/institution_identifier.py @@ -1,5 +1,9 @@ from django.contrib import admin +from main_app.admin.base_admin import BaseModelAdmin +from main_app.models import InstitutionIdentifier -class InstitutionIdentifierAdmin(admin.ModelAdmin): + +@admin.register(InstitutionIdentifier) +class InstitutionIdentifierAdmin(BaseModelAdmin): pass diff --git a/django/cantusdb_project/main_app/identifiers.py b/django/cantusdb_project/main_app/identifiers.py index 844ddcc50..4ab27e298 100644 --- a/django/cantusdb_project/main_app/identifiers.py +++ b/django/cantusdb_project/main_app/identifiers.py @@ -13,7 +13,7 @@ class ExternalIdentifiers: (ExternalIdentifiers.WIKIDATA, "Wikidata"), (ExternalIdentifiers.GND, "GND (Gemeinsame Normdatei)"), (ExternalIdentifiers.BNF, "Bibliothèque national de France"), - (ExternalIdentifiers.LC, "Library of Congress") + (ExternalIdentifiers.LC, "Library of Congress"), ) TYPE_PREFIX = { @@ -22,5 +22,5 @@ class ExternalIdentifiers: ExternalIdentifiers.WIKIDATA: ("wkp", "https://www.wikidata.org/wiki/"), ExternalIdentifiers.GND: ("dnb", "https://d-nb.info/gnd/"), ExternalIdentifiers.BNF: ("bnf", "https://catalogue.bnf.fr/ark:/12148/cb"), - ExternalIdentifiers.LC: ("lc", "https://id.loc.gov/authorities/") + ExternalIdentifiers.LC: ("lc", "https://id.loc.gov/authorities/"), } diff --git a/django/cantusdb_project/main_app/models/__init__.py b/django/cantusdb_project/main_app/models/__init__.py index fad179093..9959354e9 100644 --- a/django/cantusdb_project/main_app/models/__init__.py +++ b/django/cantusdb_project/main_app/models/__init__.py @@ -12,4 +12,4 @@ from main_app.models.rism_siglum import RismSiglum from main_app.models.source import Source from main_app.models.institution import Institution -from main_app.models.institution_identifier import InstitutionIdentifier \ No newline at end of file +from main_app.models.institution_identifier import InstitutionIdentifier diff --git a/django/cantusdb_project/main_app/models/institution_identifier.py b/django/cantusdb_project/main_app/models/institution_identifier.py index 51da6e920..9ca13d537 100644 --- a/django/cantusdb_project/main_app/models/institution_identifier.py +++ b/django/cantusdb_project/main_app/models/institution_identifier.py @@ -5,8 +5,11 @@ class InstitutionIdentifier(BaseModel): - identifier = models.CharField(max_length=512, help_text="Do not provide the full URL here; only the identifier.") + identifier = models.CharField( + max_length=512, + help_text="Do not provide the full URL here; only the identifier.", + ) identifier_type = models.IntegerField(choices=IDENTIFIER_TYPES) - institution = models.ForeignKey("Institution", - related_name="identifiers", - on_delete=models.CASCADE) + institution = models.ForeignKey( + "Institution", related_name="identifiers", on_delete=models.CASCADE + ) From 454629119823a9a0ab06d04ab20eb94e59061ec3 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 7 Jun 2024 16:42:06 +0000 Subject: [PATCH 14/26] cantusindex: fix TypeError in get_suggested_chant --- django/cantusdb_project/cantusindex.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/django/cantusdb_project/cantusindex.py b/django/cantusdb_project/cantusindex.py index 210aa0505..b00ef8ee3 100644 --- a/django/cantusdb_project/cantusindex.py +++ b/django/cantusdb_project/cantusindex.py @@ -91,9 +91,12 @@ def get_suggested_chant( # mostly, in case of a timeout within get_json_from_ci_api return None - fulltext: str = json["info"]["field_full_text"] - incipit: str = " ".join(fulltext.split(" ")[:5]) - genre_name: str = json["info"]["field_genre"] + try: + fulltext: str = json["info"]["field_full_text"] + incipit: str = " ".join(fulltext.split(" ")[:5]) + genre_name: str = json["info"]["field_genre"] + except TypeError: + return None genre_id: Optional[int] = None try: genre_id = Genre.objects.get(name=genre_name).id From e3a6279b9f5d406f55cd0862629fc011251d0588 Mon Sep 17 00:00:00 2001 From: Dylan Hillerbrand Date: Tue, 11 Jun 2024 09:04:41 -0400 Subject: [PATCH 15/26] refactor(nginx): Consolidate static files for custom error pages --- config/nginx/conf.d/cantusdb.conf.development | 13 ------------- .../cantusdb_project/static}/style.css | 0 nginx/error_pages/502.html | 6 +++--- nginx/error_pages/504.html | 6 +++--- nginx/error_pages/CantusLogoSmall.gif | Bin 7083 -> 0 bytes nginx/error_pages/background.jpg | Bin 19450 -> 0 bytes nginx/error_pages/favicon.ico | Bin 1150 -> 0 bytes 7 files changed, 6 insertions(+), 19 deletions(-) rename {nginx/error_pages => django/cantusdb_project/static}/style.css (100%) delete mode 100644 nginx/error_pages/CantusLogoSmall.gif delete mode 100644 nginx/error_pages/background.jpg delete mode 100644 nginx/error_pages/favicon.ico diff --git a/config/nginx/conf.d/cantusdb.conf.development b/config/nginx/conf.d/cantusdb.conf.development index 1b8e0b654..5d294c5f9 100644 --- a/config/nginx/conf.d/cantusdb.conf.development +++ b/config/nginx/conf.d/cantusdb.conf.development @@ -24,19 +24,6 @@ server { expires modified +24h; } - location = /style.css { - root /; - } - location = /background.jpg { - root /; - } - location = /CantusLogoSmall.gif { - root /; - } - location = /favicon.ico { - root /; - } - error_page 502 /502.html; location = /502.html { root /; diff --git a/nginx/error_pages/style.css b/django/cantusdb_project/static/style.css similarity index 100% rename from nginx/error_pages/style.css rename to django/cantusdb_project/static/style.css diff --git a/nginx/error_pages/502.html b/nginx/error_pages/502.html index fec106b4c..c9b67bfdf 100644 --- a/nginx/error_pages/502.html +++ b/nginx/error_pages/502.html @@ -2,12 +2,12 @@ 502 Bad Gateway | Cantus Manuscript Database - - + +
- +

502 Bad Gateway

The server encountered a temporary error and could not fulfill your request.

Our apologies. Please wait a few moments and try again.

diff --git a/nginx/error_pages/504.html b/nginx/error_pages/504.html index fc06a4805..74fb4a365 100644 --- a/nginx/error_pages/504.html +++ b/nginx/error_pages/504.html @@ -2,12 +2,12 @@ 504 Gateway Timeout | Cantus Manuscript Database - - + +
- +

504 Gateway Timeout

The server took too long to respond and could not fulfill your request.

Our apologies. Please wait a few moments and try again.

diff --git a/nginx/error_pages/CantusLogoSmall.gif b/nginx/error_pages/CantusLogoSmall.gif deleted file mode 100644 index 7c2b19440b07d67f36ab71cd8551b956f055ef62..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7083 zcmWlZcRbXO@>n;cA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l zT|@l=Y4V?b$F>495Qt)HEC&YF{8sTPv0#0!PZJKD2j$l)Vc@77jG&#m}-|4*wum&RNsU>ZMuc5hYf+{)JZe`;=DUw-rIHG}j8z=q%_?qxr! z|Jmhf-m?GG^l~4t-_$?5>*>UdX#XF-|70)N4dnYD0uGEK^Ll|T#`x@dFQDA413-t| zx_@c^<7W-PX=+e(f94ke+I9kXln7Wa@Z2H$kDoLb*z5qg;b`$aQ0X1Iw?rLisrI~& b{C}F(zTPW2Yu5DpqBEnaKxE_s`~NoqsZ53a diff --git a/nginx/error_pages/favicon.ico b/nginx/error_pages/favicon.ico deleted file mode 100644 index 07a2d4dbf7fa0f86898fe5408d3b791de593ccc5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1150 zcmbtSv5^8X3=}h80MW;UKl7m*pb1)FzKm5smJU}ULy=de~geVt)#Uivjcv| zqv1Q*-`x$X=je?8*#!> HoBdDjWm9IV From b11f202c2686d1182d6b01447493acc51e4c9bd7 Mon Sep 17 00:00:00 2001 From: Dylan Hillerbrand Date: Tue, 11 Jun 2024 09:06:01 -0400 Subject: [PATCH 16/26] feat(nginx): Add custom 500 error page --- config/nginx/conf.d/cantusdb.conf.development | 7 ++++++- nginx/error_pages/500.html | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 nginx/error_pages/500.html diff --git a/config/nginx/conf.d/cantusdb.conf.development b/config/nginx/conf.d/cantusdb.conf.development index 5d294c5f9..d7710cd51 100644 --- a/config/nginx/conf.d/cantusdb.conf.development +++ b/config/nginx/conf.d/cantusdb.conf.development @@ -23,7 +23,12 @@ server { alias /resources/api_cache/concordances.json; expires modified +24h; } - + + error_page 500 /500.html; + location = /500.html{ + root /; + } + error_page 502 /502.html; location = /502.html { root /; diff --git a/nginx/error_pages/500.html b/nginx/error_pages/500.html new file mode 100644 index 000000000..8d987ae68 --- /dev/null +++ b/nginx/error_pages/500.html @@ -0,0 +1,16 @@ + + + + 500 Internal Server Error | Cantus Manuscript Database + + + + +
+ +

500 Internal Server Error

+

The server encountered a temporary error and could not fulfill your request.

+

Our apologies. Please wait a few moments and try again.

+
+ + \ No newline at end of file From 62f418ba25a767da3f948c67e855056c54a602f4 Mon Sep 17 00:00:00 2001 From: Dylan Hillerbrand Date: Tue, 11 Jun 2024 09:08:08 -0400 Subject: [PATCH 17/26] build(nginx): Add nginx password file - Adds a password file to the nginx container build process - Adds a mock password file to the repo (note: actual password file for the staging server is provisioned by ansible --- nginx/Dockerfile | 3 ++- nginx/password/.htpasswd | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 nginx/password/.htpasswd diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 2b2ba9c0c..080a18815 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -6,4 +6,5 @@ RUN curl -LJO https://github.com/go-acme/lego/releases/download/v4.14.2/lego_v4. mv lego /usr/local/bin/lego && \ rm lego_v4.14.2_linux_amd64.tar.gz RUN mkdir -p /var/www/lego -COPY error_pages . \ No newline at end of file +COPY error_pages . +COPY password/.htpasswd /etc/nginx/.htpasswd \ No newline at end of file diff --git a/nginx/password/.htpasswd b/nginx/password/.htpasswd new file mode 100644 index 000000000..4453f326c --- /dev/null +++ b/nginx/password/.htpasswd @@ -0,0 +1 @@ +# Note: This file is intentionally empty for development and production environments. It will be replaced with a file containing a hashed password on the staging server by ansible. \ No newline at end of file From 76ee930a35149086faff12991f39fdefcc24b17b Mon Sep 17 00:00:00 2001 From: Dylan Hillerbrand Date: Tue, 11 Jun 2024 09:17:10 -0400 Subject: [PATCH 18/26] style(nginx): Add missing space to cantusdb.conf.development --- config/nginx/conf.d/cantusdb.conf.development | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/nginx/conf.d/cantusdb.conf.development b/config/nginx/conf.d/cantusdb.conf.development index d7710cd51..972c91519 100644 --- a/config/nginx/conf.d/cantusdb.conf.development +++ b/config/nginx/conf.d/cantusdb.conf.development @@ -25,7 +25,7 @@ server { } error_page 500 /500.html; - location = /500.html{ + location = /500.html { root /; } @@ -37,4 +37,4 @@ server { location = /504.html { root /; } -} \ No newline at end of file +} From 75cf1560443783d29c8014f088ab9c857158459d Mon Sep 17 00:00:00 2001 From: Andrew Hankinson Date: Tue, 11 Jun 2024 15:44:25 +0200 Subject: [PATCH 19/26] Fixed: Expand institution model After a review of the existing institution information in Cantus, the following improvements are made - Adds region, country, and alternate names fields for the institution - Modifies the admin site for institutions to show the table, and to show an inline for adding identifiers --- .../main_app/admin/institution.py | 21 +++++++- ...titution_country_alter_institution_city.py | 51 +++++++++++++++++++ .../main_app/models/institution.py | 22 ++++++-- 3 files changed, 89 insertions(+), 5 deletions(-) create mode 100644 django/cantusdb_project/main_app/migrations/0016_institution_alternate_names_institution_region_squashed_0017_institution_country_alter_institution_city.py diff --git a/django/cantusdb_project/main_app/admin/institution.py b/django/cantusdb_project/main_app/admin/institution.py index 99cb914b1..e93333d01 100644 --- a/django/cantusdb_project/main_app/admin/institution.py +++ b/django/cantusdb_project/main_app/admin/institution.py @@ -1,9 +1,26 @@ from django.contrib import admin from main_app.admin.base_admin import BaseModelAdmin -from main_app.models import Institution +from main_app.models import Institution, InstitutionIdentifier + + +class InstitutionIdentifierInline(admin.TabularInline): + model = InstitutionIdentifier + extra = 0 + exclude = ["created_by", "last_updated_by"] @admin.register(Institution) class InstitutionAdmin(BaseModelAdmin): - pass + list_display = ("name", "siglum", "get_city_region", "country") + search_fields = ("name", "siglum", "city", "region", "alternate_names") + list_filter = ("city",) + inlines = (InstitutionIdentifierInline,) + + def get_city_region(self, obj): + name = [obj.city] + if obj.region: + name.append(f"({obj.region})") + return " ".join(name) + + get_city_region.short_description = "City" diff --git a/django/cantusdb_project/main_app/migrations/0016_institution_alternate_names_institution_region_squashed_0017_institution_country_alter_institution_city.py b/django/cantusdb_project/main_app/migrations/0016_institution_alternate_names_institution_region_squashed_0017_institution_country_alter_institution_city.py new file mode 100644 index 000000000..15e17ec59 --- /dev/null +++ b/django/cantusdb_project/main_app/migrations/0016_institution_alternate_names_institution_region_squashed_0017_institution_country_alter_institution_city.py @@ -0,0 +1,51 @@ +# Generated by Django 4.1.6 on 2024-06-11 09:05 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + replaces = [ + ("main_app", "0016_institution_alternate_names_institution_region"), + ("main_app", "0017_institution_country_alter_institution_city"), + ] + + dependencies = [ + ("main_app", "0015_source_holding_institution"), + ] + + operations = [ + migrations.AddField( + model_name="institution", + name="alternate_names", + field=models.TextField( + blank=True, + help_text="Enter alternate names on separate lines.", + null=True, + ), + ), + migrations.AddField( + model_name="institution", + name="region", + field=models.CharField( + blank=True, + help_text='Province / State / Canton / County. Used to disambiguate cities, e.g., "London (Ontario)".', + max_length=64, + null=True, + ), + ), + migrations.AddField( + model_name="institution", + name="country", + field=models.CharField(default="s.l.", max_length=64), + ), + migrations.AlterField( + model_name="institution", + name="city", + field=models.CharField( + blank=True, + help_text="City / Town / Village / Settlement", + max_length=64, + null=True, + ), + ), + ] diff --git a/django/cantusdb_project/main_app/models/institution.py b/django/cantusdb_project/main_app/models/institution.py index f8b85c522..b8f11ca10 100644 --- a/django/cantusdb_project/main_app/models/institution.py +++ b/django/cantusdb_project/main_app/models/institution.py @@ -3,10 +3,26 @@ from main_app.models import BaseModel +region_help_text = """Province / State / Canton / County. Used to disambiguate cities, e.g., "London (Ontario)".""" +city_help_text = """City / Town / Village / Settlement""" + + class Institution(BaseModel): name = models.CharField(max_length=255, default="s.n.") siglum = models.CharField(max_length=32, default="XX-Nn") - city = models.CharField(max_length=64, blank=True, null=True) + city = models.CharField( + max_length=64, blank=True, null=True, help_text=city_help_text + ) + region = models.CharField( + max_length=64, blank=True, null=True, help_text=region_help_text + ) + country = models.CharField(max_length=64, default="s.l.") + alternate_names = models.TextField( + blank=True, null=True, help_text="Enter alternate names on separate lines." + ) - def __str__(self): - return f"{self.name} ({self.siglum})" + def __str__(self) -> str: + names: list = [self.name] + if self.siglum: + names.append(f"({self.siglum})") + return " ".join(names) From 5d9998bc6f207eed6e97595eeb729b8d91008bfc Mon Sep 17 00:00:00 2001 From: Andrew Hankinson Date: Tue, 11 Jun 2024 17:02:17 +0200 Subject: [PATCH 20/26] Add former sigla to institution records Request from Debra for institution records --- .../0018_institution_former_sigla.py | 22 +++++++++++++++++++ .../main_app/models/institution.py | 3 +++ 2 files changed, 25 insertions(+) create mode 100644 django/cantusdb_project/main_app/migrations/0018_institution_former_sigla.py diff --git a/django/cantusdb_project/main_app/migrations/0018_institution_former_sigla.py b/django/cantusdb_project/main_app/migrations/0018_institution_former_sigla.py new file mode 100644 index 000000000..cdd13afe9 --- /dev/null +++ b/django/cantusdb_project/main_app/migrations/0018_institution_former_sigla.py @@ -0,0 +1,22 @@ +# Generated by Django 4.1.6 on 2024-06-11 15:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ( + "main_app", + "0016_institution_alternate_names_institution_region_squashed_0017_institution_country_alter_institution_city", + ), + ] + + operations = [ + migrations.AddField( + model_name="institution", + name="former_sigla", + field=models.TextField( + blank=True, help_text="Enter former sigla on separate lines.", null=True + ), + ), + ] diff --git a/django/cantusdb_project/main_app/models/institution.py b/django/cantusdb_project/main_app/models/institution.py index b8f11ca10..c4a2140fa 100644 --- a/django/cantusdb_project/main_app/models/institution.py +++ b/django/cantusdb_project/main_app/models/institution.py @@ -20,6 +20,9 @@ class Institution(BaseModel): alternate_names = models.TextField( blank=True, null=True, help_text="Enter alternate names on separate lines." ) + former_sigla = models.TextField( + blank=True, null=True, help_text="Enter former sigla on separate lines." + ) def __str__(self) -> str: names: list = [self.name] From 7734cde8eafe839fb99875017e71e2737ced50fb Mon Sep 17 00:00:00 2001 From: Dylan Hillerbrand Date: Wed, 12 Jun 2024 09:55:01 -0400 Subject: [PATCH 21/26] Comment out chant segment and BD-specific fields on chant forms --- django/cantusdb_project/main_app/forms.py | 71 ++++++++++--------- .../main_app/templates/chant_create.html | 15 ++-- .../main_app/templates/chant_edit.html | 15 ++-- 3 files changed, 56 insertions(+), 45 deletions(-) diff --git a/django/cantusdb_project/main_app/forms.py b/django/cantusdb_project/main_app/forms.py index 100027609..41abb97b3 100644 --- a/django/cantusdb_project/main_app/forms.py +++ b/django/cantusdb_project/main_app/forms.py @@ -83,13 +83,14 @@ class Meta: "content_structure", "indexing_notes", "addendum", - "segment", - "liturgical_function", - "polyphony", - "cm_melody_id", - "incipit_of_refrain", - "later_addition", - "rubrics", + # See issue #1521: Temporarily commenting out segment-related functions on Chant + # "segment", + # "liturgical_function", + # "polyphony", + # "cm_melody_id", + # "incipit_of_refrain", + # "later_addition", + # "rubrics", ] # the widgets dictionary is ignored for a model field with a non-empty # choices attribute. In this case, you must override the form field to @@ -148,13 +149,14 @@ class Meta: "Mass Alleluias. Punctuation is omitted.", ) - segment = SelectWidgetNameModelChoiceField( - queryset=Segment.objects.all().order_by("id"), - required=True, - initial=Segment.objects.get(id=4063), # Default to the "Cantus" segment - help_text="Select the Database segment that the chant belongs to. " - "In most cases, this will be the CANTUS segment.", - ) + # See issue #1521: Temporarily commenting out segment-related functions on Chant + # segment = SelectWidgetNameModelChoiceField( + # queryset=Segment.objects.all().order_by("id"), + # required=True, + # initial=Segment.objects.get(id=4063), # Default to the "Cantus" segment + # help_text="Select the Database segment that the chant belongs to. " + # "In most cases, this will be the CANTUS segment.", + # ) # automatically computed fields # source and incipit are mandatory fields in model, @@ -281,13 +283,14 @@ class Meta: "manuscript_full_text_proofread", "volpiano_proofread", "proofread_by", - "segment", - "liturgical_function", - "polyphony", - "cm_melody_id", - "incipit_of_refrain", - "later_addition", - "rubrics", + # See issue #1521: Temporarily commenting out segment-related functions on Chant + # "segment", + # "liturgical_function", + # "polyphony", + # "cm_melody_id", + # "incipit_of_refrain", + # "later_addition", + # "rubrics", ] widgets = { # manuscript_full_text_std_spelling: defined below (required) @@ -317,12 +320,13 @@ class Meta: "proofread_by": autocomplete.ModelSelect2Multiple( url="proofread-by-autocomplete" ), - "polyphony": SelectWidget(), - "liturgical_function": SelectWidget(), - "cm_melody_id": TextInputWidget(), - "incipit_of_refrain": TextInputWidget(), - "later_addition": TextInputWidget(), - "rubrics": TextInputWidget(), + # See issue #1521: Temporarily commenting out segment-related functions on Chant + # "polyphony": SelectWidget(), + # "liturgical_function": SelectWidget(), + # "cm_melody_id": TextInputWidget(), + # "incipit_of_refrain": TextInputWidget(), + # "later_addition": TextInputWidget(), + # "rubrics": TextInputWidget(), } manuscript_full_text_std_spelling = forms.CharField( @@ -347,12 +351,13 @@ class Meta: help_text="Each folio starts with '1'.", ) - segment = SelectWidgetNameModelChoiceField( - queryset=Segment.objects.all().order_by("id"), - required=True, - help_text="Select the Database segment that the chant belongs to. " - "In most cases, this will be the CANTUS segment.", - ) + # See issue #1521: Temporarily commenting out segment-related functions on Chant + # segment = SelectWidgetNameModelChoiceField( + # queryset=Segment.objects.all().order_by("id"), + # required=True, + # help_text="Select the Database segment that the chant belongs to. " + # "In most cases, this will be the CANTUS segment.", + # ) class SourceEditForm(forms.ModelForm): diff --git a/django/cantusdb_project/main_app/templates/chant_create.html b/django/cantusdb_project/main_app/templates/chant_create.html index 39bb752cc..3e60159bc 100644 --- a/django/cantusdb_project/main_app/templates/chant_create.html +++ b/django/cantusdb_project/main_app/templates/chant_create.html @@ -84,7 +84,8 @@

Create Chant

{{ form.cantus_id }}
-
+ +
@@ -140,10 +141,11 @@

Create Chant

{{ form.extra }}
-
+ +
@@ -179,8 +181,9 @@

Create Chant

+ -