Skip to content

Commit cab7b83

Browse files
committed
Merge branch 'develop'
2 parents 7d26d11 + c927c5b commit cab7b83

File tree

6 files changed

+200
-24
lines changed

6 files changed

+200
-24
lines changed

compose/production/django/start

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ python /app/manage.py migrate
88
python /app/manage.py autopopulate_main_menus --add-home-links
99
python /app/manage.py collectstatic --noinput
1010
python /app/manage.py vocab init
11-
python manage.py search_index --rebuild -f &
11+
python /app/manage.py search_index --rebuild -f &
1212
python /app/manage.py zotero_import --delete &
1313
/usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:5000 --chdir=/app --timeout 180 --forwarded-allow-ips="*"
Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,57 @@
1-
<dt>{% if direct %}is {{ label }}{% else %}has {{ label|cut:' of' }}{% endif %}</dt>
2-
<dd>
1+
<li>
2+
{% if level == 1 %}
3+
{% if related.relationships.count > 1 or related.related_to.count > 1 %}
4+
<button
5+
class="relationship-group"
6+
data-toggle="collapse"
7+
href="#related-{{ related.pk }}"
8+
role="button"
9+
aria-expanded="false"
10+
aria-controls="related-{{ related.pk }}"
11+
aria-label="Expand/collapse"
12+
></button>
13+
{% endif %}
14+
{% endif %}
15+
316
{% if related.get_radical_markers %}
417
{% for m in related.get_radical_markers_range %}
518
{# Custom phrygian cap icon #}
619
<span class="small-icon radical"></span>
720
{% endfor %}
821
{% endif %}
922

23+
{% if label %}<span class="label">{{ label|capfirst }}:</span>{% endif %}
1024
<a href="{% url 'resource-detail' related.pk %}">{{ related.title }}</a>
11-
{% include "core/includes/type.html" with resource=related %}
12-
</dd>
13-
{% for classification in relationship.get_classification %}
14-
<dd class="{{ classification.label }}">{{ classification.label }}</dd>
25+
26+
{% for classification in related.get_classification %}
27+
<span class="{{ classification.label }}">{{ classification.label }}</span>
28+
{% if not forloop.last %}
29+
<span class="separator">|</span>
30+
{% endif %}
1531
{% endfor %}
32+
33+
{% if level != 1 %}
34+
{% include "core/includes/type.html" with resource=related %}
35+
{% endif %}
36+
37+
{% if level < 2 %}
38+
{% if related.relationships.count or related.related_to.count %}
39+
<ul class="collapse" id="related-{{ related.pk }}">
40+
{% if related.relationships.count %}
41+
{% for related_resource in related.relationships.all %}
42+
{% if related_resource.related_to != object %}
43+
{% include "core/includes/relationship.html" with label=related_resource.relationship_type.label level=level|add:1 related=related_resource.related_to %}
44+
{% endif %}
45+
{% endfor %}
46+
{% endif %}
47+
{% if related.related_to.count %}
48+
{% for related_resource in related.get_related_resources %}
49+
{% if related_resource.resource != object %}
50+
{% include "core/includes/relationship.html" with label=related_resource.relationship_type.label level=level|add:1 related=related_resource.resource %}
51+
{% endif %}
52+
{% endfor %}
53+
{% endif %}
54+
</ul>
55+
{% endif %}
56+
{% endif %}
57+
</li>

radical_translations/core/templates/core/resource_detail.html

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,20 +148,38 @@ <h2>Contributions</h2>
148148
{% endif %}
149149

150150
{% if object.relationships.count or object.related_to.count %}
151+
<section class="related-resources">
151152
<h2>Related resources</h2>
152-
<dl>
153+
<ul class="relationship-list">
153154
{% if object.relationships.count %}
154-
{% for relationship in object.relationships.all %}
155-
{% include "core/includes/relationship.html" with direct=True label=relationship.relationship_type.label related=relationship.related_to %}
155+
{% regroup object.relationships.all by relationship_type as relationships %}
156+
{% for relationship in relationships %}
157+
<li>
158+
<span class="relationship-group relationship-group-label" data-toggle="collapse" href="#{{ relationship.grouper.label|slugify }}" role="button" aria-expanded="true" aria-controls="{{ relationship.grouper.label|slugify }}">{{ relationship.grouper.label|cut:' of'|capfirst }}{{relationship.list|length|pluralize}}</span>
159+
<ul class="collapse show" id="{{ relationship.grouper.label|slugify }}">
160+
{% for related in relationship.list %}
161+
{% include "core/includes/relationship.html" with level=1 related=related.related_to %}
162+
{% endfor %}
163+
</ul>
164+
</li>
156165
{% endfor %}
157166
{% endif %}
158167

159168
{% if object.related_to.count %}
160-
{% for relationship in object.get_related_resources %}
161-
{% include "core/includes/relationship.html" with label=relationship.relationship_type.label related=relationship.resource %}
169+
{% regroup object.get_related_resources by relationship_type as relationships %}
170+
{% for relationship in relationships %}
171+
<li>
172+
<span class="relationship-group relationship-group-label" data-toggle="collapse" href="#{{ relationship.grouper.label|slugify }}" role="button" aria-expanded="true" aria-controls="{{ relationship.grouper.label|slugify }}">{{ relationship.grouper.label|cut:' of'|capfirst }}{{relationship.list|length|pluralize}}</span>
173+
<ul class="collapse show" id="{{ relationship.grouper.label|slugify }}">
174+
{% for related in relationship.list %}
175+
{% include "core/includes/relationship.html" with level=1 related=related.resource %}
176+
{% endfor %}
177+
</ul>
178+
</li>
162179
{% endfor %}
163180
{% endif %}
164-
</dl>
181+
</ul>
182+
</section>
165183
{% endif %}
166184

167185
{% if object.summary %}

radical_translations/static/css/project.css

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12303,4 +12303,44 @@ Initial code from this Stackoverflow answer https://stackoverflow.com/a/49373879
1230312303
#key {
1230412304
border: 1px solid #000;
1230512305
}
12306+
}
12307+
.related-resources {
12308+
margin-bottom: 16px;
12309+
margin-bottom: 1rem;
12310+
}
12311+
.related-resources ul {
12312+
list-style: none;
12313+
}
12314+
.related-resources ul.relationship-list {
12315+
padding-left: 0;
12316+
}
12317+
.related-resources ul li ul li {
12318+
margin-bottom: 8px;
12319+
margin-bottom: 0.5rem;
12320+
}
12321+
.related-resources [aria-expanded]::before {
12322+
display: inline-block;
12323+
margin-right: 8px;
12324+
margin-right: 0.5rem;
12325+
vertical-align: text-top;
12326+
}
12327+
.related-resources .relationship-group[aria-expanded=true]::before {
12328+
content: url("/static/fontawesome/svgs/solid/caret-down.svg");
12329+
width: 10px;
12330+
}
12331+
.related-resources .relationship-group[aria-expanded=false]::before {
12332+
content: url("/static/fontawesome/svgs/solid/caret-right.svg");
12333+
width: 7px;
12334+
}
12335+
.related-resources .relationship-group-label {
12336+
font-family: "Oswald", sans-serif;
12337+
font-size: 28px;
12338+
font-size: 1.75rem;
12339+
font-variation-settings: "wdth" 100, "wght" 700;
12340+
font-weight: 700;
12341+
}
12342+
.related-resources button {
12343+
background: none;
12344+
border: none;
12345+
padding: 0;
1230612346
}

radical_translations/static/css/project.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

radical_translations/static/sass/project.scss

Lines changed: 86 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ a {
4747

4848
body {
4949
font-family: Lora, serif;
50-
font-variation-settings: "wdth" 100, "wght" 400;
50+
font-variation-settings:
51+
"wdth" 100,
52+
"wght" 400;
5153

5254
background: url("../images/rt-bg.svg") no-repeat top left
5355
lighten($old-yellow, 30%);
@@ -72,7 +74,9 @@ body {
7274

7375
b,
7476
strong {
75-
font-variation-settings: "wdth" 100, "wght" 700;
77+
font-variation-settings:
78+
"wdth" 100,
79+
"wght" 700;
7680
}
7781

7882
.close {
@@ -218,7 +222,9 @@ footer {
218222

219223
&.date {
220224
font-size: 1.5em;
221-
font-variation-settings: "wdth" 100, "wght" 700;
225+
font-variation-settings:
226+
"wdth" 100,
227+
"wght" 700;
222228
font-weight: 700;
223229

224230
&::before {
@@ -299,7 +305,9 @@ h5,
299305
h6,
300306
.card-header {
301307
font-family: Oswald, sans-serif;
302-
font-variation-settings: "wdth" 100, "wght" 700;
308+
font-variation-settings:
309+
"wdth" 100,
310+
"wght" 700;
303311
font-weight: 700;
304312
}
305313

@@ -310,7 +318,9 @@ h6,
310318
.title {
311319
font-family: Oswald, sans-serif;
312320
font-size: 1.25rem;
313-
font-variation-settings: "wdth" 100, "wght" 700;
321+
font-variation-settings:
322+
"wdth" 100,
323+
"wght" 700;
314324
}
315325

316326
.site-title {
@@ -409,7 +419,9 @@ h6,
409419
nav,
410420
.main-menu {
411421
font-family: Oswald, sans-serif;
412-
font-variation-settings: "wdth" 100, "wght" 400;
422+
font-variation-settings:
423+
"wdth" 100,
424+
"wght" 400;
413425

414426
a {
415427
text-decoration: none;
@@ -441,7 +453,9 @@ nav,
441453
display: block;
442454
font-family: "Oswald", sans-serif;
443455
font-size: 4rem;
444-
font-variation-settings: "wdth" 100, "wght" 600;
456+
font-variation-settings:
457+
"wdth" 100,
458+
"wght" 600;
445459
line-height: 1;
446460
margin: 0;
447461
min-width: 280px;
@@ -1614,11 +1628,15 @@ Initial code from this Stackoverflow answer https://stackoverflow.com/a/49373879
16141628
}
16151629

16161630
.lora-reg {
1617-
font-variation-settings: "wdth" 100, "wght" 400;
1631+
font-variation-settings:
1632+
"wdth" 100,
1633+
"wght" 400;
16181634
}
16191635

16201636
.lora-bold {
1621-
font-variation-settings: "wdth" 100, "wght" 700;
1637+
font-variation-settings:
1638+
"wdth" 100,
1639+
"wght" 700;
16221640
}
16231641

16241642
// Country colours
@@ -1668,7 +1686,9 @@ $viz-resource-colour: $old-yellow;
16681686

16691687
.label {
16701688
color: $radical-red;
1671-
font-variation-settings: "wdth" 100, "wght" 700;
1689+
font-variation-settings:
1690+
"wdth" 100,
1691+
"wght" 700;
16721692
opacity: 1;
16731693
text-transform: uppercase;
16741694

@@ -1854,3 +1874,59 @@ $viz-resource-colour: $old-yellow;
18541874
border: 1px solid #000;
18551875
}
18561876
}
1877+
1878+
.related-resources {
1879+
margin-bottom: 1rem;
1880+
1881+
ul {
1882+
list-style: none;
1883+
1884+
&.relationship-list {
1885+
padding-left: 0;
1886+
}
1887+
1888+
li {
1889+
ul {
1890+
li {
1891+
margin-bottom: 0.5rem;
1892+
}
1893+
}
1894+
}
1895+
}
1896+
1897+
[aria-expanded] {
1898+
&::before {
1899+
display: inline-block;
1900+
margin-right: 0.5rem;
1901+
vertical-align: text-top;
1902+
}
1903+
}
1904+
1905+
.relationship-group[aria-expanded="true"] {
1906+
&::before {
1907+
content: url("/static/fontawesome/svgs/solid/caret-down.svg");
1908+
width: 10px;
1909+
}
1910+
}
1911+
.relationship-group[aria-expanded="false"] {
1912+
&::before {
1913+
content: url("/static/fontawesome/svgs/solid/caret-right.svg");
1914+
width: 7px;
1915+
}
1916+
}
1917+
1918+
.relationship-group-label {
1919+
font-family: "Oswald", sans-serif;
1920+
font-size: 1.75rem;
1921+
font-variation-settings:
1922+
"wdth" 100,
1923+
"wght" 700;
1924+
font-weight: 700;
1925+
}
1926+
1927+
button {
1928+
background: none;
1929+
border: none;
1930+
padding: 0;
1931+
}
1932+
}

0 commit comments

Comments
 (0)