Add new admin blueprint with new user delete feature. Reorganize templates etc.

This commit is contained in:
Stephan Porada
2019-08-15 15:56:53 +02:00
parent 93330c0efb
commit bccf661957
8 changed files with 134 additions and 15 deletions

View File

@ -15,18 +15,6 @@ def index():
return render_template('main/index.html.j2', title='Opaque')
@main.route('/admin', methods=['GET', 'POST'])
@login_required
@admin_required
def for_admins_only():
users = User.query.order_by(User.username).all()
items = [AdminUserItem(u.username, u.email, u.role_id, u.confirmed) for u in users]
table = AdminUserTable(items).__html__() # converts table object to html string
table = table.replace('tbody', 'tbody class="list"', 1) # add class list to tbody element. Needed by list.js
return render_template('main/admin.html.j2', title='Administration tools',
table=table)
@main.route('/corpora/<int:corpus_id>')
@login_required
def corpus(corpus_id):