mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-12 00:50:40 +00:00
Cleanup
This commit is contained in:
@ -2,8 +2,8 @@ from flask import flash, redirect, render_template, request, url_for
|
||||
from flask_breadcrumbs import register_breadcrumb
|
||||
from app import db, hashids
|
||||
from app.models import Corpus, Role, User, UserSettingJobStatusMailNotificationLevel
|
||||
from app.settings.forms import EditNotificationSettingsForm
|
||||
from app.settings.forms import EditProfileSettingsForm
|
||||
from app.settings.forms import EditNotificationsForm
|
||||
from app.settings.forms import EditAccountForm
|
||||
from . import bp
|
||||
from .forms import AdminEditUserForm
|
||||
from app.users.utils import (
|
||||
@ -24,22 +24,22 @@ def admin():
|
||||
@bp.route('/corpora')
|
||||
@register_breadcrumb(bp, '.corpora', 'Corpora')
|
||||
def corpora():
|
||||
corpora = [x.to_json_serializeable(backrefs=True) for x in Corpus.query.all()]
|
||||
corpora = Corpus.query.all()
|
||||
return render_template(
|
||||
'admin/corpora.html.j2',
|
||||
corpora=corpora,
|
||||
title='Corpora'
|
||||
title='Corpora',
|
||||
corpora=corpora
|
||||
)
|
||||
|
||||
|
||||
@bp.route('/users')
|
||||
@register_breadcrumb(bp, '.users', '<i class="material-icons left">group</i>Users')
|
||||
def users():
|
||||
users = [x.to_json_serializeable(backrefs=True) for x in User.query.all()]
|
||||
users = User.query.all()
|
||||
return render_template(
|
||||
'admin/users.html.j2',
|
||||
users=users,
|
||||
title='Users'
|
||||
title='Users',
|
||||
users=users
|
||||
)
|
||||
|
||||
|
||||
@ -47,13 +47,11 @@ def users():
|
||||
@register_breadcrumb(bp, '.users.entity', '', dynamic_list_constructor=user_dlc)
|
||||
def user(user_id):
|
||||
user = User.query.get_or_404(user_id)
|
||||
return render_template('admin/user.html.j2', title=user.username, user=user)
|
||||
|
||||
|
||||
@bp.route('/users/<hashid:user_id>/dashboard')
|
||||
@register_breadcrumb(bp, '.users.entity.dashboard', 'Dashboard', endpoint_arguments_constructor=user_eac)
|
||||
def user_dashboard(user_id):
|
||||
return render_template('main/dashboard.html.j2', title='Dashboard')
|
||||
return render_template(
|
||||
'admin/user.html.j2',
|
||||
title=user.username,
|
||||
user=user
|
||||
)
|
||||
|
||||
|
||||
@bp.route('/users/<hashid:user_id>/edit', methods=['GET', 'POST'])
|
||||
@ -64,12 +62,12 @@ def edit_user(user_id):
|
||||
data={'confirmed': user.confirmed, 'role': user.role.hashid},
|
||||
prefix='admin-edit-user-form'
|
||||
)
|
||||
edit_profile_settings_form = EditProfileSettingsForm(
|
||||
edit_profile_settings_form = EditAccountForm(
|
||||
user,
|
||||
data=user.to_json_serializeable(),
|
||||
prefix='edit-profile-settings-form'
|
||||
)
|
||||
edit_notification_settings_form = EditNotificationSettingsForm(
|
||||
edit_notification_settings_form = EditNotificationsForm(
|
||||
data=user.to_json_serializeable(),
|
||||
prefix='edit-notification-settings-form'
|
||||
)
|
||||
|
Reference in New Issue
Block a user