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
39e6f504
Commit
39e6f504
authored
May 21, 2016
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move to helper, no instance variables
parent
b94088d5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
17 deletions
+10
-17
app/models/todo.rb
app/models/todo.rb
+0
-7
app/views/dashboard/todos/_todo.html.haml
app/views/dashboard/todos/_todo.html.haml
+1
-1
lib/api/todos.rb
lib/api/todos.rb
+9
-9
No files found.
app/models/todo.rb
View file @
39e6f504
...
...
@@ -34,13 +34,6 @@ class Todo < ActiveRecord::Base
action
==
BUILD_FAILED
end
def
action_name
case
action
when
Todo
::
ASSIGNED
then
'assigned you'
when
Todo
::
MENTIONED
then
'mentioned you on'
end
end
def
body
if
note
.
present?
note
.
note
...
...
app/views/dashboard/todos/_todo.html.haml
View file @
39e6f504
...
...
@@ -11,7 +11,7 @@
-
else
(removed)
%span
.todo-label
=
todo
.
action_name
=
todo
_action_name
(
todo
)
-
if
todo
.
target
=
todo_target_link
(
todo
)
-
else
...
...
lib/api/todos.rb
View file @
39e6f504
...
...
@@ -14,11 +14,11 @@ module API
#
# Example Request:
# GET /todos
#
get
do
@todos
=
find_todos
@todos
=
paginate
@todos
todos
=
find_todos
present
@todos
,
with:
Entities
::
Todo
present
paginate
(
todos
)
,
with:
Entities
::
Todo
end
# Mark todo as done
...
...
@@ -31,10 +31,10 @@ module API
# DELETE /todos/:id
#
delete
':id'
do
@
todo
=
current_user
.
todos
.
find
(
params
[
:id
])
@
todo
.
done
todo
=
current_user
.
todos
.
find
(
params
[
:id
])
todo
.
done
present
@
todo
,
with:
Entities
::
Todo
present
todo
,
with:
Entities
::
Todo
end
# Mark all todos as done
...
...
@@ -44,10 +44,10 @@ module API
# DELETE /todos
#
delete
do
@
todos
=
find_todos
@
todos
.
each
(
&
:done
)
todos
=
find_todos
todos
.
each
(
&
:done
)
present
@todos
,
with:
Entities
::
Todo
present
paginate
(
todos
)
,
with:
Entities
::
Todo
end
end
end
...
...
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