mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-10-31 02:32:45 +00:00 
			
		
		
		
	Avatar condition and breadcrumb update
This commit is contained in:
		| @@ -35,13 +35,13 @@ def dashboard(): | |||||||
|  |  | ||||||
|  |  | ||||||
| @bp.route('/user_manual') | @bp.route('/user_manual') | ||||||
| @register_breadcrumb(bp, '.user_manual', 'User manual') | @register_breadcrumb(bp, '.user_manual', '<i class="material-icons left">help</i>User manual') | ||||||
| def user_manual(): | def user_manual(): | ||||||
|     return render_template('main/user_manual.html.j2', title='User manual') |     return render_template('main/user_manual.html.j2', title='User manual') | ||||||
|  |  | ||||||
|  |  | ||||||
| @bp.route('/news') | @bp.route('/news') | ||||||
| @register_breadcrumb(bp, '.news', 'News') | @register_breadcrumb(bp, '.news', '<i class="material-icons left">email</i>News') | ||||||
| def news(): | def news(): | ||||||
|     return render_template('main/news.html.j2', title='News') |     return render_template('main/news.html.j2', title='News') | ||||||
|  |  | ||||||
| @@ -59,7 +59,7 @@ def terms_of_use(): | |||||||
|  |  | ||||||
|  |  | ||||||
| @bp.route('/social-area') | @bp.route('/social-area') | ||||||
| @register_breadcrumb(bp, '.social_area', 'Social Area') | @register_breadcrumb(bp, '.social_area', '<i class="material-icons left">group</i>Social Area') | ||||||
| def social_area(): | def social_area(): | ||||||
|     users = [ |     users = [ | ||||||
|         u.to_json_serializeable(relationships=True, filter_by_privacy_settings=True,) for u |         u.to_json_serializeable(relationships=True, filter_by_privacy_settings=True,) for u | ||||||
|   | |||||||
| @@ -70,11 +70,7 @@ | |||||||
|                 <div class="row"> |                 <div class="row"> | ||||||
|                   <div class="col s2"></div> |                   <div class="col s2"></div> | ||||||
|                   <div class="col s8"> |                   <div class="col s8"> | ||||||
|                     {% if user.avatar %} |  | ||||||
|                     <img src="{{ url_for('.profile_avatar', user_id=user.id) }}" alt="user-image" class="circle responsive-img" id="avatar"> |                     <img src="{{ url_for('.profile_avatar', user_id=user.id) }}" alt="user-image" class="circle responsive-img" id="avatar"> | ||||||
|                     {% else %} |  | ||||||
|                     <img src="{{ url_for('static', filename='images/user_avatar.png') }}" alt="user-image" class="circle responsive-img" id="avatar"> |  | ||||||
|                     {% endif %} |  | ||||||
|                   </div> |                   </div> | ||||||
|                   <div class="col s2"></div> |                   <div class="col s2"></div> | ||||||
|                 </div> |                 </div> | ||||||
|   | |||||||
| @@ -12,11 +12,7 @@ | |||||||
|               <div class="col s3"> |               <div class="col s3"> | ||||||
|                 <br> |                 <br> | ||||||
|                 <br> |                 <br> | ||||||
|                 {% if user.avatar %} |  | ||||||
|                 <img src="{{ url_for('.profile_avatar', user_id=user_id) }}" alt="user-image" class="circle responsive-img"> |                 <img src="{{ url_for('.profile_avatar', user_id=user_id) }}" alt="user-image" class="circle responsive-img"> | ||||||
|                 {% else %} |  | ||||||
|                 <img src="{{ url_for('static', filename='images/user_avatar.png') }}" alt="user-image" class="circle responsive-img"> |  | ||||||
|                 {% endif %} |  | ||||||
|               </div> |               </div> | ||||||
|               <div class="col s1"></div> |               <div class="col s1"></div> | ||||||
|               <div class="col s7"> |               <div class="col s7"> | ||||||
|   | |||||||
| @@ -26,7 +26,7 @@ from .utils import ( | |||||||
|  |  | ||||||
|  |  | ||||||
| @bp.route('') | @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 | @login_required | ||||||
| def users(): | def users(): | ||||||
|     return redirect(url_for('main.social_area', _anchor='users')) |     return redirect(url_for('main.social_area', _anchor='users')) | ||||||
| @@ -65,7 +65,7 @@ def user(user_id): | |||||||
| def profile_avatar(user_id): | def profile_avatar(user_id): | ||||||
|     user = User.query.get_or_404(user_id) |     user = User.query.get_or_404(user_id) | ||||||
|     if user.avatar is None: |     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()): |     if not user.is_public and not (user == current_user or current_user.is_administrator()): | ||||||
|         abort(403) |         abort(403) | ||||||
|     return send_from_directory( |     return send_from_directory( | ||||||
| @@ -78,7 +78,7 @@ def profile_avatar(user_id): | |||||||
|  |  | ||||||
|  |  | ||||||
| @bp.route('/<hashid:user_id>/edit', methods=['GET', 'POST']) | @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 | @login_required | ||||||
| def edit_profile(user_id): | def edit_profile(user_id): | ||||||
|     user = User.query.get_or_404(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) |     user = User.query.get_or_404(user_id) | ||||||
|     return [ |     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) |             'url': url_for('.user', user_id=user_id) | ||||||
|         } |         } | ||||||
|     ] |     ] | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user