Add target status

This commit is contained in:
Alfredo Sumaran 2016-04-28 13:54:13 -05:00 committed by Jacob Schatz
parent 5fb1de3426
commit 33be8181ac
3 changed files with 21 additions and 0 deletions

View File

@ -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 {

View File

@ -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],

View File

@ -17,6 +17,10 @@
&middot; #{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