summaryrefslogtreecommitdiff
path: root/app/views/shared/empty_states/_issues.html.haml
blob: 2691ec4cd46051d58194bf2d3fb3241667ccdcae (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
- button_path = local_assigns.fetch(:button_path, false)
- project_select_button = local_assigns.fetch(:project_select_button, false)
- show_import_button = local_assigns.fetch(:show_import_button, false) && Feature.enabled?(:issues_import_csv) && can?(current_user, :import_issues, @project)
- has_button = button_path || project_select_button
- closed_issues_count = issuables_count_for_state(:issues, :closed)
- opened_issues_count = issuables_count_for_state(:issues, :opened)
- is_opened_state = params[:state] == 'opened'
- is_closed_state = params[:state] == 'closed'

.row.empty-state
  .col-12
    .svg-content
      = image_tag 'illustrations/issues.svg'
  .col-12
    .text-content
      - if has_filter_bar_param?
        %h4.text-center
          = _("Sorry, your filter produced no results")
        %p.text-center
          = _("To widen your search, change or remove filters above")
        - if show_new_issue_link?(@project)
          .text-center
            = link_to _("New issue"), new_project_issue_path(@project), class: "btn btn-success", title: _("New issue"), id: "new_issue_body_link"
      - elsif is_opened_state && opened_issues_count == 0 && closed_issues_count > 0
        %h4.text-center
          = _("There are no open issues")
        %p.text-center
          = _("To keep this project going, create a new issue")
        - if show_new_issue_link?(@project)
          .text-center
            = link_to _("New issue"), new_project_issue_path(@project), class: "btn btn-success", title: _("New issue"), id: "new_issue_body_link"
      - elsif is_closed_state && opened_issues_count > 0 && closed_issues_count == 0
        %h4.text-center
          = _("There are no closed issues")
      - elsif current_user
        %h4
          = _("The Issue Tracker is the place to add things that need to be improved or solved in a project")
        %p
          = _("Issues can be bugs, tasks or ideas to be discussed. Also, issues are searchable and filterable.")
        - if has_button
          .text-center
            - if project_select_button
              = render 'shared/new_project_item_select', path: 'issues/new', label: _('New issue'), type: :issues, with_feature_enabled: 'issues'
            - else
              = link_to _('New issue'), button_path, class: 'btn btn-success', title: _('New issue'), id: 'new_issue_link'

            - if show_import_button
              = render 'projects/issues/import_csv/button', type: :text

      - else
        %h4.text-center= _("There are no issues to show")
        %p
          = _("The Issue Tracker is the place to add things that need to be improved or solved in a project. You can register or sign in to create issues for this project.")
        .text-center
          = link_to _('Register / Sign In'), new_user_session_path, class: 'btn btn-success'

- if show_import_button
  = render 'projects/issues/import_csv/modal'