mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: Use replaceWith
instead of transitionTo
when redirecting to a
user's activity. That way the back button works nicely. Also we can now shorten a lot of links that were going to activity instead.
This commit is contained in:
parent
3f9c4100ef
commit
80fd714b23
8 changed files with 8 additions and 8 deletions
|
@ -4,7 +4,7 @@
|
|||
<div class='field'>{{i18n user.username.title}}</div>
|
||||
<div class='value'>{{username}}</div>
|
||||
<div class='controls'>
|
||||
{{#link-to 'userActivity' model class="btn"}}
|
||||
{{#link-to 'user' model class="btn"}}
|
||||
<i class='fa fa-user'></i>
|
||||
{{i18n admin.user.show_public_profile}}
|
||||
{{/link-to}}
|
||||
|
|
|
@ -11,7 +11,7 @@ Discourse.RestrictedUserRoute = Discourse.Route.extend({
|
|||
afterModel: function() {
|
||||
var user = this.modelFor('user');
|
||||
if (!user.get('can_edit')) {
|
||||
this.transitionTo('userActivity');
|
||||
this.replaceWith('userActivity');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,6 @@
|
|||
**/
|
||||
Discourse.UserIndexRoute = Discourse.UserActivityRoute.extend({
|
||||
redirect: function() {
|
||||
this.transitionTo('userActivity', this.modelFor('user'));
|
||||
this.replaceWith('userActivity', this.modelFor('user'));
|
||||
}
|
||||
});
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
{{#if userBadges}}
|
||||
<div>
|
||||
{{#each userBadges}}
|
||||
{{#link-to 'userActivity' user}}
|
||||
{{#link-to 'user' user}}
|
||||
<div class="badge-user">
|
||||
{{avatar user imageSize="large"}}
|
||||
<div class="details">
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
{{avatar this imageSize="large"}}
|
||||
</td>
|
||||
<td>
|
||||
<h3>{{#link-to 'userActivity' this}}{{username}}{{/link-to}}</h3>
|
||||
<h3>{{#link-to 'user' this}}{{username}}{{/link-to}}</h3>
|
||||
<p>{{name}}</p>
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<button class='btn btn-primary' {{action composePrivateMessage user}}><i class='fa fa-envelope'></i>{{i18n user.private_message}}</button>
|
||||
{{/if}}
|
||||
|
||||
{{#link-to 'userActivity.index' user class="btn"}}<i class='fa fa-user'></i>{{i18n user.show_profile}}{{/link-to}}
|
||||
{{#link-to 'user' user class="btn"}}<i class='fa fa-user'></i>{{i18n user.show_profile}}{{/link-to}}
|
||||
|
||||
{{#if showFilter}}
|
||||
<button class='btn' {{action togglePosts user}}><i class='fa fa-filter'></i>{{i18n topic.filter_to username="username" post_count="participant.post_count"}}</button>
|
||||
|
|
|
@ -102,7 +102,7 @@
|
|||
<dt>{{i18n user.last_seen}}</dt><dd>{{date last_seen_at}}</dd>
|
||||
{{/if}}
|
||||
{{#if invited_by}}
|
||||
<dt>{{i18n user.invited_by}}</dt><dd>{{#link-to 'userActivity' invited_by}}{{invited_by.username}}{{/link-to}}</dd>
|
||||
<dt>{{i18n user.invited_by}}</dt><dd>{{#link-to 'user' invited_by}}{{invited_by.username}}{{/link-to}}</dd>
|
||||
{{/if}}
|
||||
{{#if email}}
|
||||
<dt>{{i18n user.email.title}}</dt><dd {{bind-attr title="email"}}>{{email}}</dd>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<section class='d-dropdown' id='user-dropdown'>
|
||||
<ul class='user-dropdown-links'>
|
||||
<li>{{#link-to 'userActivity' currentUser class="user-activity-link" }}{{i18n user.profile}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'user' currentUser class="user-activity-link" }}{{i18n user.profile}}{{/link-to}}</li>
|
||||
{{#if showAdminLinks}}
|
||||
<li>{{#link-to 'adminUser' currentUser.username }}{{i18n admin_title}}{{/link-to}}</li>
|
||||
{{/if}}
|
||||
|
|
Loading…
Reference in a new issue