2012-10-02 18:01:40 +02:00
%h3.page_title
Group: #{@group.name}
%br
%table.zebra-striped
%thead
%tr
%th Group
%th
%tr
%td
%b
Name:
%td
= @group.name
2012-12-03 19:14:05 +01:00
= link_to edit_admin_group_path(@group), class: "btn btn-small right" do
%i.icon-edit
Rename
2012-10-02 18:01:40 +02:00
%tr
%td
%b
2012-11-23 19:31:09 +01:00
Path:
2012-10-02 18:01:40 +02:00
%td
2012-12-15 01:16:25 +01:00
%span.monospace= File.join(Gitlab.config.gitolite.repos_path, @group.path)
2012-10-02 18:01:40 +02:00
%tr
%td
%b
Owner:
%td
= @group.owner_name
2012-12-03 19:14:05 +01:00
.right
= link_to "#", class: "btn btn-small change-owner-link" do
%i.icon-edit
Change owner
2012-12-14 04:14:05 +01:00
%tr.change-owner-holder.hide
%td.bgred
%b.cred
New Owner:
%td.bgred
= form_for [:admin, @group] do |f|
= f.select :owner_id, User.all.map { |user| [user.name, user.id] }, {}, {class: 'chosen'}
%div
2013-01-29 21:18:19 +01:00
= f.submit 'Change Owner', class: "btn btn-remove"
2012-12-14 04:14:05 +01:00
= link_to "Cancel", "#", class: "btn change-owner-cancel-link"
2012-12-25 23:52:20 +01:00
- if @group.projects.any?
%fieldset
%legend Projects (#{@group.projects.count})
%table
%thead
%tr
%th Project name
%th Path
%th Users
%th.cred Danger Zone!
- @group.projects.each do |project|
%tr
%td
= link_to project.name_with_namespace, [:admin, project]
%td
%span.monospace= project.path_with_namespace + ".git"
%td= project.users.count
%td.bgred
2013-01-29 21:18:19 +01:00
= link_to 'Transfer project to global namespace', remove_project_admin_group_path(@group, project_id: project.id), confirm: 'Remove project from group and move to global namespace. Are you sure?', method: :delete, class: "btn btn-remove small"
2012-12-25 23:52:20 +01:00
= form_tag project_teams_update_admin_group_path(@group), id: "new_team_member", class: "bulk_import", method: :put do
%table.zebra-striped
%thead
%tr
%th Users
%th Project Access:
2013-01-25 19:37:38 +01:00
- @group.users.each do |user|
- next unless user
%tr{class: "user_#{user.id}"}
%td.name= link_to user.name, admin_user_path(user)
2012-12-25 23:52:20 +01:00
%td.projects_access
2013-01-25 19:37:38 +01:00
- user.authorized_projects.in_namespace(@group).each do |project|
- u_p = user.users_projects.in_project(project).first
2013-01-02 19:59:47 +01:00
- next unless u_p
2012-12-26 12:15:28 +01:00
%span
2013-01-25 19:37:38 +01:00
= project.name_with_namespace
= link_to "(#{ u_p.project_access_human })", edit_admin_project_member_path(project, user)
2012-12-03 19:14:05 +01:00
%tr
2012-12-25 23:52:20 +01:00
%td.input= select_tag :user_ids, options_from_collection_for_select(@users , :id, :name), multiple: true, data: {placeholder: 'Select users'}, class: 'chosen span5'
%td= select_tag :project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span3"}
2012-12-03 19:14:05 +01:00
%tr
2013-01-29 21:18:19 +01:00
%td= submit_tag 'Add user to projects in group', class: "btn btn-primary"
2012-12-03 19:14:05 +01:00
%td
2012-12-25 23:52:20 +01:00
Read more about project permissions
%strong= link_to "here", help_permissions_path, class: "vlink"
2012-10-02 18:01:40 +02:00
2012-12-25 23:52:20 +01:00
- else
%fieldset
%legend Group is empty
2012-11-27 07:31:15 +01:00
2012-10-02 18:01:40 +02:00
= form_tag project_update_admin_group_path(@group), class: "bulk_import", method: :put do
2012-11-27 07:31:15 +01:00
%fieldset
%legend Move projects to group
2012-12-03 19:14:05 +01:00
.alert
You can move only projects with existing repos
%br
Group projects will be moved in group directory and will not be accessible by old path
2012-11-27 07:31:15 +01:00
.clearfix
= label_tag :project_ids do
Projects
.input
= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name_with_namespace), multiple: true, data: {placeholder: 'Select projects'}, class: 'chosen span5'
.form-actions
2013-01-29 21:18:19 +01:00
= submit_tag 'Add', class: "btn btn-primary"
2012-12-03 19:14:05 +01:00
:javascript
$(function(){
var modal = $('.change-owner-holder');
$('.change-owner-link').bind("click", function(){
$(this).hide();
modal.show();
});
$('.change-owner-cancel-link').bind("click", function(){
modal.hide();
$('.change-owner-link').show();
})
})