From 62b89e1f9a31c8c078c737e9279827e44efa0dac Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 9 Sep 2019 17:24:55 -0500 Subject: [PATCH] user upgrades: make upgrade page visible to logged out users. --- app/controllers/user_upgrades_controller.rb | 2 +- app/views/user_upgrades/new.html.erb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/user_upgrades_controller.rb b/app/controllers/user_upgrades_controller.rb index e295b16a1..1c01cc0e0 100644 --- a/app/controllers/user_upgrades_controller.rb +++ b/app/controllers/user_upgrades_controller.rb @@ -1,5 +1,5 @@ class UserUpgradesController < ApplicationController - before_action :member_only, :only => [:new, :show] + before_action :member_only, only: [:show] helper_method :user skip_before_action :verify_authenticity_token, only: [:create] diff --git a/app/views/user_upgrades/new.html.erb b/app/views/user_upgrades/new.html.erb index ac750e72f..f27bd35d9 100644 --- a/app/views/user_upgrades/new.html.erb +++ b/app/views/user_upgrades/new.html.erb @@ -106,7 +106,9 @@ <% if Danbooru.config.stripe_publishable_key %> - <% if CurrentUser.safe_mode? %> + <% if CurrentUser.is_anonymous? %> +

<%= link_to "Sign up", new_user_path %> or <%= link_to "login", new_session_path(url: new_user_upgrade_path) %> first to upgrade your account.

+ <% elsif CurrentUser.safe_mode? %> <%= render "stripe_payment" %> <% else %> <%= render "stripe_payment_safebooru" %>