Fix #4924: Moderator dashboard shouldn't show a "Promote" link that's unusable by non-moderators

Remove these links entirely.
This commit is contained in:
evazion
2021-11-19 17:37:55 -06:00
parent 5d55b722a8
commit 330a412714
7 changed files with 6 additions and 25 deletions

View File

@@ -206,25 +206,6 @@ module ApplicationHelper
link_to(text, user, class: user_class, data: data)
end
def mod_link_to_user(user, positive_or_negative)
html = ""
html << link_to_user(user)
if CurrentUser.is_gold? && user != CurrentUser.user
if positive_or_negative == :positive
html << " [" + link_to("+", new_user_feedback_path(:user_feedback => {:category => "positive", :user_id => user.id})) + "]"
if CurrentUser.is_moderator? && !user.is_builder?
html << " [" + link_to("promote", edit_admin_user_path(user)) + "]"
end
else
html << " [" + link_to("&ndash;".html_safe, new_user_feedback_path(:user_feedback => {:category => "negative", :user_id => user.id})) + "]"
end
end
html.html_safe
end
def embed_wiki(title, **options)
wiki = WikiPage.find_by(title: title)
text = format_text(wiki&.body)

View File

@@ -9,7 +9,7 @@
<tbody>
<% @dashboard.artists.each do |activity| %>
<tr>
<td><%= mod_link_to_user(activity.user, :positive) %></td>
<td><%= link_to_user(activity.user) %></td>
<td><%= link_to activity.count, artist_versions_path(:search => {:updater_id => activity.user.id}) %></td>
</tr>
<% end %>

View File

@@ -21,7 +21,7 @@
<% end %>
</div>
</td>
<td><%= mod_link_to_user(activity.comment.creator, :negative) %></td>
<td><%= link_to_user(activity.comment.creator) %></td>
<td><%= activity.count %></td>
<td><%= activity.comment.score %></td>
</tr>

View File

@@ -9,7 +9,7 @@
<tbody>
<% @dashboard.notes.each do |activity| %>
<tr>
<td><%= mod_link_to_user(activity.user, :positive) %></td>
<td><%= link_to_user(activity.user) %></td>
<td><%= link_to activity.count, note_versions_path(:search => {:updater_id => activity.user.id}) %></td>
</tr>
<% end %>

View File

@@ -9,7 +9,7 @@
<tbody>
<% @dashboard.tags.each do |activity| %>
<tr>
<td><%= mod_link_to_user(activity.user, :positive) %></td>
<td><%= link_to_user(activity.user) %></td>
<td><%= link_to activity.count, post_versions_path(:search => {:updater_id => activity.user.id}) %></td>
</tr>
<% end %>

View File

@@ -9,7 +9,7 @@
<tbody>
<% @dashboard.posts.each do |activity| %>
<tr>
<td><%= mod_link_to_user(activity.user, :positive) %></td>
<td><%= link_to_user(activity.user) %></td>
<td><%= link_to activity.count, posts_path(:tags => "user:#{activity.user.name}") %></td>
</tr>
<% end %>

View File

@@ -9,7 +9,7 @@
<tbody>
<% @dashboard.wiki_pages.each do |activity| %>
<tr>
<td><%= mod_link_to_user(activity.user, :positive) %></td>
<td><%= link_to_user(activity.user) %></td>
<td><%= link_to activity.count, wiki_page_versions_path(:search => {:updater_id => activity.user.id}) %></td>
</tr>
<% end %>