mirror of
https://github.com/discourse/discourse-subscriptions.git
synced 2025-07-06 14:32:11 +00:00
basic route and template
This commit is contained in:
parent
78914e0511
commit
ac267fabaf
4
app/controllers/patrons_controller.rb
Normal file
4
app/controllers/patrons_controller.rb
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
class PatronsController < ApplicationController
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
end
|
@ -1,12 +0,0 @@
|
|||||||
|
|
||||||
export default function() {
|
|
||||||
const { disabled_plugins = [] } = this.site;
|
|
||||||
|
|
||||||
if (disabled_plugins.indexOf("discourse-patrons") !== -1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.route("patrons", function() {
|
|
||||||
this.route("show", { path: ":payment_id" });
|
|
||||||
});
|
|
||||||
}
|
|
4
assets/javascripts/discourse/patrons-route-map.js.es6
Normal file
4
assets/javascripts/discourse/patrons-route-map.js.es6
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
export default function () {
|
||||||
|
this.route('patrons');
|
||||||
|
}
|
3
assets/javascripts/discourse/routes/patrons.js.es6
Normal file
3
assets/javascripts/discourse/routes/patrons.js.es6
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
export default Discourse.Route.extend({
|
||||||
|
});
|
2
assets/javascripts/discourse/templates/patrons.hbs
Normal file
2
assets/javascripts/discourse/templates/patrons.hbs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
patrons
|
@ -1,6 +1,5 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
DiscoursePatrons::Engine.routes.draw do
|
Discourse::Application.routes.append do
|
||||||
get '/' => 'patrons#index'
|
get '/patrons' => 'patrons#index'
|
||||||
get '/:id' => 'patrons#show'
|
|
||||||
end
|
end
|
||||||
|
@ -1,21 +1,3 @@
|
|||||||
plugins:
|
plugins:
|
||||||
discourse_patrons_enabled:
|
discourse_patrons_enabled:
|
||||||
default: false
|
default: false
|
||||||
client: true
|
|
||||||
discourse_patrons_secret_key:
|
|
||||||
default: ''
|
|
||||||
client: false
|
|
||||||
discourse_patrons_public_key:
|
|
||||||
default: ''
|
|
||||||
client: true
|
|
||||||
discourse_patrons_currency:
|
|
||||||
client: true
|
|
||||||
default: "USD"
|
|
||||||
type: enum
|
|
||||||
choices:
|
|
||||||
- AUD
|
|
||||||
- CAD
|
|
||||||
- EUR
|
|
||||||
- JPY
|
|
||||||
- GBP
|
|
||||||
- USD
|
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
module ::DiscoursePatrons
|
|
||||||
PLUGIN_NAME = "discourse-patrons"
|
|
||||||
|
|
||||||
class Engine < ::Rails::Engine
|
|
||||||
engine_name DiscoursePatrons::PLUGIN_NAME
|
|
||||||
isolate_namespace DiscoursePatrons
|
|
||||||
end
|
|
||||||
end
|
|
14
plugin.rb
14
plugin.rb
@ -1,15 +1,9 @@
|
|||||||
# frozen_string_literal: true
|
# name: Discourse Patrons
|
||||||
|
|
||||||
# name: discourse-patrons
|
|
||||||
# about: Integrates Stripe into Discourse to allow visitors to make payments
|
|
||||||
# version: 1.0.0
|
# version: 1.0.0
|
||||||
# url: https://github.com/rimian/discourse-patrons
|
|
||||||
# authors: Rimian Perkins
|
|
||||||
|
|
||||||
enabled_site_setting :discourse_patrons_enabled
|
enabled_site_setting :discourse_patrons_enabled
|
||||||
|
|
||||||
load File.expand_path('../lib/discourse_patrons/engine.rb', __FILE__)
|
after_initialize do
|
||||||
|
load File.expand_path('../config/routes.rb', __FILE__)
|
||||||
Discourse::Application.routes.append do
|
load File.expand_path('../app/controllers/patrons_controller.rb', __FILE__)
|
||||||
mount ::DiscoursePatrons::Engine, at: '/patrons'
|
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user