1class Admin::SitesController < Admin::AdminController |
|
2 before_action :require_sysadmin |
|
3 before_action :fetch_site |
|
5 def edit |
|
6 respond_to do |format| |
|
7 format.html
|
|
8 end |
|
9 end |
|
11 def update |
|
12 if @site.update(site_params) |
|
13 redirect_to edit_admin_site_url(tab: params[:tab]), notice: :site_updated |
|
14 else |
|
15 respond_to do |format| |
|
16 format.html { render :edit } |
|
17 end |
|
18 end |
|
19 end |
|
21 private
|
|
23 def fetch_site |
|
24 @site = Site.instance |
|
25 end |
|
27 def site_params |
|
28 params.require(:site).permit( |
|
29 :title, :url, :email_from, :username, :password, :enabled, |
|
30 :protected, :petition_duration, :minimum_number_of_sponsors, |
|
31 :maximum_number_of_sponsors, :threshold_for_moderation, |
|
32 :threshold_for_response, :threshold_for_debate, :feedback_email, |
|
33 :moderate_url, :login_timeout, :disable_constituency_api, |
|
34 :signature_count_interval, :update_signature_counts, |
|
35 :disable_trending_petitions, :threshold_for_moderation_delay, |
|
36 :disable_invalid_signature_count_check, :disable_daily_update_statistics_job, |
|
37 :disable_plus_address_check, :disable_feedback_sending |
|
38 )
|
|
39 end |
|
40end |