Clean up todo topics related HTML

This commit is contained in:
rubenwardy 2018-06-02 19:41:13 +01:00
parent a6f4249afb
commit 3657316fa2
No known key found for this signature in database
GPG Key ID: A1E29D52FF81513C
5 changed files with 41 additions and 24 deletions

View File

@ -60,5 +60,5 @@ rm db.sqlite && python setup.py -t && FLASK_CONFIG=../config.cfg FLASK_APP=app/_
FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py flask db migrate
# Run migration
FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py flask db migrate
FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py flask db upgrade
```

View File

@ -5,8 +5,10 @@
{% endblock %}
{% block content %}
{% if canApproveNew %}
<h2>Packages Awaiting Approval</h2>
<h2>Awaiting Approval</h2>
{% if canApproveNew and packages %}
<h3>Packages</h3>
<ul>
{% for p in packages %}
<li><a href="{{ p.getDetailsURL() }}">
@ -18,8 +20,8 @@
</ul>
{% endif %}
{% if canApproveScn %}
<h2>Screenshots Awaiting Approval</h2>
{% if canApproveScn and screenshots %}
<h3>Screenshots</h3>
<ul>
{% for s in screenshots %}
<li>
@ -35,8 +37,8 @@
</ul>
{% endif %}
{% if canApproveRel %}
<h2>Releases Awaiting Approval</h2>
{% if canApproveRel and releases %}
<h3>Releases</h3>
<ul>
{% for r in releases %}
<li>
@ -52,11 +54,17 @@
</ul>
{% endif %}
<h2>Forum Topics without a Package</h2>
{% if not (packages or screenshots or releases) %}
<p>
<i>All done!</i>
</p>
{% endif %}
<h2>Unadded Topic List</h2>
<p>
There are
<a href="{{ url_for('todo_topics_page') }}">{{ topics_to_add }} packages</a>
to be added to cdb.
to be added to cdb, based on forum topics picked up by Krock's mod search.
</p>
{% endblock %}

View File

@ -100,24 +100,31 @@
{% if topics_to_add %}
<div class="box box_grey">
<h2>Topics to Add</h2>
<h2>Unadded Packages</h2>
<table class="box-body">
<tr>
<th>Id</th>
<th>Title</th>
<th>Name</th>
<th>Link</th>
</tr>
{% for topic in topics_to_add %}
<div class="box-body">
<p>
List of your topics without a matching package.
Powered by Krock's Mod Search.
</p>
<table>
<tr>
<td>{{ topic.topic_id }}</td>
<td>[{{ topic.getType().value }}] <a href="https://forum.minetest.net/viewtopic.php?t={{ topic.topic_id}}">{{ topic.title }}</a></td>
<td>{{ topic.name or ""}}</td>
<td><a href="{{ topic.link }}">{{ topic.link | domain }}</a></td>
<th>Id</th>
<th>Title</th>
<th>Name</th>
<th>Link</th>
</tr>
{% endfor %}
</table>
{% for topic in topics_to_add %}
<tr>
<td>{{ topic.topic_id }}</td>
<td>[{{ topic.getType().value }}] <a href="https://forum.minetest.net/viewtopic.php?t={{ topic.topic_id}}">{{ topic.title }}</a></td>
<td>{{ topic.name or ""}}</td>
<td><a href="{{ topic.link }}">{{ topic.link | domain }}</a></td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endif %}

View File

@ -58,6 +58,7 @@ def todo_topics_page():
topics = KrockForumTopic.query \
.filter(~ db.exists().where(Package.forums==KrockForumTopic.topic_id)) \
.order_by(db.asc(KrockForumTopic.title)) \
.all()
return render_template("todo/topics.html", topics=topics, total=total)

View File

@ -101,6 +101,7 @@ def user_profile_page(username):
topics_to_add = KrockForumTopic.query \
.filter_by(author_id=user.id) \
.filter(~ db.exists().where(Package.forums==KrockForumTopic.topic_id)) \
.order_by(db.asc(KrockForumTopic.title)) \
.all()
# Process GET or invalid POST