diff --git a/app/assets/stylesheets/pages/todos.scss b/app/assets/stylesheets/pages/todos.scss index e51c3491dae714048642fbd46ea6da4bab679d97..7301d84ba21642583af52b6204d13d5c6011e01f 100644 --- a/app/assets/stylesheets/pages/todos.scss +++ b/app/assets/stylesheets/pages/todos.scss @@ -29,6 +29,14 @@ .todo-item { .todo-title { @include str-truncated(calc(100% - 174px)); + overflow: visible; + } + + .status-box { + margin: 0; + float: none; + display: inline-block; + font-weight: normal; } .todo-body { diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 81b9b5d7052585c6e0a9b0efcd0838a42cb6d642..5d020e7f241fc55d6d2832464a1f3831147d66bc 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -37,6 +37,15 @@ module TodosHelper end end + def todo_target_state_pill(todo) + klass = 'status-box ' + klass << "status-box-#{todo.target.state.dasherize}" + + content_tag(:span, nil, class: klass) { + todo.target.state.capitalize + } + end + def todos_filter_params { state: params[:state], diff --git a/app/views/dashboard/todos/_todo.html.haml b/app/views/dashboard/todos/_todo.html.haml index 539f1dc60360615f4949f571ea2f80d6527fba62..1f4a03cda2ebfafa5b2f9d05e0ea71bb59187c1e 100644 --- a/app/views/dashboard/todos/_todo.html.haml +++ b/app/views/dashboard/todos/_todo.html.haml @@ -17,6 +17,10 @@ · #{time_ago_with_tooltip(todo.created_at)} + - if (todo.target.is_a?(MergeRequest) || todo.target.is_a?(Issue)) && ['closed', 'merged'].include?(todo.target.state) + %span.target-status + = todo_target_state_pill(todo) + - if todo.pending? .todo-actions.pull-right = link_to [:dashboard, todo], method: :delete, class: 'btn btn-loading done-todo' do