mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-01 02:05:41 +08:00
Add tooltips for users on project cards
This commit is contained in:
parent
163a2d1e60
commit
cd43973952
2 changed files with 17 additions and 2 deletions
|
@ -5,6 +5,14 @@ module ProjectsHelper
|
||||||
t('user_projects.enums.role.' + user_project.role)
|
t('user_projects.enums.role.' + user_project.role)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def user_names_with_roles(user_projects)
|
||||||
|
user_projects.map { |up| user_name_with_role(up) }.join('
')
|
||||||
|
end
|
||||||
|
|
||||||
|
def user_name_with_role(user_project)
|
||||||
|
"#{user_project.user.name} - #{I18n.t("user_projects.enums.role.#{user_project.role}")}"
|
||||||
|
end
|
||||||
|
|
||||||
def construct_module_connections(my_module)
|
def construct_module_connections(my_module)
|
||||||
conns = []
|
conns = []
|
||||||
my_module.outputs.each do |output|
|
my_module.outputs.each do |output|
|
||||||
|
|
|
@ -37,12 +37,19 @@
|
||||||
<span class="card-label"><%= t('projects.index.card.users') %></span>
|
<span class="card-label"><%= t('projects.index.card.users') %></span>
|
||||||
<div class="value">
|
<div class="value">
|
||||||
|
|
||||||
<% project.users.each do |user| %>
|
<% project.user_projects[0..4].each do |user_project| %>
|
||||||
<span class="global-avatar-container">
|
<span class="global-avatar-container">
|
||||||
<%= image_tag avatar_path(user, :icon_small) %>
|
<%= image_tag(avatar_path(user_project.user, :icon_small), title: user_name_with_role(user_project)) %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<% more_users = project.user_projects[5..-1].to_a %>
|
||||||
|
<% if more_users.any? %>
|
||||||
|
<a href="" title="<%= user_names_with_roles(more_users) %>">
|
||||||
|
+ <%= more_users.size %>
|
||||||
|
</a>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% if project.active? %>
|
<% if project.active? %>
|
||||||
<%= link_to project_users_edit_path(project),
|
<%= link_to project_users_edit_path(project),
|
||||||
class: 'manage-users-link',
|
class: 'manage-users-link',
|
||||||
|
|
Loading…
Reference in a new issue