mirror of
https://github.com/discourse/discourse.git
synced 2025-03-02 09:19:22 +00:00
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'),
|
currentPath: Ember.computed.alias('application.currentPath'),
|
||||||
adminTools: optionalService(),
|
adminTools: optionalService(),
|
||||||
|
|
||||||
@computed("content.username")
|
@computed('model.username')
|
||||||
viewingSelf(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')
|
@computed('model.profileBackground')
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
connectorTagName="li"
|
connectorTagName="li"
|
||||||
args=(hash model=model)}}
|
args=(hash model=model)}}
|
||||||
|
|
||||||
{{#if viewingSelf}}
|
{{#if canExpandProfile}}
|
||||||
<li>
|
<li>
|
||||||
{{#if collapsedInfo}}
|
{{#if collapsedInfo}}
|
||||||
<a {{action "expandProfile"}} href class="btn">
|
<a {{action "expandProfile"}} href class="btn">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user