mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 04:12:45 +00:00 
			
		
		
		
	UI enhancements
This commit is contained in:
		@@ -1,9 +1,9 @@
 | 
			
		||||
from flask import flash, redirect, render_template, url_for
 | 
			
		||||
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 Role, User, UserSettingJobStatusMailNotificationLevel
 | 
			
		||||
from app.users.forms import EditNotificationSettingsForm
 | 
			
		||||
from app.users.forms import EditProfileSettingsForm
 | 
			
		||||
from app.models import Corpus, Role, User, UserSettingJobStatusMailNotificationLevel
 | 
			
		||||
from app.settings.forms import EditNotificationSettingsForm
 | 
			
		||||
from app.settings.forms import EditProfileSettingsForm
 | 
			
		||||
from . import bp
 | 
			
		||||
from .forms import AdminEditUserForm
 | 
			
		||||
from app.users.utils import (
 | 
			
		||||
@@ -15,7 +15,21 @@ from app.users.utils import (
 | 
			
		||||
@bp.route('')
 | 
			
		||||
@register_breadcrumb(bp, '.', '<i class="material-icons left">admin_panel_settings</i>Administration')
 | 
			
		||||
def index():
 | 
			
		||||
    return redirect(url_for('.users'))
 | 
			
		||||
    return render_template(
 | 
			
		||||
        'admin/admin.html.j2',
 | 
			
		||||
        title='Administration'
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@bp.route('/corpora')
 | 
			
		||||
@register_breadcrumb(bp, '.corpora', 'Corpora')
 | 
			
		||||
def corpora():
 | 
			
		||||
    corpora = [x.to_json_serializeable(backrefs=True) for x in Corpus.query.all()]
 | 
			
		||||
    return render_template(
 | 
			
		||||
        'admin/corpora.html.j2',
 | 
			
		||||
        corpora=corpora,
 | 
			
		||||
        title='Corpora'
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@bp.route('/users')
 | 
			
		||||
@@ -33,7 +47,13 @@ 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', user=user)
 | 
			
		||||
    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')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@bp.route('/users/<hashid:user_id>/edit', methods=['GET', 'POST'])
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user