Commit 2c8000e3 authored by Alfredo Sumaran's avatar Alfredo Sumaran Committed by Jacob Schatz

Move conditional to a method

parent 7586807f
...@@ -46,6 +46,10 @@ module TodosHelper ...@@ -46,6 +46,10 @@ module TodosHelper
end end
end end
def show_todo_state?(todo)
(todo.target.is_a?(MergeRequest) || todo.target.is_a?(Issue)) && ['closed', 'merged'].include?(todo.target.state)
end
def todos_filter_params def todos_filter_params
{ {
state: params[:state], state: params[:state],
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
= image_tag avatar_icon(todo.author_email, 40), class: 'avatar s40', alt:'' = image_tag avatar_icon(todo.author_email, 40), class: 'avatar s40', alt:''
.todo-title.title .todo-title.title
- unless todo.build_failed? - unless todo.build_failed?
- if (todo.target.is_a?(MergeRequest) || todo.target.is_a?(Issue)) && ['closed', 'merged'].include?(todo.target.state) - if show_todo_state?(todo)
%span.target-status %span.target-status
= todo_target_state_pill(todo) = todo_target_state_pill(todo)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment