Add missing tags section to user todo list
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
from flask import *
|
from flask import *
|
||||||
from flask_login import current_user, login_required
|
from flask_login import current_user, login_required
|
||||||
from sqlalchemy import or_
|
from sqlalchemy import or_
|
||||||
|
from sqlalchemy.sql.operators import is_
|
||||||
|
|
||||||
from app.models import *
|
from app.models import *
|
||||||
from app.querybuilder import QueryBuilder
|
from app.querybuilder import QueryBuilder
|
||||||
@@ -166,9 +167,13 @@ def view_user(username=None):
|
|||||||
.order_by(db.asc(ForumTopic.name), db.asc(ForumTopic.title)) \
|
.order_by(db.asc(ForumTopic.name), db.asc(ForumTopic.title)) \
|
||||||
.all()
|
.all()
|
||||||
|
|
||||||
|
needs_tags = user.maintained_packages \
|
||||||
|
.filter(Package.state != PackageState.APPROVED) \
|
||||||
|
.filter_by(tags=None).order_by(db.asc(Package.title)).all()
|
||||||
|
|
||||||
return render_template("todo/user.html", current_tab="user", user=user,
|
return render_template("todo/user.html", current_tab="user", user=user,
|
||||||
unapproved_packages=unapproved_packages, outdated_packages=outdated_packages,
|
unapproved_packages=unapproved_packages, outdated_packages=outdated_packages,
|
||||||
topics_to_add=topics_to_add)
|
needs_tags=needs_tags, topics_to_add=topics_to_add)
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/todo/outdated/")
|
@bp.route("/todo/outdated/")
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{% extends "todo/todo_base.html" %}
|
{% extends "todo/todo_base.html" %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
{{ _("All Package Tags") }}
|
{{ _("Package Tags") }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link {% if current_tab == "tags" %}active{% endif %}"
|
<a class="nav-link {% if current_tab == "tags" %}active{% endif %}"
|
||||||
href="{{ url_for('todo.tags') }}">
|
href="{{ url_for('todo.tags') }}">
|
||||||
{{ _("All Package Tags") }}
|
{{ _("Package Tags") }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
|
|||||||
@@ -10,18 +10,16 @@
|
|||||||
{% for package in unapproved_packages %}
|
{% for package in unapproved_packages %}
|
||||||
<a class="list-group-item list-group-item-action" href="{{ package.getDetailsURL() }}">
|
<a class="list-group-item list-group-item-action" href="{{ package.getDetailsURL() }}">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% if package %}
|
<div class="col-sm-2 text-muted">
|
||||||
<div class="col-sm-2 text-muted">
|
<img
|
||||||
<img
|
class="img-fluid"
|
||||||
class="img-fluid"
|
style="max-height: 22px; max-width: 22px;"
|
||||||
style="max-height: 22px; max-width: 22px;"
|
src="{{ package.getThumbnailOrPlaceholder() }}" />
|
||||||
src="{{ package.getThumbnailOrPlaceholder() }}" />
|
|
||||||
|
|
||||||
<span class="pl-2">
|
<span class="pl-2">
|
||||||
{{ package.title }}
|
{{ package.title }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
State: {{ package.state.value }}
|
State: {{ package.state.value }}
|
||||||
@@ -29,7 +27,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p class="list-group-item"><i>{{ _("Nothing to do :)") }}</i></p>
|
<p class="text-muted">{{ _("Nothing to do :)") }}</p>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -51,6 +49,27 @@
|
|||||||
{% from "macros/todo.html" import render_outdated_packages %}
|
{% from "macros/todo.html" import render_outdated_packages %}
|
||||||
{{ render_outdated_packages(outdated_packages, current_user) }}
|
{{ render_outdated_packages(outdated_packages, current_user) }}
|
||||||
|
|
||||||
|
<div class="mt-5"></div>
|
||||||
|
<a class="btn btn-secondary float-right" href="{{ url_for('todo.tags', author=user.username) }}">See All</a>
|
||||||
|
<h2>{{ _("Packages Without Tags") }}</h2>
|
||||||
|
<div class="list-group mt-3 mb-5">
|
||||||
|
{% for package in needs_tags %}
|
||||||
|
<a class="list-group-item list-group-item-action" href="{{ package.getDetailsURL() }}">
|
||||||
|
<img
|
||||||
|
class="img-fluid"
|
||||||
|
style="max-height: 22px; max-width: 22px;"
|
||||||
|
src="{{ package.getThumbnailOrPlaceholder() }}" />
|
||||||
|
|
||||||
|
<span class="pl-2">
|
||||||
|
{{ package.title }}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
<p class="text-muted">{{ _("Nothing to do :)") }}</p>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<h2 class="mt-5">{{ _("Unadded Topics") }}</h2>
|
<h2 class="mt-5">{{ _("Unadded Topics") }}</h2>
|
||||||
{% if topics_to_add %}
|
{% if topics_to_add %}
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
Reference in New Issue
Block a user