basic route and template
This commit is contained in:
parent
78914e0511
commit
ac267fabaf
|
@ -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" });
|
||||
});
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
export default function () {
|
||||
this.route('patrons');
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
export default Discourse.Route.extend({
|
||||
});
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
patrons
|
|
@ -1,6 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
DiscoursePatrons::Engine.routes.draw do
|
||||
get '/' => 'patrons#index'
|
||||
get '/:id' => 'patrons#show'
|
||||
Discourse::Application.routes.append do
|
||||
get '/patrons' => 'patrons#index'
|
||||
end
|
||||
|
|
|
@ -1,21 +1,3 @@
|
|||
plugins:
|
||||
discourse_patrons_enabled:
|
||||
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
|
||||
# about: Integrates Stripe into Discourse to allow visitors to make payments
|
||||
# name: Discourse Patrons
|
||||
# version: 1.0.0
|
||||
# url: https://github.com/rimian/discourse-patrons
|
||||
# authors: Rimian Perkins
|
||||
|
||||
enabled_site_setting :discourse_patrons_enabled
|
||||
|
||||
load File.expand_path('../lib/discourse_patrons/engine.rb', __FILE__)
|
||||
|
||||
Discourse::Application.routes.append do
|
||||
mount ::DiscoursePatrons::Engine, at: '/patrons'
|
||||
after_initialize do
|
||||
load File.expand_path('../config/routes.rb', __FILE__)
|
||||
load File.expand_path('../app/controllers/patrons_controller.rb', __FILE__)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue