Skip to content
Snippets Groups Projects
Commit 2854c472 authored by Martin Mareš's avatar Martin Mareš
Browse files

DSN: Přehled všech DSN pro správce

parent cd5f5153
Branches
No related tags found
1 merge request!138Zpracování nedoručenek
# Web: Nástroje pro správce
from flask import render_template, request
import mo.db as db
from mo.web import app
from mo.web.util import PagerForm
@app.route('/admin/dsn')
def admin_all_dsn():
pager = PagerForm(formdata=request.args)
if request.args:
pager.validate()
sess = db.get_session()
query = sess.query(db.EmailDSN).order_by(db.EmailDSN.arrived_at.desc())
(count, query) = pager.apply_limits(query, pagesize=20)
dsns = query.all()
return render_template('admin_dsn.html', dsns=dsns, pager=pager, count=count)
{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% block title %}Všechny nedoručenky{% endblock %}
{% block body %}
<div class="btn-group">
{% if pager.offset.data > 0 %}
{{ wtf.form_field(pager.previous) }}
{% else %}
<button class="btn" disabled>Předchozí</button>
{% endif %}
{% if count > pager.offset.data + pager.limit.data %}
{{ wtf.form_field(pager.next) }}
{% else %}
<button class="btn" disabled>Další</button>
{% endif %}
</div>
{% if count > 0 %}
Zobrazuji nedoručenky <b>{{pager.get_min()}}</b><b>{{pager.get_max(count)}}</b> z <b>{{count}} nalezených</b>.
{% else %}
<b>Nebyly nalezeny žádné nedoručenky.</b>
{% endif %}
{% include "parts/dsn.html" %}
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment