mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
Add user mention partial
This commit is contained in:
12
app/assets/stylesheets/user_mention.css
Normal file
12
app/assets/stylesheets/user_mention.css
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
.avatar {
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.current-user {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.current-user .avatar {
|
||||
border: 2px solid #00dded;
|
||||
}
|
||||
@@ -31,11 +31,8 @@
|
||||
|
||||
<div class="header">
|
||||
<% if current_user %>
|
||||
<div class="user-info">
|
||||
<%= image_tag current_user.avatar_url, size: "32x32", class: "avatar" if current_user.avatar_url %>
|
||||
<%= current_user.username if current_user.username %>
|
||||
<%= link_to "Sign Out", signout_path, method: :delete, data: { "turbo-method": :delete } %>
|
||||
</div>
|
||||
<%= render "shared/user_mention", user: current_user %>
|
||||
<%= link_to "Sign Out", signout_path, method: :delete, data: { "turbo-method": :delete } %>
|
||||
<% else %>
|
||||
<%= link_to "Sign in with Slack", slack_auth_path %>
|
||||
<% end %>
|
||||
|
||||
7
app/views/shared/_user_mention.html.erb
Normal file
7
app/views/shared/_user_mention.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<div class="user-info <%= current_user == user ? "current-user" : "" %>">
|
||||
<%= image_tag user.avatar_url,
|
||||
size: "32x32",
|
||||
class: "avatar",
|
||||
alt: "#{user.username}'s avatar" if user.avatar_url %>
|
||||
<%= user.username if user.username %>
|
||||
</div>
|
||||
Reference in New Issue
Block a user