BigW Consortium Gitlab

index.html.haml 2.53 KB
Newer Older
1 2
- page_title "Todos"
- header_title "Todos", dashboard_todos_path
3 4 5

.top-area
  %ul.nav-links
6 7
    - todo_pending_active = ('active' if params[:state].blank? || params[:state] == 'pending')
    %li{class: "todos-pending #{todo_pending_active}"}
8
      = link_to todos_filter_path(state: 'pending') do
9
        %span
10
          To do
11 12
        %span.badge
          = todos_pending_count
13 14
    - todo_done_active = ('active' if params[:state] == 'done')
    %li{class: "todos-done #{todo_done_active}"}
15
      = link_to todos_filter_path(state: 'done') do
16 17
        %span
          Done
18 19
        %span.badge
          = todos_done_count
20

21 22
  .nav-controls
    - if @todos.any?(&:pending?)
23 24 25
      = 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')
26

27
.todos-filters
28
  .row-content-block.second-block
29
    = form_tag todos_filter_path(without: [:project_id, :author_id, :type, :action_id]), method: :get, class: 'filter-form' do
30
      .filter-item.inline
31
        = select_tag('project_id', todo_projects_options,
32 33 34 35 36 37
          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
38
        = select_tag('type', todo_types_options,
39 40 41
          class: 'select2 trigger-submit', include_blank: true,
          data: {placeholder: 'Type'})
      .filter-item.inline.actions-filter
42
        = select_tag('action_id', todo_actions_options,
43 44
          class: 'select2 trigger-submit', include_blank: true,
          data: {placeholder: 'Action'})
45

46
.prepend-top-default
47
  - if @todos.any?
48
    .js-todos-options{ data: {per_page: @todos.limit_value, current_page: @todos.current_page, total_pages: @todos.total_pages} }
49
    - @todos.group_by(&:project).each do |group|
50
      .panel.panel-default.panel-small.js-todos-list
51 52 53 54
        - project = group[0]
        .panel-heading
          = link_to project.name_with_namespace, namespace_project_path(project.namespace, project)

55
        %ul.content-list.todos-list
56
          = render group[1]
57
    = paginate @todos, theme: "gitlab"
58
  - else
59
    .nothing-here-block You're all done!
60 61 62 63 64 65 66 67

:javascript
  new UsersSelect();

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