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

@ -11,7 +11,7 @@
body {
font-family: monospace;
margin: 40px auto;
max-width: 1040px;
max-width: 900px;
line-height: 1.6;
font-size: 18px;
color: #444;

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>

24
templates/github.html Normal file
View file

@ -0,0 +1,24 @@
{% extends "base.html" %}
{% block title %}Conference archive{% endblock %}
{% block content %}
<h1>Conference archive</h1>
<p>{{ items | count }} matches found</p>
{% for person, qid, wd_name, photo in items %}
<div>
<a href="{{ url_for("person", person_id=person.id) }}">{{ person.name }}</a>
##
<a href="https://www.wikidata.org/wiki/{{ qid }}">{{ wd_name }} ({{ qid }})</a>
{% if photo %}📷{% endif %}
</div>
{% endfor %}
{% endblock %}
{% block style %}
<style>
.searchmatch { background: lightgreen }
</style>
{% endblock %}

View file

@ -7,6 +7,7 @@
<div class="row">
<h1>Conference archive</h1>
{#
<form action="{{ url_for("search_people") }}">
<div class="mb-3">
<label for="q" class="form-label">speaker name</label>
@ -14,6 +15,7 @@
</div>
<button type="submit" class="btn btn-primary">Search</button>
</form>
#}
<div style="margin-bottom:1rem">
👥

View file

@ -1,5 +1,12 @@
<p>
<form action="{{ url_for("search_people") }}">
<a href="{{ url_for("index") }}">home</a>
| <a href="{{ url_for("events_page") }}">events</a>
| <a href="{{ url_for("top_speakers_page") }}">speakers</a>
<input type="text" class="form-control" placeholder="speaker name" name="q" id="q">
<button type="submit" class="btn btn-primary">search</button>
</form>
</p>

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>

37
templates/reports.html Normal file
View file

@ -0,0 +1,37 @@
{% extends "base.html" %}
{% block title %}Conference archive{% endblock %}
{% block content %}
<h1>Conference archive</h1>
<h2>Reports</h2>
<div>Talks: {{ "{:,d}".format(event_count) }}</div>
<div>Talks with no event date: {{ "{:,d}".format(missing_event_date_count) }}</div>
<div>Speakers: {{ "{:,d}".format(speaker_count) }}</div>
<div>Speakers with no bio: {{ "{:,d}".format(no_bio_count) }}</div>
<div>Speakers with one bio: {{ "{:,d}".format(one_bio_count) }}</div>
<div>Speakers with more than one bio: {{ "{:,d}".format(multiple_bio_count) }}</div>
<h2>Talks with missing dates</h2>
{% for event in missing_event_date %}
<div>{{ event.title }}<br>
&nbsp;{{ event.conference.title }}<br>
&nbsp;GUID: {{ event.guid or "missing" }}
</div>
{% endfor %}
<h2>Speakers with a shorter recent biography</h2>
<p>{{ shorter_recent_bio | count }} found</p>
{% for person, recent_bio_length, longest in shorter_recent_bio %}
<div>
<a href="{{ url_for("person", person_id=person.id) }}">{{ person.name }}</a>
recent bio: {{ recent_bio_length }} vs {{ longest }}
</div>
{% endfor %}
{% endblock %}

View file

@ -17,9 +17,9 @@
<p>Found {{ q.count() }} events matching '{{ search_for }}'</p>
<ul>
{% for item in q %}
<li>
<div>
🎤
<a href="{{ url_for("event_page", event_id=item.id) }}">{{ item.title }}</a>
&mdash;
<a href="{{ url_for("conference_page", short_name=item.conference.short_name) }}">{{ item.conference.title }}</a>

View file

@ -1,8 +1,66 @@
{% extends "base.html" %}
{% block style %}
<script src="{{ url_for("static", filename="leader-line.min.js") }}"></script>
<style>
.right-images {
position: absolute;
right: -280px;
top: 0;
width: 120px;
}
.left-images {
position: absolute;
right: -140px;
top: 0;
width: 120px;
}
.image {
max-width: 100%;
}
.container {
position: relative;
}
</style>
{% endblock %}
{% set show_images = True %}
{% block title %}Conference archive{% endblock %}
{% block content %}
<div class="container">
{% if show_images %}
<div class="left-images">
{% for person, photo in left_photos %}
<div class="image-container" id="image-{{person.id}}">
<a href="{{ url_for("person", person_id=person.id) }}">
<img class="image" src="{{ url_for("static", filename=photo) }}" alt="{{ person.name}}" title="{{ person.name}}">
</a>
</div>
{% endfor %}
</div>
<div class="right-images">
{% for person, photo in right_photos %}
<div class="image-container">
<a href="{{ url_for("person", person_id=person.id) }}">
<img id="image-{{person.id}}" class="image" src="{{ url_for("static", filename=photo) }}" alt="{{ person.name}}" title="{{ person.name}}">
</a>
</div>
{% endfor %}
</div>
{% endif %}
<h1>Conference archive</h1>
<form action="{{ url_for("search_people") }}">
@ -27,17 +85,68 @@
<ul>
{% for person, count in top_speakers %}
{% if loop.first or loop.previtem[1] != count %}
<h4>{{ count }} conferences</h4>
{% endif %}
<div>
<span id="person-{{ person.id }}">
👤
<a href="{{ url_for("person", person_id=person.id) }}">{{ person.name }}</a>
({{ count }} conferences, {{ person.event_count }} talks)
{% if person.wikidata_photo %}📷{% endif %}
{% if person.photo_filename() %}📷{% endif %}
{% if person.wikidata_qid %}
<a href="https://www.wikidata.org/wiki/{{ person.wikidata_qid }}">Wikidata</a>
{% endif %}
</span>
</div>
{% endfor %}
</div>
{% endblock %}
{% block script %}
{% if show_images %}
<script>
{# var person_ids = {{ photo_person_ids | tojson }}; #}
var left = {{ left | tojson }};
var right = {{ right | tojson }};
var lines = {};
window.addEventListener('load', function() {
for(var i =0; i < left.length; i++) {
var id = left[i];
var person = document.getElementById('person-' + id);
var image = document.getElementById('image-' + id);
var line = new LeaderLine(LeaderLine.mouseHoverAnchor(person, 'draw'), image);
line.setOptions({startSocket: 'right', endSocket: 'left', path: 'fluid'});
var line2 = new LeaderLine(LeaderLine.mouseHoverAnchor(image, 'draw'), person);
line2.setOptions({startSocket: 'left', endSocket: 'right', path: 'fluid'});
// lines[id] = line;
}
for(var i =0; i < right.length; i++) {
var id = right[i];
var person = document.getElementById('person-' + id);
var image = document.getElementById('image-' + id);
var line = new LeaderLine(LeaderLine.mouseHoverAnchor(person, 'draw'), image);
line.setOptions({startSocket: 'right', endSocket: 'left', path: 'fluid'});
var line2 = new LeaderLine(LeaderLine.mouseHoverAnchor(image, 'draw'), person);
line2.setOptions({startSocket: 'left', endSocket: 'right', path: 'fluid'});
// lines[id] = line;
}
});
</script>
{% endif %}
{% endblock %}