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
Boxiang Sun
gitlab-ce
Commits
f917bf80
Commit
f917bf80
authored
Oct 03, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed try method call on due date
parent
06fdfc73
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
app/helpers/todos_helper.rb
app/helpers/todos_helper.rb
+11
-3
No files found.
app/helpers/todos_helper.rb
View file @
f917bf80
...
@@ -117,11 +117,19 @@ module TodosHelper
...
@@ -117,11 +117,19 @@ module TodosHelper
def
todo_due_date
(
todo
)
def
todo_due_date
(
todo
)
return
unless
todo
.
target
.
try
(
:due_date
)
return
unless
todo
.
target
.
try
(
:due_date
)
is_due_today
=
todo
.
target
.
due_date
.
try
(
:today?
)
is_due_today
=
todo
.
target
.
due_date
.
today?
is_overdue
=
todo
.
target
.
try
(
:overdue?
)
is_overdue
=
todo
.
target
.
overdue?
css_class
=
if
is_due_today
'text-warning'
elsif
is_overdue
'text-danger'
else
''
end
html
=
"· "
.
html_safe
html
=
"· "
.
html_safe
html
<<
content_tag
(
:span
,
class:
[(
'text-warning'
if
is_due_today
),
(
'text-danger'
if
is_overdue
)]
)
do
html
<<
content_tag
(
:span
,
class:
css_class
)
do
"Due
#{
is_due_today
?
"today"
:
todo
.
target
.
due_date
.
to_s
(
:medium
)
}
"
"Due
#{
is_due_today
?
"today"
:
todo
.
target
.
due_date
.
to_s
(
:medium
)
}
"
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