Commit 52d29f5d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Project team page improved

parent 38c2cfb9
...@@ -181,11 +181,12 @@ span.update-author { ...@@ -181,11 +181,12 @@ span.update-author {
} }
&.joined { &.joined {
background-color: #1cb9ff; background-color: #1ca9dd;
} }
&.left { &.left {
background-color: #ff5057; background-color: #888;
float:none;
} }
} }
......
...@@ -2,5 +2,9 @@ module ProjectsHelper ...@@ -2,5 +2,9 @@ module ProjectsHelper
def grouper_project_members(project) def grouper_project_members(project)
@project.users_projects.sort_by(&:project_access).reverse.group_by(&:project_access) @project.users_projects.sort_by(&:project_access).reverse.group_by(&:project_access)
end end
def remove_from_team_message(project, member)
"You are going to remove #{member.user_name} from #{project.name}. Are you sure?"
end
end end
- user = member.user - user = member.user
- allow_admin = can? current_user, :admin_project, @project - allow_admin = can? current_user, :admin_project, @project
%tr{id: dom_id(member), class: "team_member_row user_#{user.id}"} %tr{id: dom_id(member), class: "team_member_row user_#{user.id}"}
%td %td.span6
= link_to project_team_member_path(@project, member), title: user.name, class: "dark" do = link_to project_team_member_path(@project, member), title: user.name, class: "dark" do
= image_tag gravatar_icon(user.email, 40), class: "avatar s32" = image_tag gravatar_icon(user.email, 40), class: "avatar s32"
= link_to project_team_member_path(@project, member), title: user.name, class: "dark" do = link_to project_team_member_path(@project, member), title: user.name, class: "dark" do
%strong= truncate(user.name, lenght: 40) %strong= truncate(user.name, lenght: 40)
%br %br
%div.cgray= user.email %small.cgray= user.email
%td %td.span5
.right .right
- if current_user == user
%span.btn.disabled This is you!
- if @project.owner == user - if @project.owner == user
%span.btn.disabled.success Project Owner %span.btn.disabled.success Owner
- if user.blocked - elsif user.blocked
%span.btn.disabled.blocked Blocked %span.btn.disabled.blocked Blocked
- elsif allow_admin
= link_to project_team_member_path(project_id: @project, id: member.id), confirm: remove_from_team_message(@project, member), method: :delete, class: "very_small btn danger" do
%i.icon-minus.icon-white
- if allow_admin - if allow_admin
= form_for(member, as: :team_member, url: project_team_member_path(@project, member)) do |f| = form_for(member, as: :team_member, url: project_team_member_path(@project, member)) do |f|
= f.select :project_access, options_for_select(UsersProject.access_roles, member.project_access), {}, class: "medium project-access-select" = f.select :project_access, options_for_select(UsersProject.access_roles, member.project_access), {}, class: "medium project-access-select span2"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment