From 8d24ff455e154174184bdf820b5a9023276e6dcf Mon Sep 17 00:00:00 2001 From: Rimian Perkins Date: Tue, 8 Oct 2019 21:59:20 +1100 Subject: [PATCH] have a dash board page --- ...s.es6 => admin-plugins-discourse-patrons-dashboard.js.es6} | 0 .../admin-plugins-discourse-patrons-plans-index.js.es6 | 2 -- .../javascripts/discourse/discourse-patrons-route-map.js.es6 | 1 + ...s.es6 => admin-plugins-discourse-patrons-dashboard.js.es6} | 0 ...rons-index.hbs => plugins-discourse-patrons-dashboard.hbs} | 0 .../discourse/templates/admin/plugins-discourse-patrons.hbs | 2 +- plugin.rb | 4 ++-- 7 files changed, 4 insertions(+), 5 deletions(-) rename assets/javascripts/discourse/controllers/{admin-plugins-discourse-patrons-index.js.es6 => admin-plugins-discourse-patrons-dashboard.js.es6} (100%) rename assets/javascripts/discourse/routes/{admin-plugins-discourse-patrons-index.js.es6 => admin-plugins-discourse-patrons-dashboard.js.es6} (100%) rename assets/javascripts/discourse/templates/admin/{plugins-discourse-patrons-index.hbs => plugins-discourse-patrons-dashboard.hbs} (100%) diff --git a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-index.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-dashboard.js.es6 similarity index 100% rename from assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-index.js.es6 rename to assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-dashboard.js.es6 diff --git a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-plans-index.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-plans-index.js.es6 index b6b536b..afbfd52 100644 --- a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-plans-index.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-plans-index.js.es6 @@ -1,6 +1,4 @@ -import { ajax } from "discourse/lib/ajax"; import DiscourseURL from "discourse/lib/url"; -import Plan from "discourse/plugins/discourse-patrons/discourse/models/plan"; export default Ember.Controller.extend({ actions: { diff --git a/assets/javascripts/discourse/discourse-patrons-route-map.js.es6 b/assets/javascripts/discourse/discourse-patrons-route-map.js.es6 index 1b55db0..255b90f 100644 --- a/assets/javascripts/discourse/discourse-patrons-route-map.js.es6 +++ b/assets/javascripts/discourse/discourse-patrons-route-map.js.es6 @@ -3,6 +3,7 @@ export default { path: "/plugins", map() { this.route("discourse-patrons", function() { + this.route("dashboard"); this.route("subscriptions"); this.route("plans", function() { this.route("show", { path: "/:plan-id" }); diff --git a/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-index.js.es6 b/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-dashboard.js.es6 similarity index 100% rename from assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-index.js.es6 rename to assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-dashboard.js.es6 diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-index.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-dashboard.hbs similarity index 100% rename from assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-index.hbs rename to assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-dashboard.hbs diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons.hbs index 6f2ec76..785989a 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons.hbs @@ -2,7 +2,7 @@

{{i18n 'discourse_patrons.title' site_name=siteSettings.title}}

diff --git a/plugin.rb b/plugin.rb index b6c3f26..43cc74d 100644 --- a/plugin.rb +++ b/plugin.rb @@ -21,10 +21,10 @@ extend_content_security_policy( script_src: ['https://js.stripe.com/v3/'] ) -add_admin_route 'discourse_patrons.title', 'discourse-patrons' +add_admin_route 'discourse_patrons.title', 'discourse-patrons.dashboard' Discourse::Application.routes.append do - get '/admin/plugins/discourse-patrons' => 'admin/plugins#index' + get '/admin/plugins/discourse-patrons/dashboard' => 'admin/plugins#index' get '/admin/plugins/discourse-patrons/subscriptions' => 'admin/plugins#index' get '/admin/plugins/discourse-patrons/plans' => 'admin/plugins#index' get '/admin/plugins/discourse-patrons/plans/:plan_id' => 'admin/plugins#index'