only show the link when the plugin is enabled

This commit is contained in:
Rimian Perkins 2017-02-27 12:07:21 +11:00
parent b6c213321b
commit 5328dd7a9a
4 changed files with 14 additions and 4 deletions

View File

@ -1,4 +1,5 @@
<div class="discourse-donations">
<a href="/users/{{model.username}}/payments">Donate</a>
</div>
{{#if siteSettings.discourse_donations_enabled}}
<div class="discourse-donations">
<a href="/users/{{model.username}}/payments">Donate</a>
</div>
{{/if}}

View File

@ -0,0 +1,3 @@
en:
site_settings:
discourse_donations_enabled: "Enable the discourse donations plugin."

4
config/settings.yml Normal file
View File

@ -0,0 +1,4 @@
plugins:
discourse_donations_enabled:
default: true
client: true

View File

@ -9,6 +9,8 @@ gem 'stripe', '2.0.1'
load File.expand_path('../lib/discourse_donations/engine.rb', __FILE__)
load File.expand_path('../config/stripe.rb', __FILE__)
enabled_site_setting :discourse_donations_enabled
after_initialize do
header_script = '<script src="https://js.stripe.com/v3/"></script>'