From 1914c56b05056738a80f75d1a3e72be464b5752d Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Wed, 28 Feb 2024 23:53:22 +0100 Subject: [PATCH] Adjust what content gets hidden on banned user profiles --- app/views/layouts/user/profile.html.haml | 5 +++-- app/views/user/_profile.html.haml | 3 ++- app/views/user/show.html.haml | 23 +++++++++++------------ 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/app/views/layouts/user/profile.html.haml b/app/views/layouts/user/profile.html.haml index 1af75a29..ef497627 100644 --- a/app/views/layouts/user/profile.html.haml +++ b/app/views/layouts/user/profile.html.haml @@ -8,8 +8,9 @@ .d-none.d-sm-block= render 'shared/links' .col-lg-9.col-md-8.col-xs-12.col-sm-8 = render 'questionbox', user: @user - = render 'tabs/profile', user: @user - = yield + - unless @user.banned? + = render 'tabs/profile', user: @user + = yield - if user_signed_in? = render 'modal/list', user: @user - if current_user.mod? && @user != current_user diff --git a/app/views/user/_profile.html.haml b/app/views/user/_profile.html.haml index 7afb27f8..705d85a9 100644 --- a/app/views/user/_profile.html.haml +++ b/app/views/user/_profile.html.haml @@ -37,4 +37,5 @@ .profile__location %i.fa.fa-fw.fa-location-arrow = user.profile.location - = render "user/actions", user: user, type: :follower + - unless user.banned? + = render "user/actions", user: user, type: :follower diff --git a/app/views/user/show.html.haml b/app/views/user/show.html.haml index 40beee3d..baca6552 100644 --- a/app/views/user/show.html.haml +++ b/app/views/user/show.html.haml @@ -1,17 +1,16 @@ -- unless @user.banned? - %div{ data: { controller: "navigation" } } - %button.d-none{ data: { hotkey: "j", action: "navigation#down" } } - %button.d-none{ data: { hotkey: "k", action: "navigation#up" } } - #pinned-answers - - @pinned_answers.each do |a| - = render "answerbox", a: +%div{ data: { controller: "navigation" } } + %button.d-none{ data: { hotkey: "j", action: "navigation#down" } } + %button.d-none{ data: { hotkey: "k", action: "navigation#up" } } + #pinned-answers + - @pinned_answers.each do |a| + = render "answerbox", a: - #answers - - if @answers.empty? - = render "shared/empty", icon: "fa-regular fa-comments", translation_key: ".user.answers" + #answers + - if @answers.empty? + = render "shared/empty", icon: "fa-regular fa-comments", translation_key: ".user.answers" - - @answers.each do |a| - = render "answerbox", a: + - @answers.each do |a| + = render "answerbox", a: - if @more_data_available .d-flex.justify-content-center.justify-content-sm-start#paginator