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' } })
|