Avatar condition and breadcrumb update

This commit is contained in:
Inga Kirschnick
2023-03-14 14:21:23 +01:00
parent 777151b2bf
commit f1be57e509
5 changed files with 7 additions and 15 deletions

View File

@ -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)

View File

@ -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)
}
]