2020-04-06 18:09:37 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Projects::StaticSiteEditorController < Projects::ApplicationController
|
2020-04-13 12:10:03 +00:00
|
|
|
include ExtractsPath
|
2020-04-15 09:09:46 +00:00
|
|
|
include CreatesCommit
|
|
|
|
|
2020-04-06 18:09:37 +00:00
|
|
|
layout 'fullscreen'
|
|
|
|
|
|
|
|
prepend_before_action :authenticate_user!, only: [:show]
|
2020-04-13 12:10:03 +00:00
|
|
|
before_action :assign_ref_and_path, only: [:show]
|
2020-04-15 09:09:46 +00:00
|
|
|
before_action :authorize_edit_tree!, only: [:show]
|
2020-06-30 15:08:48 +00:00
|
|
|
before_action do
|
|
|
|
push_frontend_feature_flag(:sse_image_uploads)
|
|
|
|
end
|
2020-04-06 18:09:37 +00:00
|
|
|
|
|
|
|
def show
|
2020-04-13 12:10:03 +00:00
|
|
|
@config = Gitlab::StaticSiteEditor::Config.new(@repository, @ref, @path, params[:return_url])
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def assign_ref_and_path
|
|
|
|
@ref, @path = extract_ref(params[:id])
|
|
|
|
|
|
|
|
render_404 if @ref.blank? || @path.blank?
|
2020-04-06 18:09:37 +00:00
|
|
|
end
|
|
|
|
end
|