Skip to content

Commit

Permalink
basic implementation of foreign labels section
Browse files Browse the repository at this point in the history
  • Loading branch information
osma committed Nov 14, 2023
1 parent 200e12a commit 116e3b7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion resource/css/skosmos.css
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ body {
margin-bottom: 0;
}

.term-other-languages a {
.term-other-languages .label {
display: inline-block;
width: 50%;
}
Expand Down
17 changes: 14 additions & 3 deletions src/view/concept-card.inc
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,24 @@
</td>
</tr>
{% endfor %}
{% set foreignLabels = concept.foreignLabels %}
{% if foreignLabels %}
<tr>
<td class="main-table-label px-0">Muunkieliset termit</td>
<td class="main-table-label px-0">{{ 'foreign prefLabels'|trans }}</td>
<td class="term-other-languages align-middle px-0">
<a href="#">A General descriptors</a>
<span>englanti</span>
{% for language,labels in foreignLabels %}
{% for value in labels.prefLabel|default([])|merge(labels.altLabel|default([])) %}
{% if value.type == "skos:prefLabel" and value.lang in request.vocab.config.languages %}
<a class="label" href='{{ concept.uri|link_url(request.vocabid,request.lang, 'page', value.lang) }}' hreflang='{{ value.lang }}'>{{ value.label }}</a>
{% else %}
<span class="label">{{ value.label }}</span>
{% endif %}
{% if loop.first %}<span>{{ language }}</span>{% endif %}
{% endfor %}
{% endfor %}
</td>
</tr>
{% endif %}
<tr>
<td class="main-table-label px-0">URI</td>
<td class="align-middle px-0"><a href="#">{{ concept.uri }}</a></td>
Expand Down

0 comments on commit 116e3b7

Please sign in to comment.