File: _snippets.html.haml

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (22 lines) | stat: -rw-r--r-- 1,134 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
- button_path = local_assigns.fetch(:button_path, false)
- button_text = s_('SnippetsEmptyState|New snippet') if button_path
- illustration = 'illustrations/empty-state/empty-snippets-md.svg'

- if current_user
  = render Pajamas::EmptyStateComponent.new(svg_path: illustration,
    title: s_('SnippetsEmptyState|Code snippets'),
    primary_button_text: button_text,
    primary_button_link: button_path,
    primary_button_options: { data: { testid: 'create-first-snippet-link' } },
    secondary_button_text: _('Explore snippets'),
    secondary_button_link: explore_snippets_path,
    empty_state_options: { data: { testid: 'snippets-empty-state' } }) do |c|

    - c.with_description do
      = s_('SnippetsEmptyState|Store, share, and embed small pieces of code and text.')
      = link_to _('Learn more.'), help_page_path('user/snippets.md'), target: '_blank', rel: 'noopener noreferrer', class: 'gl-underline'

- else
  = render Pajamas::EmptyStateComponent.new(svg_path: illustration,
    title:  s_('SnippetsEmptyState|There are no snippets to show.'),
    empty_state_options: { data: { testid: 'snippets-empty-state' } })