/
source_list.html
121 lines (119 loc) · 6.54 KB
/
source_list.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{% extends "base.html" %}
{% block content %}
<title>Browse Sources | Cantus Manuscript Database</title>
<script src="/static/js/source_list.js"></script>
<div class="mr-3 p-3 col-md-12 mx-auto bg-white rounded">
<!-- global search bar-->
<object align="right" class="search-bar">
{% include "global_search_bar.html" %}
</object>
<h3>Browse Sources</h3>
<small>Displaying {{ page_obj.start_index }}-{{ page_obj.end_index }} of <b>{{ page_obj.paginator.count }}</b> sources</small>
<form method="get">
<div class="form-row align-items-end">
<div class="form-group m-1 col-lg">
<label for="segmentFilter"><small>Segment</small></label>
<select id="segmentFilter" name="segment" class="form-control custom-select custom-select-sm">
<option value="">- Any -</option>
<option value="4063">CANTUS Database</option>
<option value="4064">Bower Sequence Database</option>
</select>
</div>
<div class="form-group m-1 col-lg">
<label for="generalSearch"><small>General search (siglum, city, description ..)</small></label>
<input type="text" class="form-control form-control-sm" name="general"
placeholder="Enter any part of a word" value="{{ request.GET.general }}" id="generalSearch">
</div>
<div class="form-group m-1 col-lg">
<label for="indexingSearch"><small>Indexing Notes</small></label>
<input type="text" class="form-control form-control-sm" name="indexing"
placeholder="Search for indexers, proofreaders, editors." value="{{ request.GET.indexing }}"
id="indexingSearch">
</div>
</div>
<div class="form-row form-row align-items-end">
<div class="form-group m-1 col-lg">
<label for="provenanceFilter"><small>Provenance (origin/history)</small></label>
<select id="provenanceFilter" name="provenance" class="form-control custom-select custom-select-sm">
<option value="">- Any -</option>
{% for provenance in provenances %}
<option value="{{ provenance.id }}">{{ provenance.name }}</option>
{% endfor %}
</select>
</div>
<div class="form-group m-1 col-lg">
<label for="centuryFilter"><small>Century</small></label>
<select id="centuryFilter" name="century" class="form-control custom-select custom-select-sm">
<option value="">- Any -</option>
{% for century in centuries %}
<option value="{{ century.id }}">{{ century.name }}</option>
{% endfor %}
</select>
</div>
<div class="form-group m-1 col-lg">
<label for="fullSourceFilter"><small>Full source/Fragment</small></label>
<select id="fullSourceFilter" name="fullSource" class="form-control custom-select custom-select-sm">
<option value="">- Any -</option>
<option value="true">Complete source</option>
<option value="false">Fragment</option>
</select>
</div>
<div class="form-group m-1 col-lg">
<button type="submit" class="btn btn-dark btn-sm" id="btn-submit"> Apply </button>
<a href="/sources/?segment={{ request.GET.segment }}" class="btn btn-dark btn-sm" id="btn-reset"> Reset </a>
</div>
</div>
</form>
{% if sources %}
<table class="table table-sm small table-bordered table-responsive">
<thead>
<tr>
<th scope="col" class="text-wrap" style="text-align:center">Source</th>
<th scope="col" class="text-wrap" style="text-align:center">Siglum</th>
<th scope="col" class="text-wrap" style="text-align:center">Summary</th>
<th scope="col" class="text-wrap" style="text-align:center">Date/Origin</th>
<th scope="col" class="text-wrap" style="text-align:center">Image Link</th>
<th scope="col" class="text-wrap" style="text-align:center">Chants<br>/ Melodies</th>
</tr>
</thead>
<tbody>
{% for source in sources %}
<tr>
<td class="text-wrap" style="text-align:center" title="{{ source.title }}">
<a href="{% url 'source-detail' source.id %}"><b>{{ source.title|truncatechars_html:50 }}</b></a>
</td>
<td class="text-wrap" style="text-align:center">
<b>{{ source.siglum }}</b>
</td>
<td class="text-wrap" style="text-align:center" title="{{ source.summary|default:""|truncatechars_html:500 }}">
{{ source.summary|default:""|truncatechars_html:120 }}
</td>
<td class="text-wrap" style="text-align:center">
{% if source.century.exists %}
<b><a href="{% url 'century-detail' source.century.first.id %}">{{ source.century.first.name }}</a></b><br>
{% endif %}
{% if source.provenance %}
<a href="{% url 'provenance-detail' source.provenance.id %}">{{ source.provenance.name }}</a>
{% endif %}
</td>
<td class="text-wrap" style="text-align:center">
{% if source.image_link %}
<a href="{{ source.image_link }}" target="_blank">Images</a>
{% endif %}
</td>
<td class="text-wrap" style="text-align:center">
<b>{{ source.number_of_chants|default_if_none:"0" }}</b>
{% if source.number_of_melodies %}
<br>/ {{ source.number_of_melodies }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
No sources found.
{% endif %}
{% include "pagination.html" %}
</div>
{% endblock %}