initial templates and routes

This commit is contained in:
Rimian Perkins 2019-09-24 15:20:07 +10:00
parent 308c8ea771
commit dfef3c49cf
8 changed files with 42 additions and 22 deletions

View File

@ -0,0 +1,7 @@
export default Ember.Controller.extend({
actions: {
createPlan() {
this.transitionToRoute("adminPlugins.discourse-patrons.plans");
}
}
});

View File

@ -0,0 +1 @@
export default Ember.Controller.extend({});

View File

@ -0,0 +1 @@
export default Ember.Controller.extend({});

View File

@ -1,13 +1,13 @@
import { ajax } from "discourse/lib/ajax";
export default Discourse.Route.extend({
model(params) {
return ajax("/patrons/admin/subscriptions", {
method: "get",
data: {
order: params.order,
descending: params.descending
}
}).then(results => results);
}
// model(params) {
// return ajax("/patrons/admin/subscriptions", {
// method: "get",
// data: {
// order: params.order,
// descending: params.descending
// }
// }).then(results => results);
// }
});

View File

@ -1,3 +1,7 @@
[plans show]
<h4>[plans show]</h4>
<div class="buttons">
{{d-button label="plans.show" action="createPlan" icon="plus"}}
</div>

View File

@ -1,8 +1,8 @@
<h3>Plans.</h3>
{{#link-to 'adminPlugins.discourse-patrons.plans.show' 'new'}}
{{#link-to 'adminPlugins.discourse-patrons.plans.show' 'new' class="btn btn-primary"}}
New
{{/link-to}}
[{{outlet}}]
{{outlet}}

View File

@ -1,10 +1,6 @@
<h3>Subscription Plans</h3>
{{#d-button action="createSubscriptionPlan" class="btn btn-primary btn-payment btn-discourse-patrons"}}
New
{{/d-button}}
<table class="table discourse-patrons-admin">
<thead>
<tr>

View File

@ -1,12 +1,23 @@
<h2>{{i18n 'discourse_patrons.title' site_name=siteSettings.title}}</h2>
{{!-- {{#link-to 'adminPlugins.discourse-patrons'}}
Payments
{{/link-to}}
{{#link-to 'adminPlugins.discourse-patrons.subscriptions'}}
Subscriptions
{{/link-to}} --}}
<ul class="nav nav-pills">
<li>
{{#link-to 'adminPlugins.discourse-patrons'}}
Payments
{{/link-to}}
</li>
<li>
{{#link-to 'adminPlugins.discourse-patrons.plans'}}
Plans
{{/link-to}}
</li>
<li>
{{#link-to 'adminPlugins.discourse-patrons.subscriptions'}}
Subscriptions
{{/link-to}}
</li>
</ul>
<hr>