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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
22b8b9a7
Commit
22b8b9a7
authored
May 31, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address feedback
parent
228a6845
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
26 additions
and
32 deletions
+26
-32
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+3
-1
app/assets/javascripts/issues-bulk-assignment.js.coffee
app/assets/javascripts/issues-bulk-assignment.js.coffee
+1
-1
app/assets/javascripts/labels_select.js.coffee
app/assets/javascripts/labels_select.js.coffee
+9
-12
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+0
-6
app/views/projects/issues/_issue.html.haml
app/views/projects/issues/_issue.html.haml
+1
-1
app/views/projects/labels/_label.html.haml
app/views/projects/labels/_label.html.haml
+1
-1
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+1
-1
app/views/shared/issuable/_label_dropdown.html.haml
app/views/shared/issuable/_label_dropdown.html.haml
+6
-6
app/views/shared/issuable/_label_page_default.html.haml
app/views/shared/issuable/_label_page_default.html.haml
+4
-3
No files found.
app/assets/javascripts/gl_dropdown.js.coffee
View file @
22b8b9a7
...
@@ -491,7 +491,9 @@ class GitLabDropdown
...
@@ -491,7 +491,9 @@ class GitLabDropdown
addInput
:
(
fieldName
,
value
)
->
addInput
:
(
fieldName
,
value
)
->
# Create hidden input for form
# Create hidden input for form
$input
=
$
(
"<input type='hidden' name='
#{
fieldName
}
' value='
#{
value
}
' />"
)
$input
=
$
(
'<input>'
).
attr
(
'type'
,
'hidden'
)
.
attr
(
'name'
,
fieldName
)
.
val
(
value
)
if
@
options
.
inputId
?
if
@
options
.
inputId
?
$input
.
attr
(
'id'
,
@
options
.
inputId
)
$input
.
attr
(
'id'
,
@
options
.
inputId
)
...
...
app/assets/javascripts/issues-bulk-assignment.js.coffee
View file @
22b8b9a7
...
@@ -13,7 +13,7 @@ class @IssuableBulkActions
...
@@ -13,7 +13,7 @@ class @IssuableBulkActions
@
container
.
find
selector
@
container
.
find
selector
bindEvents
:
->
bindEvents
:
->
@
form
.
o
n
'submit'
,
@
onFormSubmit
.
bind
(
@
)
@
form
.
o
ff
(
'submit'
).
on
(
'submit'
,
@
onFormSubmit
.
bind
(
@
)
)
onFormSubmit
:
(
e
)
->
onFormSubmit
:
(
e
)
->
e
.
preventDefault
()
e
.
preventDefault
()
...
...
app/assets/javascripts/labels_select.js.coffee
View file @
22b8b9a7
...
@@ -199,6 +199,9 @@ class @LabelsSelect
...
@@ -199,6 +199,9 @@ class @LabelsSelect
callback
data
callback
data
renderRow
:
(
label
,
instance
)
->
renderRow
:
(
label
,
instance
)
->
$li
=
$
(
'<li>'
)
$a
=
$
(
'<a href="#">'
)
selectedClass
=
[]
selectedClass
=
[]
removesAll
=
label
.
id
is
0
or
not
label
.
id
?
removesAll
=
label
.
id
is
0
or
not
label
.
id
?
...
@@ -238,21 +241,15 @@ class @LabelsSelect
...
@@ -238,21 +241,15 @@ class @LabelsSelect
colorEl
=
''
colorEl
=
''
# We need to identify which items are actually labels
# We need to identify which items are actually labels
labelIdHtml
=
labelClass
=
''
if
label
.
id
if
label
.
id
# Add label id only for labels
selectedClass
.
push
(
'label-item'
)
labelIdHtml
=
"data-label-id='
#{
label
.
id
}
'"
$a
.
attr
(
'data-label-id'
,
label
.
id
)
# Add class only for labels
$a
.
addClass
(
selectedClass
.
join
(
' '
))
labelClass
=
'label-item'
.
html
(
"
#{
colorEl
}
#{
_
.
escape
(
label
.
title
)
}
"
)
"<li>
# Return generated html
<a href='#'
#{
labelIdHtml
}
class='
#{
labelClass
}
#{
selectedClass
.
join
(
' '
)
}
'>
$li
.
html
(
$a
).
prop
(
'outerHTML'
)
#{
colorEl
}
#{
_
.
escape
(
label
.
title
)
}
</a>
</li>"
persistWhenHide
:
$dropdown
.
data
(
'persistWhenHide'
)
persistWhenHide
:
$dropdown
.
data
(
'persistWhenHide'
)
search
:
search
:
fields
:
[
'title'
]
fields
:
[
'title'
]
...
...
app/helpers/issuables_helper.rb
View file @
22b8b9a7
...
@@ -96,10 +96,4 @@ module IssuablesHelper
...
@@ -96,10 +96,4 @@ module IssuablesHelper
issuable
.
open?
?
:opened
:
:closed
issuable
.
open?
?
:opened
:
:closed
end
end
end
end
def
label_ids
(
issuable
)
return
nil
if
!
issuable
.
labels
.
any?
issuable
.
labels
.
pluck
:id
end
end
end
app/views/projects/issues/_issue.html.haml
View file @
22b8b9a7
%li
{
id:
dom_id
(
issue
),
class:
issue_css_classes
(
issue
),
url:
issue_path
(
issue
),
data:
{
labels:
label_ids
(
issue
)
,
id:
issue
.
id
}
}
%li
{
id:
dom_id
(
issue
),
class:
issue_css_classes
(
issue
),
url:
issue_path
(
issue
),
data:
{
labels:
issue
.
label_ids
,
id:
issue
.
id
}
}
-
if
controller
.
controller_name
==
'issues'
&&
can?
(
current_user
,
:admin_issue
,
@project
)
-
if
controller
.
controller_name
==
'issues'
&&
can?
(
current_user
,
:admin_issue
,
@project
)
.issue-check
.issue-check
=
check_box_tag
dom_id
(
issue
,
"selected"
),
nil
,
false
,
'data-id'
=>
issue
.
id
,
class:
"selected_issue"
=
check_box_tag
dom_id
(
issue
,
"selected"
),
nil
,
false
,
'data-id'
=>
issue
.
id
,
class:
"selected_issue"
...
...
app/views/projects/labels/_label.html.haml
View file @
22b8b9a7
%li
{
id:
dom_id
(
label
),
:"data-id"
=>
label
.
id
}
%li
{
id:
dom_id
(
label
),
data:
{
id:
label
.
id
}
}
}
=
render
"shared/label_row"
,
label:
label
=
render
"shared/label_row"
,
label:
label
.pull-info-right
.pull-info-right
...
...
app/views/shared/issuable/_filter.html.haml
View file @
22b8b9a7
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
=
dropdown_tag
(
"Milestone"
,
options:
{
title:
"Assign milestone"
,
toggle_class:
'js-milestone-select js-extra-options js-filter-submit js-filter-bulk-update'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable dropdown-menu-milestone"
,
placeholder:
"Search milestones"
,
data:
{
show_no:
true
,
field_name:
"update[milestone_id]"
,
project_id:
@project
.
id
,
milestones:
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:json
),
use_id:
true
}
})
=
dropdown_tag
(
"Milestone"
,
options:
{
title:
"Assign milestone"
,
toggle_class:
'js-milestone-select js-extra-options js-filter-submit js-filter-bulk-update'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable dropdown-menu-milestone"
,
placeholder:
"Search milestones"
,
data:
{
show_no:
true
,
field_name:
"update[milestone_id]"
,
project_id:
@project
.
id
,
milestones:
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:json
),
use_id:
true
}
})
.filter-item.inline.labels-filter
.filter-item.inline.labels-filter
=
render
"shared/issuable/label_dropdown"
,
classes:
' js-filter-bulk-update js-multiselect '
,
show_create:
false
,
show_footer:
false
,
extra_options:
false
,
filter_submit:
false
,
show_footer:
false
,
data_options:
{
persist_when_hide:
"true"
,
field_name:
"update[label_ids][]"
,
show_no:
false
,
show_any:
false
,
use_id:
true
}
=
render
"shared/issuable/label_dropdown"
,
classes:
[
'js-filter-bulk-update'
,
'js-multiselect'
]
,
show_create:
false
,
show_footer:
false
,
extra_options:
false
,
filter_submit:
false
,
show_footer:
false
,
data_options:
{
persist_when_hide:
"true"
,
field_name:
"update[label_ids][]"
,
show_no:
false
,
show_any:
false
,
use_id:
true
}
=
hidden_field_tag
'update[issues_ids]'
,
[]
=
hidden_field_tag
'update[issues_ids]'
,
[]
=
hidden_field_tag
:state_event
,
params
[
:state_event
]
=
hidden_field_tag
:state_event
,
params
[
:state_event
]
...
...
app/views/shared/issuable/_label_dropdown.html.haml
View file @
22b8b9a7
...
@@ -3,23 +3,23 @@
...
@@ -3,23 +3,23 @@
-
filter_submit
=
local_assigns
.
fetch
(
:filter_submit
,
true
)
-
filter_submit
=
local_assigns
.
fetch
(
:filter_submit
,
true
)
-
show_footer
=
local_assigns
.
fetch
(
:show_footer
,
true
)
-
show_footer
=
local_assigns
.
fetch
(
:show_footer
,
true
)
-
data_options
=
local_assigns
.
fetch
(
:data_options
,
{})
-
data_options
=
local_assigns
.
fetch
(
:data_options
,
{})
-
classes
=
local_assigns
.
fetch
(
:classes
,
''
)
-
classes
=
local_assigns
.
fetch
(
:classes
,
[]
)
-
dropdown_data
=
{
toggle:
'dropdown'
,
field_name:
'label_name[]'
,
show_no:
"true"
,
show_any:
"true"
,
selected:
params
[
:label_name
],
project_id:
@project
.
try
(
:id
),
labels:
labels_filter_path
,
default_label:
"Label"
}
-
dropdown_data
=
{
toggle:
'dropdown'
,
field_name:
'label_name[]'
,
show_no:
"true"
,
show_any:
"true"
,
selected:
params
[
:label_name
],
project_id:
@project
.
try
(
:id
),
labels:
labels_filter_path
,
default_label:
"Label"
}
-
dropdown_data
.
merge!
(
data_options
)
-
dropdown_data
.
merge!
(
data_options
)
-
classes
<<
'
js-extra-options
'
if
extra_options
-
classes
<<
'
js-extra-options
'
if
extra_options
-
classes
<<
'
js-filter-submit
'
if
filter_submit
-
classes
<<
'
js-filter-submit
'
if
filter_submit
-
if
params
[
:label_name
].
present?
-
if
params
[
:label_name
].
present?
-
if
params
[
:label_name
].
respond_to?
(
'any?'
)
-
if
params
[
:label_name
].
respond_to?
(
'any?'
)
-
params
[
:label_name
].
each
do
|
label
|
-
params
[
:label_name
].
each
do
|
label
|
=
hidden_field_tag
"label_name[]"
,
label
,
id:
nil
=
hidden_field_tag
"label_name[]"
,
label
,
id:
nil
.dropdown
.dropdown
%button
.dropdown-menu-toggle.js-label-select.js-multiselect
{
class:
classes
,
type:
"button"
,
data:
dropdown_data
}
%button
.dropdown-menu-toggle.js-label-select.js-multiselect
{
class:
classes
.
join
(
' '
)
,
type:
"button"
,
data:
dropdown_data
}
%span
.dropdown-toggle-text
%span
.dropdown-toggle-text
=
h
(
multi_label_name
(
params
[
:label_name
],
"Label"
))
=
h
(
multi_label_name
(
params
[
:label_name
],
"Label"
))
=
icon
(
'chevron-down'
)
=
icon
(
'chevron-down'
)
.dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable
.dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable
=
render
partial:
"shared/issuable/label_page_default"
,
locals:
{
title:
"Filter by label"
,
show_footer:
show_footer
}
=
render
partial:
"shared/issuable/label_page_default"
,
locals:
{
title:
"Filter by label"
,
show_footer:
show_footer
,
show_create:
show_create
}
-
if
can?
current_user
,
:admin_label
,
@project
and
@project
and
show_create
-
if
show_create
and
@project
and
can?
(
current_user
,
:admin_label
,
@project
)
=
render
partial:
"shared/issuable/label_page_create"
=
render
partial:
"shared/issuable/label_page_create"
=
dropdown_loading
=
dropdown_loading
app/views/shared/issuable/_label_page_default.html.haml
View file @
22b8b9a7
-
title
=
local_assigns
.
fetch
(
:title
,
'Assign labels'
)
-
title
=
local_assigns
.
fetch
(
:title
,
'Assign labels'
)
-
show_create
=
local_assigns
.
fetch
(
:show_create
,
true
)
-
show_footer
=
local_assigns
.
fetch
(
:show_footer
,
true
)
-
show_footer
=
local_assigns
.
fetch
(
:show_footer
,
true
)
-
filter_placeholder
=
local_assigns
.
fetch
(
:filter_placeholder
,
'Search labels'
)
-
filter_placeholder
=
local_assigns
.
fetch
(
:filter_placeholder
,
'Search labels'
)
.dropdown-page-one
.dropdown-page-one
...
@@ -8,13 +9,13 @@
...
@@ -8,13 +9,13 @@
-
if
@project
and
show_footer
-
if
@project
and
show_footer
=
dropdown_footer
do
=
dropdown_footer
do
%ul
.dropdown-footer-list
%ul
.dropdown-footer-list
-
if
can?
current_user
,
:admin_label
,
@project
-
if
can?
(
current_user
,
:admin_label
,
@project
)
%li
%li
%a
.dropdown-toggle-page
{
href:
"#"
}
%a
.dropdown-toggle-page
{
href:
"#"
}
Create new
Create new
%li
%li
=
link_to
namespace_project_labels_path
(
@project
.
namespace
,
@project
),
:"data-is-link"
=>
true
do
=
link_to
namespace_project_labels_path
(
@project
.
namespace
,
@project
),
:"data-is-link"
=>
true
do
-
if
can?
current_user
,
:admin_label
,
@project
-
if
show_create
&&
@project
&&
can?
(
current_user
,
:admin_label
,
@project
)
Manage labels
Manage labels
-
else
-
else
View labels
View labels
...
...
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