2020-04-06 14:09:37 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Projects::StaticSiteEditorController < Projects::ApplicationController
|
2020-04-13 08:10:03 -04:00
|
|
|
include ExtractsPath
|
2020-04-15 05:09:46 -04:00
|
|
|
include CreatesCommit
|
|
|
|
|
2020-04-06 14:09:37 -04:00
|
|
|
layout 'fullscreen'
|
|
|
|
|
|
|
|
prepend_before_action :authenticate_user!, only: [:show]
|
2020-04-13 08:10:03 -04:00
|
|
|
before_action :assign_ref_and_path, only: [:show]
|
2020-04-15 05:09:46 -04:00
|
|
|
before_action :authorize_edit_tree!, only: [:show]
|
2020-06-30 11:08:48 -04:00
|
|
|
before_action do
|
|
|
|
push_frontend_feature_flag(:sse_image_uploads)
|
|
|
|
end
|
2020-04-06 14:09:37 -04:00
|
|
|
|
|
|
|
def show
|
2020-04-13 08:10:03 -04: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 14:09:37 -04:00
|
|
|
end
|
|
|
|
end
|