Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
050110c9
Commit
050110c9
authored
Apr 12, 2016
by
Arinde Eniola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hide help block when user is creating a new project inside a group
parent
e933a0b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
4 deletions
+27
-4
CHANGELOG
CHANGELOG
+1
-0
app/assets/javascripts/behaviors/requires_input.js.coffee
app/assets/javascripts/behaviors/requires_input.js.coffee
+15
-1
app/helpers/namespaces_helper.rb
app/helpers/namespaces_helper.rb
+10
-2
app/views/projects/new.html.haml
app/views/projects/new.html.haml
+1
-1
No files found.
CHANGELOG
View file @
050110c9
...
@@ -26,6 +26,7 @@ v 8.7.0 (unreleased)
...
@@ -26,6 +26,7 @@ v 8.7.0 (unreleased)
- API: Fix milestone filtering by `iid` (Robert Schilling)
- API: Fix milestone filtering by `iid` (Robert Schilling)
- Implement 'Groups View' as an option for dashboard preferences !3379 (Elias W.)
- Implement 'Groups View' as an option for dashboard preferences !3379 (Elias W.)
- Better errors handling when creating milestones inside groups
- Better errors handling when creating milestones inside groups
- Hide `Create a group` help block when creating a new project in a group
- Implement 'TODOs View' as an option for dashboard preferences !3379 (Elias W.)
- Implement 'TODOs View' as an option for dashboard preferences !3379 (Elias W.)
- Gracefully handle notes on deleted commits in merge requests (Stan Hu)
- Gracefully handle notes on deleted commits in merge requests (Stan Hu)
- Fix creation of merge requests for orphaned branches (Stan Hu)
- Fix creation of merge requests for orphaned branches (Stan Hu)
...
...
app/assets/javascripts/behaviors/requires_input.js.coffee
View file @
050110c9
...
@@ -35,4 +35,18 @@ $.fn.requiresInput = ->
...
@@ -35,4 +35,18 @@ $.fn.requiresInput = ->
$form
.
on
'change input'
,
fieldSelector
,
requireInput
$form
.
on
'change input'
,
fieldSelector
,
requireInput
$
->
$
->
$
(
'form.js-requires-input'
).
requiresInput
()
$form
=
$
(
'form.js-requires-input'
)
$form
.
requiresInput
()
# Hide or Show the help block when creating a new project
# based on the option selected
hideOrShowHelpBlock
=
(
form
)
->
selected
=
$
(
'.js-select-namespace option:selected'
)
if
selected
.
length
and
selected
.
data
(
'options-parent'
)
is
'groups'
return
form
.
find
(
'.help-block'
).
hide
()
else
if
selected
.
length
form
.
find
(
'.help-block'
).
show
()
hideOrShowHelpBlock
(
$form
)
$
(
'.select2.js-select-namespace'
).
change
->
hideOrShowHelpBlock
(
$form
)
app/helpers/namespaces_helper.rb
View file @
050110c9
...
@@ -3,8 +3,16 @@ module NamespacesHelper
...
@@ -3,8 +3,16 @@ module NamespacesHelper
groups
=
current_user
.
owned_groups
+
current_user
.
masters_groups
groups
=
current_user
.
owned_groups
+
current_user
.
masters_groups
users
=
[
current_user
.
namespace
]
users
=
[
current_user
.
namespace
]
group_opts
=
[
"Groups"
,
groups
.
sort_by
(
&
:human_name
).
map
{
|
g
|
[
display_path
?
g
.
path
:
g
.
human_name
,
g
.
id
]}
]
data_attr_group
=
{
'data-options-parent'
=>
'groups'
}
users_opts
=
[
"Users"
,
users
.
sort_by
(
&
:human_name
).
map
{
|
u
|
[
display_path
?
u
.
path
:
u
.
human_name
,
u
.
id
]}
]
data_attr_users
=
{
'data-options-parent'
=>
'users'
}
group_opts
=
[
"Groups"
,
groups
.
sort_by
(
&
:human_name
).
map
{
|
g
|
[
display_path
?
g
.
path
:
g
.
human_name
,
g
.
id
,
data_attr_group
]
}
]
users_opts
=
[
"Users"
,
users
.
sort_by
(
&
:human_name
).
map
{
|
u
|
[
display_path
?
u
.
path
:
u
.
human_name
,
u
.
id
,
data_attr_users
]
}
]
options
=
[]
options
=
[]
options
<<
group_opts
options
<<
group_opts
...
...
app/views/projects/new.html.haml
View file @
050110c9
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
-
if
current_user
.
can_select_namespace?
-
if
current_user
.
can_select_namespace?
.input-group-addon
.input-group-addon
=
root_url
=
root_url
=
f
.
select
:namespace_id
,
namespaces_options
(
params
[
:namespace_id
]
||
:current_user
,
display_path:
true
),
{},
{
class:
'select2'
,
tabindex:
1
}
=
f
.
select
:namespace_id
,
namespaces_options
(
params
[
:namespace_id
]
||
:current_user
,
display_path:
true
),
{},
{
class:
'select2
js-select-namespace
'
,
tabindex:
1
}
.input-group-addon
.input-group-addon
\/
\/
-
else
-
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment