Add country, city and venue.

This commit is contained in:
Edward Betts 2023-09-17 09:46:33 +05:30
parent a0df624f16
commit 301c389ba9
4 changed files with 134 additions and 1 deletions

30
templates/add_venue.html Normal file
View file

@ -0,0 +1,30 @@
{% extends "base.html" %}
{% block title %}New venue{% endblock %}
{% block content %}
<div class="container">
<div class="row">
<h1>Conference archive</h1>
<p><a href="{{ url_for("index") }}">home</a></p>
<h2>New venue</h2>
<p>City: {{ city.name }}, {{ city.country.name }}</p>
<form>
<div class="mb-3">
<label for="name" class="form-label">Name</label>
<input type="text" class="form-control" id="name" name="name">
</div>
<div class="mb-3">
<label for="wikidata_qid" class="form-label">Wikidata QID</label>
<input type="text" class="form-control" id="wikidata_qid" name="wikidata_qid">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,39 @@
{% extends "base.html" %}
{% block title %}Countries{% endblock %}
{% block content %}
<div class="container">
<div class="row">
<h1>Conference archive</h1>
<p><a href="{{ url_for("index") }}">home</a></p>
<h2>Countries</h2>
{% for item in items %}
<div>
<h4>{{ item.name }}</h4>
<p><a href="https://www.wikidata.org/wiki/{{ item.wikidata_qid }}">Wikidata: {{ item.wikidata_qid }}</a></p>
<div>
<ul>
{% for city in item.cities %}
<li>
{{ city.name }}
(<a href="https://www.wikidata.org/wiki/{{ item.wikidata_qid }}">{{ item.wikidata_qid }}</a>)
&mdash;
{% if city.venues %}
{% for venue in city.venues %}
{{ venue.name }}
{% endfor %}
{% endif %}
<a href="{{ url_for("add_venue", city_id=city.id) }}">add venue in city</a>
</li>
{% endfor %}
</ul>
</div>
</div>
{% endfor %}
</div>
</div>
{% endblock %}