A more extensible way to disable expanding/contracting of user profiles

This commit is contained in:
Robin Ward 2018-04-03 14:19:56 -04:00
parent 0188cbb650
commit 76d734ea6e
2 changed files with 9 additions and 3 deletions

View File

@ -10,9 +10,15 @@ export default Ember.Controller.extend(CanCheckEmails, {
currentPath: Ember.computed.alias('application.currentPath'),
adminTools: optionalService(),
@computed("content.username")
@computed('model.username')
viewingSelf(username) {
return username === User.currentProp('username');
let currentUser = this.currentUser;
return currentUser && username === currentUser.get('username');
},
@computed('viewingSelf')
canExpandProfile(viewingSelf) {
return viewingSelf;
},
@computed('model.profileBackground')

View File

@ -67,7 +67,7 @@
connectorTagName="li"
args=(hash model=model)}}
{{#if viewingSelf}}
{{#if canExpandProfile}}
<li>
{{#if collapsedInfo}}
<a {{action "expandProfile"}} href class="btn">