mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-03 20:02:47 +00:00 
			
		
		
		
	Avatar condition and breadcrumb update
This commit is contained in:
		@@ -26,7 +26,7 @@ from .utils import (
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@bp.route('')
 | 
			
		||||
@register_breadcrumb(bp, '.', '<i class="material-icons left">group</i>Users')
 | 
			
		||||
@register_breadcrumb(bp, '.', '<i class="material-icons left">group</i>Social Area')
 | 
			
		||||
@login_required
 | 
			
		||||
def users():
 | 
			
		||||
    return redirect(url_for('main.social_area', _anchor='users'))
 | 
			
		||||
@@ -65,7 +65,7 @@ def user(user_id):
 | 
			
		||||
def profile_avatar(user_id):
 | 
			
		||||
    user = User.query.get_or_404(user_id)
 | 
			
		||||
    if user.avatar is None:
 | 
			
		||||
        return redirect(url_for('static', filename='images/default_avatar.png'))
 | 
			
		||||
        return redirect(url_for('static', filename='images/user_avatar.png'))
 | 
			
		||||
    if not user.is_public and not (user == current_user or current_user.is_administrator()):
 | 
			
		||||
        abort(403)
 | 
			
		||||
    return send_from_directory(
 | 
			
		||||
@@ -78,7 +78,7 @@ def profile_avatar(user_id):
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@bp.route('/<hashid:user_id>/edit', methods=['GET', 'POST'])
 | 
			
		||||
@register_breadcrumb(bp, '.entity.edit', 'Edit', endpoint_arguments_constructor=user_eac)
 | 
			
		||||
@register_breadcrumb(bp, '.entity.edit', '<i class="material-icons left">settings</i>Edit', endpoint_arguments_constructor=user_eac)
 | 
			
		||||
@login_required
 | 
			
		||||
def edit_profile(user_id):
 | 
			
		||||
    user = User.query.get_or_404(user_id)
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,7 @@ def user_dynamic_list_constructor():
 | 
			
		||||
    user = User.query.get_or_404(user_id)
 | 
			
		||||
    return [
 | 
			
		||||
        {
 | 
			
		||||
            'text': f'<i class="material-icons left">account_circle</i>{user.username}',
 | 
			
		||||
            'text': f'<i class="material-icons left">person</i>{user.username}',
 | 
			
		||||
            'url': url_for('.user', user_id=user_id)
 | 
			
		||||
        }
 | 
			
		||||
    ]
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user