diff --git a/django/cantusdb_project/main_app/templates/century_detail.html b/django/cantusdb_project/main_app/templates/century_detail.html index b3c7e6e9c..631c6afe3 100644 --- a/django/cantusdb_project/main_app/templates/century_detail.html +++ b/django/cantusdb_project/main_app/templates/century_detail.html @@ -1,23 +1,24 @@ -{% extends "base.html" %} +{% extends "single_column_with_search_bar.html" %} {% block title %} {{ century.name }} | Cantus Database {% endblock %} -{% block content %} -
- - {% include "global_search_bar.html" %} - +{% block header %}

{{ century.name }}

- +{% endblock %} +{% block maincontent %} +
+
+ +
{% endblock %} diff --git a/django/cantusdb_project/main_app/templates/chant_search.html b/django/cantusdb_project/main_app/templates/chant_search.html index 5ade5b0e1..a5a877d17 100644 --- a/django/cantusdb_project/main_app/templates/chant_search.html +++ b/django/cantusdb_project/main_app/templates/chant_search.html @@ -1,4 +1,5 @@ -{% extends "base.html" %} +{% extends "single_column_with_search_bar.html" %} +{% load humanize %} {% block title %} Search Chants | Cantus Database @@ -8,53 +9,44 @@ {% endblock %} -{% block content %} -
- - {% include "global_search_bar.html" %} - +{% block header %}

Search Chants

+{% endblock %} +{% block maincontent %} {% if source %}

Searching in source: {{ source.short_heading }}

{% elif keyword %} -

- +

» Search {{ keyword }} on CantusIndex.org -

{% endif %} {% if chants.all %} -

- Displaying {{ page_obj.start_index }}-{{ page_obj.end_index }} of {{ page_obj.paginator.count }} - chant{{ page_obj.paginator.count|pluralize }} +

+ Displaying {{ page_obj.start_index }}-{{ page_obj.end_index }} of {{ page_obj.paginator.count|intcomma }} + chant{{ page_obj.paginator.count|pluralize }}.

{% endif %} -
-
- -
-
-
-
+
+
-
+
-
- +
+
-
- +
+
-
- +
+
-
- +
+
-
- +
+
-
- +
+
-
- +
+
-
+
{% endif %}
-
+
@@ -315,12 +303,10 @@

Search Chants

- {% include "pagination.html" %} {% else %} {% if request.GET %} - No chants found. +

No chants found.

{% endif %} {% endif %} -
{% endblock %} diff --git a/django/cantusdb_project/main_app/templates/chant_seq_by_cantus_id.html b/django/cantusdb_project/main_app/templates/chant_seq_by_cantus_id.html index 19543c760..5ad5a6344 100644 --- a/django/cantusdb_project/main_app/templates/chant_seq_by_cantus_id.html +++ b/django/cantusdb_project/main_app/templates/chant_seq_by_cantus_id.html @@ -1,21 +1,17 @@ -{% extends "base.html" %} +{% extends "filterable_table_with_search_bar.html" %} {% block title %} Chants by Cantus ID: {{ cantus_id }} | Cantus Database {% endblock %} -{% block content %} -
- - - {% include "global_search_bar.html" %} - +{% block header %}

Chants by Cantus ID: {{ cantus_id }}

- Displaying {{ page_obj.start_index }}-{{ page_obj.end_index }} of {{ page_obj.paginator.count }} chants +{% endblock %} +{% block list_table %}
@@ -78,9 +74,9 @@

-
{{ chant.mode|default:"" }} + {% if chant.volpiano %} - 1 + {% endif %} @@ -93,6 +89,4 @@

- {% include "pagination.html" %} -
{% endblock %} diff --git a/django/cantusdb_project/main_app/templates/contact.html b/django/cantusdb_project/main_app/templates/contact.html index 50ddfe0f2..e0d1b2702 100644 --- a/django/cantusdb_project/main_app/templates/contact.html +++ b/django/cantusdb_project/main_app/templates/contact.html @@ -1,18 +1,16 @@ -{% extends "base.html" %} +{% extends "single_column_with_search_bar.html" %} {% block title %} Contact | Cantus Database {% endblock %} -{% block content %} -
- - - {% include "global_search_bar.html" %} - - +{% block header %}

Contact

-

Please direct questions or comments about Cantus Database to Debra Lacoste at debra.lacoste@dal.ca.

- -
+{% endblock %} +{% block maincontent %} +
+
+

Please direct questions or comments about Cantus Database to Debra Lacoste at debra.lacoste@dal.ca.

+
+
{% endblock %} diff --git a/django/cantusdb_project/main_app/templates/feast_detail.html b/django/cantusdb_project/main_app/templates/feast_detail.html index 5dde5423c..9ecf2da28 100644 --- a/django/cantusdb_project/main_app/templates/feast_detail.html +++ b/django/cantusdb_project/main_app/templates/feast_detail.html @@ -1,19 +1,17 @@ -{% extends "base.html" %} +{% extends "single_column_with_search_bar.html" %} {% load helper_tags %} {# for month_to_string #} {% block title %} {{ feast.name }} | Cantus Database {% endblock %} -{% block content %} -
- - {% include "global_search_bar.html" %} - +{% block header %}

{{ feast.name }}

-

{{ feast.description }}

- -
+{% endblock %} +{% block maincontent %} +
+

{{ feast.description }}

+
{% if feast.feast_code %}
@@ -42,8 +40,6 @@

{{ feast.name }}

{% endif %}
- -
{% if frequent_chants %}
@@ -104,5 +100,4 @@

Sources containing the feast

{% endif %}
-
{% endblock %} diff --git a/django/cantusdb_project/main_app/templates/feast_list.html b/django/cantusdb_project/main_app/templates/feast_list.html index 045fd7806..e5677a9ba 100644 --- a/django/cantusdb_project/main_app/templates/feast_list.html +++ b/django/cantusdb_project/main_app/templates/feast_list.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "filterable_table_with_search_bar.html" %} {% load helper_tags %} {# for month_to_string #} {% block title %} @@ -9,21 +9,17 @@ {% endblock %} -{% block content %} -
- - {% include "global_search_bar.html" %} - - +{% block header %}

List of Feasts

- Displaying {{ page_obj.start_index }}-{{ page_obj.end_index }} of {{ page_obj.paginator.count }} +{% endblock %} +{% block list_filter_form %}
-
+
-
+
-
+
-
- +
+
-
+
+{% endblock %} +{% block list_table %} {% if feasts %} @@ -89,10 +87,6 @@

List of Feasts

{% endfor %} -
- {% include "pagination.html" %} - {% else %} - No feasts found. + {% endif %} -
{% endblock %} diff --git a/django/cantusdb_project/main_app/templates/filterable_table_with_search_bar.html b/django/cantusdb_project/main_app/templates/filterable_table_with_search_bar.html new file mode 100644 index 000000000..ae1ad6a88 --- /dev/null +++ b/django/cantusdb_project/main_app/templates/filterable_table_with_search_bar.html @@ -0,0 +1,46 @@ +{% extends "single_column_with_search_bar.html" %} +{% load humanize %} +{# A template for use with list pages. The template introduces the following blocks: + - list_filter_form: a block for the form displayed above the table that powers list/table filtering + - list_table: a block for the table that displays the list + A header block is inherited from `single_column_with_search_bar.html` and is displayed alongside + global search bar at the top of the page. + This template also handles display of an object count shown beneath the header: "Displaying x-y of N + [object type]". Views using this template must pass a `Page` object as `page_obj` in the context (this + happens by default in views with a `MultipleObjectMixin`). The template uses the `context_object_name` + attribute of the view to determine the object type to display in this object count. + Pagination is included at the bottom of the page, except if no results are found. + #} + +{% block maincontent %} +
+
+

Displaying {{ page_obj.start_index|intcomma }}-{{ page_obj.end_index|intcomma }} of {{ page_obj.paginator.count|intcomma }} {{ view.context_object_name }}.

+
+
+
+ {% block list_filter_form %} + {% endblock %} +
+ {% if page_obj.paginator.count > 0 %} +
+
+ {% block list_table %} + {% endblock %} +
+
+ {% else %} +
+
+

No {{ view.context_object_name }} found.

+
+
+ {% endif %} + {% if page_obj.paginator.num_pages > 1%} +
+
+ {% include "pagination.html" %} +
+
+ {% endif %} +{% endblock %} \ No newline at end of file diff --git a/django/cantusdb_project/main_app/templates/genre_detail.html b/django/cantusdb_project/main_app/templates/genre_detail.html index bd32c5cbf..181e3d4de 100644 --- a/django/cantusdb_project/main_app/templates/genre_detail.html +++ b/django/cantusdb_project/main_app/templates/genre_detail.html @@ -1,16 +1,17 @@ -{% extends "base.html" %} +{% extends "single_column_with_search_bar.html" %} {% block title %} {{ genre.name }} | Cantus Database {% endblock %} -{% block content %} -
- - {% include "global_search_bar.html" %} - - +{% block header %}

{{ genre.name }}

-

{{ genre.description }}

+{% endblock %} + +{% block maincontent %} +
+
+

{{ genre.description }}

+
{% endblock %} diff --git a/django/cantusdb_project/main_app/templates/genre_list.html b/django/cantusdb_project/main_app/templates/genre_list.html index e68d8e5e5..77f8d86bc 100644 --- a/django/cantusdb_project/main_app/templates/genre_list.html +++ b/django/cantusdb_project/main_app/templates/genre_list.html @@ -1,37 +1,35 @@ -{% extends "base.html" %} +{% extends "filterable_table_with_search_bar.html" %} {% load helper_tags %} {% block title %} List of Genres | Cantus Database {% endblock %} -{% block content %} -
- - {% include "global_search_bar.html" %} - -

- List of Genres -

- Displaying {{ page_obj.start_index }}-{{ page_obj.end_index }} of {{ page_obj.paginator.count }} - - +{% block scripts %} + +{% endblock %} +{% block header %} +

+ List of Genres +

+{% endblock %} +{% block list_table %} +
+ + + {% sortable_header request "name" "Abbreviation" %} + {% sortable_header request "description" "Genre" %} + + + + {% for genre in genres %} - {% sortable_header request "name" "Abbreviation" %} - {% sortable_header request "description" "Genre" %} + + - - - {% for genre in genres %} - - - - - {% endfor %} - -
+ {{ genre.name }} + + {{ genre.description|default:"" }} +
- {{ genre.name }} - - {{ genre.description|default:"" }} -
- {% include "pagination.html" %} -
+ {% endfor %} + + {% endblock %} diff --git a/django/cantusdb_project/main_app/templates/indexer_list.html b/django/cantusdb_project/main_app/templates/indexer_list.html index eb1144f12..7a14bcae2 100644 --- a/django/cantusdb_project/main_app/templates/indexer_list.html +++ b/django/cantusdb_project/main_app/templates/indexer_list.html @@ -1,26 +1,23 @@ -{% extends "base.html" %} +{% extends "filterable_table_with_search_bar.html" %} {% block title %} List of Indexers | Cantus Database {% endblock %} -{% block content %} -
- - {% include "global_search_bar.html" %} - +{% block header %}

List of Indexers

- Displaying {{ page_obj.start_index }}-{{ page_obj.end_index }} of {{ page_obj.paginator.count }} -
-
- +{% endblock %} +{% block list_filter_form %} + +
+
-
- +{% endblock %} +{% block list_table %} @@ -51,6 +48,4 @@

List of Indexers

{% endfor %}
- {% include "pagination.html" %} -
{% endblock %} diff --git a/django/cantusdb_project/main_app/templates/institution_detail.html b/django/cantusdb_project/main_app/templates/institution_detail.html index b22ba9bbb..dda7961c5 100644 --- a/django/cantusdb_project/main_app/templates/institution_detail.html +++ b/django/cantusdb_project/main_app/templates/institution_detail.html @@ -1,17 +1,15 @@ -{% extends "base.html" %} +{% extends "single_column_with_search_bar.html" %} {% block title %} {% endblock %} -{% block content %} -
- - {% include "global_search_bar.html" %} - -

{{ institution.name }} {% if institution.siglum %}({{ institution.siglum }}){% endif %}

-

{% if institution.city %}{{ institution.city }}{% else %}[No City]{% endif %}, {{ institution.country }}

- {% if institution_authorities %} +{% block header %} +

{{ institution.name }} {% if institution.siglum %}({{ institution.siglum }}){% endif %}

+

{% if institution.city %}{{ institution.city }}{% else %}[No City]{% endif %}, {{ institution.country }}

+{% endblock %} +{% block maincontent %} + {% if institution_authorities %}
@@ -20,20 +18,42 @@

{% if institution.city %}{{ institution.city }}{% else %}[No City]{% endif % {% endfor %}

+ {% endif %} +
+
+ {% if num_cantus_sources > 0 %} +
+
Cantus Database
+ + + + + + + + {% for source in cantus_sources %} + + + + {% endfor %} + +
Sources
+ {{ source.shelfmark }}{% if source.name %} ("{{ source.name }}"){% endif %} +
+
{% endif %} -
-
- {% if num_cantus_sources > 0 %} + + {% if num_bower_sources > 0 %}
-
Cantus Database
+
Clavis Sequentiarum (Sequence Database by Calvin Bower)
- - - + + + - {% for source in cantus_sources %} + {% for source in bower_sources %}
Sources
Sources
{{ source.shelfmark }}{% if source.name %} ("{{ source.name }}"){% endif %} @@ -43,29 +63,6 @@
Cantus Database
- {% endif %} - - {% if num_bower_sources > 0 %} -
-
Clavis Sequentiarum (Sequence Database by Calvin Bower)
- - - - - - - - {% for source in bower_sources %} - - - - {% endfor %} - -
Sources
- {{ source.shelfmark }}{% if source.name %} ("{{ source.name }}"){% endif %} -
-
- {% endif %} -
+ {% endif %}
{% endblock %} \ No newline at end of file diff --git a/django/cantusdb_project/main_app/templates/institution_list.html b/django/cantusdb_project/main_app/templates/institution_list.html index b4fa0c1a7..b7bdc3dd8 100644 --- a/django/cantusdb_project/main_app/templates/institution_list.html +++ b/django/cantusdb_project/main_app/templates/institution_list.html @@ -1,48 +1,43 @@ -{% extends "base.html" %} +{% extends "filterable_table_with_search_bar.html" %} {% block title %} - + Institutions | Cantus Database {% endblock %} -{% block content %} -
- - {% include "global_search_bar.html" %} - -

Institutions

- Displaying {{ page_obj.start_index }}-{{ page_obj.end_index }} of {{ page_obj.paginator.count }} - - +{% block header %} +

Institutions

+{% endblock %} +{% block list_table %} +
+ + + + + + + + + + {% for institution in institutions %} - - - - + + + + - - - {% for institution in institutions %} - - - - - - - {% endfor %} - -
CountryCityNameSources
CountryCityNameSources + {{ institution.country }} + + {% if institution.city %} + {{ institution.city }} + {% else %} + [No City] + {% endif %} + + + {{ institution.name }} {% if institution.siglum %}({{ institution.siglum }}){% endif %} + + {{ institution.num_sources }}
- {{ institution.country }} - - {% if institution.city %} - {{ institution.city }} - {% else %} - [No City] - {% endif %} - - - {{ institution.name }} {% if institution.siglum %}({{ institution.siglum }}){% endif %} - - {{ institution.num_sources }}
- {% include "pagination.html" %} -
+ {% endfor %} + + {% endblock %} \ No newline at end of file diff --git a/django/cantusdb_project/main_app/templates/items_count.html b/django/cantusdb_project/main_app/templates/items_count.html index 4f0dcf277..3559cf2a9 100644 --- a/django/cantusdb_project/main_app/templates/items_count.html +++ b/django/cantusdb_project/main_app/templates/items_count.html @@ -1,16 +1,14 @@ -{% extends "base.html" %} +{% extends "single_column_with_search_bar.html" %} {% load humanize %} {% block title %} Content Statistics | Cantus Database {% endblock %} -{% block content %} -
- - {% include "global_search_bar.html" %} - +{% block header %}

Content Statistics

+{% endblock %} +{% block maincontent %} @@ -35,6 +33,4 @@

Content Statistics

- -
{% endblock %} diff --git a/django/cantusdb_project/main_app/templates/notation_detail.html b/django/cantusdb_project/main_app/templates/notation_detail.html index cd01c3327..ba9d3367f 100644 --- a/django/cantusdb_project/main_app/templates/notation_detail.html +++ b/django/cantusdb_project/main_app/templates/notation_detail.html @@ -1,23 +1,24 @@ -{% extends "base.html" %} +{% extends "single_column_with_search_bar.html" %} {% block title %} {{ notation.name }} | Cantus Database {% endblock %} -{% block content %} -
- - {% include "global_search_bar.html" %} - +{% block header %}

{{ notation.name }}

- -
+{% endblock %} +{% block maincontent %} +
+
+ +
+
{% endblock %} diff --git a/django/cantusdb_project/main_app/templates/pagination.html b/django/cantusdb_project/main_app/templates/pagination.html index 3f1074e8b..03b3efeeb 100644 --- a/django/cantusdb_project/main_app/templates/pagination.html +++ b/django/cantusdb_project/main_app/templates/pagination.html @@ -1,7 +1,8 @@ {% load helper_tags %} {# for url_add_get_params #} +{% load humanize %} -Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }} \ No newline at end of file +Page {{ page_obj.number|intcomma }} of {{ page_obj.paginator.num_pages|intcomma }} \ No newline at end of file diff --git a/django/cantusdb_project/main_app/templates/provenance_detail.html b/django/cantusdb_project/main_app/templates/provenance_detail.html index 13abcbfdb..5057b549d 100644 --- a/django/cantusdb_project/main_app/templates/provenance_detail.html +++ b/django/cantusdb_project/main_app/templates/provenance_detail.html @@ -1,23 +1,24 @@ -{% extends "base.html" %} +{% extends "single_column_with_search_bar.html" %} {% block title %} {{ provenance.name }} | Cantus Database {% endblock %} -{% block content %} -
- - {% include "global_search_bar.html" %} - +{% block header %}

{{ provenance.name }}

- -
+{% endblock %} +{% block maincontent %} +
+
+ +
+
{% endblock %} diff --git a/django/cantusdb_project/main_app/templates/sequence_detail.html b/django/cantusdb_project/main_app/templates/sequence_detail.html index cb0323bb2..9ae13fc02 100644 --- a/django/cantusdb_project/main_app/templates/sequence_detail.html +++ b/django/cantusdb_project/main_app/templates/sequence_detail.html @@ -1,28 +1,26 @@ -{% extends "base.html" %} +{% extends "single_column_with_search_bar.html" %} {% block title %} {{ sequence.title }} | Cantus Database {% endblock %} -{% block content %} -
- - {% if messages %} -
- {% for message in messages %} - {{ message }} - {% endfor %} -
- {% endif %} - - {% include "global_search_bar.html" %} - +{% block header %}

{{ sequence.title }}

{% if user_can_edit_sequence %} -

- View | Edit -

+

+ View | Edit +

{% endif %} +{% endblock %} +{% block maincontent %} + +{% if messages %} +
+ {% for message in messages %} + {{ message }} + {% endfor %} +
+{% endif %}
Siglum @@ -223,6 +221,4 @@

Concordances

{% endif %} -
- {% endblock %} \ No newline at end of file diff --git a/django/cantusdb_project/main_app/templates/sequence_list.html b/django/cantusdb_project/main_app/templates/sequence_list.html index a74ba919f..ab5bc7d72 100644 --- a/django/cantusdb_project/main_app/templates/sequence_list.html +++ b/django/cantusdb_project/main_app/templates/sequence_list.html @@ -1,19 +1,15 @@ -{% extends "base.html" %} +{% extends "filterable_table_with_search_bar.html" %} {% block title %} Clavis Sequentiarum (Calvin Bower) | Cantus Database {% endblock %} -{% block content %} -
- - {% include "global_search_bar.html" %} - +{% block header %}

Clavis Sequentiarum (Calvin Bower)

- Displaying {{ page_obj.start_index }}-{{ page_obj.end_index }} of {{ page_obj.paginator.count }} - +{% endblock %} +{% block list_filter_form %}
-
+
@@ -31,6 +27,8 @@

Clavis Sequentiarum (Calvin Bower)

+{% endblock %} +{% block list_table %} {% if sequences %}
@@ -86,9 +84,5 @@

Clavis Sequentiarum (Calvin Bower)

- {% else %} - No sequences found. {% endif %} - {% include "pagination.html" %} -
{% endblock %} \ No newline at end of file diff --git a/django/cantusdb_project/main_app/templates/service_detail.html b/django/cantusdb_project/main_app/templates/service_detail.html index 8c4f14f80..7fc2d387a 100644 --- a/django/cantusdb_project/main_app/templates/service_detail.html +++ b/django/cantusdb_project/main_app/templates/service_detail.html @@ -1,15 +1,16 @@ -{% extends "base.html" %} +{% extends "single_column_with_search_bar.html" %} {% block title %} {{ service.name }} | Cantus Database {% endblock %} -{% block content %} -
- - {% include "global_search_bar.html" %} - +{% block header %}

{{ service.name }}

-

{{ service.description }}

+{% endblock %} +{% block maincontent %} +
+
+

{{ service.description }}

+
{% endblock %} diff --git a/django/cantusdb_project/main_app/templates/service_list.html b/django/cantusdb_project/main_app/templates/service_list.html index 19e6871c4..526210905 100644 --- a/django/cantusdb_project/main_app/templates/service_list.html +++ b/django/cantusdb_project/main_app/templates/service_list.html @@ -1,16 +1,13 @@ -{% extends "base.html" %} +{% extends "filterable_table_with_search_bar.html" %} {% block title %} Service Abbreviations | Cantus Database {% endblock %} -{% block content %} -
- - {% include "global_search_bar.html" %} - +{% block header %}

Service Abbreviations

- Displaying {{ page_obj.start_index }}-{{ page_obj.end_index }} of {{ page_obj.paginator.count }} +{% endblock %} +{% block list_table %} @@ -29,6 +26,4 @@

Service Abbreviations

{% endfor %}
- {% include "pagination.html" %} -
{% endblock %} diff --git a/django/cantusdb_project/main_app/templates/single_column_with_search_bar.html b/django/cantusdb_project/main_app/templates/single_column_with_search_bar.html new file mode 100644 index 000000000..c1cd4774a --- /dev/null +++ b/django/cantusdb_project/main_app/templates/single_column_with_search_bar.html @@ -0,0 +1,29 @@ +{% extends "base.html" %} +{# A template that provides a single column layout with a search bar in the upper-right corner. On + narrower screens, the search bar jumps above the main header. #} +{# The template introduces the following blocks: + - header: a block for content that should appear in the upper-left corner of the content area + - maincontent: a block for the main content of the page (under the header and search bar) + #} + +{% block content %} +
+
+ +
+ {% block header %} + {# Contents of header block show in the upper-left corner of content, in the same row as the search bar #} + {% endblock %} +
+
+
+
+ {% block maincontent %} + {# Contents of maincontent block show below the header block and search bar #} + {% endblock %} +
+
+
+{% endblock %} \ No newline at end of file diff --git a/django/cantusdb_project/main_app/templates/source_edit.html b/django/cantusdb_project/main_app/templates/source_edit.html index ecc7539f2..a7a1650f2 100644 --- a/django/cantusdb_project/main_app/templates/source_edit.html +++ b/django/cantusdb_project/main_app/templates/source_edit.html @@ -11,7 +11,6 @@ {{ form.media }} {% endblock %} - {% block uppersidebar %}