mirror of
https://github.com/discourse/discourse-subscriptions.git
synced 2025-03-06 17:49:24 +00:00
Implement new Theme
* remove old SiteCustomization (deprecated) * Create a theme and add a field for the header
This commit is contained in:
parent
66094fdfdd
commit
a0711a6a6c
15
plugin.rb
15
plugin.rb
@ -1,6 +1,6 @@
|
|||||||
# name: discourse-donations
|
# name: discourse-donations
|
||||||
# about: Integrating Discourse with Stripe for donations
|
# about: Integrating Discourse with Stripe for donations
|
||||||
# version: 1.7.3
|
# version: 1.8.0
|
||||||
# url: https://github.com/choiceaustralia/discourse-donations
|
# url: https://github.com/choiceaustralia/discourse-donations
|
||||||
# authors: Rimian Perkins
|
# authors: Rimian Perkins
|
||||||
|
|
||||||
@ -13,16 +13,9 @@ enabled_site_setting :discourse_donations_enabled
|
|||||||
after_initialize do
|
after_initialize do
|
||||||
# Must be placed on every page for fraud protection.
|
# Must be placed on every page for fraud protection.
|
||||||
header_script = '<script src="https://js.stripe.com/v3/"></script>'
|
header_script = '<script src="https://js.stripe.com/v3/"></script>'
|
||||||
|
discourse_donations_theme = Theme.find_or_create_by(name: 'Discourse Donations Header', hidden: false, user_id: -1)
|
||||||
discourse_donations_customization = SiteCustomization.find_or_create_by({
|
discourse_donations_theme.set_field('common', 'head_tag', header_script)
|
||||||
name: 'Discourse Donations Header',
|
discourse_donations_theme.save
|
||||||
header: header_script,
|
|
||||||
mobile_header: header_script,
|
|
||||||
enabled: true,
|
|
||||||
user_id: -1
|
|
||||||
})
|
|
||||||
|
|
||||||
SiteCustomization.where(name: discourse_donations_customization.name).where.not(id: discourse_donations_customization.id).delete_all
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Discourse::Application.routes.prepend do
|
Discourse::Application.routes.prepend do
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
require 'fakeweb'
|
||||||
|
|
||||||
#TODO register some fixtures
|
#TODO register some fixtures
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user