when looking at your own profile it should be collapsed.

This commit is contained in:
Sam 2015-09-02 16:50:40 +10:00
parent 6e04e5bd2c
commit a0dd0bf1af
4 changed files with 21 additions and 2 deletions

View File

@ -1,5 +1,6 @@
import { exportUserArchive } from 'discourse/lib/export-csv';
import CanCheckEmails from 'discourse/mixins/can-check-emails';
import computed from 'ember-addons/ember-computed-decorators';
export default Ember.Controller.extend(CanCheckEmails, {
indexStream: false,
@ -11,7 +12,10 @@ export default Ember.Controller.extend(CanCheckEmails, {
return this.get('content.username') === Discourse.User.currentProp('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'),
@ -59,6 +63,9 @@ export default Ember.Controller.extend(CanCheckEmails, {
privateMessagesUnreadActive: Em.computed.equal('pmView', 'unread'),
actions: {
expandProfile: function() {
this.set('forceExpand', true);
},
adminDelete: function() {
Discourse.AdminUser.find(this.get('model.username').toLowerCase()).then(function(user){
user.destroy({deletePosts: true});

View File

@ -1,4 +1,4 @@
<div class="container">
<div class="container{{if viewingSelf ' viewing-self'}}">
<section class='user-main'>
<section {{bind-attr class="collapsedInfo :about model.profileBackground:has-background:no-background"}} style={{model.profileBackground}}>
<div class='staff-counters'>
@ -52,6 +52,11 @@
{{#if canInviteToForum}}
<li>{{#link-to 'userInvited' class="btn right"}}{{fa-icon "user-plus"}}{{i18n 'user.invited.title'}}{{/link-to}}</li>
{{/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>
</section>

View File

@ -104,6 +104,12 @@
}
.viewing-self .user-main .about.collapsed-info {
.secondary, .staff-counters {
display: inherit;
}
}
.user-main {
margin-bottom: 50px;

View File

@ -412,6 +412,7 @@ en:
private_messages: "Messages"
activity_stream: "Activity"
preferences: "Preferences"
expand_profile: "Expand"
bookmarks: "Bookmarks"
bio: "About me"
invited_by: "Invited By"