FIX: defines an enabled_site_setting

This will amongst other things prevent to load plugin's code if the plugin is disabled.
This commit is contained in:
jjaffeux 2020-08-01 17:31:28 +02:00
parent 1e6e3bb3e9
commit 75fb2bf892
3 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,7 @@
en:
site_settings:
discourse_adplugin_enabled: Enable the discourse-adplugin.
no_ads_for_personal_messages: "Don't show ads when viewing personal messages"
no_ads_for_restricted_categories: "Don't show ads in categories that aren't visible to everyone."
no_ads_for_groups: "Don't show ads to users in these groups."

View File

@ -1,4 +1,7 @@
ad_plugin:
discourse_adplugin_enabled:
client: true
default: true
no_ads_for_personal_messages:
client: true
default: true

View File

@ -10,6 +10,8 @@ register_asset "stylesheets/adplugin.scss"
add_admin_route 'admin.adplugin.house_ads.title', 'houseAds'
enabled_site_setting :discourse_adplugin_enabled
module ::AdPlugin
def self.plugin_name
'discourse-adplugin'.freeze