Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

admin page that lists solver descriptions

  • Loading branch information...
commit d1cbb834aa42febdd46c77828f34f674512578da 1 parent c8ec8b6
@ceari authored
View
28 edacc/templates/accounts/list_solver_descriptions.html
@@ -0,0 +1,28 @@
+{% extends "base.html" %}
+{% block title %}List of submitted descriptions{% endblock %}
+{% block content %}
+ <h2>List of submitted descriptions</h2>
+ <h3>By Solver</h3>
+ <ul>
+ {% for s in solvers %}
+ {% if s.description_pdf %}
+ <li><a href="{{ url_for('frontend.solver_description_download', database=database, solver_id=s.idSolver) }}">{{ s.name }}</a> (<a href="mailto:{{ s.user.email }}">{{ s.user.lastname}}, {{ s.user.firstname }}</a>)</li>
+ {% else %}
+ <li><span style="color: red">{{ s.name }} (missing)</span> (<a href="mailto:{{ s.user.email }}">{{ s.user.lastname}}, {{ s.user.firstname }}</a>)</li>
+ {% endif %}
+ {% endfor %}
+ </ul>
+ <h3>By category</h3>
+ {% for c in solvers_by_category %}
+ <p>{{ c.name }}</p>
+ <ul>
+ {% for s in solvers %}
+ {% if s.description_pdf %}
+ <li><a href="{{ url_for('frontend.solver_description_download', database=database, solver_id=s.idSolver) }}">{{ s.name }}</a> (<a href="mailto:{{ s.user.email }}">{{ s.user.lastname}}, {{ s.user.firstname }}</a>)</li>
+ {% else %}
+ <li><span style="color: red">{{ s.name }} (missing)</span> (<a href="mailto:{{ s.user.email }}">{{ s.user.lastname}}, {{ s.user.firstname }}</a>)</li>
+ {% endif %}
+ {% endfor %}
+ </ul>
+ {% endfor %}
+{% endblock %}
View
2  edacc/templates/accounts/list_users.html
@@ -59,6 +59,8 @@
</tbody>
</table>
{% endif %}
+<h2>Information</h2>
+<a href="{{ url_for('accounts.list_solver_descriptions', database=database) }}">List of submitted descriptions</a>
<h2>Email addresses (Admins <strong>excluded</strong>)</h2>
<a href="mailto:?bcc={% for u in users %}{% if not u.admin %}{{ u.email }};{% endif %}{% endfor %}">{% for u in users %}{% if not u.admin %}{{ u.email }}, {% endif %}{% endfor %}</a>
<h2>Email addresses (Admins <strong>included</strong>)</h2>
View
17 edacc/views/accounts.py
@@ -550,6 +550,23 @@ def submit_solver(database, id=None):
return render('/accounts/submit_solver.html', database=database, error=error,
db=db, id=id, form=form)
+
+@accounts.route('/<database>/list-solver-descriptions/', methods=['GET'])
+@require_login
+@require_admin
+def list_solver_descriptions(database):
+ db = models.get_database(database) or abort(404)
+
+ solvers = [s for s in db.session.query(db.Solver).all() if s.User_idUser]
+
+ solvers_by_category = dict()
+ for category in db.session.query(db.CompetitionCategory).all():
+ solvers_by_category[category] = [s for s in category.solvers if s.User_idUser]
+
+ return render('/accounts/list_solver_descriptions.html', database=database,
+ db=db, solvers=solvers, solvers_by_category=solvers_by_category)
+
+
@accounts.route('/<database>/delete-solver/<int:solver_id>', methods=['GET'])
@require_login
@require_phase(phases=(2, 4))
Please sign in to comment.
Something went wrong with that request. Please try again.