Improve property page

Allow sorting property values by name
Use label from different language if English label is missing
This commit is contained in:
Edward Betts 2019-09-14 13:26:16 +01:00
parent 3215333caf
commit a20666f9d4
3 changed files with 67 additions and 16 deletions

View file

@ -21,7 +21,7 @@
<h3>{{ prop_label }} ({{ key }})</h3>
{% for claim in claims %}
{% set claim_qid = claim.mainsnak.datavalue.value.id %}
<a href="{{ url_for('find_more_page', property_id=key[1:], item_id=claim_qid[1:]) }}">{{ other[claim_qid] }}</a> ({{ claim_qid }})
<a href="{{ url_for('find_more_page', property_id=key[1:], item_id=claim_qid[1:]) }}">{{ other[claim_qid] or '[ label missing ]' }}</a> ({{ claim_qid }})
{% endfor %}
{% endif %}
{% endfor %}

View file

@ -8,6 +8,14 @@
<p><a href="{{ url_for('index') }}">back to index</a></p>
<p>Sort order:
{% if order == 'name' %}
<b>name</b> or <a href="?sort=count">count</a>
{% else %}
<a href="?sort=name">name</a> or <b>count</b>
{% endif %}
</p>
<ul>
{% for row in rows if '/' in row.object.value %}
{% set qid = row.object.value.rpartition('/')[2] %}