diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 1860f279f..121523d42 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -20,6 +20,7 @@ <% end %> +<% is_me = @user.same_as?(current_user) %>
@@ -56,7 +57,7 @@
<% end %> <% end %> - +

<% if @user.discord.present? %> @@ -72,7 +73,7 @@ <% end %> <% end %> <% if current_user&.at_least_moderator? %> - Moderator Tools <% if @user.community_user.mod_warnings&.size.positive? %> (<%= pluralize(@user.community_user.mod_warnings.count, 'message') %>) <% end %> + Moderator Tools <% if @user.community_user.mod_warnings&.size.positive? %> (<%= pluralize(@user.community_user.mod_warnings.count, 'message') %>) <% end %>

quick actions
@@ -80,10 +81,11 @@ annotations on user privileges warnings and suspensions sent to user - <% if @user.community_user.suspended? %>(includes lifting the suspension) - <% elsif @user.community_user.mod_warnings&.size.positive? %> - (latest <%= time_ago_in_words(@user.community_user.latest_warning) %> ago) - <% end %> + <% if @user.community_user.suspended? %> + (includes lifting the suspension) + <% elsif @user.community_user.mod_warnings&.size.positive? %> + (latest <%= time_ago_in_words(@user.community_user.latest_warning) %> ago) + <% end %> warn or suspend user
@@ -146,26 +148,39 @@ <%= @user.reputation %> - Number of top-level posts + Top-level posts <%= @user.metric '1' %> - Number of answers + + + <%= link_to search_path(search: "user:#{@user.id} post_type:2"), + 'aria-label': is_me ? 'View your answers' : "View answers from #{rtl_safe_username(@user)}" do %> + Answers + <% end %> + <%= @user.metric '2' %> - Sum of received votes (up minus down) + + <%= link_to is_me ? my_vote_summary_path : vote_summary_path, + 'aria-label': + is_me ? 'View your received votes' : "View received votes for #{rtl_safe_username(@user)}" do %> + Received votes + <% end %> +
(up minus down) + <%= @user.metric 's' %> - Number of edits made + Edits made <%= @user.metric 'E' %> - <% if current_user&.id == @user.id || current_user&.at_least_moderator? %> - User since <%= @user.community_user.created_at %> + <% if is_me || current_user&.at_least_moderator? %> + Joined <%= @user.community_user.created_at %> <% end %> - + <% unless @abilities.empty? %>

Earned Abilities

@@ -181,14 +196,10 @@ <% end %> <% end %>
@@ -203,25 +214,45 @@ Posts - Count + + <%= link_to user_posts_path, + 'aria-label': is_me ? 'View your posts' : "View posts for #{rtl_safe_username(@user)}" do %> + Total + <% end %> + <%= @user.posts.undeleted.count %> - Questions + + <%= link_to search_path(search: "user:#{@user.id} post_type:1"), + 'aria-label': is_me ? 'View your questions' : "View questions from #{rtl_safe_username(@user)}" do %> + Questions + <% end %> + <%= posts_for(posts_by_post_type, Question) %> - Answers + + <%= link_to search_path(search: "user:#{@user.id} post_type:2"), + 'aria-label': is_me ? 'View your answers' : "View answers from #{rtl_safe_username(@user)}" do %> + Answers + <% end %> + <%= posts_for(posts_by_post_type, Answer) %> - Articles + + <%= link_to search_path(search: "user:#{@user.id} post_type:5"), + 'aria-label': is_me ? 'View your articles' : "View articles from #{rtl_safe_username(@user)}" do %> + Articles + <% end %> + <%= posts_for(posts_by_post_type, Article) %> @@ -238,48 +269,48 @@ Votes cast - Count + Total <%= @user.votes.count %> - <% if @user.id == current_user&.id || current_user&.admin? %> - - -
- - - Upvotes -
- - <%= votes_by_type[1] || 0 %> - - - -
- - - Downvotes -
- - <%= votes_by_type[-1] || 0 %> - - - on Question - - <%= votes_for(votes_by_post_type, Question) %> - - - - on Answer - - <%= votes_for(votes_by_post_type, Answer) %> - - - - on Article - - <%= votes_for(votes_by_post_type, Article) %> - - + <% if is_me || current_user&.admin? %> + + +
+ + + Upvotes +
+ + <%= votes_by_type[1] || 0 %> + + + +
+ + + Downvotes +
+ + <%= votes_by_type[-1] || 0 %> + + + on Questions + + <%= votes_for(votes_by_post_type, Question) %> + + + + on Answers + + <%= votes_for(votes_by_post_type, Answer) %> + + + + on Articles + + <%= votes_for(votes_by_post_type, Article) %> + + <% end %>
@@ -288,9 +319,9 @@ Flags raised - Count + Total - <% if current_user&.id == @user.id || at_least_moderator? %> + <% if is_me || at_least_moderator? %> <%= link_to @user.flags.count, flag_history_path(@user.id), class: 'is-muted', 'aria-label': "View flag history for #{@user.flags.count} flags" %> <% else %>