basic route and template

This commit is contained in:
Rimian Perkins
2019-09-11 17:13:12 +10:00
parent 78914e0511
commit ac267fabaf
10 changed files with 19 additions and 54 deletions
+4
View 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" });
});
}
@@ -0,0 +1,4 @@
export default function () {
this.route('patrons');
}
@@ -0,0 +1,3 @@
export default Discourse.Route.extend({
});
@@ -0,0 +1,2 @@
patrons
+2 -3
View File
@@ -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
-18
View File
@@ -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
View File
@@ -1 +0,0 @@
assets/javascripts/discourse/
-10
View File
@@ -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
+4 -10
View File
@@ -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