A more extensible way to disable expanding/contracting of user profiles
This commit is contained in:
parent
0188cbb650
commit
76d734ea6e
|
@ -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')
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
connectorTagName="li"
|
||||
args=(hash model=model)}}
|
||||
|
||||
{{#if viewingSelf}}
|
||||
{{#if canExpandProfile}}
|
||||
<li>
|
||||
{{#if collapsedInfo}}
|
||||
<a {{action "expandProfile"}} href class="btn">
|
||||
|
|
Loading…
Reference in New Issue