Rename adsense_ads_txt setting to ads_txt

This commit is contained in:
Penar Musaraj 2019-06-03 11:39:28 -04:00
parent ab9cf6459e
commit f745ecfbdc
4 changed files with 18 additions and 7 deletions

View File

@ -3,6 +3,7 @@ en:
no_ads_for_groups: "Don't show ads to users in these groups." no_ads_for_groups: "Don't show ads to users in these groups."
house_ads_after_nth_post: 'If "Between posts" house ads are defined, show an ad after every N posts, where N is this value.' house_ads_after_nth_post: 'If "Between posts" house ads are defined, show an ad after every N posts, where N is this value.'
house_ads_frequency: "If other ad networks are configured to show in an ad slot, how often should house ads be shown, as a percentage." house_ads_frequency: "If other ad networks are configured to show in an ad slot, how often should house ads be shown, as a percentage."
ads_txt: "Contents of your ads.txt file. More details available at <a href='https://support.google.com/adsense/answer/7532444?hl=en' target='_blank'>this Google AdSense help page</a>."
dfp_publisher_id: "Input your Google Ad Manager (formerly called DFP) network code, which is found in your network settings." dfp_publisher_id: "Input your Google Ad Manager (formerly called DFP) network code, which is found in your network settings."
dfp_through_trust_level: "Show your ads to users based on trust levels. Users with trust level higher than this value will not see ads." dfp_through_trust_level: "Show your ads to users based on trust levels. Users with trust level higher than this value will not see ads."
@ -55,7 +56,6 @@ en:
adsense_post_bottom_ad_sizes: "Choose your ad size" adsense_post_bottom_ad_sizes: "Choose your ad size"
adsense_mobile_post_bottom_ad_size: "Choose your ad size" adsense_mobile_post_bottom_ad_size: "Choose your ad size"
adsense_nth_post_code: "Show an ad after every N posts, where N is this value." adsense_nth_post_code: "Show an ad after every N posts, where N is this value."
adsense_ads_txt: "Contents of your ads.txt file. More details available at <a href='https://support.google.com/adsense/answer/7532444?hl=en' target='_blank'>this Google AdSense help page</a>."
amazon_through_trust_level: "Show your ads to users based on trust levels. Users with trust level higher than this value will not see ads." amazon_through_trust_level: "Show your ads to users based on trust levels. Users with trust level higher than this value will not see ads."
amazon_topic_list_top_src_code: "Enter src code to display at topic list top location" amazon_topic_list_top_src_code: "Enter src code to display at topic list top location"

View File

@ -13,6 +13,10 @@ ad_plugin:
default: 100 default: 100
min: 0 min: 0
max: 100 max: 100
ads_txt:
client: false
default: ""
textarea: true
adsense_plugin: adsense_plugin:
adsense_publisher_code: adsense_publisher_code:
@ -124,10 +128,6 @@ adsense_plugin:
client: true client: true
default: "" default: ""
min: 1 min: 1
adsense_ads_txt:
client: false
default: ""
textarea: true
dfp_plugin: dfp_plugin:
dfp_publisher_id: dfp_publisher_id:

View File

@ -0,0 +1,11 @@
# frozen_string_literal: true
class RenameSiteSettingAdsTxt < ActiveRecord::Migration[5.2]
def up
execute "UPDATE site_settings SET name = 'ads_txt' WHERE name = 'adsense_ads_txt'"
end
def down
execute "UPDATE site_settings SET name = 'adsense_ads_txt' WHERE name = 'ads_txt'"
end
end

View File

@ -43,9 +43,9 @@ after_initialize do
skip_before_action :check_xhr skip_before_action :check_xhr
def index def index
raise Discourse::NotFound unless SiteSetting.adsense_ads_txt.present? raise Discourse::NotFound unless SiteSetting.ads_txt.present?
render plain: SiteSetting.adsense_ads_txt render plain: SiteSetting.ads_txt
end end
end end