from app import app
from app.models.attachment import Attachment
from app.utils.priv_required import priv_required
from app.utils.render import render

# TODO: add pagination & moderation tools (deletion)

@app.route('/admin/fichiers', methods=['GET'])
@priv_required('misc.admin-panel')
def adm_attachments():
    attachments = Attachment.query.all()

    return render('admin/attachments.html', attachments=attachments)
