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