diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-05-10 01:19:26 +0300 |
---|---|---|
committer | Jacob Schatz <jschatz1@gmail.com> | 2016-05-25 15:15:20 +0300 |
commit | fd0c40fc801b766622654485717532f821efb795 (patch) | |
tree | 08df2258c49f2134b435b5172da7a7299c106ea8 /app/helpers | |
parent | 7d7ded5ee9ce05c41e1143d43cb49e261fb86423 (diff) |
Address feedback
Signed-off-by: Alfredo Sumaran <alfredo@gitlab.com>
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/todos_helper.rb | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 150d826ac44..27f33b3eded 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -38,18 +38,15 @@ module TodosHelper end def todo_target_state_pill(todo) - klass = 'status-box ' - klass << "status-box-#{todo.target.state.dasherize}" - - content_tag(:span, nil, class: klass) do - todo.target.state.capitalize + if show_todo_state?(todo) + content_tag(:span, nil, class: 'target-status') do + content_tag(:span, nil, class: "status-box status-box-#{todo.target.state.dasherize}") do + todo.target.state.capitalize + 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 { state: params[:state], @@ -108,4 +105,10 @@ module TodosHelper options_from_collection_for_select(types, 'name', 'title', params[:type]) end + + private + + def show_todo_state?(todo) + (todo.target.is_a?(MergeRequest) || todo.target.is_a?(Issue)) && ['closed', 'merged'].include?(todo.target.state) + end end |