Skip to content

Commit

Permalink
Merge pull request #1359 from jacobdgm/1049-complete-785
Browse files Browse the repository at this point in the history
Source Detail: Hide folio/feast dropdowns in sidebar for Bower sources
  • Loading branch information
jacobdgm authored Mar 15, 2024
2 parents 16b4002 + 676e65c commit 9074c25
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions django/cantusdb_project/main_app/templates/source_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,24 +185,28 @@ <h4>{{ source.siglum }}</h4>
</div>
<div class="card-body">
<small>
<!--a small selector of all folios of this source-->
<select id="folioSelect" class="w-30" onchange="jumpToFolio({{ source.id }})">
<option value="">Select a folio:</option>
{% for folio in folios %}
<option value="{{ folio }}">{{ folio }}</option>
{% endfor %}
</select>
{% if source.segment.id == 4063 %}
{# all of the following are different ways to link to the Chant List page #}
{# Since sources in the Bower segment contain no chants, the Chant List page #}
{# is currently set up to raise a 404 if you try to access it for a source in #}
{# the Bower segment. So, we need to display this section only for sources in #}
{# the CANTUS segment #}
<!--a small selector of all folios of this source-->
<select id="folioSelect" class="w-30" onchange="jumpToFolio({{ source.id }})">
<option value="">Select a folio:</option>
{% for folio in folios %}
<option value="{{ folio }}">{{ folio }}</option>
{% endfor %}
</select>

<select id="feastSelect" onchange="jumpToFeast({{ source.id }})" style="width: 200px;"> <!-- style attribute prevents select element from extending beyond left edge of div element -->
<option value="">Select a feast:</option>
{% for folio, feast in feasts_with_folios %}
<option value="{{ feast.id }}">{{ folio }} - {{ feast.name }}</option>
{% endfor %}
</select>
<select id="feastSelect" onchange="jumpToFeast({{ source.id }})" style="width: 200px;"> <!-- style attribute prevents select element from extending beyond left edge of div element -->
<option value="">Select a feast:</option>
{% for folio, feast in feasts_with_folios %}
<option value="{{ feast.id }}">{{ folio }} - {{ feast.name }}</option>
{% endfor %}
</select>

<br>
{% if source.segment.id == 4063 %}
{# only display this link for sources in the CANTUS segment #}
<br>
<a href="{% url "chant-list" source.id %}" class="guillemet" target="_blank">View all chants</a>
{% endif %}
<a href="{% url "source-inventory" source.id %}" class="guillemet" target="_blank">View full inventory</a>
Expand Down

0 comments on commit 9074c25

Please sign in to comment.