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

Restyle admin:teams:show

parent ae90107c
%h3.page_title
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
%hr
.row
.span6
.ui-box
%h5.title
Team info:
%ul.well-list
%li
%span.light Name:
%strong= @team.name
%li
%span.light Path:
%strong
= @team.path
%li
%span.light Description:
%strong
= @team.description
%tr
%td
%b
Owner:
%td
= @team.owner.name
%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
%tr.change-owner-holder.hide
%td.bgred
%b.cred
New Owner:
%td.bgred
%li.change-owner-holder.hide.bgred
.form-holder
%strong.cred New Owner:
= 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
= 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"
%fieldset
%legend
%li
%span.light Created at:
%strong
= @team.created_at.stamp("March 1, 1999")
.span6
.ui-box
%h5.title
Members (#{@team.members.count})
%span= link_to 'Add members', new_admin_team_member_path(@team), class: "btn btn-primary btn-small pull-right", id: :add_members_to_team
- if @team.members.any?
%table#members_list
%thead
%tr
%th User name
%th Default project access
%th Team access
%th.cred.span3 Danger Zone!
.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|
%tr.member{ class: "user_#{member.id}"}
%td
%li.member{ class: "user_#{member.id}"}
= link_to [:admin, member] do
%strong
= member.name
%small= "(#{member.email})"
%td= @team.human_default_projects_access(member)
%td= @team.admin?(member) ? "Admin" : "Member"
%td.bgred
.pull-right
%span.light
= @team.human_default_projects_access(member)
- if @team.admin?(member)
%span.label.label-info Admin
 
= 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}"
%fieldset
%legend
.ui-box
%h5.title
Projects (#{@team.projects.count})
%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?
%table#projects_list
%thead
%tr
%th Project name
%th Max access
%th.cred.span3 Danger Zone!
.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|
%tr.project
%td
= link_to project.name_with_namespace, [:admin, project]
%td
%span= @team.human_max_project_access(project)
%td.bgred
%li.project
= link_to [:admin, project] do
%strong
= project.name_with_namespace
.pull-right
%span.light
= @team.human_max_project_access(project)
 
= 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