Commit 44209861 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Allow group path renaming. Dont show project transfer if no permissions. More danger messages :)

parent a8fbda94
...@@ -100,6 +100,12 @@ input[type='search'].search-text-input { ...@@ -100,6 +100,12 @@ input[type='search'].search-text-input {
border: 1px solid #ccc; border: 1px solid #ccc;
} }
input[type='text'].danger {
background: #F2DEDE!important;
border-color: #D66;
text-shadow: 0 1px 1px #fff
}
fieldset legend { font-size: 17px; } fieldset legend { font-size: 17px; }
/** PAGINATION **/ /** PAGINATION **/
......
%h3.page_title Rename Group %h3.page_title Rename Group
%hr %hr
.alert
Renaming group can have unintended side effects.
%br
Renaming group will rename directory for all related projects
= form_for [:admin, @group] do |f| = form_for [:admin, @group] do |f|
- if @group.errors.any? - if @group.errors.any?
.alert-message.block-message.error .alert-message.block-message.error
...@@ -14,6 +10,19 @@ ...@@ -14,6 +10,19 @@
.input .input
= f.text_field :name, placeholder: "Example Group", class: "xxlarge" = f.text_field :name, placeholder: "Example Group", class: "xxlarge"
.clearfix.group_name_holder
= f.label :path do
%span.cred Group path is
.input
= f.text_field :path, placeholder: "example-group", class: "xxlarge danger"
%ul.cred
%li Changing group path can have unintended side effects.
%li Renaming group path will rename directory for all related projects
%li It will change web url for access group and group projects.
%li It will change the git path to repositories under this group.
.form-actions .form-actions
= f.submit 'Rename group', class: "btn save-btn" = f.submit 'Rename group', class: "btn danger"
= link_to 'Cancel', admin_groups_path, class: "btn cancel-btn" = link_to 'Cancel', admin_groups_path, class: "btn cancel-btn"
...@@ -33,12 +33,17 @@ ...@@ -33,12 +33,17 @@
= link_to "#", class: "btn btn-small change-owner-link" do = link_to "#", class: "btn btn-small change-owner-link" do
%i.icon-edit %i.icon-edit
Change owner Change owner
.change-owner-holder.hide
= form_for [:admin, @group] do |f|
= f.select :owner_id, User.all.map { |user| [user.name, user.id] }, {}, {class: 'chosen'}
= f.submit 'Save', class: "btn btn-small save-btn"
= link_to "Cancel", "#", class: "btn btn-small change-owner-cancel-link"
%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
= f.submit 'Change Owner', class: "btn danger"
= link_to "Cancel", "#", class: "btn change-owner-cancel-link"
%fieldset %fieldset
%legend Projects (#{@group.projects.count}) %legend Projects (#{@group.projects.count})
%table %table
......
...@@ -17,19 +17,6 @@ ...@@ -17,19 +17,6 @@
.controls .controls
= text_field_tag :ppath, @project.path_to_repo, class: "xxlarge", readonly: true = text_field_tag :ppath, @project.path_to_repo, class: "xxlarge", readonly: true
.control-group
= f.label :namespace_id do
%span Namespace
.controls
- if can? current_user, :change_namespace, @project
= f.select :namespace_id, namespaces_options(@project.namespace_id || Namespace::global_id), {prompt: 'Choose a project namespace'}, {class: 'chosen'}
 
%span.cred Be careful. Changing project namespace can have unintended side effects
- else
%a.btn.disabled= @project.namespace.try(:human_name) || "/"
 
%span.cred Only owner can change project namespace.
- unless @project.heads.empty? - unless @project.heads.empty?
.clearfix .clearfix
...@@ -63,6 +50,22 @@ ...@@ -63,6 +50,22 @@
= f.check_box :wiki_enabled = f.check_box :wiki_enabled
%span.descr Pages for project documentation %span.descr Pages for project documentation
- if can? current_user, :change_namespace, @project
%fieldset.features
%legend Transfer:
.control-group
= f.label :namespace_id do
%span Namespace
.controls
= f.select :namespace_id, namespaces_options(@project.namespace_id || Namespace::global_id), {prompt: 'Choose a project namespace'}, {class: 'chosen'}
%br
%ul.prepend-top-10.cred
%li Be careful. Changing project namespace can have unintended side effects
%li You can transfer project only to namespaces you can manage
%li You will need to update your local repositories to point to the new location.
%br %br
.actions .actions
......
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