Commit a8557183 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Redesign team.members pages

parent d6cebe34
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
- allow_admin = can? current_user, :manage_user_team, @team - allow_admin = can? current_user, :manage_user_team, @team
%li{id: dom_id(member), class: "team_member_row user_#{user.id}"} %li{id: dom_id(member), class: "team_member_row user_#{user.id}"}
.row .row
.span5 .span4
= link_to user_path(user.username), title: user.name, class: "dark" do = link_to user_path(user.username), 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 user_path(user.username), title: user.name, class: "dark" do = link_to user_path(user.username), title: user.name, class: "dark" do
...@@ -10,21 +10,22 @@ ...@@ -10,21 +10,22 @@
%br %br
%small.cgray= user.username %small.cgray= user.username
.span4 .span7.pull-right
- if allow_admin - if allow_admin
= form_for(member, as: :team_member, url: team_member_path(@team, user)) do |f| .pull-left
= f.select :permission, options_for_select(UsersProject.access_roles, @team.default_projects_access(user)), {}, class: "medium trigger-submit" = form_for(member, as: :team_member, url: team_member_path(@team, user)) do |f|
%br = label_tag do
= label_tag do = f.check_box :group_admin, class: 'trigger-submit'
= f.check_box :group_admin, class: 'trigger-submit' %span Admin access
%span Admin access  
.pull-right = f.select :permission, options_for_select(UsersProject.access_roles, @team.default_projects_access(user)), {}, class: "medium trigger-submit"
- if current_user == user .pull-right
%span.btn.disabled This is you! - if current_user == user
- if @team.owner == user %span.btn.disabled This is you!
%span.btn.disabled Owner - if @team.owner == user
- elsif user.blocked? %span.btn.disabled Owner
%span.btn.disabled.blocked Blocked - elsif user.blocked?
- elsif allow_admin %span.btn.disabled.blocked Blocked
= link_to team_member_path(@team, user), confirm: remove_from_user_team_message(@team, user), method: :delete, class: "btn-tiny btn btn-remove", title: "Remove from team" do - elsif allow_admin
%i.icon-minus.icon-white = link_to team_member_path(@team, user), confirm: remove_from_user_team_message(@team, user), method: :delete, class: "btn-tiny btn btn-remove", title: "Remove from team" do
%i.icon-minus.icon-white
%h3.page_title %h3.page_title
Team: #{@team.name} Team: #{@team.name}
%fieldset %hr
%legend Members (#{@team.members.count})
= form_tag team_members_path(@team), id: "team_members", class: "bulk_import", method: :post do = form_tag team_members_path(@team), id: "team_members", class: "bulk_import", method: :post do
%table#members_list %h6 1. Choose people you want in the team
%thead .clearfix
%tr = label_tag :user_ids, "People"
%th User name .input
%th Default project access = users_select_tag(:user_ids, multiple: true)
%th Team access
%th %h6 2. Set access level for them
- @team.members.each do |member| .clearfix
%tr.member = label_tag :project_access, "Project Access"
%td .input= select_tag :default_project_access, options_for_select(Project.access_options), class: "project-access-select chosen"
= member.name
%small= "(#{member.username})" .clearfix
%td= @team.human_default_projects_access(member) = label_tag :group_admin do
%td= @team.admin?(member) ? "Admin" : "Member" %span Team Admin?
%td .input= check_box_tag :group_admin
%tr
%td .actions
= users_select_tag(:user_ids, multiple: true) = submit_tag 'Add users', class: "btn btn-create", id: :add_members_to_team
%td= select_tag :default_project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span3" } = link_to "Cancel", team_members_path(@team), class: "btn btn-cancel"
%td
%span= check_box_tag :group_admin
%span Admin?
%td= submit_tag 'Add User', class: "btn btn-create", id: :add_members_to_team
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