summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-12-03 19:46:47 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-12-03 19:46:47 +0000
commite7452c6b8fd7705f24e2f95b82fcb9deb6d3a7ef (patch)
tree93b5d37b82f0d0a45f4e7a6812f60de68f571422
parent805b4cf522b183105100d726d74f5761917f1766 (diff)
parentfc5afc60ace366fd010f1df1484d2f048c162a7b (diff)
downloadgitlab-ce-e7452c6b8fd7705f24e2f95b82fcb9deb6d3a7ef.tar.gz
Merge branch 'ui/new-project' into 'master'
UI: New Project form tweaks Depends on !1953 See the commits for more details, the messages mostly speak for themselves. Before: ![Screen_Shot_2015-12-02_at_17.43.23](/uploads/302e734f6796a85a9f4be9c2f494869d/Screen_Shot_2015-12-02_at_17.43.23.png) After: ![Screen_Shot_2015-12-02_at_17.44.11](/uploads/411980e53a4f87cf0a04e5bcb7329f82/Screen_Shot_2015-12-02_at_17.44.11.png) See merge request !1964
-rw-r--r--app/assets/stylesheets/framework/forms.scss8
-rw-r--r--app/helpers/namespaces_helper.rb6
-rw-r--r--app/views/projects/new.html.haml33
3 files changed, 26 insertions, 21 deletions
diff --git a/app/assets/stylesheets/framework/forms.scss b/app/assets/stylesheets/framework/forms.scss
index cc92966c458..032d343df44 100644
--- a/app/assets/stylesheets/framework/forms.scss
+++ b/app/assets/stylesheets/framework/forms.scss
@@ -91,9 +91,17 @@ label {
}
.input-group {
+ .select2-container {
+ display: table-cell;
+ width: 200px !important;
+ }
.input-group-addon {
background-color: #f7f8fa;
}
+ .input-group-addon:not(:first-child):not(:last-child) {
+ border-left: 0;
+ border-right: 0;
+ }
}
.help-block {
diff --git a/app/helpers/namespaces_helper.rb b/app/helpers/namespaces_helper.rb
index e7f3cb21038..faba418c4db 100644
--- a/app/helpers/namespaces_helper.rb
+++ b/app/helpers/namespaces_helper.rb
@@ -1,10 +1,10 @@
module NamespacesHelper
- def namespaces_options(selected = :current_user, scope = :default)
+ def namespaces_options(selected = :current_user, display_path: false)
groups = current_user.owned_groups + current_user.masters_groups
users = [current_user.namespace]
- group_opts = ["Groups", groups.sort_by(&:human_name).map {|g| [g.human_name, g.id]} ]
- users_opts = [ "Users", users.sort_by(&:human_name).map {|u| [u.human_name, u.id]} ]
+ group_opts = ["Groups", groups.sort_by(&:human_name).map {|g| [display_path ? g.path : g.human_name, g.id]} ]
+ users_opts = [ "Users", users.sort_by(&:human_name).map {|u| [display_path ? u.path : u.human_name, u.id]} ]
options = []
options << group_opts
diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml
index c9d1fc3da21..a4bd8d54af2 100644
--- a/app/views/projects/new.html.haml
+++ b/app/views/projects/new.html.haml
@@ -11,16 +11,21 @@
Project path
.col-sm-10
.input-group
- = f.text_field :path, placeholder: "my-awesome-project", class: "form-control", tabindex: 1, autofocus: true, required: true
- .input-group-addon
- \.git
-
- - if current_user.can_select_namespace?
- .form-group
- = f.label :namespace_id, class: 'control-label' do
- %span Namespace
- .col-sm-10
- = f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user), {}, {class: 'select2', tabindex: 2}
+ - if current_user.can_select_namespace?
+ .input-group-addon
+ = root_url
+ = f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user, display_path: true), {}, {class: 'select2', tabindex: 1}
+ .input-group-addon
+ \/
+ - else
+ .input-group-addon
+ #{root_url}#{current_user.username}/
+ = f.text_field :path, placeholder: "my-awesome-project", class: "form-control", tabindex: 2, autofocus: true, required: true
+
+ - if current_user.can_create_group?
+ .help-block
+ Want to house several dependent projects under the same namespace?
+ = link_to "Create a group", new_group_path
- if import_sources_enabled?
.project-import.js-toggle-container
@@ -96,14 +101,6 @@
.form-actions
= f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4
- - if current_user.can_create_group?
- .pull-right
- .light.inline
- .space-right
- Need a group for several dependent projects?
- = link_to new_group_path, class: "btn" do
- Create a group
-
.save-project-loader.hide
.center
%h2