Merge pull request #510 from ZogStriP/fix-can-t-click-on-avatars-when-on-my-profile-page

fix: can't click on avatars when on my profile page
This commit is contained in:
Robin Ward 2013-03-21 10:58:47 -07:00
commit c541d9699c
3 changed files with 11 additions and 3 deletions

View File

@ -96,6 +96,10 @@ Discourse.Utilities = {
return url; return url;
}, },
userUrl: function(username) {
return Discourse.getURL("/users/" + username);
},
emailValid: function(email) { emailValid: function(email) {
// see: http://stackoverflow.com/questions/46155/validate-email-address-in-javascript // see: http://stackoverflow.com/questions/46155/validate-email-address-in-javascript
var re; var re;

View File

@ -8,6 +8,10 @@
**/ **/
Discourse.UserAction = Discourse.Model.extend({ Discourse.UserAction = Discourse.Model.extend({
userUrl: (function() {
return Discourse.Utilities.userUrl(this.get('username'));
}).property(),
postUrl: (function() { postUrl: (function() {
return Discourse.Utilities.postUrl(this.get('slug'), this.get('topic_id'), this.get('post_number')); return Discourse.Utilities.postUrl(this.get('slug'), this.get('topic_id'), this.get('post_number'));
}).property(), }).property(),

View File

@ -2,7 +2,7 @@
{{#collection contentBinding="stream" itemClass="item"}} {{#collection contentBinding="stream" itemClass="item"}}
{{#with view.content}} {{#with view.content}}
<div class='clearfix info'> <div class='clearfix info'>
<a href="{{unbound usernameUrl}}" class='avatar-link'><div class='avatar-wrapper'>{{avatar this imageSize="large" extraClasses="actor" ignoreTitle="true"}}</div></a> <a href="{{unbound userUrl}}" class='avatar-link'><div class='avatar-wrapper'>{{avatar this imageSize="large" extraClasses="actor" ignoreTitle="true"}}</div></a>
<span class='time'>{{date path="created_at" leaveAgo="true"}}</span> <span class='time'>{{date path="created_at" leaveAgo="true"}}</span>
<span class="title"> <span class="title">
<a href="{{unbound postUrl}}">{{unbound title}}</a> <a href="{{unbound postUrl}}">{{unbound title}}</a>
@ -17,7 +17,7 @@
{{/if}} {{/if}}
</span> </span>
{{/unless}} {{/unless}}
<a class='name' href="{{unbound usernameUrl}}">{{personalizedName name usernamePath="username"}}</a> <a class='name' href="{{unbound userUrl}}">{{personalizedName name usernamePath="username"}}</a>
{{#if description}} {{#if description}}
<span class='type'>{{unbound description}}</span> <span class='type'>{{unbound description}}</span>
{{#if isPostAction}} {{#if isPostAction}}
@ -40,7 +40,7 @@
<div class='child-actions'> <div class='child-actions'>
<i class="icon {{unbound icon}}"></i> <i class="icon {{unbound icon}}"></i>
{{#each items}} {{#each items}}
<a href="{{unbound usernameUrl}}" class='avatar-link'><div class='avatar-wrapper'>{{avatar this imageSize="tiny" extraClasses="actor" ignoreTitle="true"}}</div></a> <a href="{{unbound userUrl}}" class='avatar-link'><div class='avatar-wrapper'>{{avatar this imageSize="tiny" extraClasses="actor" ignoreTitle="true"}}</div></a>
{{/each}} {{/each}}
</div> </div>
{{/each}} {{/each}}