mirror of
https://github.com/discourse/discourse.git
synced 2025-06-10 19:59:12 +08:00
when looking at your own profile it should be collapsed.
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
import { exportUserArchive } from 'discourse/lib/export-csv';
|
import { exportUserArchive } from 'discourse/lib/export-csv';
|
||||||
import CanCheckEmails from 'discourse/mixins/can-check-emails';
|
import CanCheckEmails from 'discourse/mixins/can-check-emails';
|
||||||
|
import computed from 'ember-addons/ember-computed-decorators';
|
||||||
|
|
||||||
export default Ember.Controller.extend(CanCheckEmails, {
|
export default Ember.Controller.extend(CanCheckEmails, {
|
||||||
indexStream: false,
|
indexStream: false,
|
||||||
@ -11,7 +12,10 @@ export default Ember.Controller.extend(CanCheckEmails, {
|
|||||||
return this.get('content.username') === Discourse.User.currentProp('username');
|
return this.get('content.username') === Discourse.User.currentProp('username');
|
||||||
}.property('content.username'),
|
}.property('content.username'),
|
||||||
|
|
||||||
collapsedInfo: Em.computed.not('indexStream'),
|
@computed('indexStream', 'viewingSelf', 'forceExpand')
|
||||||
|
collapsedInfo(indexStream, viewingSelf, forceExpand){
|
||||||
|
return (!indexStream || viewingSelf) && !forceExpand;
|
||||||
|
},
|
||||||
|
|
||||||
linkWebsite: Em.computed.not('model.isBasic'),
|
linkWebsite: Em.computed.not('model.isBasic'),
|
||||||
|
|
||||||
@ -59,6 +63,9 @@ export default Ember.Controller.extend(CanCheckEmails, {
|
|||||||
privateMessagesUnreadActive: Em.computed.equal('pmView', 'unread'),
|
privateMessagesUnreadActive: Em.computed.equal('pmView', 'unread'),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
expandProfile: function() {
|
||||||
|
this.set('forceExpand', true);
|
||||||
|
},
|
||||||
adminDelete: function() {
|
adminDelete: function() {
|
||||||
Discourse.AdminUser.find(this.get('model.username').toLowerCase()).then(function(user){
|
Discourse.AdminUser.find(this.get('model.username').toLowerCase()).then(function(user){
|
||||||
user.destroy({deletePosts: true});
|
user.destroy({deletePosts: true});
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div class="container">
|
<div class="container{{if viewingSelf ' viewing-self'}}">
|
||||||
<section class='user-main'>
|
<section class='user-main'>
|
||||||
<section {{bind-attr class="collapsedInfo :about model.profileBackground:has-background:no-background"}} style={{model.profileBackground}}>
|
<section {{bind-attr class="collapsedInfo :about model.profileBackground:has-background:no-background"}} style={{model.profileBackground}}>
|
||||||
<div class='staff-counters'>
|
<div class='staff-counters'>
|
||||||
@ -52,6 +52,11 @@
|
|||||||
{{#if canInviteToForum}}
|
{{#if canInviteToForum}}
|
||||||
<li>{{#link-to 'userInvited' class="btn right"}}{{fa-icon "user-plus"}}{{i18n 'user.invited.title'}}{{/link-to}}</li>
|
<li>{{#link-to 'userInvited' class="btn right"}}{{fa-icon "user-plus"}}{{i18n 'user.invited.title'}}{{/link-to}}</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{#if collapsedInfo}}
|
||||||
|
{{#if viewingSelf}}
|
||||||
|
<li><a {{action "expandProfile"}} href class="btn right">{{fa-icon "angle-double-down"}}{{i18n 'user.expand_profile'}}</a></li>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
@ -104,6 +104,12 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.viewing-self .user-main .about.collapsed-info {
|
||||||
|
.secondary, .staff-counters {
|
||||||
|
display: inherit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.user-main {
|
.user-main {
|
||||||
margin-bottom: 50px;
|
margin-bottom: 50px;
|
||||||
|
|
||||||
|
@ -412,6 +412,7 @@ en:
|
|||||||
private_messages: "Messages"
|
private_messages: "Messages"
|
||||||
activity_stream: "Activity"
|
activity_stream: "Activity"
|
||||||
preferences: "Preferences"
|
preferences: "Preferences"
|
||||||
|
expand_profile: "Expand"
|
||||||
bookmarks: "Bookmarks"
|
bookmarks: "Bookmarks"
|
||||||
bio: "About me"
|
bio: "About me"
|
||||||
invited_by: "Invited By"
|
invited_by: "Invited By"
|
||||||
|
Reference in New Issue
Block a user