Code for importing data from pretalx
This commit is contained in:
parent
1001c51bc1
commit
e48acab387
5 changed files with 392 additions and 5 deletions
83
confarchive/templates/import/event.html
Normal file
83
confarchive/templates/import/event.html
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Import – Conference archive{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Import</h1>
|
||||
|
||||
<form method="POST">
|
||||
<button>run import</button>
|
||||
</form>
|
||||
|
||||
<h2>event</h2>
|
||||
<div>
|
||||
{{ event.slug }} –
|
||||
{{ prefer_en_label(event.name) }}
|
||||
({{ event.date_from }} to {{ event.date_to }})
|
||||
</div>
|
||||
|
||||
|
||||
<h2>rooms</h2>
|
||||
<p>room count: {{ rooms.count }}</p>
|
||||
<ul>
|
||||
{% for room in rooms["results"] %}
|
||||
<li>{{ prefer_en_label(room.name) }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h2>speakers</h2>
|
||||
<p>speaker count: {{ speakers | count }}</p>
|
||||
{% for speaker in speakers %}
|
||||
<div>
|
||||
<h3 id="{{ speaker.code }}">{{ speaker.name }}</h3>
|
||||
{% if speaker.avatar %}
|
||||
<div><img src="{{ speaker.avatar }}" style="max-width:200px"></div>
|
||||
{% endif %}
|
||||
{% if speaker.biography %}
|
||||
<blockquote>
|
||||
{% for paragraph in speaker.biography.splitlines() %}
|
||||
<p>{{ paragraph }}</p>
|
||||
{% endfor %}
|
||||
</blockquote>
|
||||
{% else %}
|
||||
<p>No biography</p>
|
||||
{% endif %}
|
||||
<p>{{ plural(person_candidates[speaker.code].count(), "candidate") }} found</p>
|
||||
{% for candidate in person_candidates[speaker.code] %}
|
||||
<div><a href="{{ url_for("person", person_id=candidate.id) }}">{{ candidate.name }}</a></div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{#<pre>{{ speaker | pprint }}</pre> #}
|
||||
{% endfor %}
|
||||
|
||||
<h2>talks</h2>
|
||||
<p>talk count: {{ talks.count }}</p>
|
||||
{% for talk in talks["results"] %}
|
||||
<div>
|
||||
<h3>{{ talk.title }}</h3>
|
||||
{% if talk.speakers %}
|
||||
<div>speakers:
|
||||
{% for speaker in talk.speakers %}
|
||||
<a href="#{{ speaker.code }}">{{ speaker.name }}</a> ({{ speaker.code }})
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div>no speakers</div>
|
||||
{% endif %}
|
||||
<div>start: {{ talk.slot.start }}</div>
|
||||
<div>duration: {{ talk.duration }}</div>
|
||||
<div>room: {{ prefer_en_label(talk.slot.room) }}</div>
|
||||
<div>track: {{ prefer_en_label(talk.track) }}</div>
|
||||
<h4>abstract</h3>
|
||||
<div>{{ talk.abstract }}</div>
|
||||
<h4>description</h3>
|
||||
<div>{{ talk.description }}</div>
|
||||
</div>
|
||||
{# <pre>{{ talk | pprint }}</pre> #}
|
||||
{% endfor %}
|
||||
|
||||
<form method="POST">
|
||||
<button>run import</button>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
40
confarchive/templates/import/start.html
Normal file
40
confarchive/templates/import/start.html
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Import – Conference archive{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Import</h1>
|
||||
|
||||
<form>
|
||||
<div>
|
||||
<label for="url">URL</label>
|
||||
<input name="url" id="url" size="60"/>
|
||||
</div>
|
||||
<button>next</button>
|
||||
</form>
|
||||
|
||||
{% if events %}
|
||||
<div style="margin-top: 1.5rem">
|
||||
{% for event in events %}
|
||||
<hr>
|
||||
<h3>
|
||||
{% set href = url_for("import_event", hostname=hostname, slug=event.slug) %}
|
||||
<a href="{{ href }}">
|
||||
{{ prefer_en_label(event.name) or "[ anme missing ]" }}
|
||||
</a>
|
||||
</h3>
|
||||
<div>
|
||||
{{event.slug}} ({{ event.date_from }} to {{ event.date_to }})
|
||||
</div>
|
||||
{% if event.existing %}
|
||||
{% set conf = event.existing %}
|
||||
<div>
|
||||
Already loaded:
|
||||
<a href="{{ url_for("conference_page", short_name=conf.short_name) }}">{{ conf.title }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if event.people_detail.count() > 1 %}
|
||||
{% if event.people_detail | count > 1 %}
|
||||
<div>
|
||||
Other people:
|
||||
{% for p in event.people %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue