Ask user to connect to Wikidata account

This commit is contained in:
Edward Betts 2019-09-27 16:59:43 +01:00
parent 7a233021fd
commit f5efbf1d85
2 changed files with 10 additions and 0 deletions

1
app.py
View file

@ -410,6 +410,7 @@ def item_page(item_id):
catalog_detail=catalog_detail,
labels=find_more_props,
entity=item.entity,
username=get_username(),
label=label,
image=image,
other=other,

View file

@ -84,6 +84,14 @@
</div>
</div>
{% if not username %}
<div class="alert alert-info mt-4" role="alert">
This tool must be connected with Wikidata to work.
</div>
<p><a href="{{ url_for('start_oauth') }}" class="btn btn-primary btn-lg">Connect with Wikidata</a>
{% endif %}
{% if username %}
<form method="POST" action="{{ url_for('save', item_id=item_id) }}">
{% raw %}
<div id="app" class="mt-2">
@ -129,6 +137,7 @@
</div>
{% endraw %}
</form>
{% endif %}
</div>
<div class="flex-shrink-1 vh-100">
<img src="{{ image.thumburl }}" />