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
feee3838
Commit
feee3838
authored
Aug 16, 2012
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Combine unassigned_issue and unassigned_milestone into unassigned_filter
parent
5a90d044
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+5
-8
app/views/issues/index.html.haml
app/views/issues/index.html.haml
+2
-2
No files found.
app/helpers/issues_helper.rb
View file @
feee3838
...
...
@@ -37,13 +37,10 @@ module IssuesHelper
@project
.
issues
.
tag_counts_on
(
:labels
).
map
(
&
:name
)
end
# Returns a fake Milestone-like object that can be used in a
# <tt>select_tag</tt> to allow filtering by issues with no assigned milestone
def
unassigned_milestone
OpenStruct
.
new
(
id:
0
,
title:
'Unspecified'
)
end
def
unassigned_issue
OpenStruct
.
new
(
id:
0
,
name:
'Unassigned'
)
# Returns an OpenStruct object suitable for use by <tt>options_from_collection_for_select</tt>
# to allow filtering issues by an unassigned User or Milestone
def
unassigned_filter
# Milestone uses :title, Issue uses :name
OpenStruct
.
new
(
id:
0
,
title:
'Unspecified'
,
name:
'Unassigned'
)
end
end
app/views/issues/index.html.haml
View file @
feee3838
...
...
@@ -49,8 +49,8 @@
.right
=
form_tag
project_issues_path
(
@project
),
method: :get
,
class: :right
do
=
select_tag
(
:label_name
,
options_for_select
(
issue_tags
,
params
[
:label_name
]),
prompt:
"Labels"
)
=
select_tag
(
:assignee_id
,
options_from_collection_for_select
([
unassigned_
issue
]
+
@project
.
users
.
all
,
"id"
,
"name"
,
params
[
:assignee_id
]),
prompt:
"Assignee"
)
=
select_tag
(
:milestone_id
,
options_from_collection_for_select
([
unassigned_
milestone
]
+
@project
.
milestones
.
order
(
"id desc"
).
all
,
"id"
,
"title"
,
params
[
:milestone_id
]),
prompt:
"Milestone"
)
=
select_tag
(
:assignee_id
,
options_from_collection_for_select
([
unassigned_
filter
]
+
@project
.
users
.
all
,
"id"
,
"name"
,
params
[
:assignee_id
]),
prompt:
"Assignee"
)
=
select_tag
(
:milestone_id
,
options_from_collection_for_select
([
unassigned_
filter
]
+
@project
.
milestones
.
order
(
"id desc"
).
all
,
"id"
,
"title"
,
params
[
:milestone_id
]),
prompt:
"Milestone"
)
=
hidden_field_tag
:f
,
params
[
:f
]
.clearfix
...
...
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