various improvements

This commit is contained in:
Edward Betts 2023-09-22 21:00:56 +01:00
parent 6922b1bf11
commit d1a46dd422
11 changed files with 504 additions and 74 deletions

View file

@ -2,9 +2,36 @@
{% block title %}{{ item.name }}{% endblock %}
{% block style %}
<style>
.image-container {
float: right;
width: 300px;
}
.image {
max-width: 100%;
}
.text-nowrap {
white-space: nowrap;
}
</style>
{% endblock %}
{% block content %}
<div class="container">
<div class="row">
{% set photo = item.photo_filename() %}
{% if photo %}
<div class="image-container">
<img class="image" src="{{ url_for("static", filename=photo) }}">
</div>
{% endif %}
<h1>{{ item.name }}</h1>
<p>
@ -19,10 +46,6 @@
</p>
{% if item.wikidata_photo %}
<img src="{{ url_for("static", filename="wikidata_photo/thumb/" + item.wikidata_photo.0) }}">
{% endif %}
{% set search_for = item.name + ' ' + " haswbstatement:P31=Q5" %}
<p><a href="https://www.wikidata.org/w/index.php?search={{ search_for | urlencode }}&title=Special%3ASearch&ns0=1&ns120=1">Search for {{ item.name }} on Wikidata</a></p>
@ -42,25 +65,57 @@
<button type="submit" class="btn btn-primary">delete</button>
</form>
{% if show_wikidata_matches %}
{% if wikidata_hits %}
<p>Possible Wikidata matches</p>
<ul>
{% for hit in wikidata_hits %}
<li>
<a href="https://www.wikidata.org/wiki/{{ hit.qid }}">{{ hit.qid }}</a>
{{ hit.label }} &mdash; {{ hit.description }}
</li>
{% endfor %}
</ul>
{% elif not item.wikidata_qid %}
<p>No similar names found on Wikidata</p>
{% endif %}
{% endif %}
{% set bio_source = item.bio_source() %}
{% if bio_source %}
<h2>Biography</h2>
<blockquote>
<div>{{ bio_source.bio | safe }}</div>
<div>&mdash; biography from
<a href="{{ url_for("conference_page", short_name=bio_source.conference.short_name) }}">{{ bio_source.conference.title }}</a><br>
<a href="{{ bio_source.url }}">{{ bio_source.url }}</a>
</div>
</blockquote>
{% else %}
<p>No biography available.</p>
{% endif %}
<h2>Conferences</h2>
<p>{{ item.conferences_association.count() }} known conferences</p>
{% for apperance in item.conference_by_time() %}
{% set conf = apperance.conference %}
<div>
<h3>👥 {{ conf.title }}
<h3>👥
<a href="{{ url_for("conference_page", short_name=conf.short_name) }}">{{ conf.title }}</a>
<small>📅 {{ conf.start.strftime("%d %b %Y") }}</small>
</h3>
{% if apperance.bio %}<p>Biography: {{ apperance.bio | safe }}</p>{% endif %}
{% if 0 and apperance.bio %}<p>Biography: {{ apperance.bio | safe }}</p>{% endif %}
</div>
{% for event in apperance.events %}
<div>
<h4>
🎤
<a href="{{ url_for("event_page", event_id=event.id) }}">{{ event.title }}</a>
<small>
&nbsp;&nbsp;🎤
<a href="{{ url_for("event_page", event_id=event.id) }}">{{ event.title }}</a><br>
&nbsp;&nbsp;
<span class="text-nowrap">
{% if event.event_date %}
{{ event.event_date.strftime("%d %b %Y") }}
{% else %}
@ -68,8 +123,7 @@
{% endif %}
<a class="event-detail-toggle" href="#">show details</a>
</small>
</h4>
</span>
<div class="event-detail" id="event_{{event.id }}" style="display:none">
<p>
@ -97,13 +151,16 @@
{% endif %}
</div>
{% endif %}
{% if event.people_detail.count() > 1 %}
<div>
Other people:
{% for p in event.people %}
{% if p.id != item.id %}
<a href="{{ url_for(request.endpoint, person_id=p.id) }}">{{ p.name }}</a>
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
</div>