Remote following success page (#4129)

* Added a success page to remote following
Includes follow-through links to web (the old redirect target) and back to the remote user's profile

* Use Account.new in spec instead of a fake with only id
(fixes spec)

* Fabricate(:account) over Account.new

* Remove self from the success text
(and all HTML with it)
This commit is contained in:
STJrInuyasha
2017-07-10 09:05:06 -07:00
committed by Eugen Rochko
parent d081d4a422
commit 7a889a8e12
5 changed files with 34 additions and 3 deletions

View File

@ -15,7 +15,7 @@ class AuthorizeFollowsController < ApplicationController
if @account.nil?
render :error
else
redirect_to web_url("accounts/#{@account.id}")
render :success
end
rescue ActiveRecord::RecordNotFound, Mastodon::NotPermittedError
render :error

View File

@ -375,3 +375,12 @@ code {
width: 50%;
}
}
.post-follow-actions {
text-align: center;
color: $ui-primary-color;
div {
margin-bottom: 4px;
}
}

View File

@ -0,0 +1,16 @@
- content_for :page_title do
= t('authorize_follow.title', acct: @account.acct)
.form-container
.follow-prompt
- if @account.locked?
%h2= t('authorize_follow.follow_request')
- else
%h2= t('authorize_follow.following')
= render 'card', account: @account
.post-follow-actions
%div= link_to t('authorize_follow.post_follow.web'), web_url("accounts/#{@account.id}"), class: 'button button--block'
%div= link_to t('authorize_follow.post_follow.return'), @account.url, class: 'button button--block'
%div= t('authorize_follow.post_follow.close')