2016-02-20 13:59:59 +00:00
|
|
|
- page_title "Todos"
|
|
|
|
- header_title "Todos", dashboard_todos_path
|
2016-02-12 18:45:44 +00:00
|
|
|
|
|
|
|
.top-area
|
|
|
|
%ul.nav-links
|
2016-02-23 20:09:35 +00:00
|
|
|
- todo_pending_active = ('active' if params[:state].blank? || params[:state] == 'pending')
|
|
|
|
%li{class: "todos-pending #{todo_pending_active}"}
|
2016-02-20 19:53:25 +00:00
|
|
|
= link_to todos_filter_path(state: 'pending') do
|
2016-02-18 03:20:31 +00:00
|
|
|
%span
|
2016-02-20 19:52:57 +00:00
|
|
|
To do
|
2016-05-04 21:25:10 +00:00
|
|
|
%span.badge
|
2016-07-12 00:48:35 +00:00
|
|
|
= number_with_delimiter(todos_pending_count)
|
2016-02-23 20:09:35 +00:00
|
|
|
- todo_done_active = ('active' if params[:state] == 'done')
|
|
|
|
%li{class: "todos-done #{todo_done_active}"}
|
2016-02-20 19:53:25 +00:00
|
|
|
= link_to todos_filter_path(state: 'done') do
|
2016-02-18 03:20:31 +00:00
|
|
|
%span
|
|
|
|
Done
|
2016-05-04 21:25:10 +00:00
|
|
|
%span.badge
|
2016-07-12 00:48:35 +00:00
|
|
|
= number_with_delimiter(todos_done_count)
|
2016-02-18 03:20:31 +00:00
|
|
|
|
2016-02-20 19:53:25 +00:00
|
|
|
.nav-controls
|
|
|
|
- if @todos.any?(&:pending?)
|
2016-03-17 13:08:59 +00:00
|
|
|
= link_to destroy_all_dashboard_todos_path(todos_filter_params), class: 'btn btn-loading js-todos-mark-all', method: :delete do
|
|
|
|
Mark all as done
|
|
|
|
= icon('spinner spin')
|
2016-02-20 19:53:25 +00:00
|
|
|
|
2016-02-20 13:59:59 +00:00
|
|
|
.todos-filters
|
2016-04-25 20:02:15 +00:00
|
|
|
.row-content-block.second-block
|
2016-02-20 19:53:25 +00:00
|
|
|
= form_tag todos_filter_path(without: [:project_id, :author_id, :type, :action_id]), method: :get, class: 'filter-form' do
|
2016-02-18 03:20:31 +00:00
|
|
|
.filter-item.inline
|
2016-08-27 22:45:01 +00:00
|
|
|
- if params[:project_id].present?
|
|
|
|
= hidden_field_tag(:project_id, params[:project_id])
|
2016-08-29 23:28:44 +00:00
|
|
|
= dropdown_tag(project_dropdown_label(params[:project_id], 'Project'), options: { toggle_class: 'js-project-search js-filter-submit', title: 'Filter by project', filter: true, filterInput: 'input#project-search', dropdown_class: 'dropdown-menu-selectable dropdown-menu-project js-filter-submit',
|
|
|
|
placeholder: 'Search projects', data: { data: todo_projects_options } })
|
2016-02-18 03:20:31 +00:00
|
|
|
.filter-item.inline
|
2016-08-27 22:45:01 +00:00
|
|
|
- if params[:author_id].present?
|
|
|
|
= hidden_field_tag(:author_id, params[:author_id])
|
2016-08-29 23:28:44 +00:00
|
|
|
= dropdown_tag(user_dropdown_label(params[:author_id], 'Author'), options: { toggle_class: 'js-user-search js-filter-submit js-author-search', title: 'Filter by author', filter: true, filterInput: 'input#author-search', dropdown_class: 'dropdown-menu-user dropdown-menu-selectable dropdown-menu-author js-filter-submit',
|
2016-08-27 22:45:01 +00:00
|
|
|
placeholder: 'Search authors', data: { any_user: 'Any Author', first_user: (current_user.username if current_user), current_user: true, project_id: (@project.id if @project), selected: params[:author_id], field_name: 'author_id', default_label: 'Author' } })
|
2016-02-18 03:20:31 +00:00
|
|
|
.filter-item.inline
|
2016-08-27 23:18:48 +00:00
|
|
|
- if params[:type].present?
|
|
|
|
= hidden_field_tag(:type, params[:type])
|
2016-08-28 15:24:48 +00:00
|
|
|
= dropdown_tag(todo_types_dropdown_label(params[:type], 'Type'), options: { toggle_class: 'js-type-search js-filter-submit', dropdown_class: 'dropdown-menu-selectable dropdown-menu-type js-filter-submit',
|
|
|
|
data: { data: todo_types_options } })
|
2016-02-18 03:20:31 +00:00
|
|
|
.filter-item.inline.actions-filter
|
2016-08-27 23:18:48 +00:00
|
|
|
- if params[:action_id].present?
|
|
|
|
= hidden_field_tag(:action_id, params[:action_id])
|
2016-08-28 15:24:48 +00:00
|
|
|
= dropdown_tag(todo_actions_dropdown_label(params[:action_id], 'Action'), options: { toggle_class: 'js-action-search js-filter-submit', dropdown_class: 'dropdown-menu-selectable dropdown-menu-action js-filter-submit',
|
|
|
|
data: { data: todo_actions_options }})
|
2016-07-26 21:21:20 +00:00
|
|
|
.pull-right
|
|
|
|
.dropdown.inline.prepend-left-10
|
|
|
|
%button.dropdown-toggle.btn{type: 'button', 'data-toggle' => 'dropdown'}
|
|
|
|
%span.light
|
|
|
|
- if @sort.present?
|
|
|
|
= sort_options_hash[@sort]
|
|
|
|
- else
|
|
|
|
= sort_title_recently_created
|
|
|
|
%b.caret
|
|
|
|
%ul.dropdown-menu.dropdown-menu-align-right.dropdown-menu-sort
|
|
|
|
%li
|
|
|
|
= link_to todos_filter_path(sort: sort_value_priority) do
|
|
|
|
= sort_title_priority
|
|
|
|
= link_to todos_filter_path(sort: sort_value_recently_created) do
|
|
|
|
= sort_title_recently_created
|
|
|
|
= link_to todos_filter_path(sort: sort_value_oldest_created) do
|
|
|
|
= sort_title_oldest_created
|
|
|
|
|
|
|
|
|
2016-02-19 18:37:29 +00:00
|
|
|
.prepend-top-default
|
2016-02-20 13:59:59 +00:00
|
|
|
- if @todos.any?
|
2016-04-01 17:55:45 +00:00
|
|
|
.js-todos-options{ data: {per_page: @todos.limit_value, current_page: @todos.current_page, total_pages: @todos.total_pages} }
|
2016-02-20 13:59:59 +00:00
|
|
|
- @todos.group_by(&:project).each do |group|
|
2016-08-30 19:20:31 +00:00
|
|
|
.panel.panel-default.panel-small
|
2016-02-12 18:45:44 +00:00
|
|
|
- project = group[0]
|
|
|
|
.panel-heading
|
|
|
|
= link_to project.name_with_namespace, namespace_project_path(project.namespace, project)
|
|
|
|
|
2016-03-18 18:02:08 +00:00
|
|
|
%ul.content-list.todos-list
|
2016-02-12 18:45:44 +00:00
|
|
|
= render group[1]
|
2016-02-20 13:59:59 +00:00
|
|
|
= paginate @todos, theme: "gitlab"
|
2016-02-12 18:45:44 +00:00
|
|
|
- else
|
2016-02-20 19:53:25 +00:00
|
|
|
.nothing-here-block You're all done!
|