2016-02-20 08:59:59 -05:00
|
|
|
- page_title "Todos"
|
|
|
|
- header_title "Todos", dashboard_todos_path
|
2016-02-12 13:45:44 -05:00
|
|
|
|
|
|
|
.top-area
|
|
|
|
%ul.nav-links
|
2016-02-17 22:20:31 -05:00
|
|
|
%li{class: ('active' if params[:state].blank? || params[:state] == 'pending')}
|
2016-02-20 14:53:25 -05:00
|
|
|
= link_to todos_filter_path(state: 'pending') do
|
2016-02-17 22:20:31 -05:00
|
|
|
%span
|
2016-02-20 14:52:57 -05:00
|
|
|
To do
|
2016-02-17 22:20:31 -05:00
|
|
|
%span{class: 'badge'}
|
2016-02-20 08:59:59 -05:00
|
|
|
= todos_pending_count
|
2016-02-17 22:20:31 -05:00
|
|
|
%li{class: ('active' if params[:state] == 'done')}
|
2016-02-20 14:53:25 -05:00
|
|
|
= link_to todos_filter_path(state: 'done') do
|
2016-02-17 22:20:31 -05:00
|
|
|
%span
|
|
|
|
Done
|
|
|
|
%span{class: 'badge'}
|
2016-02-20 08:59:59 -05:00
|
|
|
= todos_done_count
|
2016-02-17 22:20:31 -05:00
|
|
|
|
2016-02-20 14:53:25 -05:00
|
|
|
.nav-controls
|
|
|
|
- if @todos.any?(&:pending?)
|
|
|
|
= link_to 'Mark all as done', destroy_all_dashboard_todos_path(todos_filter_params), class: 'btn', method: :delete
|
|
|
|
|
2016-02-20 08:59:59 -05:00
|
|
|
.todos-filters
|
2016-02-17 22:20:31 -05:00
|
|
|
.gray-content-block.second-block
|
2016-02-20 14:53:25 -05:00
|
|
|
= form_tag todos_filter_path(without: [:project_id, :author_id, :type, :action_id]), method: :get, class: 'filter-form' do
|
2016-02-17 22:20:31 -05:00
|
|
|
.filter-item.inline
|
2016-02-20 08:59:59 -05:00
|
|
|
= select_tag('project_id', todo_projects_options,
|
2016-02-17 22:20:31 -05:00
|
|
|
class: 'select2 trigger-submit', include_blank: true,
|
|
|
|
data: {placeholder: 'Project'})
|
|
|
|
.filter-item.inline
|
|
|
|
= users_select_tag(:author_id, selected: params[:author_id],
|
|
|
|
placeholder: 'Author', class: 'trigger-submit', any_user: "Any Author", first_user: true, current_user: true)
|
|
|
|
.filter-item.inline
|
2016-02-20 08:59:59 -05:00
|
|
|
= select_tag('type', todo_types_options,
|
2016-02-17 22:20:31 -05:00
|
|
|
class: 'select2 trigger-submit', include_blank: true,
|
|
|
|
data: {placeholder: 'Type'})
|
|
|
|
.filter-item.inline.actions-filter
|
2016-02-20 08:59:59 -05:00
|
|
|
= select_tag('action_id', todo_actions_options,
|
2016-02-17 22:20:31 -05:00
|
|
|
class: 'select2 trigger-submit', include_blank: true,
|
|
|
|
data: {placeholder: 'Action'})
|
2016-02-12 13:45:44 -05:00
|
|
|
|
2016-02-19 13:37:29 -05:00
|
|
|
.prepend-top-default
|
2016-02-20 08:59:59 -05:00
|
|
|
- if @todos.any?
|
|
|
|
- @todos.group_by(&:project).each do |group|
|
2016-02-19 13:37:29 -05:00
|
|
|
.panel.panel-default.panel-small
|
2016-02-12 13:45:44 -05:00
|
|
|
- project = group[0]
|
|
|
|
.panel-heading
|
|
|
|
= link_to project.name_with_namespace, namespace_project_path(project.namespace, project)
|
|
|
|
|
2016-02-20 08:59:59 -05:00
|
|
|
%ul.well-list.todos-list
|
2016-02-12 13:45:44 -05:00
|
|
|
= render group[1]
|
2016-02-20 08:59:59 -05:00
|
|
|
= paginate @todos, theme: "gitlab"
|
2016-02-12 13:45:44 -05:00
|
|
|
- else
|
2016-02-20 14:53:25 -05:00
|
|
|
.nothing-here-block You're all done!
|
2016-02-17 22:20:31 -05:00
|
|
|
|
|
|
|
:javascript
|
|
|
|
new UsersSelect();
|
|
|
|
|
|
|
|
$('form.filter-form').on('submit', function (event) {
|
|
|
|
event.preventDefault();
|
|
|
|
Turbolinks.visit(this.action + '&' + $(this).serialize());
|
|
|
|
});
|