diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | app/templates/todo/list.html | 24 | ||||
-rw-r--r-- | app/templates/users/user_profile_page.html | 37 | ||||
-rw-r--r-- | app/views/packages/todo.py | 1 | ||||
-rw-r--r-- | app/views/users.py | 1 |
5 files changed, 41 insertions, 24 deletions
@@ -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 ``` diff --git a/app/templates/todo/list.html b/app/templates/todo/list.html index 20e8f4f..f2172a6 100644 --- a/app/templates/todo/list.html +++ b/app/templates/todo/list.html @@ -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 %} diff --git a/app/templates/users/user_profile_page.html b/app/templates/users/user_profile_page.html index 7181fc2..5c5113b 100644 --- a/app/templates/users/user_profile_page.html +++ b/app/templates/users/user_profile_page.html @@ -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 %} diff --git a/app/views/packages/todo.py b/app/views/packages/todo.py index 9553ef2..d4526ee 100644 --- a/app/views/packages/todo.py +++ b/app/views/packages/todo.py @@ -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) diff --git a/app/views/users.py b/app/views/users.py index 86219f9..51efd1d 100644 --- a/app/views/users.py +++ b/app/views/users.py @@ -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 |