diff --git a/app/assets/stylesheets/projects.scss b/app/assets/stylesheets/projects.scss index e6d880fe5..50472f0f3 100644 --- a/app/assets/stylesheets/projects.scss +++ b/app/assets/stylesheets/projects.scss @@ -528,7 +528,7 @@ li.module-hover { grid-auto-rows: 2em; grid-column-gap: 1em; grid-row-gap: 1em; - grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); + grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); width: 100%; .table-header { @@ -771,7 +771,7 @@ li.module-hover { grid-auto-rows: 2em; grid-column-gap: 1em; grid-row-gap: 1em; - grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); + grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); width: 100%; .table-header { @@ -930,6 +930,23 @@ li.module-hover { display: none; } + .more-users { + align-items: center; + background: $color-volcano; + border-radius: 50%; + color: $color-white; + cursor: pointer; + display: flex; + height: 2em; + justify-content: center; + margin-right: .25em; + width: 2em; + + &:hover { + text-decoration: none; + } + } + .new-user { align-items: center; background: $color-concrete; diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index fd30443c8..b3747a828 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -5,6 +5,14 @@ module ProjectsHelper t('user_projects.enums.role.' + user_project.role) end + def user_names_with_roles(user_projects) + user_projects.map { |up| user_name_with_role(up) }.join(' ').html_safe + end + + def user_name_with_role(user_project) + "#{sanitize_input(user_project.user.name)} - #{I18n.t("user_projects.enums.role.#{user_project.role}")}" + end + def construct_module_connections(my_module) conns = [] my_module.outputs.each do |output| diff --git a/app/views/projects/index/_project_card.html.erb b/app/views/projects/index/_project_card.html.erb index 26329d1b5..7a3e9f32c 100644 --- a/app/views/projects/index/_project_card.html.erb +++ b/app/views/projects/index/_project_card.html.erb @@ -37,12 +37,19 @@ <%= t('projects.index.card.users') %>
- <% project.users.each do |user| %> + <% project.user_projects[0..3].each do |user_project| %> - <%= image_tag avatar_path(user, :icon_small) %> + <%= image_tag(avatar_path(user_project.user, :icon_small), title: user_name_with_role(user_project)) %> <% end %> + <% more_users = project.user_projects[4..-1].to_a %> + <% if more_users.any? %> + + +<%= more_users.size %> + + <% end %> + <% if project.active? %> <%= link_to project_users_edit_path(project), class: 'manage-users-link',