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
Kazuhiko Shiozaki
gitlab-ce
Commits
42cbcb23
Commit
42cbcb23
authored
Feb 20, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"X assigned you Y" instead of "X assigned Y"
parent
d53ae7f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
12 deletions
+8
-12
app/helpers/todos_helper.rb
app/helpers/todos_helper.rb
+7
-0
app/models/todo.rb
app/models/todo.rb
+0
-11
app/views/dashboard/todos/_todo.html.haml
app/views/dashboard/todos/_todo.html.haml
+1
-1
No files found.
app/helpers/todos_helper.rb
View file @
42cbcb23
...
...
@@ -7,6 +7,13 @@ module TodosHelper
current_user
.
todos
.
done
.
count
end
def
todo_action_name
(
todo
)
case
todo
.
action
when
Todo
::
ASSIGNED
then
'assigned you'
when
Todo
::
MENTIONED
then
'mentioned you on'
end
end
def
todo_target_link
(
todo
)
target
=
todo
.
target_type
.
titleize
.
downcase
link_to
"
#{
target
}
#{
todo
.
target
.
to_reference
}
"
,
todo_target_path
(
todo
)
...
...
app/models/todo.rb
View file @
42cbcb23
...
...
@@ -43,13 +43,6 @@ class Todo < ActiveRecord::Base
state
:done
end
def
action_name
case
action
when
ASSIGNED
then
'assigned'
when
MENTIONED
then
'mentioned you on'
end
end
def
body
if
note
.
present?
note
.
note
...
...
@@ -57,8 +50,4 @@ class Todo < ActiveRecord::Base
target
.
title
end
end
def
target_iid
target
.
respond_to?
(
:iid
)
?
target
.
iid
:
target_id
end
end
app/views/dashboard/todos/_todo.html.haml
View file @
42cbcb23
...
...
@@ -6,7 +6,7 @@
%span
.author_name
=
link_to_author
todo
%span
.todo_label
=
todo
.
action_name
=
todo
_action_name
(
todo
)
=
todo_target_link
(
todo
)
·
#{
time_ago_with_tooltip
(
todo
.
created_at
)
}
...
...
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