Commit 62a9bb5a authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Restyle admin:teams:show

parent ae90107c
%h3.page_title %h3.page_title
Team: #{@team.name} Team: #{@team.name}
%br
%table.zebra-striped
%thead
%tr
%th Team
%th
%tr
%td
%b
Name:
%td
= @team.name
 
= link_to edit_admin_team_path(@team), class: "btn btn-small pull-right" do
%i.icon-edit
Edit
%tr
%td
%b
Description:
%td
= @team.description
%tr
%td
%b
Owner:
%td
= @team.owner.name
.pull-right
= link_to "#", class: "btn btn-small change-owner-link" do
%i.icon-edit
Change owner
%tr.change-owner-holder.hide = link_to edit_admin_team_path(@team), class: "btn btn-small pull-right" do
%td.bgred %i.icon-edit
%b.cred Edit
New Owner: %hr
%td.bgred
= form_for @team, url: admin_team_path(@team) do |f|
= f.select :owner_id, User.all.map { |user| [user.name, user.id] }, {}, {class: 'chosen'}
%div
= f.submit 'Change Owner', class: "btn btn-remove"
= link_to "Cancel", "#", class: "btn change-owner-cancel-link"
%fieldset
%legend .row
Members (#{@team.members.count}) .span6
%span= link_to 'Add members', new_admin_team_member_path(@team), class: "btn btn-primary btn-small pull-right", id: :add_members_to_team .ui-box
- if @team.members.any? %h5.title
%table#members_list Team info:
%thead %ul.well-list
%tr %li
%th User name %span.light Name:
%th Default project access %strong= @team.name
%th Team access %li
%th.cred.span3 Danger Zone! %span.light Path:
- @team.members.each do |member| %strong
%tr.member{ class: "user_#{member.id}"} = @team.path
%td
%li
%span.light Description:
%strong
= @team.description
%li
%span.light Owned by:
%strong
- if @team.owner
= link_to @team.owner.name, admin_user_path(@team.owner)
- else
(deleted)
.pull-right
= link_to "#", class: "btn btn-small change-owner-link" do
%i.icon-edit
Change owner
%li.change-owner-holder.hide.bgred
.form-holder
%strong.cred New Owner:
= form_for @team, url: admin_team_path(@team) do |f|
= users_select_tag(:"user_team[owner_id]")
.prepend-top-10
= f.submit 'Change Owner', class: "btn btn-remove"
= link_to "Cancel", "#", class: "btn change-owner-cancel-link"
%li
%span.light Created at:
%strong
= @team.created_at.stamp("March 1, 1999")
.span6
.ui-box
%h5.title
Members (#{@team.members.count})
.pull-right
= link_to 'Add members', new_admin_team_member_path(@team), class: "btn btn-small", id: :add_members_to_team
%ul.well-list#members_list
- @team.members.each do |member|
%li.member{ class: "user_#{member.id}"}
= link_to [:admin, member] do = link_to [:admin, member] do
= member.name %strong
%small= "(#{member.email})" = member.name
%td= @team.human_default_projects_access(member) .pull-right
%td= @team.admin?(member) ? "Admin" : "Member" %span.light
%td.bgred = @team.human_default_projects_access(member)
= link_to 'Edit', edit_admin_team_member_path(@team, member), class: "btn btn-small" - if @team.admin?(member)
  %span.label.label-info Admin
= link_to 'Remove', admin_team_member_path(@team, member), confirm: 'Remove member from team. Are you sure?', method: :delete, class: "btn btn-remove btn-small", id: "remove_member_#{member.id}"  
= link_to 'Edit', edit_admin_team_member_path(@team, member), class: "btn btn-small"
 
= link_to 'Remove', admin_team_member_path(@team, member), confirm: 'Remove member from team. Are you sure?', method: :delete, class: "btn btn-remove btn-small", id: "remove_member_#{member.id}"
.ui-box
%h5.title
Projects (#{@team.projects.count})
.pull-right
= link_to 'Add projects', new_admin_team_project_path(@team), class: "btn btn-small", id: :assign_projects_to_team
%ul.well-list#projects_list
- @team.projects.each do |project|
%li.project
= link_to [:admin, project] do
%strong
= project.name_with_namespace
%fieldset .pull-right
%legend %span.light
Projects (#{@team.projects.count}) = @team.human_max_project_access(project)
%span= link_to 'Add projects', new_admin_team_project_path(@team), class: "btn btn-primary btn-small pull-right", id: :assign_projects_to_team  
- if @team.projects.any? = link_to 'Edit', edit_admin_team_project_path(@team, project), class: "btn btn-small"
%table#projects_list  
%thead = link_to 'Relegate', admin_team_project_path(@team, project), confirm: 'Remove project from team. Are you sure?', method: :delete, class: "btn btn-remove small", id: "relegate_project_#{project.id}"
%tr
%th Project name
%th Max access
%th.cred.span3 Danger Zone!
- @team.projects.each do |project|
%tr.project
%td
= link_to project.name_with_namespace, [:admin, project]
%td
%span= @team.human_max_project_access(project)
%td.bgred
= link_to 'Edit', edit_admin_team_project_path(@team, project), class: "btn btn-small"
 
= link_to 'Relegate', admin_team_project_path(@team, project), confirm: 'Remove project from team. Are you sure?', method: :delete, class: "btn btn-remove small", id: "relegate_project_#{project.id}"
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