Convert server side paths to use /u/

This commit is contained in:
Robin Ward
2017-03-28 14:27:54 -04:00
parent 45a257815a
commit 14410b71fb
38 changed files with 82 additions and 80 deletions

View File

@@ -348,7 +348,9 @@ class Admin::UsersController < Admin::AdminController
email_token: email_token.token)
end
render json: success_json.merge!(password_url: "#{Discourse.base_url}/users/password-reset/#{email_token.token}")
render json: success_json.merge!(
password_url: "#{Discourse.base_url}#{password_reset_token_path(token: email_token.token)}"
)
end

View File

@@ -192,8 +192,8 @@ class ListController < ApplicationController
target_user = fetch_user_from_params
@title = "#{SiteSetting.title} - #{I18n.t("rss_description.user_topics", username: target_user.username)}"
@link = "#{Discourse.base_url}/users/#{target_user.username}/activity/topics"
@atom_link = "#{Discourse.base_url}/users/#{target_user.username}/activity/topics.rss"
@link = "#{Discourse.base_url}/u/#{target_user.username}/activity/topics"
@atom_link = "#{Discourse.base_url}/u/#{target_user.username}/activity/topics.rss"
@description = I18n.t("rss_description.user_topics", username: target_user.username)
@topic_list = TopicQuery.new(nil, order: 'created').send("list_topics_by", target_user)

View File

@@ -103,7 +103,7 @@ class PostsController < ApplicationController
@posts = posts
@title = "#{SiteSetting.title} - #{I18n.t("rss_description.user_posts", username: user.username)}"
@link = "#{Discourse.base_url}/users/#{user.username}/activity"
@link = "#{Discourse.base_url}/u/#{user.username}/activity"
@description = I18n.t("rss_description.user_posts", username: user.username)
render 'posts/latest', formats: [:rss]
end

View File

@@ -189,7 +189,7 @@ class UsersController < ApplicationController
cookies[:destination_url] = "/my/#{params[:path]}"
redirect_to "/login-preferences"
else
redirect_to(path("/users/#{current_user.username}/#{params[:path]}"))
redirect_to(path("/u/#{current_user.username}/#{params[:path]}"))
end
end