BigW Consortium Gitlab

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

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

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

Phil Hughes committed
28 29 30 31 32 33 34 35 36 37 38 39
  .todos-filters
    .row-content-block.second-block
      = form_tag todos_filter_path(without: [:project_id, :author_id, :type, :action_id]), method: :get, class: 'filter-form' do
        .filter-item.inline
          - if params[:project_id].present?
            = hidden_field_tag(:project_id, params[:project_id])
          = 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 } })
        .filter-item.inline
          - if params[:author_id].present?
            = hidden_field_tag(:author_id, params[:author_id])
          = 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',
40
            placeholder: 'Search authors', data: { any_user: 'Any Author', first_user: (current_user.username if current_user), project_id: (@project.id if @project), selected: params[:author_id], field_name: 'author_id', default_label: 'Author', todo_filter: true, todo_state_filter: params[:state] || 'pending' } })
Phil Hughes committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
        .filter-item.inline
          - if params[:type].present?
            = hidden_field_tag(:type, params[:type])
          = 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 } })
        .filter-item.inline.actions-filter
          - if params[:action_id].present?
            = hidden_field_tag(:action_id, params[:action_id])
          = 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 }})
        .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
Felipe Artur committed
58
                = sort_title_recently_created
Phil Hughes committed
59 60 61 62 63 64 65 66 67
              = icon('caret-down')
            %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
Felipe Artur committed
68 69


70
.prepend-top-default
71
  - if @todos.any?
72
    .js-todos-options{ data: {per_page: @todos.limit_value, current_page: @todos.current_page, total_pages: @todos.total_pages} }
73
    - @todos.group_by(&:project).each do |group|
74
      .panel.panel-default.panel-small
75 76 77 78
        - project = group[0]
        .panel-heading
          = link_to project.name_with_namespace, namespace_project_path(project.namespace, project)

79
        %ul.content-list.todos-list
80
          = render group[1]
81
    = paginate @todos, theme: "gitlab"
Phil Hughes committed
82 83 84
  - elsif current_user.todos.any?
    .todos-all-done
      = render "shared/empty_states/todos_all_done.svg"
85
      - if todos_filter_empty?
86
        %h4.text-center
Josep Llaneras committed
87
          = Gitlab.config.gitlab.no_todos_messages.sample
88 89 90 91 92 93 94
        %p.text-center
          Are you looking for things to do? Take a look at
          = succeed "," do
            = link_to "the opened issues", issues_dashboard_path
          contribute to
          = link_to "merge requests", merge_requests_dashboard_path
          or mention someone in a comment to assign a new todo automatically.
95 96 97
      - else
        %h4.text-center
          There are no todos to show.
98
  - else
Phil Hughes committed
99 100 101 102 103 104 105 106 107 108 109 110
    .todos-empty
      .todos-empty-hero
        = render "shared/empty_states/todos_empty.svg"
      .todos-empty-content
        %h4
          Todos let you see what you should do next.
        %p
          When an issue or merge request is assigned to you, or when you
          %strong
            @mention
          in a comment, this will trigger a new item in your todo list, automatically.
        %p
111
          You will always know what to work on next.