2020-03-09 00:40:16 +08:00
|
|
|
class Admins::LaboratorySettingsController < Admins::BaseController
|
2020-10-16 16:26:15 +08:00
|
|
|
|
|
|
|
def new
|
|
|
|
respond_to do |format|
|
|
|
|
format.js
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-03-09 00:40:16 +08:00
|
|
|
def show
|
|
|
|
@laboratory = current_laboratory
|
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
|
|
|
Admins::SaveLaboratorySettingService.call(current_laboratory, form_params)
|
|
|
|
render_ok
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def current_laboratory
|
|
|
|
@_current_laboratory ||= Laboratory.find(params[:laboratory_id])
|
|
|
|
end
|
|
|
|
|
|
|
|
def form_params
|
|
|
|
params.permit(:identifier, :name,
|
|
|
|
:nav_logo, :login_logo, :tab_logo, :oj_banner,
|
|
|
|
:subject_banner, :course_banner, :competition_banner, :moop_cases_banner,
|
2023-09-27 09:29:50 +08:00
|
|
|
:footer, navbar: %i[name link hidden index])
|
2020-03-09 00:40:16 +08:00
|
|
|
end
|
|
|
|
end
|