2018-06-14 05:19:12 -04:00
|
|
|
- page_title _("Snippets")
|
2015-09-17 06:16:24 -04:00
|
|
|
|
2019-02-22 07:12:36 -05:00
|
|
|
- if @snippets.exists?
|
|
|
|
- if current_user
|
|
|
|
.top-area
|
|
|
|
- include_private = @project.team.member?(current_user) || current_user.admin?
|
|
|
|
= render partial: 'snippets/snippets_scope_menu', locals: { subject: @project, include_private: include_private }
|
2016-12-07 17:35:53 -05:00
|
|
|
|
2016-12-07 17:48:26 -05:00
|
|
|
- if can?(current_user, :create_project_snippet, @project)
|
2019-02-22 07:12:36 -05:00
|
|
|
.nav-controls
|
|
|
|
- if can?(current_user, :create_project_snippet, @project)
|
|
|
|
= link_to _("New snippet"), new_project_snippet_path(@project), class: "btn btn-success", title: _("New snippet")
|
2013-08-12 05:08:52 -04:00
|
|
|
|
2019-02-22 07:12:36 -05:00
|
|
|
= render 'shared/snippets/list'
|
|
|
|
- else
|
|
|
|
= render 'shared/empty_states/snippets', button_path: new_namespace_project_snippet_path(@project.namespace, @project)
|