mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
Add conditional shows for different aspects of user_mention
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
<span class="rank"><%= (entries.index(entry) + 1).ordinalize %></span>
|
||||
<% end %>
|
||||
<span class="user" style="display: inline-block;">
|
||||
<%= render "shared/user_mention", user: entry.user %>
|
||||
<%= render "shared/user_mention", user: entry.user, show: [:neighborhood] %>
|
||||
</span>
|
||||
<span class="time"><%= short_time_detailed entry.total_seconds %></span>
|
||||
</div>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<% @entries.each_with_index do |entry, index| %>
|
||||
<tr>
|
||||
<td><%= (index + 1).ordinalize %></td>
|
||||
<td><%= render "shared/user_mention", user: entry.user %></td>
|
||||
<td><%= render "shared/user_mention", user: entry.user, show: [:neighborhood, :slack] %></td>
|
||||
<td><%= short_time_detailed entry.total_seconds %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
size: "32x32",
|
||||
class: "avatar",
|
||||
alt: "#{user.username}'s avatar" if user.avatar_url %>
|
||||
<% if user.slack_uid.present? %>
|
||||
<% if local_assigns.fetch(:show, []).include?(:slack) && user.slack_uid.present? %>
|
||||
<%= link_to "@#{user.display_name}", "https://slack.com/app_redirect?channel=#{user.slack_uid}", target: "_blank" %>
|
||||
<% else %>
|
||||
<%= user.display_name %>
|
||||
<% end %>
|
||||
<% if user.slack_uid.present? && neighborhood = SlackNeighborhood.find_by_id(user.slack_uid) %>
|
||||
<% if local_assigns.fetch(:show, []).include?(:neighborhood) && user.slack_uid.present? && neighborhood = SlackNeighborhood.find_by_id(user.slack_uid) %>
|
||||
<%= link_to "🏘️", "https://slack.com/app_redirect?channel=#{neighborhood.dig("id")}", target: "_blank" %>
|
||||
<% end %>
|
||||
<% unless current_user == user %>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<hr>
|
||||
<ul>
|
||||
<% users.each do |user| %>
|
||||
<%= render "shared/user_mention", user: user %>
|
||||
<%= render "shared/user_mention", user: user, show: [:slack] %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user