Skip to content

Commit

Permalink
Merge branch 'develop' into fixed-1505-institutions
Browse files Browse the repository at this point in the history
  • Loading branch information
ahankinson committed Jun 13, 2024
2 parents 5605ba6 + 2050973 commit 2d213fd
Show file tree
Hide file tree
Showing 13 changed files with 85 additions and 64 deletions.
16 changes: 4 additions & 12 deletions config/nginx/conf.d/cantusdb.conf.development
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,9 @@ server {
alias /resources/api_cache/concordances.json;
expires modified +24h;
}

location = /style.css {
root /;
}
location = /background.jpg {
root /;
}
location = /CantusLogoSmall.gif {
root /;
}
location = /favicon.ico {

error_page 500 /500.html;
location = /500.html {
root /;
}

Expand All @@ -45,4 +37,4 @@ server {
location = /504.html {
root /;
}
}
}
71 changes: 38 additions & 33 deletions django/cantusdb_project/main_app/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand All @@ -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):
Expand Down
15 changes: 9 additions & 6 deletions django/cantusdb_project/main_app/templates/chant_create.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,16 @@ <h3>Create Chant</h3>
<label for="{{ form.cantus_id.id_for_label }}"><small>Cantus ID:</small></label>
{{ form.cantus_id }}
</div>
<div id="segment-select-field" class="form-group m-1 col-lg-4">
<!-- # See issue #1521: Temporarily commenting out segment-related functions on Chant -->
<!-- <div id="segment-select-field" class="form-group m-1 col-lg-4">
<small>{{ form.segment.label_tag }}<span class="text-danger" title="This field is required">*</span></small>
{{ form.segment }}
</div>
<div class="form-group m-1 col-lg-3">
<small>{{ form.liturgical_function.label_tag }}</small>
{{ form.liturgical_function }}
</div>
</div> -->
</div>

<div class="form-row">
Expand Down Expand Up @@ -140,10 +141,11 @@ <h3>Create Chant</h3>
{{ form.extra }}
</div>

<div class="form-group m-1 col-lg-2">
<!-- # See issue #1521: Temporarily commenting out segment-related functions on Chant -->
<!-- <div class="form-group m-1 col-lg-2">
<small>{{ form.polyphony.label_tag }}</small>
{{ form.polyphony }}
</div>
</div> -->
</div>

<div class="form-row">
Expand Down Expand Up @@ -179,8 +181,9 @@ <h3>Create Chant</h3>

</div>

<!-- See issue #1521: Temporarily commenting out segment-related functions on Chants -->
<!-- The next three rows of fields are hidden unless the Benedicamus Domino segment is selected. -->
<div id="benedicamus-domino-segment-fields" hidden>
<!-- <div id="benedicamus-domino-segment-fields" hidden>
<div class="form-row">
<div class="form-group m-1 col-lg-4">
Expand Down Expand Up @@ -209,7 +212,7 @@ <h3>Create Chant</h3>
{{ form.rubrics }}
</div>
</div>
</div>
</div> -->

<div class="form-row align-items-end">
<div class="form-group m-1 col-lg">
Expand Down
15 changes: 9 additions & 6 deletions django/cantusdb_project/main_app/templates/chant_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,16 @@
</label>
{{ form.melody_id }}
</div>
<div id="segment-select-field" class="form-group m-1 col-lg-4">
<!-- # See issue #1521: Temporarily commenting out segment-related functions on Chant -->
<!-- <div id="segment-select-field" class="form-group m-1 col-lg-4">
<small>{{ form.segment.label_tag }}<span class="text-danger" title="This field is required">*</span></small>
{{ form.segment }}
</div>
<div class="form-group m-1 col-lg-3">
<small>{{ form.liturgical_function.label_tag }}</small>
{{ form.liturgical_function }}
</div>
</div> -->
</div>

<div class="form-row">
Expand All @@ -125,10 +126,11 @@
<small>{{ form.extra.label_tag }}</small>
{{ form.extra }}
</div>
<div class="form-group m-1 col-lg-2">
<!-- # See issue #1521: Temporarily commenting out segment-related functions on Chant -->
<!-- <div class="form-group m-1 col-lg-2">
<small>{{ form.polyphony.label_tag }}</small>
{{ form.polyphony }}
</div>
</div> -->
</div>
<div class="form-row">
<div class="form-group m-1 col-lg-12">
Expand Down Expand Up @@ -157,8 +159,9 @@
{% endif %}
</div>

<!-- # See issue #1521: Temporarily commenting out segment-related functions on Chant -->
<!-- The next three rows of fields are hidden unless the Benedicamus Domino segment is selected. -->
<div id="benedicamus-domino-segment-fields" hidden>
<!-- <div id="benedicamus-domino-segment-fields" hidden>
<div class="form-row">
<div class="form-group m-1 col-lg-4">
Expand Down Expand Up @@ -187,7 +190,7 @@
{{ form.rubrics }}
</div>
</div>
</div>
</div> -->

{% if suggested_fulltext %}
<div class="form-row">
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
COPY error_pages .
COPY password/.htpasswd /etc/nginx/.htpasswd
16 changes: 16 additions & 0 deletions nginx/error_pages/500.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<title>500 Internal Server Error | Cantus Manuscript Database</title>
<link rel="stylesheet" type="text/css" href="/static/style.css">
<link rel="icon" href="/static/favicon.ico">
</head>
<body>
<div class="page">
<a href="/"><img src="/static/CantusLogoSmall.gif"></a>
<h1>500 Internal Server Error</h1>
<p>The server encountered a temporary error and could not fulfill your request.</p>
<p>Our apologies. Please wait a few moments and try again.</p>
</div>
</body>
</html>
6 changes: 3 additions & 3 deletions nginx/error_pages/502.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<html>
<head>
<title>502 Bad Gateway | Cantus Manuscript Database</title>
<link rel="stylesheet" type="text/css" href="/style.css">
<link rel="icon" href="/favicon.ico">
<link rel="stylesheet" type="text/css" href="/static/style.css">
<link rel="icon" href="/static/favicon.ico">
</head>
<body>
<div class="page">
<a href="/"><img src="/CantusLogoSmall.gif"></a>
<a href="/"><img src="/static/CantusLogoSmall.gif"></a>
<h1>502 Bad Gateway</h1>
<p>The server encountered a temporary error and could not fulfill your request.</p>
<p>Our apologies. Please wait a few moments and try again.</p>
Expand Down
6 changes: 3 additions & 3 deletions nginx/error_pages/504.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<html>
<head>
<title>504 Gateway Timeout | Cantus Manuscript Database</title>
<link rel="stylesheet" type="text/css" href="/style.css">
<link rel="icon" href="/favicon.ico">
<link rel="stylesheet" type="text/css" href="/static/style.css">
<link rel="icon" href="/static/favicon.ico">
</head>
<body>
<div class="page">
<a href="/"><img src="/CantusLogoSmall.gif"></a>
<a href="/"><img src="/static/CantusLogoSmall.gif"></a>
<h1>504 Gateway Timeout</h1>
<p>The server took too long to respond and could not fulfill your request.</p>
<p>Our apologies. Please wait a few moments and try again.</p>
Expand Down
Binary file removed nginx/error_pages/CantusLogoSmall.gif
Binary file not shown.
Binary file removed nginx/error_pages/background.jpg
Binary file not shown.
Binary file removed nginx/error_pages/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions nginx/password/.htpasswd
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 2d213fd

Please sign in to comment.