conference-archive/templates/top_speakers.html

177 lines
4.4 KiB
HTML
Raw Normal View History

2023-09-15 19:04:41 +01:00
{% extends "base.html" %}
2023-09-22 21:00:56 +01:00
{% 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;
}
2023-09-24 08:51:34 +01:00
.person {
display: flex;
align-items: top;
margin-bottom: 10px;
}
.info {
flex: 1; /* Allow text to take remaining space */
padding-right: 10px; /* Add spacing between text and image */
}
img.photo {
max-width: 120px; /* Set max width for images */
height: auto; /* Maintain image aspect ratio */
}
</style>
2023-09-22 21:00:56 +01:00
</style>
{% endblock %}
2023-09-24 08:51:34 +01:00
{% set show_images = False %}
2023-09-22 21:00:56 +01:00
2023-09-15 19:04:41 +01:00
{% block title %}Conference archive{% endblock %}
{% block content %}
2023-09-22 21:00:56 +01:00
<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 %}
2023-09-15 19:04:41 +01:00
<h1>Conference archive</h1>
<form action="{{ url_for("search_people") }}">
<div class="mb-3">
<label for="q" class="form-label">speaker name</label>
<input type="text" class="form-control" name="q" id="q">
</div>
<button type="submit" class="btn btn-primary">Search</button>
</form>
2023-09-21 04:59:17 +01:00
<h3>Speaker/conference frequency distribution</h3>
<p>Distribution of speakers by conference count.</p>
{% for conf_count, speaker_count in speaker_counts %}
<div>
{{ plural(conf_count, "conference") }}:
{{ plural(speaker_count, "speaker") }}
</div>
{% endfor %}
2023-09-15 19:04:41 +01:00
<h3>Top speakers</h3>
<ul>
{% for person, count in top_speakers %}
2023-09-22 21:00:56 +01:00
{% if loop.first or loop.previtem[1] != count %}
<h4>{{ count }} conferences</h4>
{% endif %}
2023-09-24 08:51:34 +01:00
<div class="person">
{% set photo = person.photo_filename() %}
<span class="info" id="person-{{ person.id }}">
2023-09-21 04:59:17 +01:00
👤
2023-09-24 08:51:34 +01:00
<a href="{{ url_for("person", person_id=person.id) }}">{{ person.name }}</a><br>
2023-09-21 04:59:17 +01:00
({{ count }} conferences, {{ person.event_count }} talks)
2023-09-22 21:00:56 +01:00
{% if person.photo_filename() %}📷{% endif %}
2023-09-15 19:04:41 +01:00
{% if person.wikidata_qid %}
2023-09-21 04:59:17 +01:00
<a href="https://www.wikidata.org/wiki/{{ person.wikidata_qid }}">Wikidata</a>
2023-09-15 19:04:41 +01:00
{% endif %}
2023-09-22 21:00:56 +01:00
</span>
2023-09-24 08:51:34 +01:00
{% if photo %}
<img class="photo" src="{{ url_for("static", filename=photo) }}" alt="{{ person.name }}">
{% endif %}
2023-09-21 04:59:17 +01:00
</div>
2023-09-15 19:04:41 +01:00
{% endfor %}
2023-09-22 21:00:56 +01:00
</div>
2023-09-15 19:04:41 +01:00
{% endblock %}
2023-09-22 21:00:56 +01:00
{% block script %}
{% if show_images %}
<script>
{# var person_ids = {{ photo_person_ids | tojson }}; #}
var left = {{ left | tojson }};
var right = {{ right | tojson }};
var lines = {};
2023-09-15 19:04:41 +01:00
2023-09-22 21:00:56 +01:00
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 %}