author_id = db.Column(db.Integer, db.ForeignKey("user.id"), nullable=False)
author = db.relationship("User")
+ wip = db.Column(db.Boolean, server_default="0")
+
type = db.Column(db.Enum(PackageType), nullable=False)
title = db.Column(db.String(200), nullable=False)
name = db.Column(db.String(30), nullable=True)
.table-topalign td {
vertical-align: top;
}
+
+.wiptopic a {
+ color: #7ac;
+}
links_by_id = getLinksFromModSearch()
info_by_id = {}
- getTopicsFromForum(11, out=info_by_id, extra={ 'type': PackageType.MOD })
- getTopicsFromForum(15, out=info_by_id, extra={ 'type': PackageType.GAME })
+ getTopicsFromForum(11, out=info_by_id, extra={ 'type': PackageType.MOD, 'wip': False })
+ getTopicsFromForum(9, out=info_by_id, extra={ 'type': PackageType.MOD, 'wip': True })
+ getTopicsFromForum(15, out=info_by_id, extra={ 'type': PackageType.GAME, 'wip': False })
+ getTopicsFromForum(50, out=info_by_id, extra={ 'type': PackageType.GAME, 'wip': True })
# Caches
username_to_user = {}
topic.title = title
topic.name = name
topic.link = link
+ topic.wip = info["wip"]
topic.posts = info["posts"]
topic.views = info["views"]
topic.created_at = info["date"]
<table>
<tr>
<th>Id</th>
+ <th></th>
<th>Title</th>
{% if show_author %}<th>Author</th>{% endif %}
<th>Name</th>
<th>Actions</th>
</tr>
{% for topic in topics %}
- <tr>
+ <tr{% if topic.wip %} class="wiptopic"{% endif %}>
<td>{{ topic.topic_id }}</td>
- <td>[{{ topic.type.value }}] <a href="https://forum.minetest.net/viewtopic.php?t={{ topic.topic_id}}">{{ topic.title }}</a></td>
+ <td>
+ [{{ topic.type.value }}]
+ </td>
+ <td>
+ <a href="https://forum.minetest.net/viewtopic.php?t={{ topic.topic_id}}">{{ topic.title }}</a>
+ {% if topic.wip %}[WIP]{% endif %}
+ </td>
{% if show_author %}
<td><a href="{{ url_for('user_profile_page', username=topic.author.username) }}">{{ topic.author.display_name}}</a></td>
{% endif %}
<a href="https://forum.minetest.net/viewtopic.php?t={{ t.topic_id }}">
{{ t.title }} by {{ t.author.display_name }}
</a>
+ {% if t.wip %}[WIP]{% endif %}
</li>
{% endfor %}
</ul>
<p>
There are
<a href="{{ url_for('todo_topics_page') }}">{{ topics_to_add }} packages</a>
- to be added to cdb, based on forum topics picked up by Krock's mod search.
+ to be added to cdb, based on cdb's forum parser.
</p>
{% endblock %}
<div class="box-body">
<p>
- List of your topics without a matching package.
- Powered by Krock's Mod Search.
+ List of your forum topics which do not have a matching package.
</p>
-
-
{% from "macros/topictable.html" import render_topictable %}
{{ render_topictable(topics_to_add, show_author=False) }}
</div>
topics = ForumTopic.query \
.filter(~ db.exists().where(Package.forums==ForumTopic.topic_id)) \
- .order_by(db.asc(ForumTopic.name), db.asc(ForumTopic.title)) \
+ .order_by(db.asc(ForumTopic.wip), db.asc(ForumTopic.name), db.asc(ForumTopic.title)) \
.all()
return render_template("todo/topics.html", topics=topics, total=total)
--- /dev/null
+"""empty message
+
+Revision ID: 9e2ac631efb0
+Revises: 11b6ef362f98
+Create Date: 2018-07-06 23:16:50.507010
+
+"""
+from alembic import op
+import sqlalchemy as sa
+
+
+# revision identifiers, used by Alembic.
+revision = '9e2ac631efb0'
+down_revision = '11b6ef362f98'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+ # ### commands auto generated by Alembic - please adjust! ###
+ op.add_column('forum_topic', sa.Column('wip', sa.Boolean(), nullable=False, server_default="0"))
+ # ### end Alembic commands ###
+
+
+def downgrade():
+ # ### commands auto generated by Alembic - please adjust! ###
+ op.drop_column('forum_topic', 'wip')
+ # ### end Alembic commands ###