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
Léo-Paul Géneau
gitlab-ce
Commits
115454f3
Commit
115454f3
authored
Feb 28, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
created-by-me filter for issues inside project. Fixed global project.issues order
parent
15b121d6
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
5 deletions
+14
-5
app/contexts/issues_list_context.rb
app/contexts/issues_list_context.rb
+3
-2
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+2
-1
app/models/issue.rb
app/models/issue.rb
+4
-0
app/models/project.rb
app/models/project.rb
+1
-1
app/views/issues/_filter.html.haml
app/views/issues/_filter.html.haml
+4
-1
No files found.
app/contexts/issues_list_context.rb
View file @
115454f3
...
...
@@ -7,12 +7,13 @@ class IssuesListContext < BaseContext
@issues
=
case
params
[
:status
]
when
issues_filter
[
:all
]
then
@project
.
issues
when
issues_filter
[
:closed
]
then
@project
.
issues
.
closed
when
issues_filter
[
:to_me
]
then
@project
.
issues
.
opened
.
assigned
(
current_user
)
when
issues_filter
[
:to_me
]
then
@project
.
issues
.
assigned
(
current_user
)
when
issues_filter
[
:by_me
]
then
@project
.
issues
.
authored
(
current_user
)
else
@project
.
issues
.
opened
end
@issues
=
@issues
.
tagged_with
(
params
[
:label_name
])
if
params
[
:label_name
].
present?
@issues
=
@issues
.
includes
(
:author
,
:project
)
.
order
(
"updated_at"
)
@issues
=
@issues
.
includes
(
:author
,
:project
)
# Filter by specific assignee_id (or lack thereof)?
if
params
[
:assignee_id
].
present?
...
...
app/helpers/issues_helper.rb
View file @
115454f3
...
...
@@ -27,6 +27,7 @@ module IssuesHelper
all:
"all"
,
closed:
"closed"
,
to_me:
"assigned-to-me"
,
by_me:
"created-by-me"
,
open:
"open"
}
end
...
...
app/models/issue.rb
View file @
115454f3
...
...
@@ -30,6 +30,10 @@ class Issue < ActiveRecord::Base
where
(
'assignee_id = :user'
,
user:
user
.
id
)
end
def
authored
(
user
)
where
(
'author_id = :user'
,
user:
user
.
id
)
end
def
open_for
(
user
)
opened
.
assigned
(
user
)
end
...
...
app/models/project.rb
View file @
115454f3
...
...
@@ -45,7 +45,7 @@ class Project < ActiveRecord::Base
has_many
:events
,
dependent: :destroy
has_many
:merge_requests
,
dependent: :destroy
has_many
:issues
,
dependent: :destroy
,
order:
"state, created_at DESC"
has_many
:issues
,
dependent: :destroy
,
order:
"state
DESC
, created_at DESC"
has_many
:milestones
,
dependent: :destroy
has_many
:users_projects
,
dependent: :destroy
has_many
:notes
,
dependent: :destroy
...
...
app/views/issues/_filter.html.haml
View file @
115454f3
...
...
@@ -6,7 +6,10 @@
Open
%li
{
class:
(
"active"
if
params
[
:status
]
==
'assigned-to-me'
)}
=
link_to
project_issues_path
(
@project
,
status:
'assigned-to-me'
)
do
Assigned To Me
Assigned to me
%li
{
class:
(
"active"
if
params
[
:status
]
==
'created-by-me'
)}
=
link_to
project_issues_path
(
@project
,
status:
'created-by-me'
)
do
Created by me
%li
{
class:
(
"active"
if
params
[
:status
]
==
'closed'
)}
=
link_to
project_issues_path
(
@project
,
status:
'closed'
)
do
Closed
...
...
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