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,22 +2,22 @@
{% block style %}
<style>
.image-container {
width: 200px; /* Adjust this to your desired square size */
height: 240px; /* Same as width for a square */
display: inline-flex; /* Use inline-flex to display containers horizontally */
margin-right: 10px; /* Add some spacing between images (adjust as needed) */
justify-content: center; /* Horizontally center the content */
align-items: center; /* Vertically center the content */
overflow: hidden; /* Hide overflowing image parts */
}
.images {
position: absolute;
right: -200px;
top: 0;
width: 180px;
}
.image {
max-width: 100%;
}
.container {
position: relative;
}
.image-container img {
max-width: 100%;
max-height: 100%;
object-fit: cover; /* Crop and scale the image to fit the container */
object-position: center; /* Center the cropping horizontally */
}
</style>
{% endblock %}
@ -26,17 +26,36 @@
{% block title %}{{ item.title }}{% endblock %}
{% block content %}
<div class="container">
{% if show_images %}
<div class="images">
{% for person in item.people %}
{% set photo = person.photo_filename() %}
{% if photo %}
<div class="image-container">
<a href="{{ url_for("person", person_id=person.id) }}">
{{ person.name }}<br>
<img class="image" src="{{ url_for("static", filename=photo) }}" alt="{{ person.name}}" title="{{ person.name}}">
</a>
</div>
{% endif %}
{% endfor %}
</div>
{% endif %}
<div class="row">
<h1>{{ item.title }}</h1>
<p><a href="{{ url_for("index") }}">home</a></p>
<div>
{% if item.series %}
<div>series: {{ item.series.name }}
{% if item.series.wikidata_qid %}
<a href="https://www.wikidata.org/wiki/{{ item.series.wikidata_qid }}">Wikidata</a>
{% endif %}
</div>
{% endif %}
<div>start: {{ item.start }}</div>
<div>end: {{ item.end }}</div>
{% if days %}
@ -64,20 +83,6 @@
{% endif %}
</div>
{% if show_images %}
<div>
{% for person in item.people %}
{% if person.wikidata_photo %}
<span class="image-container">
<a href="{{ url_for("person", person_id=person.id) }}">
<img src="{{ url_for("static", filename=person_image_filename(person.id)) }}" alt="{{ person.name}}" title="{{ person.name}}">
</a>
</span>
{% endif %}
{% endfor %}
</div>
{% endif %}
<h3>Talks</h3>
<p>{{ item.events.count() }} talks</p>