@@ -1,6 +1,9 @@
|
||||
class Admin::SettingsController < Admin::BaseController
|
||||
include Admin::ManagesProposalSettings
|
||||
|
||||
helper_method :successful_proposal_setting, :successful_proposals, :poll_feature_short_title_setting, :poll_feature_description_setting,
|
||||
:poll_feature_link_setting, :email_feature_short_title_setting, :email_feature_description_setting
|
||||
:poll_feature_link_setting, :email_feature_short_title_setting, :email_feature_description_setting,
|
||||
:poster_feature_short_title_setting, :poster_feature_description_setting
|
||||
|
||||
def index
|
||||
all_settings = Setting.all.group_by { |s| s.type }
|
||||
@@ -28,32 +31,4 @@ class Admin::SettingsController < Admin::BaseController
|
||||
def settings_params
|
||||
params.require(:setting).permit(:value)
|
||||
end
|
||||
|
||||
def successful_proposal_setting
|
||||
@successful_proposal_setting ||= Setting.find_by(key: 'proposals.successful_proposal_id')
|
||||
end
|
||||
|
||||
def successful_proposals
|
||||
Proposal.successful
|
||||
end
|
||||
|
||||
def poll_feature_short_title_setting
|
||||
@poll_feature_short_title_setting ||= Setting.find_by(key: 'proposals.poll_short_title')
|
||||
end
|
||||
|
||||
def poll_feature_description_setting
|
||||
@poll_feature_description_setting ||= Setting.find_by(key: 'proposals.poll_description')
|
||||
end
|
||||
|
||||
def poll_feature_link_setting
|
||||
@poll_feature_link_setting ||= Setting.find_by(key: 'proposals.poll_link')
|
||||
end
|
||||
|
||||
def email_feature_short_title_setting
|
||||
@email_feature_short_title_setting ||= Setting.find_by(key: 'proposals.email_short_title')
|
||||
end
|
||||
|
||||
def email_feature_description_setting
|
||||
@email_feature_description_setting ||= Setting.find_by(key: 'proposals.email_description')
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user