mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
FIX: User Pill errors
This commit is contained in:
@ -7,10 +7,10 @@
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.UserPrivateMessagesController = Discourse.ObjectController.extend({
|
||||
needs: ['composer'],
|
||||
|
||||
composePrivateMessage: function() {
|
||||
var composerController = Discourse.get('router.composerController');
|
||||
return composerController.open({
|
||||
this.get('controllers.composer').open({
|
||||
action: Discourse.Composer.PRIVATE_MESSAGE,
|
||||
archetypeId: 'private_message',
|
||||
draftKey: 'new_private_message'
|
||||
|
@ -166,6 +166,21 @@ Handlebars.registerHelper('avatar', function(user, options) {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
Bound avatar helper.
|
||||
|
||||
@method boundAvatar
|
||||
@for Handlebars
|
||||
**/
|
||||
Ember.Handlebars.registerBoundHelper('boundAvatar', function(user, options) {
|
||||
var username = Em.get(user, 'username');
|
||||
return new Handlebars.SafeString(Discourse.Utilities.avatarImg({
|
||||
size: options.hash.imageSize,
|
||||
username: username,
|
||||
avatarTemplate: Ember.get(user, 'avatar_template')
|
||||
}));
|
||||
});
|
||||
|
||||
/**
|
||||
Nicely format a date without a binding since the date doesn't need to change.
|
||||
|
||||
|
@ -8,7 +8,8 @@
|
||||
**/
|
||||
Discourse.RestrictedUserRoute = Discourse.Route.extend({
|
||||
|
||||
redirect: function(user) {
|
||||
redirect: function() {
|
||||
var user = this.modelFor('user');
|
||||
if (!user.get('can_edit')) {
|
||||
this.transitionTo('user.activity', user);
|
||||
}
|
||||
|
@ -2,13 +2,13 @@
|
||||
<div class="user-heading">
|
||||
<div class="container">
|
||||
<div class="full-width" id='user-menu'>
|
||||
<h1>{{name}}<span>{{unbound username}}{{{unbound statusIcon}}}</span></h1>
|
||||
<h1>{{name}}<span>{{username}}{{{statusIcon}}}</span></h1>
|
||||
|
||||
{{#if viewingSelf}}
|
||||
<button {{action "logout" target="Discourse"}} class='btn'>{{i18n user.log_out}}</button>
|
||||
{{/if}}
|
||||
{{#if currentUser.staff}}
|
||||
<a href="{{unbound adminPath}}" class='btn'><i class="icon-wrench"></i> {{i18n admin.user.show_admin_profile}}</a>
|
||||
<a {{bindAttr href="adminPath"}} class='btn'><i class="icon-wrench"></i> {{i18n admin.user.show_admin_profile}}</a>
|
||||
{{/if}}
|
||||
<ul class="nav nav-pills">
|
||||
<li>
|
||||
@ -29,7 +29,7 @@
|
||||
{{/if}}
|
||||
</ul>
|
||||
<div class='avatar-wrapper'>
|
||||
{{avatar model imageSize="120"}}
|
||||
{{boundAvatar model imageSize="120"}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user