Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-01 21:04:11 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-01 21:04:11 +0400
commite6002bdaffc819ea3b743955315cf50eb804dbdb (patch)
treeaa96a40822436bd9a33b88e8741376164320a8a7 /app/views
parent591e094e0636c084f218d52f25c01d51f7d3ecf5 (diff)
Ability to manage and remove group as owner outside of admin area
Diffstat (limited to 'app/views')
-rw-r--r--app/views/groups/edit.html.haml50
-rw-r--r--app/views/layouts/group.html.haml6
-rw-r--r--app/views/projects/_form.html.haml2
-rw-r--r--app/views/teams/edit.html.haml8
4 files changed, 60 insertions, 6 deletions
diff --git a/app/views/groups/edit.html.haml b/app/views/groups/edit.html.haml
new file mode 100644
index 00000000000..7202ef26c70
--- /dev/null
+++ b/app/views/groups/edit.html.haml
@@ -0,0 +1,50 @@
+%h3.page_title Edit Group
+%hr
+= form_for @group do |f|
+ - if @group.errors.any?
+ .alert.alert-error
+ %span= @group.errors.full_messages.first
+ .clearfix
+ = f.label :name do
+ Group name is
+ .input
+ = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left"
+ &nbsp;
+ = f.submit 'Save group', class: "btn btn-save"
+%hr
+
+
+.row
+ .span7
+ .ui-box
+ %h5.title Projects
+ %ul.well-list
+ - @group.projects.each do |project|
+ %li
+ - if project.public
+ %i.icon-share
+ - else
+ %i.icon-lock.cgreen
+ = link_to project.name_with_namespace, project
+ .pull-right
+ = link_to 'Team', project_team_index_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
+ = link_to 'Edit', edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
+ = link_to 'Remove', project, confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove"
+
+ .span5
+ .ui-box
+ %h5.title Transfer group
+ .padded
+ %p
+ Transferring group will cause loss of admin control over group and all child projects
+ = form_for @group do |f|
+ = f.select :owner_id, User.all.map { |user| [user.name, user.id] }, {}, {class: 'chosen'}
+ = f.submit 'Transfer group', class: "btn btn-small"
+ .ui-box
+ %h5.title Remove group
+ .padded.bgred
+ %p
+ Remove of group will cause removing all child projects and resources
+ %br
+ Removed group can not be restored!
+ = link_to 'Remove Group', @group, confirm: 'Removed group can not be restored! Are you sure?', method: :delete, class: "btn btn-remove btn-small"
diff --git a/app/views/layouts/group.html.haml b/app/views/layouts/group.html.haml
index 4395e408649..9057ad50ce6 100644
--- a/app/views/layouts/group.html.haml
+++ b/app/views/layouts/group.html.haml
@@ -22,4 +22,10 @@
= nav_link(path: 'groups#people') do
= link_to "People", people_group_path(@group)
+ - if can?(current_user, :manage_group, @group)
+ = nav_link(path: 'groups#edit') do
+ = link_to edit_group_path(@group), class: "tab " do
+ %i.icon-edit
+ Edit Group
+
.content= yield
diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml
index 8d3b1aded5c..0336654dc69 100644
--- a/app/views/projects/_form.html.haml
+++ b/app/views/projects/_form.html.haml
@@ -42,7 +42,7 @@
= f.check_box :wiki_enabled
%span.descr Pages for project documentation
- - if can? current_user, :change_public_mode, @project
+ - if can?(current_user, :change_public_mode, @project)
%fieldset.features
%legend
%i.icon-share
diff --git a/app/views/teams/edit.html.haml b/app/views/teams/edit.html.haml
index a3b1c734414..e0962f2b05b 100644
--- a/app/views/teams/edit.html.haml
+++ b/app/views/teams/edit.html.haml
@@ -15,8 +15,6 @@
Team path is
.input
= f.text_field :path, placeholder: "opensource", class: "xxlarge left"
- .clearfix
- .input.span3.center
- = f.submit 'Save team changes', class: "btn btn-primary"
- .input.span3.center
- = link_to 'Delete team', team_path(@team), method: :delete, confirm: "You are shure?", class: "btn btn-remove"
+ .form-actions
+ = f.submit 'Save team changes', class: "btn btn-primary"
+ = link_to 'Delete team', team_path(@team), method: :delete, confirm: "You are shure?", class: "btn btn-remove pull-right"