mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-26 04:56:16 +10:00
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:  After:  See merge request !1964
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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?
|
||||
.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_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_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
|
||||
|
||||
Reference in New Issue
Block a user