Add target status
This commit is contained in:
parent
5fb1de3426
commit
33be8181ac
|
@ -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 {
|
||||
|
|
|
@ -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],
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue