only show subscribe buttons when logged in
This commit is contained in:
parent
75e077399b
commit
370566b570
|
@ -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();
|
||||
}
|
||||
});
|
|
@ -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}}
|
|
@ -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}}
|
||||
|
|
Loading…
Reference in New Issue