conference-archive/confarchive/templates/conference.html

195 lines
4.9 KiB
HTML
Raw Permalink Normal View History

2023-09-15 19:04:41 +01:00
{% extends "base.html" %}
2023-09-21 04:59:17 +01:00
{% block style %}
<style>
2023-09-22 21:00:56 +01:00
.images {
2023-09-24 18:47:47 +01:00
position: absolute;
right: -200px;
top: 0;
width: 180px;
2023-09-22 21:00:56 +01:00
}
.image {
2023-09-24 18:47:47 +01:00
max-width: 100%;
2023-09-22 21:00:56 +01:00
}
.container {
position: relative;
}
2023-09-21 04:59:17 +01:00
</style>
{% endblock %}
{% set show_images = True %}
2023-09-15 19:04:41 +01:00
{% block title %}{{ item.title }}{% endblock %}
{% block content %}
2023-09-22 21:00:56 +01:00
2023-09-15 19:04:41 +01:00
<div class="container">
2023-09-22 21:00:56 +01:00
{% 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 %}
2023-09-15 19:04:41 +01:00
<div class="row">
<h1>{{ item.title }}</h1>
<p><a href="{{ url_for("index") }}">home</a></p>
2023-09-21 04:59:17 +01:00
<div>
2023-09-22 21:00:56 +01:00
{% if item.series %}
2023-09-21 04:59:17 +01:00
<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>
2023-09-22 21:00:56 +01:00
{% endif %}
2023-09-21 04:59:17 +01:00
<div>start: {{ item.start }}</div>
<div>end: {{ item.end }}</div>
2023-09-15 19:04:41 +01:00
{% if days %}
2023-09-21 04:59:17 +01:00
<div>days: {{ item.days }}</div>
{% endif %}
{# <div>short name: {{ item.short_name }}</div> #}
{% if item.venue %}
{% set country = item.venue.city.country %}
<div>
venue: {{ item.venue.name }}
{% if item.venue.wikidata_qid %}
<a href="https://www.wikidata.org/wiki/{{ item.venue.wikidata_qid }}">Wikidata</a>
{% endif %}
</div>
<div>
city: {{ item.venue.city.name }}
{% if item.venue.city.wikidata_qid %}
<a href="https://www.wikidata.org/wiki/{{ item.venue.city.wikidata_qid }}">Wikidata</a>
{% endif %}
</div>
<div>country: {{ country.name }} {{ country.flag }}</div>
{% endif %}
{% if item.wikidata_qid %}
<div>wikidata: <a href="https://www.wikidata.org/wiki/{{ item.wikidata_qid }}">{{ item.wikidata_qid }}</a></div>
2023-09-15 19:04:41 +01:00
{% endif %}
2023-09-24 18:48:00 +01:00
{% if item.url %}
<div>Website: <a href="{{ item.url }}">{{ item.url }}</a></div>
{% endif %}
</div>
2023-09-21 04:59:17 +01:00
</div>
{% if is_admin() %}
<form method="POST">
<div>
<label for="title">title</label>
<input type="text" name="title" id="title" value="{{ item.title }}">
</div>
<div>
<label for="short_name">short name</label>
<input type="text" name="short_name" id="short_name" value="{{ item.short_name }}">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
{% endif %}
2023-09-15 19:04:41 +01:00
<h3>Talks</h3>
<p>{{ item.events.count() }} talks</p>
{% for event in item.events %}
2023-09-21 04:59:17 +01:00
<div>
<div>
<p>
🎤
<a href="{{ url_for("event_page", event_id=event.id) }}">{{ event.title }}</a><br>
Speakers:
{% for p in event.people %}
👤
<a href="{{ url_for("person", person_id=p.id) }}">{{ p.name }}</a>
{% endfor %}<br>
2023-09-15 19:04:41 +01:00
{% if event.event_date %}
2023-09-21 04:59:17 +01:00
📅 {{ event.event_date.strftime("%a, %d %b %Y at %H:%M") }}
2023-09-15 19:04:41 +01:00
{% else %}
event date missing
{% endif %}
2023-09-21 04:59:17 +01:00
<a class="event-detail-toggle" href="#">show details</a><br>
</p>
<div class="event-detail" id="event_{{event.id }}" style="display:none">
2023-09-15 19:04:41 +01:00
{% if event.url %}
2023-09-21 04:59:17 +01:00
<p><a href="{{ event.url }}">talk on conference website</a></p>
2023-09-15 19:04:41 +01:00
{% endif %}
{% if event.abstract %}
<p class="card-text">
{% if "<" in event.abstract %}
{{ event.abstract | safe }}
{% else %}
{{ event.abstract }}
{% endif %}
</p>
{% endif %}
{% if event.description %}
<p class="card-text">
{% if "<" in event.description %}
{{ event.description | safe }}
{% else %}
{{ event.description }}
{% endif %}
</p>
{% endif %}
2023-09-21 04:59:17 +01:00
</div>
2023-09-15 19:04:41 +01:00
</div>
</div>
{% endfor %}
</div>
</div>
{% endblock %}
2023-09-21 04:59:17 +01:00
{% block script %}
<script>
// Get all elements with the class "event-detail-toggle"
var toggleLinks = document.querySelectorAll(".event-detail-toggle");
// Loop through each toggle link and attach a click event handler
toggleLinks.forEach(function(link) {
link.addEventListener("click", function(e) {
e.preventDefault(); // Prevent the default link behavior
// Find the parent div of the clicked link
var parentDiv = this.closest("div");
// Find the element with class "event-detail" inside the parent div
var detailElement = parentDiv.querySelector(".event-detail");
// Toggle the display of the detail element
if (detailElement.style.display === "none" || detailElement.style.display === "") {
detailElement.style.display = "block";
this.textContent = "hide detail"; // Change the link text
} else {
detailElement.style.display = "none";
this.textContent = "show detail"; // Change the link text
}
});
});
</script>
{% endblock %}