summaryrefslogtreecommitdiff
path: root/app/views/dashboard/tasks/index.html.haml
blob: 16e7b4ae0c57ddde90006347cec7e289de817069 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
- page_title "Task Queue"
- header_title "Task Queue", dashboard_tasks_path

.top-area
  %ul.nav-links
    %li{class: ('active' if params[:state].blank? || params[:state] == 'pending')}
      = link_to page_filter_path(state: 'pending') do
        %span
          Tasks
        %span{class: 'badge'}
          = tasks_pending_count
    %li{class: ('active' if params[:state] == 'done')}
      = link_to page_filter_path(state: 'done') do
        %span
          Done
        %span{class: 'badge'}
          = tasks_done_count

.tasks-filters
  .gray-content-block.second-block
    = form_tag page_filter_path(without: [:assignee_id, :milestone_title, :label_name, :scope, :sort]), method: :get, class: 'filter-form' do
      .filter-item.inline
        = select_tag('project_id', task_projects_options,
          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
        = select_tag('type', task_types_options,
          class: 'select2 trigger-submit', include_blank: true,
          data: {placeholder: 'Type'})
      .filter-item.inline.actions-filter
        = select_tag('action_id', task_actions_options,
          class: 'select2 trigger-submit', include_blank: true,
          data: {placeholder: 'Action'})

.tasks
  - if @tasks.any?
    - @tasks.group_by(&:project).each do |group|
      .panel.panel-default
        - project = group[0]
        .panel-heading
          = link_to project.name_with_namespace, namespace_project_path(project.namespace, project)

        %ul.well-list.tasks-list
          = render group[1]
    = paginate @tasks, theme: "gitlab"
  - else
    .nothing-here-block No tasks to show

:javascript
  new UsersSelect();

  $('form.filter-form').on('submit', function (event) {
    event.preventDefault();
    Turbolinks.visit(this.action + '&' + $(this).serialize());
  });