Adding remote follow button
This commit is contained in:
parent
91c5426455
commit
8f47f6a7ec
11 changed files with 114 additions and 20 deletions
|
@ -5,8 +5,11 @@
|
|||
= link_to t('accounts.unfollow'), unfollow_account_path(@account), data: { method: :post }, class: 'button'
|
||||
- else
|
||||
= link_to t('accounts.follow'), follow_account_path(@account), data: { method: :post }, class: 'button'
|
||||
|
||||
.avatar= image_tag @account.avatar.url( :original)
|
||||
- else
|
||||
.controls
|
||||
.remote-follow
|
||||
= link_to t('accounts.remote_follow'), account_remote_follow_path(@account), class: 'button'
|
||||
.avatar= image_tag @account.avatar.url(:original)
|
||||
%h1.name
|
||||
= display_name(@account)
|
||||
%small
|
||||
|
|
11
app/views/authorize_follow/_card.html.haml
Normal file
11
app/views/authorize_follow/_card.html.haml
Normal file
|
@ -0,0 +1,11 @@
|
|||
.account-card
|
||||
.detailed-status__display-name
|
||||
%div
|
||||
= image_tag account.avatar.url(:original), alt: '', width: 48, height: 48, class: 'avatar'
|
||||
|
||||
%span.display-name
|
||||
%strong= display_name(account)
|
||||
%span= "@#{account.acct}"
|
||||
|
||||
- unless account.note.blank?
|
||||
.account__header__content= Formatter.instance.simplified_format(account)
|
|
@ -5,17 +5,7 @@
|
|||
.follow-prompt
|
||||
%h2= t('authorize_follow.prompt_html', self: current_account.username)
|
||||
|
||||
.account-card
|
||||
.detailed-status__display-name
|
||||
%div
|
||||
= image_tag @account.avatar.url(:original), alt: '', width: 48, height: 48, class: 'avatar'
|
||||
|
||||
%span.display-name
|
||||
%strong= display_name(@account)
|
||||
%span= "@#{@account.acct}"
|
||||
|
||||
- unless @account.note.blank?
|
||||
.account__header__content= Formatter.instance.simplified_format(@account)
|
||||
= render partial: 'card', locals: { account: @account }
|
||||
|
||||
= form_tag authorize_follow_path, method: :post, class: 'simple_form' do
|
||||
= hidden_field_tag :acct, @account.acct
|
||||
|
|
13
app/views/remote_follow/new.html.haml
Normal file
13
app/views/remote_follow/new.html.haml
Normal file
|
@ -0,0 +1,13 @@
|
|||
.form-container
|
||||
.follow-prompt
|
||||
%h2= t('remote_follow.prompt')
|
||||
|
||||
= render partial: 'authorize_follow/card', locals: { account: @account }
|
||||
|
||||
= simple_form_for @remote_follow, as: :remote_follow, url: account_remote_follow_path(@account) do |f|
|
||||
= render 'shared/error_messages', object: @remote_follow
|
||||
|
||||
= f.input :acct, placeholder: t('remote_follow.acct')
|
||||
|
||||
.actions
|
||||
= f.button :button, t('remote_follow.proceed'), type: :submit
|
Loading…
Add table
Add a link
Reference in a new issue