diff --git a/app/static/styles.css b/app/static/styles.css index 0c59adf5..9d644e80 100644 --- a/app/static/styles.css +++ b/app/static/styles.css @@ -612,7 +612,7 @@ div.navbar { } .card { - max-width: 350px; + max-width: 380px; margin-left: auto; margin-right: auto; } diff --git a/app/static/styles.scss b/app/static/styles.scss index 29b474d5..5cb9c594 100644 --- a/app/static/styles.scss +++ b/app/static/styles.scss @@ -175,7 +175,7 @@ div.navbar { } .card { - max-width: 350px; + max-width: 380px; margin-left: auto; margin-right: auto; diff --git a/app/templates/base.html b/app/templates/base.html index 4badd911..3d89d364 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -1,4 +1,4 @@ -{% macro render_username(user, add_domain=True) -%} +{% macro render_username(user, add_domain=True, htmx_redirect_back_to=None) -%} {% if user.deleted -%} {% if current_user.is_authenticated and current_user.is_admin() -%} @@ -13,6 +13,16 @@ {% endif -%} {{ user.display_name() }}{% if add_domain and not user.is_local() %}@{{ user.ap_domain }}{% endif %} +
{% if user.created_recently() -%} {% endif -%} @@ -33,12 +43,6 @@ [{{ user_note | truncate(12, True) }}] {% endif -%} {% endif -%} - {% endif -%}
{% endmacro -%} diff --git a/app/templates/post/_post_full.html b/app/templates/post/_post_full.html index bb343f60..ac1079b3 100644 --- a/app/templates/post/_post_full.html +++ b/app/templates/post/_post_full.html @@ -14,12 +14,12 @@

{{ post.url|shorten_url }}

{% endif -%} -

{% if post.reports > 0 and current_user.is_authenticated and post.community.is_moderator(current_user) -%} +

{% if post.reports > 0 and current_user.is_authenticated and post.community.is_moderator(current_user) -%} {% endif -%}submitted by - {{ render_username(post.author) }} - {% if post.edited_at -%} edited -

+ {{ render_username(post.author, htmx_redirect_back_to=request.url) }} + {% if post.edited_at -%} edited {% endif -%} +
{% if post.type == POST_TYPE_IMAGE -%}
{% if post.image_id -%} diff --git a/app/templates/post/_post_reply_teaser.html b/app/templates/post/_post_reply_teaser.html index 43a6544d..a58bb184 100644 --- a/app/templates/post/_post_reply_teaser.html +++ b/app/templates/post/_post_reply_teaser.html @@ -28,7 +28,7 @@
by - {{ render_username(post_reply.author) }} + {{ render_username(post_reply.author, htmx_redirect_back_to=request.url + '#comment_' + str(post_reply.id)) }} {% if post_reply.author.id == post_reply.post.author.id -%} [OP] {% endif -%} diff --git a/app/templates/post/_post_teaser.html b/app/templates/post/_post_teaser.html index 52f6b042..da4aba42 100644 --- a/app/templates/post/_post_teaser.html +++ b/app/templates/post/_post_teaser.html @@ -9,7 +9,7 @@ {# do nothing - blocked by keyword filter #} {% else -%}
diff --git a/app/user/routes.py b/app/user/routes.py index a344d623..fe327e22 100644 --- a/app/user/routes.py +++ b/app/user/routes.py @@ -1346,6 +1346,7 @@ def user_read_posts_delete(): @login_required def edit_user_note(actor): actor = actor.strip() + return_to = request.args.get('return_to') if '@' in actor: user: User = User.query.filter_by(ap_id=actor, deleted=False).first() else: @@ -1365,22 +1366,25 @@ def edit_user_note(actor): cache.delete_memoized(User.get_note, user, current_user) flash(_('Your changes have been saved.'), 'success') - goto = request.args.get('redirect') if 'redirect' in request.args else f'/u/{actor}' - return redirect(goto) + if return_to: + return redirect(return_to) + else: + return redirect(f'/u/{actor}') elif request.method == 'GET': form.note.data = user.get_note(current_user) - return render_template('user/edit_note.html', title=_('Edit note'), form=form, user=user, + return render_template('user/edit_note.html', title=_('Edit note'), form=form, user=user, return_to=return_to, menu_topics=menu_topics(), site=g.site) @bp.route('/user//preview') def user_preview(user_id): user = User.query.get_or_404(user_id) + return_to = request.args.get('return_to') if (user.deleted or user.banned) and current_user.is_anonymous: abort(404) - return render_template('user/user_preview.html', user=user) + return render_template('user/user_preview.html', user=user, return_to=return_to) @bp.route('/user/lookup//')