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
Jérome Perrin
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
Hide 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
...
@@ -34,13 +34,6 @@ class Todo < ActiveRecord::Base
action
==
BUILD_FAILED
action
==
BUILD_FAILED
end
end
def
action_name
case
action
when
Todo
::
ASSIGNED
then
'assigned you'
when
Todo
::
MENTIONED
then
'mentioned you on'
end
end
def
body
def
body
if
note
.
present?
if
note
.
present?
note
.
note
note
.
note
...
...
app/views/dashboard/todos/_todo.html.haml
View file @
39e6f504
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
-
else
-
else
(removed)
(removed)
%span
.todo-label
%span
.todo-label
=
todo
.
action_name
=
todo
_action_name
(
todo
)
-
if
todo
.
target
-
if
todo
.
target
=
todo_target_link
(
todo
)
=
todo_target_link
(
todo
)
-
else
-
else
...
...
lib/api/todos.rb
View file @
39e6f504
...
@@ -14,11 +14,11 @@ module API
...
@@ -14,11 +14,11 @@ module API
#
#
# Example Request:
# Example Request:
# GET /todos
# GET /todos
#
get
do
get
do
@todos
=
find_todos
todos
=
find_todos
@todos
=
paginate
@todos
present
@todos
,
with:
Entities
::
Todo
present
paginate
(
todos
)
,
with:
Entities
::
Todo
end
end
# Mark todo as done
# Mark todo as done
...
@@ -31,10 +31,10 @@ module API
...
@@ -31,10 +31,10 @@ module API
# DELETE /todos/:id
# DELETE /todos/:id
#
#
delete
':id'
do
delete
':id'
do
@
todo
=
current_user
.
todos
.
find
(
params
[
:id
])
todo
=
current_user
.
todos
.
find
(
params
[
:id
])
@
todo
.
done
todo
.
done
present
@
todo
,
with:
Entities
::
Todo
present
todo
,
with:
Entities
::
Todo
end
end
# Mark all todos as done
# Mark all todos as done
...
@@ -44,10 +44,10 @@ module API
...
@@ -44,10 +44,10 @@ module API
# DELETE /todos
# DELETE /todos
#
#
delete
do
delete
do
@
todos
=
find_todos
todos
=
find_todos
@
todos
.
each
(
&
:done
)
todos
.
each
(
&
:done
)
present
@todos
,
with:
Entities
::
Todo
present
paginate
(
todos
)
,
with:
Entities
::
Todo
end
end
end
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