From 2ab74c8979173a7cf1d4c21113bac5316f955e5e Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Thu, 29 Jun 2017 12:56:14 +0200 Subject: [PATCH] add user variable --- app/views/user_projects/_index.html.erb | 7 +++---- app/views/user_projects/_index_edit.html.erb | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/views/user_projects/_index.html.erb b/app/views/user_projects/_index.html.erb index 57498aa97..be9a9f2b7 100644 --- a/app/views/user_projects/_index.html.erb +++ b/app/views/user_projects/_index.html.erb @@ -4,16 +4,15 @@ <% if @users.size == 0 then %>
  • <%= t 'projects.index.no_users' %>
  • <% else %> - - <% @users.each_with_index do |user_proj, i| %> + <% @users.each_with_index do |user_proj, i| user = user_proj.user %>
  • <% if i > 0 %>
    <% end %>
    - <%= image_tag avatar_path(user_proj.user, :icon_small), class: 'img-circle pull-left' %> + <%= image_tag avatar_path(user, :icon_small), class: 'img-circle pull-left' %>
    - <%= user_proj.user.full_name %> + <%= user.full_name %>
    <%= t('user_projects.enums.role.'<< user_proj.role.to_s) %>
    diff --git a/app/views/user_projects/_index_edit.html.erb b/app/views/user_projects/_index_edit.html.erb index ec5e69381..0794c0545 100644 --- a/app/views/user_projects/_index_edit.html.erb +++ b/app/views/user_projects/_index_edit.html.erb @@ -3,21 +3,21 @@ <% if @users.size == 0 then %>
  • <%= t 'projects.index.modal_manage_users.no_users' %>
  • <% else %> - <% @users.each_with_index do |user_proj, i| %> + <% @users.each_with_index do |user_proj, i| user = user_proj.user %>
  • <% if i > 0 %>
    <% end %>
    - <%= image_tag avatar_path(user_proj.user, :icon_small), class: 'img-circle pull-left' %> + <%= image_tag avatar_path(user, :icon_small), class: 'img-circle pull-left' %>
    - <%= user_proj.user.full_name %> + <%= user.full_name %>
    <%= t('user_projects.enums.role.'<< user_proj.role) %>
    - <% unless user_proj.user.id == current_user.id %> + <% unless user.id == current_user.id %>
     
    <%= form_for @up, url: project_user_project_path(@project, user_proj.id, method: :put, format: :json), format: :json, method: 'put', remote: true, html: { class: 'update-user-form' } do |f| %>