upgrades: fix post-upgrade landing page.

* Fix the post-upgrade message showing the gift message instead of the
  normal upgrade message.

* Link back to Danbooru so people don't stay on Safebooru and get
  confused when they can't see hidden posts.
This commit is contained in:
evazion
2019-12-06 02:26:11 -06:00
parent f355503413
commit 669ba6fc8d
2 changed files with 9 additions and 5 deletions

View File

@@ -55,6 +55,10 @@ class UserUpgradesController < ApplicationController
flash[:error] = e.message
end
redirect_to user_upgrade_path(user_id: params[:user_id])
if @user == CurrentUser.user
redirect_to user_upgrade_path
else
redirect_to user_upgrade_path(user_id: params[:user_id])
end
end
end

View File

@@ -3,13 +3,13 @@
<% if flash[:success] %>
<h1>Congratulations!</h1>
<% if params[:user_id] %>
<p><%= user.name %> is now a <%= user.level_string %> level account. Thanks for supporting the site!</p>
<% if user != CurrentUser.user %>
<p><%= user.name %> is now a <%= user.level_string %> user. Thanks for supporting the site!</p>
<% else %>
<p>You are now a <%= user.level_string %> level account. Thanks for supporting the site!</p>
<p>You are now a <%= user.level_string %> user. Thanks for supporting the site!</p>
<% end %>
<p><%= link_to "Return to posts", posts_path %> </p>
<p><%= link_to "Go back to #{Danbooru.config.canonical_app_name}", "https://danbooru.donmai.us" %> to start using your new account.</p>
<% elsif flash[:error] %>
<h1>An error occurred!</h1>
<p><%= flash[:error] %></p>