aboutsummaryrefslogtreecommitdiff
path: root/app/templates
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-06-02 18:22:57 +0100
committerrubenwardy <rw@rubenwardy.com>2018-06-02 18:26:17 +0100
commit70afb94d3b985e314ff1f922294875e43c56fefc (patch)
tree6743df30af1b00f5ed457155bbca0724f639c97d /app/templates
parent8984adaa728c6c1c9bafb8c1ba5ea227bb17aa5b (diff)
downloadcheatdb-70afb94d3b985e314ff1f922294875e43c56fefc.tar.xz
Add topics todo list based on forum parser
Diffstat (limited to 'app/templates')
-rw-r--r--app/templates/admin/list.html1
-rw-r--r--app/templates/todo/list.html (renamed from app/templates/todo.html)8
-rw-r--r--app/templates/todo/topics.html34
-rw-r--r--app/templates/users/user_profile_page.html23
4 files changed, 66 insertions, 0 deletions
diff --git a/app/templates/admin/list.html b/app/templates/admin/list.html
index ff422ba..e5049f9 100644
--- a/app/templates/admin/list.html
+++ b/app/templates/admin/list.html
@@ -18,6 +18,7 @@
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<select name="action">
<option value="importusers">Create users from mod list</option>
+ <option value="importmodlist">Import Krock's mod list</option>
<option value="importscreenshots" selected>Import screenshots from VCS</option>
<option value="importdepends">Import dependencies from downloads</option>
<option value="modprovides">Set provides to mod name</option>
diff --git a/app/templates/todo.html b/app/templates/todo/list.html
index b20f26c..20e8f4f 100644
--- a/app/templates/todo.html
+++ b/app/templates/todo/list.html
@@ -51,4 +51,12 @@
{% endfor %}
</ul>
{% endif %}
+
+ <h2>Forum Topics without a Package</h2>
+
+ <p>
+ There are
+ <a href="{{ url_for('todo_topics_page') }}">{{ topics_to_add }} packages</a>
+ to be added to cdb.
+ </p>
{% endblock %}
diff --git a/app/templates/todo/topics.html b/app/templates/todo/topics.html
new file mode 100644
index 0000000..77f32c0
--- /dev/null
+++ b/app/templates/todo/topics.html
@@ -0,0 +1,34 @@
+{% extends "base.html" %}
+
+{% block title %}
+Topics to be Added
+{% endblock %}
+
+{% block content %}
+ <h1>Topics to be Added</h1>
+
+ <p>
+ {{ total - (topics | count) }} / {{ total }} packages have been added.
+ {{ topics | count }} remaining.
+ </p>
+
+ <table>
+ <tr>
+ <th>Id</th>
+ <th>Title</th>
+ <th>Author</th>
+ <th>Name</th>
+ <th>Link</th>
+ </tr>
+ {% for topic in topics %}
+ <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><a href="{{ url_for('user_profile_page', username=topic.author.username) }}">{{ topic.author.display_name}}</a></td>
+ <td>{{ topic.name or ""}}</td>
+ <td><a href="{{ topic.link }}">{{ topic.link | domain }}</a></td>
+
+ </tr>
+ {% endfor %}
+ </table>
+{% endblock %}
diff --git a/app/templates/users/user_profile_page.html b/app/templates/users/user_profile_page.html
index 4631256..7181fc2 100644
--- a/app/templates/users/user_profile_page.html
+++ b/app/templates/users/user_profile_page.html
@@ -98,4 +98,27 @@
{% from "macros/packagegridtile.html" import render_pkggrid %}
{{ render_pkggrid(packages, show_author=False) }}
+{% if topics_to_add %}
+ <div class="box box_grey">
+ <h2>Topics to Add</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 %}
+ <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>
+{% endif %}
+
{% endblock %}