From f1be57e5094ffc604faeb6d6d976a3b128ab548d Mon Sep 17 00:00:00 2001 From: Inga Kirschnick Date: Tue, 14 Mar 2023 14:21:23 +0100 Subject: [PATCH] Avatar condition and breadcrumb update --- app/main/routes.py | 6 +++--- app/templates/users/edit_profile.html.j2 | 4 ---- app/templates/users/profile.html.j2 | 4 ---- app/users/routes.py | 6 +++--- app/users/utils.py | 2 +- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/app/main/routes.py b/app/main/routes.py index a4b2ff2e..65a237e9 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -35,13 +35,13 @@ def dashboard(): @bp.route('/user_manual') -@register_breadcrumb(bp, '.user_manual', 'User manual') +@register_breadcrumb(bp, '.user_manual', 'helpUser manual') def user_manual(): return render_template('main/user_manual.html.j2', title='User manual') @bp.route('/news') -@register_breadcrumb(bp, '.news', 'News') +@register_breadcrumb(bp, '.news', 'emailNews') def news(): return render_template('main/news.html.j2', title='News') @@ -59,7 +59,7 @@ def terms_of_use(): @bp.route('/social-area') -@register_breadcrumb(bp, '.social_area', 'Social Area') +@register_breadcrumb(bp, '.social_area', 'groupSocial Area') def social_area(): users = [ u.to_json_serializeable(relationships=True, filter_by_privacy_settings=True,) for u diff --git a/app/templates/users/edit_profile.html.j2 b/app/templates/users/edit_profile.html.j2 index d28f6682..88eb8fb5 100644 --- a/app/templates/users/edit_profile.html.j2 +++ b/app/templates/users/edit_profile.html.j2 @@ -70,11 +70,7 @@
- {% if user.avatar %} user-image - {% else %} - user-image - {% endif %}
diff --git a/app/templates/users/profile.html.j2 b/app/templates/users/profile.html.j2 index 7d67a11b..31c12359 100644 --- a/app/templates/users/profile.html.j2 +++ b/app/templates/users/profile.html.j2 @@ -12,11 +12,7 @@


- {% if user.avatar %} user-image - {% else %} - user-image - {% endif %}
diff --git a/app/users/routes.py b/app/users/routes.py index a69fa503..21e2ff02 100644 --- a/app/users/routes.py +++ b/app/users/routes.py @@ -26,7 +26,7 @@ from .utils import ( @bp.route('') -@register_breadcrumb(bp, '.', 'groupUsers') +@register_breadcrumb(bp, '.', 'groupSocial 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('//edit', methods=['GET', 'POST']) -@register_breadcrumb(bp, '.entity.edit', 'Edit', endpoint_arguments_constructor=user_eac) +@register_breadcrumb(bp, '.entity.edit', 'settingsEdit', endpoint_arguments_constructor=user_eac) @login_required def edit_profile(user_id): user = User.query.get_or_404(user_id) diff --git a/app/users/utils.py b/app/users/utils.py index 1c4ab7a8..5c1ca83e 100644 --- a/app/users/utils.py +++ b/app/users/utils.py @@ -11,7 +11,7 @@ def user_dynamic_list_constructor(): user = User.query.get_or_404(user_id) return [ { - 'text': f'account_circle{user.username}', + 'text': f'person{user.username}', 'url': url_for('.user', user_id=user_id) } ]