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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
af541515
Commit
af541515
authored
Dec 02, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove "none" username for "Unassigned" and "Any User" select options
parent
f385988d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
20 deletions
+26
-20
app/assets/javascripts/users_select.js.coffee
app/assets/javascripts/users_select.js.coffee
+5
-8
app/assets/stylesheets/framework/selects.scss
app/assets/stylesheets/framework/selects.scss
+7
-1
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+4
-3
app/helpers/selects_helper.rb
app/helpers/selects_helper.rb
+8
-6
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+2
-2
No files found.
app/assets/javascripts/users_select.js.coffee
View file @
af541515
...
@@ -32,17 +32,15 @@ class @UsersSelect
...
@@ -32,17 +32,15 @@ class @UsersSelect
if
showNullUser
if
showNullUser
nullUser
=
{
nullUser
=
{
name
:
'Unassigned'
,
name
:
'Unassigned'
,
avatar
:
null
,
username
:
'none'
,
id
:
0
id
:
0
}
}
data
.
results
.
unshift
(
nullUser
)
data
.
results
.
unshift
(
nullUser
)
if
showAnyUser
if
showAnyUser
name
=
showAnyUser
name
=
'Any User'
if
name
==
true
anyUser
=
{
anyUser
=
{
name
:
'Any'
,
name
:
name
,
avatar
:
null
,
username
:
'none'
,
id
:
null
id
:
null
}
}
data
.
results
.
unshift
(
anyUser
)
data
.
results
.
unshift
(
anyUser
)
...
@@ -50,7 +48,6 @@ class @UsersSelect
...
@@ -50,7 +48,6 @@ class @UsersSelect
if
showEmailUser
&&
data
.
results
.
length
==
0
&&
query
.
term
.
match
(
/^[^@]+@[^@]+$/
)
if
showEmailUser
&&
data
.
results
.
length
==
0
&&
query
.
term
.
match
(
/^[^@]+@[^@]+$/
)
emailUser
=
{
emailUser
=
{
name
:
"Invite
\"
#{
query
.
term
}
\"
"
,
name
:
"Invite
\"
#{
query
.
term
}
\"
"
,
avatar
:
null
,
username
:
query
.
term
,
username
:
query
.
term
,
id
:
query
.
term
id
:
query
.
term
}
}
...
@@ -82,10 +79,10 @@ class @UsersSelect
...
@@ -82,10 +79,10 @@ class @UsersSelect
else
else
avatar
=
gon
.
default_avatar_url
avatar
=
gon
.
default_avatar_url
"<div class='user-result'>
"<div class='user-result
#{
'no-username'
unless
user
.
username
}
'>
<div class='user-image'><img class='avatar s24' src='
#{
avatar
}
'></div>
<div class='user-image'><img class='avatar s24' src='
#{
avatar
}
'></div>
<div class='user-name'>
#{
user
.
name
}
</div>
<div class='user-name'>
#{
user
.
name
}
</div>
<div class='user-username'>
#{
user
.
username
}
</div>
<div class='user-username'>
#{
user
.
username
||
""
}
</div>
</div>"
</div>"
formatSelection
:
(
user
)
->
formatSelection
:
(
user
)
->
...
...
app/assets/stylesheets/framework/selects.scss
View file @
af541515
...
@@ -123,10 +123,16 @@
...
@@ -123,10 +123,16 @@
}
}
.user-result
{
.user-result
{
min-height
:
24px
;
.user-image
{
.user-image
{
float
:
left
;
float
:
left
;
}
}
.user-name
{
&
.no-username
{
.user-name
{
line-height
:
24px
;
}
}
}
}
}
...
...
app/helpers/issues_helper.rb
View file @
af541515
...
@@ -44,9 +44,10 @@ module IssuesHelper
...
@@ -44,9 +44,10 @@ module IssuesHelper
end
end
def
bulk_update_milestone_options
def
bulk_update_milestone_options
options_for_select
([[
'None (backlog)'
,
-
1
]])
+
milestones
=
project_active_milestones
.
to_a
options_from_collection_for_select
(
project_active_milestones
,
'id'
,
milestones
.
unshift
(
Milestone
::
None
)
'title'
,
params
[
:milestone_id
])
options_from_collection_for_select
(
milestones
,
'id'
,
'title'
,
params
[
:milestone_id
])
end
end
def
milestone_options
(
object
)
def
milestone_options
(
object
)
...
...
app/helpers/selects_helper.rb
View file @
af541515
...
@@ -15,12 +15,14 @@ module SelectsHelper
...
@@ -15,12 +15,14 @@ module SelectsHelper
html
=
{
html
=
{
class:
css_class
,
class:
css_class
,
'data-placeholder'
=>
placeholder
,
data:
{
'data-null-user'
=>
null_user
,
placeholder:
placeholder
,
'data-any-user'
=>
any_user
,
null_user:
null_user
,
'data-email-user'
=>
email_user
,
any_user:
any_user
,
'data-first-user'
=>
first_user
,
email_user:
email_user
,
'data-current-user'
=>
current_user
first_user:
first_user
,
current_user:
current_user
}
}
}
unless
opts
[
:scope
]
==
:all
unless
opts
[
:scope
]
==
:all
...
...
app/views/shared/issuable/_filter.html.haml
View file @
af541515
...
@@ -31,11 +31,11 @@
...
@@ -31,11 +31,11 @@
.issues-other-filters
.issues-other-filters
.filter-item.inline
.filter-item.inline
=
users_select_tag
(
:assignee_id
,
selected:
params
[
:assignee_id
],
=
users_select_tag
(
:assignee_id
,
selected:
params
[
:assignee_id
],
placeholder:
'Assignee'
,
class:
'trigger-submit'
,
any_user:
true
,
null_user:
true
,
first_user:
true
,
current_user:
true
)
placeholder:
'Assignee'
,
class:
'trigger-submit'
,
any_user:
"Any Assignee"
,
null_user:
true
,
first_user:
true
,
current_user:
true
)
.filter-item.inline
.filter-item.inline
=
users_select_tag
(
:author_id
,
selected:
params
[
:author_id
],
=
users_select_tag
(
:author_id
,
selected:
params
[
:author_id
],
placeholder:
'Author'
,
class:
'trigger-submit'
,
any_user:
true
,
first_user:
true
,
current_user:
true
)
placeholder:
'Author'
,
class:
'trigger-submit'
,
any_user:
"Any Author"
,
first_user:
true
,
current_user:
true
)
.filter-item.inline.milestone-filter
.filter-item.inline.milestone-filter
=
select_tag
(
'milestone_title'
,
projects_milestones_options
,
=
select_tag
(
'milestone_title'
,
projects_milestones_options
,
...
...
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