Merge branch 'feature/logged-in-subscribe-page' of github.com:rimian/discourse-patrons into feature/logged-in-subscribe-page

This commit is contained in:
Rimian Perkins 2019-11-14 10:51:27 +11:00
commit 399dca953a
3 changed files with 28 additions and 16 deletions

View File

@ -0,0 +1,9 @@
import computed from "ember-addons/ember-computed-decorators";
import User from "discourse/models/user";
export default Ember.Component.extend({
@computed()
currentUser() {
return User.current();
}
});

View File

@ -0,0 +1,18 @@
{{#each products as |product|}}
<div>
<h2>{{product.name}}</h2>
<p>
{{product.description}}
</p>
{{#if currentUser}}
<div class="pull-right">
{{#link-to "patrons.subscribe.show" product.id class="btn btn-primary"}}
{{i18n 'discourse_patrons.subscribe.title'}}
{{/link-to}}
</div>
{{/if}}
</div>
{{/each}}

View File

@ -1,17 +1,2 @@
{{#each model as |product|}}
<div>
<h2>{{product.name}}</h2>
<p>
{{product.description}}
</p>
<div class="pull-right">
{{#link-to "patrons.subscribe.show" product.id class="btn btn-primary"}}
{{i18n 'discourse_patrons.subscribe.title'}}
{{/link-to}}
</div>
</div>
{{/each}}
{{product-list products=model}}