2018-09-23 19:44:14 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-09-08 13:49:20 +00:00
|
|
|
class Dashboard::SnippetsController < Dashboard::ApplicationController
|
2019-09-03 17:45:00 +00:00
|
|
|
include PaginatedCollection
|
2019-09-02 11:12:20 +00:00
|
|
|
include Gitlab::NoteableMetadata
|
|
|
|
|
2017-12-11 14:21:06 +00:00
|
|
|
skip_cross_project_access_check :index
|
|
|
|
|
2015-09-08 13:49:20 +00:00
|
|
|
def index
|
2019-09-02 11:12:20 +00:00
|
|
|
@snippets = SnippetsFinder.new(current_user, author: current_user, scope: params[:scope])
|
|
|
|
.execute
|
|
|
|
.page(params[:page])
|
|
|
|
.inc_author
|
|
|
|
|
2019-09-03 17:45:00 +00:00
|
|
|
return if redirect_out_of_range(@snippets)
|
|
|
|
|
2019-09-02 11:12:20 +00:00
|
|
|
@noteable_meta_data = noteable_meta_data(@snippets, 'Snippet')
|
2015-09-08 13:49:20 +00:00
|
|
|
end
|
|
|
|
end
|