Minor fixes. Link directoy to user activity to avoid a redirect.
This commit is contained in:
parent
e77ee1eaa8
commit
5d66f6ed8e
|
@ -13,9 +13,6 @@ Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
||||||
// Whether the app has focus or not
|
// Whether the app has focus or not
|
||||||
hasFocus: true,
|
hasFocus: true,
|
||||||
|
|
||||||
// Are we currently scrolling?
|
|
||||||
scrolling: false,
|
|
||||||
|
|
||||||
// Helps with integration tests
|
// Helps with integration tests
|
||||||
URL_FIXTURES: {},
|
URL_FIXTURES: {},
|
||||||
|
|
||||||
|
|
|
@ -249,6 +249,7 @@ Discourse.User = Discourse.Model.extend({
|
||||||
|
|
||||||
findDetails: function() {
|
findDetails: function() {
|
||||||
var user = this;
|
var user = this;
|
||||||
|
|
||||||
return PreloadStore.getAndRemove("user_" + user.get('username'), function() {
|
return PreloadStore.getAndRemove("user_" + user.get('username'), function() {
|
||||||
return Discourse.ajax("/users/" + user.get('username') + '.json');
|
return Discourse.ajax("/users/" + user.get('username') + '.json');
|
||||||
}).then(function (json) {
|
}).then(function (json) {
|
||||||
|
|
|
@ -17,7 +17,7 @@ Discourse.UserStream = Discourse.Model.extend({
|
||||||
}.observes('filter'),
|
}.observes('filter'),
|
||||||
|
|
||||||
findItems: function() {
|
findItems: function() {
|
||||||
var me = this;
|
var userStream = this;
|
||||||
if(this.get("loading")) { return Ember.RSVP.reject(); }
|
if(this.get("loading")) { return Ember.RSVP.reject(); }
|
||||||
this.set("loading",true);
|
this.set("loading",true);
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ Discourse.UserStream = Discourse.Model.extend({
|
||||||
|
|
||||||
var stream = this;
|
var stream = this;
|
||||||
return Discourse.ajax(url, {cache: 'false'}).then( function(result) {
|
return Discourse.ajax(url, {cache: 'false'}).then( function(result) {
|
||||||
me.set("loading",false);
|
userStream.set("loading",false);
|
||||||
if (result && result.user_actions) {
|
if (result && result.user_actions) {
|
||||||
var copy = Em.A();
|
var copy = Em.A();
|
||||||
_.each(result.user_actions,function(action) {
|
_.each(result.user_actions,function(action) {
|
||||||
|
@ -38,7 +38,7 @@ Discourse.UserStream = Discourse.Model.extend({
|
||||||
stream.get('content').pushObjects(copy);
|
stream.get('content').pushObjects(copy);
|
||||||
stream.set('itemsLoaded', stream.get('itemsLoaded') + result.user_actions.length);
|
stream.set('itemsLoaded', stream.get('itemsLoaded') + result.user_actions.length);
|
||||||
}
|
}
|
||||||
}, function(){ me.set("loading", false); });
|
}, function(){ userStream.set("loading", false); });
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -85,7 +85,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li class='current-user'>
|
<li class='current-user'>
|
||||||
{{#if currentUser}}
|
{{#if currentUser}}
|
||||||
{{#titledLinkTo 'user' currentUser titleKey="current_user" class="icon"}}{{avatar currentUser imageSize="medium" }}{{/titledLinkTo}}
|
{{#linkTo 'userActivity.index' currentUser titleKey="current_user" class="icon"}}{{avatar currentUser imageSize="medium" }}{{/linkTo}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="icon not-logged-in-avatar" {{action showLogin}}><i class='icon-user'></i></div>
|
<div class="icon not-logged-in-avatar" {{action showLogin}}><i class='icon-user'></i></div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
Loading…
Reference in New Issue