diff options
author | George Tsiolis <tsiolis.g@gmail.com> | 2019-02-22 15:12:36 +0300 |
---|---|---|
committer | Kushal Pandya <kushalspandya@gmail.com> | 2019-02-22 15:12:36 +0300 |
commit | 220cb4c3a73022d5fccd2f3cbb180bc87fe42512 (patch) | |
tree | 2948682b2063339ca820861cff82eec1e31404f6 /app/views/shared | |
parent | cafc4943e04d5b342cbfa3d056d9359da0ea5c66 (diff) |
Improve snippets empty state
Diffstat (limited to 'app/views/shared')
-rw-r--r-- | app/views/shared/empty_states/_snippets.html.haml | 20 | ||||
-rw-r--r-- | app/views/shared/snippets/_list.html.haml | 12 |
2 files changed, 32 insertions, 0 deletions
diff --git a/app/views/shared/empty_states/_snippets.html.haml b/app/views/shared/empty_states/_snippets.html.haml new file mode 100644 index 00000000000..a1a16b9d067 --- /dev/null +++ b/app/views/shared/empty_states/_snippets.html.haml @@ -0,0 +1,20 @@ +- button_path = local_assigns.fetch(:button_path, false) + +.row.empty-state + .col-12 + .svg-content + = image_tag 'illustrations/snippets_empty.svg' + .text-content + - if current_user + %h4 + = s_('SnippetsEmptyState|Snippets are small pieces of code or notes that you want to keep.') + %p + = s_('SnippetsEmptyState|They can be either public or private.') + .text-center + = link_to s_('SnippetsEmptyState|New snippet'), button_path, class: 'btn btn-success', title: s_('SnippetsEmptyState|New snippet'), id: 'new_snippet_link' + - unless current_page?(dashboard_snippets_path) + = link_to s_('SnippetsEmptyState|Explore public snippets'), explore_snippets_path, class: 'btn btn-default', title: s_('SnippetsEmptyState|Explore public snippets') + - else + %h4.text-center= s_('SnippetsEmptyState|There are no snippets to show.') + + diff --git a/app/views/shared/snippets/_list.html.haml b/app/views/shared/snippets/_list.html.haml new file mode 100644 index 00000000000..5d2152eb411 --- /dev/null +++ b/app/views/shared/snippets/_list.html.haml @@ -0,0 +1,12 @@ +- remote = local_assigns.fetch(:remote, false) +- link_project = local_assigns.fetch(:link_project, false) + +- if @snippets.exists? + .snippets-list-holder + %ul.content-list + = render partial: 'shared/snippets/snippet', collection: @snippets, locals: { link_project: link_project } + + = paginate @snippets, theme: 'gitlab', remote: remote + +- else + .nothing-here-block= s_("SnippetsEmptyState|No snippets found") |