mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 05:34:28 +08:00
Collapse user details when not viewing index view
This commit is contained in:
parent
f8625b5510
commit
a215fc5bdc
|
@ -12,6 +12,10 @@ Discourse.UserController = Discourse.ObjectController.extend({
|
|||
return this.get('content.username') === Discourse.User.currentProp('username');
|
||||
}.property('content.username'),
|
||||
|
||||
collapsedInfo: function() {
|
||||
return !this.get('indexStream');
|
||||
}.property('indexStream'),
|
||||
|
||||
canSeePrivateMessages: function() {
|
||||
return this.get('viewingSelf') || Discourse.User.currentProp('staff');
|
||||
}.property('viewingSelf'),
|
||||
|
|
|
@ -22,6 +22,8 @@ Discourse.UserActivityStreamRoute = Discourse.Route.extend({
|
|||
setupController: function(controller, model) {
|
||||
controller.set('model', model);
|
||||
this.controllerFor('user_activity').set('userActionType', this.get('userActionType'));
|
||||
|
||||
this.controllerFor('user').set('indexStream', !this.get('userActionType'));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ Discourse.UserTopicListRoute = Discourse.Route.extend({
|
|||
setupController: function(controller, model) {
|
||||
this.controllerFor('user_activity').set('userActionType', this.get('userActionType'));
|
||||
controller.set('model', model);
|
||||
this.controllerFor('user').set('indexStream', false);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -21,7 +22,10 @@ function createPMRoute(viewName, path, type) {
|
|||
setupController: function(controller, model) {
|
||||
this._super(controller, model);
|
||||
controller.set('hideCategories', true);
|
||||
this.controllerFor('user').set('pmView', viewName);
|
||||
this.controllerFor('user').setProperties({
|
||||
pmView: viewName,
|
||||
indexStream: false
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -33,7 +33,8 @@
|
|||
</section>
|
||||
|
||||
<section class='user-main'>
|
||||
<section class='about'>
|
||||
<section {{bindAttr class="collapsedInfo :about"}}>
|
||||
|
||||
<div class='details'>
|
||||
<div class='primary'>
|
||||
{{boundAvatar model imageSize="huge"}}
|
||||
|
|
|
@ -129,6 +129,43 @@
|
|||
@include border-radius-all(4px);
|
||||
}
|
||||
|
||||
|
||||
.about.collapsed-info {
|
||||
.controls {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.details {
|
||||
.secondary { display: none; }
|
||||
.bio { display: none; }
|
||||
|
||||
.primary {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
margin-top: 0;
|
||||
|
||||
.avatar {
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
border: 2px solid white;
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 20px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 17px;
|
||||
line-height: 20px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.about {
|
||||
background-color: #444;
|
||||
margin-bottom: 10px;
|
||||
|
|
Loading…
Reference in New Issue
Block a user