Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.html.haml « todos « dashboard « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1b0bd10db77a292290e9266a83e6cdc9859abda8 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
- page_title _("To-Do List")

= render_two_factor_auth_recovery_settings_check
= render_dashboard_ultimate_trial(current_user)
= render_if_exists 'dashboard/todos/saml_reauth_notice'
- add_page_specific_style 'page_bundles/todos'
- add_page_specific_style 'page_bundles/issuable'
- filter_by_done = params[:state] == 'done'
- open_todo_count = todos_has_filtered_results? && !filter_by_done ? @allowed_todos.count : todos_pending_count
- done_todo_count = todos_has_filtered_results? && filter_by_done ? @allowed_todos.count : todos_done_count

.page-title-holder.d-flex.align-items-center
  %h1.page-title.gl-font-size-h-display= _("To-Do List")

- if current_user.todos.any?
  .top-area
    = gl_tabs_nav({ class: 'gl-flex-grow-1 gl-border-0' }) do
      = gl_tab_link_to todos_filter_path(state: 'pending'), item_active: params[:state].blank? || params[:state] == 'pending', class: "js-todos-pending" do
        = _("To Do")
        = gl_tab_counter_badge(number_with_delimiter(open_todo_count), { class: 'js-todos-badge' })
      = gl_tab_link_to todos_filter_path(state: 'done'), item_active: filter_by_done, class: "js-todos-done" do
        = _("Done")
        = gl_tab_counter_badge(number_with_delimiter(done_todo_count), { class: 'js-todos-badge' })

    .nav-controls
      - if @allowed_todos.any?(&:pending?)
        .gl-mr-3
          = render Pajamas::ButtonComponent.new(button_options: { class: 'btn-loading gl-align-items-center js-todos-mark-all'}, method: :delete, href: destroy_all_dashboard_todos_path(todos_filter_params)) do
            = gl_loading_icon(inline: true)
            = s_("Todos|Mark all as done")
          = render Pajamas::ButtonComponent.new(button_options: { class: 'btn-loading gl-align-items-center js-todos-undo-all hidden'}, method: :patch, href: bulk_restore_dashboard_todos_path(todos_filter_params)) do
            = gl_loading_icon(inline: true)
            = s_("Todos|Undo mark all as done")

  .todos-filters
    .issues-details-filters.row-content-block.second-block
      = form_tag todos_filter_path(without: [:project_id, :author_id, :type, :action_id]), method: :get, class: 'filter-form gl-display-flex gl-flex-direction-column gl-sm-flex-direction-row' do
        .filter-categories.gl-display-flex.gl-flex-direction-column.gl-md-flex-direction-row.gl-flex-grow-1.gl-flex-wrap.gl-mx-n2
          .filter-item.gl-m-2
            - if params[:group_id].present?
              = hidden_field_tag(:group_id, params[:group_id])
            = dropdown_tag(group_dropdown_label(params[:group_id], _("Group")), options: { toggle_class: 'js-group-search js-filter-submit gl-w-full gl-sm-w-auto', title: s_("Todos|Filter by group"), filter: true, filterInput: 'input#group-search', dropdown_class: 'dropdown-menu-selectable dropdown-menu-group js-filter-submit', placeholder: _("Search groups"), data: { default_label: _("Group"), display: 'static', testid: 'group-dropdown' } })
          .filter-item.gl-m-2
            - 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 gl-w-full gl-sm-w-auto', title: s_("Todos|Filter by project"), filter: true, filterInput: 'input#project-search', dropdown_class: 'dropdown-menu-selectable dropdown-menu-project js-filter-submit', placeholder: _("Search projects"), data: { default_label: _("Project"), display: 'static' } })
          .filter-item.gl-m-2
            - 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 gl-w-full gl-sm-w-auto', title: s_("Todos|Filter by author"), filter: true, filterInput: 'input#author-search', dropdown_class: 'dropdown-menu-user dropdown-menu-selectable dropdown-menu-author js-filter-submit', 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' } })
          .filter-item.gl-m-2
            - 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 gl-w-full gl-sm-w-auto', dropdown_class: 'dropdown-menu-selectable dropdown-menu-type js-filter-submit', data: { data: todo_types_options, default_label: _("Type") } })
          .filter-item.actions-filter.gl-m-2
            - 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 gl-w-full gl-sm-w-auto', dropdown_class: 'dropdown-menu-selectable dropdown-menu-action js-filter-submit', data: { data: todo_actions_options, default_label: _("Action") } })
        .filter-item.sort-filter.gl-my-2
          .dropdown
            %button.dropdown-menu-toggle.dropdown-menu-toggle-sort{ type: 'button', class: 'gl-w-full gl-sm-w-auto', 'data-toggle' => 'dropdown' }
              %span.light
              - if @sort.present?
                = sort_options_hash[@sort]
              - else
                = sort_title_recently_created
              = sprite_icon('chevron-down', css_class: 'dropdown-menu-toggle-icon')
            %ul.dropdown-menu.dropdown-menu-sort.dropdown-menu-right
              %li
                = link_to todos_filter_path(sort: sort_value_label_priority) do
                  = sort_title_label_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
                = link_to todos_filter_path(sort: sort_value_recently_updated) do
                  = sort_title_recently_updated

.row.js-todos-all
  - if @allowed_todos.any?
    .col.js-todos-list-container{ data: { testid: "todos-list-container" } }
      .js-todos-options{ data: { per_page: @allowed_todos.count, current_page: @todos.current_page, total_pages: @todos.total_pages } }
        %ul.content-list.todos-list
          = render @allowed_todos
      = paginate @todos, theme: "gitlab"
    .col.js-nothing-here-container.gl-empty-state.gl-text-center.hidden
      .svg-content.svg-150
        = image_tag 'illustrations/empty-todos-all-done-md.svg'
      .text-content.gl-text-center
        %h1.gl-font-size-h-display.gl-line-height-36.gl-mt-0
          = s_("Todos|You're all done!")
  - elsif current_user.todos.any?
    .col.todos-all-done.gl-empty-state.gl-text-center
      .svg-content.svg-150
        = image_tag (!todos_filter_empty? && !todos_has_filtered_results?) ? 'illustrations/empty-todos-all-done-md.svg' : 'illustrations/empty-todos-md.svg'
      .text-content.gl-text-center.gl-m-auto{ class: "gl-max-w-88!" }
        %h1.gl-font-size-h-display.gl-line-height-36.gl-mt-0
          - if todos_filter_empty?
            = no_todos_messages.sample
          - elsif todos_has_filtered_results?
            = _("Sorry, your filter produced no results")
          - else
            = s_("Todos|Nothing is on your to-do list. Nice work!")

        - if todos_filter_empty?
          %p
          = (s_("Todos|Not sure where to go next? Take a look at your %{strongStart}%{assignedIssuesLinkStart}assigned issues%{assignedIssuesLinkEnd}%{strongEnd} or %{strongStart}%{mergeRequestLinkStart}merge requests%{mergeRequestLinkEnd}%{mergeRequestLinkEnd}%{strongEnd}.") % { strongStart: '<strong>', strongEnd: '</strong>', assignedIssuesLinkStart: "<a href=\"#{issues_dashboard_path(assignee_username: current_user.username)}\">", assignedIssuesLinkEnd: '</a>', mergeRequestLinkStart: "<a href=\"#{merge_requests_dashboard_path(assignee_username: current_user.username)}\">", mergeRequestLinkEnd: '</a>' }).html_safe
          %p
          = link_to s_("Todos| What actions create to-do items?"), help_page_path('user/todos', anchor: 'actions-that-create-to-do-items'), target: '_blank', rel: 'noopener noreferrer'

        - elsif todos_has_filtered_results?
          %p
            = link_to s_("Todos|Do you want to remove the filters?"), todos_filter_path(without: [:project_id, :author_id, :type, :action_id])

  - else
    .col.gl-empty-state.gl-text-center
      .svg-content.svg-150
        = image_tag 'illustrations/empty-todos-md.svg'
      .text-content.gl-text-center.gl-m-auto{ class: "gl-max-w-88!" }
        %h1.gl-font-size-h-display.gl-line-height-36.gl-mt-0
          = s_("Todos|Your To-Do List shows what to work on next")
        %p
          = (s_("Todos|When an issue or merge request is assigned to you, or when you receive a %{strongStart}@mention%{strongEnd} in a comment, this automatically triggers a new item in your To-Do List.") % { strongStart: '<strong>', strongEnd: '</strong>' }).html_safe
        %p
          = s_("Todos|It's how you always know what to work on next.")