mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-25 20:46:12 +10:00
Move conditional to a method
This commit is contained in:
committed by
Jacob Schatz
parent
7586807fc3
commit
2c8000e302
@@ -46,6 +46,10 @@ module TodosHelper
|
||||
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
|
||||
{
|
||||
state: params[:state],
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
= image_tag avatar_icon(todo.author_email, 40), class: 'avatar s40', alt:''
|
||||
.todo-title.title
|
||||
- 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
|
||||
= todo_target_state_pill(todo)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user