parent
08a4ffa89f
commit
22067b97e7
|
@ -37,7 +37,11 @@ class Series(TimeStampedModel):
|
|||
slug = Column(String, unique=True)
|
||||
wikidata_qid = Column(String, unique=True)
|
||||
|
||||
conferences = relationship("Conference", back_populates="series")
|
||||
conferences = relationship(
|
||||
"Conference",
|
||||
order_by="Conference.start",
|
||||
back_populates="series",
|
||||
)
|
||||
|
||||
|
||||
class Conference(TimeStampedModel):
|
||||
|
|
8
main.py
8
main.py
|
@ -269,6 +269,14 @@ order by num
|
|||
return database.session.execute(sql)
|
||||
|
||||
|
||||
@app.route("/series")
|
||||
def list_series() -> str:
|
||||
"""Page showing list of conference series."""
|
||||
items = model.Series.query
|
||||
|
||||
return flask.render_template("series/list.html", items=items)
|
||||
|
||||
|
||||
@app.route("/speakers")
|
||||
def top_speakers_page() -> str:
|
||||
top = top_speakers()
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<form action="{{ url_for("search_people") }}">
|
||||
<a href="{{ url_for("index") }}">conferences</a>
|
||||
| <a href="{{ url_for("top_speakers_page") }}">speakers</a>
|
||||
| <a href="{{ url_for("list_series") }}">series</a>
|
||||
|
||||
<input type="text" class="form-control" placeholder="speaker name" name="q" id="q">
|
||||
<button type="submit" class="btn btn-primary">search</button>
|
||||
|
|
38
templates/series/list.html
Normal file
38
templates/series/list.html
Normal file
|
@ -0,0 +1,38 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Series – Conference archive{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Conference archive</h1>
|
||||
|
||||
<p>{{ items.count() }} series found</p>
|
||||
{% for item in items %}
|
||||
<h3>{{ item.name }}</h3>
|
||||
{% for conf in item.conferences %}
|
||||
|
||||
<div style="margin-bottom:1.5rem">
|
||||
👥
|
||||
<a href="{{ url_for("conference_page", short_name=conf.short_name) }}">{{ conf.title }}</a>
|
||||
📅
|
||||
{{ conf.start.strftime("%d %b %Y") }}
|
||||
<br/>
|
||||
{% if conf.venue %}
|
||||
📍
|
||||
{{ conf.venue.name }}
|
||||
–
|
||||
{{ conf.venue.city.name }},
|
||||
{{ conf.venue.city.country.name }}
|
||||
{{ conf.venue.city.country.flag }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
|
||||
{{ (conf.end - conf.start).days + 1 }} days,
|
||||
{{ conf.events.count() }} talks,
|
||||
{{ conf.people_detail.count() }} speakers<br/>
|
||||
</div>
|
||||
|
||||
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
Loading…
Reference in a new issue