From 21b4ba7627ceba4850e66cad4b3c63a394b5fc5b Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Wed, 28 Jun 2017 17:15:09 +0200 Subject: [PATCH 1/4] fix bugs on projects page --- app/assets/javascripts/application.js.erb | 1 - app/views/user_projects/_index.html.erb | 11 ++++++----- app/views/user_projects/_index_edit.html.erb | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index 240899728..fcea01b3b 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -60,7 +60,6 @@ function initFormSubmitLinks(el) { } /* Enable loading bars */ -Turbolinks.enableProgressBar(); $(document) .bind("ajaxSend", function(){ animateLoading(); diff --git a/app/views/user_projects/_index.html.erb b/app/views/user_projects/_index.html.erb index 2956ce50c..57498aa97 100644 --- a/app/views/user_projects/_index.html.erb +++ b/app/views/user_projects/_index.html.erb @@ -4,18 +4,19 @@ <% if @users.size == 0 then %>
  • <%= t 'projects.index.no_users' %>
  • <% else %> - <% @users.each_index do |i| user = @users[i].user %> + + <% @users.each_with_index do |user_proj, i| %>
  • <% if i > 0 %>
    <% end %>
    - <%= image_tag avatar_path(user, :icon_small), class: 'img-circle pull-left' %> + <%= image_tag avatar_path(user_proj.user, :icon_small), class: 'img-circle pull-left' %>
    - <%= user.full_name %> -
    <%= t('user_projects.enums.role.'<<@users[i].role.to_s) %> + <%= user_proj.user.full_name %> +
    <%= t('user_projects.enums.role.'<< user_proj.role.to_s) %>
    -
    +
  • <% end %> <% end %> diff --git a/app/views/user_projects/_index_edit.html.erb b/app/views/user_projects/_index_edit.html.erb index 199a6c410..ec5e69381 100644 --- a/app/views/user_projects/_index_edit.html.erb +++ b/app/views/user_projects/_index_edit.html.erb @@ -3,26 +3,26 @@ <% if @users.size == 0 then %>
  • <%= t 'projects.index.modal_manage_users.no_users' %>
  • <% else %> - <% @users.each_index do |i| user = @users[i].user %> + <% @users.each_with_index do |user_proj, i| %>
  • <% if i > 0 %>
    <% end %>
    - <%= image_tag avatar_path(user, :icon_small), class: 'img-circle pull-left' %> + <%= image_tag avatar_path(user_proj.user, :icon_small), class: 'img-circle pull-left' %>
    - <%= user.full_name %> -
    <%= t('user_projects.enums.role.'<<@users[i].role) %> + <%= user_proj.user.full_name %> +
    <%= t('user_projects.enums.role.'<< user_proj.role) %>
    - <% unless user.id == current_user.id %> + <% unless user_proj.user.id == current_user.id %>
     
    - <%= form_for @up, url: project_user_project_path(@project, @users[i].id, method: :put, format: :json), format: :json, method: 'put', remote: true, html: { class: 'update-user-form' } do |f| %> + <%= 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| %> <% # TODO replace with form helper %> - + <% # TODO replace hardcoded select html with rails helper %>