From 045f5c89cdae9af9711bc6270719dbcbf290d856 Mon Sep 17 00:00:00 2001
From: Monica Cellio <cellio@pobox.com>
Date: Thu, 6 Feb 2025 22:33:26 -0500
Subject: [PATCH] moved message count into mod menu

---
 app/views/users/show.html.erb | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 36ff1d6ee..f90c51295 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -64,14 +64,18 @@
           <% end %>
         <% end %>
         <% if current_user&.is_moderator %>
-          <a href="<%= mod_user_path(@user) %>" class="button is-danger is-outlined is-small" data-drop="#mod-tools-drop"><i class="fas fa-shield-alt"></i> Moderator Tools</a>
+          <a href="<%= mod_user_path(@user) %>" class="button is-danger is-outlined is-small" data-drop="#mod-tools-drop"><i class="fas fa-shield-alt"></i> Moderator Tools <% if @user.community_user.mod_warnings&.size.positive? %> (<%= pluralize(@user.community_user.mod_warnings.count, 'message') %>) <% end %></a> 
           <div class="droppanel" id="mod-tools-drop">
             <div class="droppanel--header">quick actions</div>
             <div class="droppanel--menu">
               <a href="/users/<%= @user.id %>/mod/activity-log">full activity log</a>
               <a href="/users/<%= @user.id %>/mod/annotations">annotations on user</a>
               <a href="/users/<%= @user.id %>/mod/privileges">privileges</a>
-              <a href="/warning/log/<%= @user.id %>">warnings and suspensions sent to user <% if @user.community_user.suspended? %><em>(includes lifting the suspension)</em><% end %></a>
+              <a href="/warning/log/<%= @user.id %>">warnings and suspensions sent to user
+		<% if @user.community_user.suspended? %><em>(includes lifting the suspension)</em>
+		<% elsif @user.community_user.mod_warnings&.size.positive? %>
+		(latest <%= time_ago_in_words(@user.community_user.latest_warning) %> ago)
+		<% end %></a>
               <a href="/warning/new/<%= @user.id %>">warn or suspend user</a>
             </div>
             <div class="h-m-t-6">
@@ -86,14 +90,6 @@
         <% end %>
       </div>
 
-      <% if moderator? && @user.community_user.mod_warnings&.size.positive? %>
-      <div class="notice is-info h-m-b-4">
-	<p><%= pluralize(@user.community_user.mod_warnings.count, 'message') %> sent,
-	  most recent: <%= time_ago_in_words(@user.community_user.latest_warning) %> ago
-	</p>
-      </div>
-      <% end %>
-
       <div class="user-profile-heading-container">
         <h2 class="user-profile-heading">Posts</h2>
         <% if @posts.size > 0 %>
-- 
GitLab