mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-23 06:28:59 +00:00
Add copyable_input
helper method to wrap shared options (#32119)
This commit is contained in:
parent
5c72b46a4e
commit
d82ffdccbb
|
@ -240,6 +240,10 @@ module ApplicationHelper
|
||||||
full_asset_url(instance_presenter.mascot&.file&.url || frontend_asset_path('images/elephant_ui_plane.svg'))
|
full_asset_url(instance_presenter.mascot&.file&.url || frontend_asset_path('images/elephant_ui_plane.svg'))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def copyable_input(options = {})
|
||||||
|
tag.input(type: :text, maxlength: 999, spellcheck: false, readonly: true, **options)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def storage_host_var
|
def storage_host_var
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
%td
|
%td
|
||||||
.input-copy
|
.input-copy
|
||||||
.input-copy__wrapper
|
.input-copy__wrapper
|
||||||
%input{ type: :text, maxlength: '999', spellcheck: 'false', readonly: 'true', value: public_invite_url(invite_code: invite.code) }
|
= copyable_input value: public_invite_url(invite_code: invite.code)
|
||||||
%button{ type: :button }= t('generic.copy')
|
%button{ type: :button }= t('generic.copy')
|
||||||
|
|
||||||
%td
|
%td
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
%td
|
%td
|
||||||
.input-copy
|
.input-copy
|
||||||
.input-copy__wrapper
|
.input-copy__wrapper
|
||||||
%input{ type: :text, maxlength: '999', spellcheck: 'false', readonly: 'true', value: public_invite_url(invite_code: invite.code) }
|
= copyable_input value: public_invite_url(invite_code: invite.code)
|
||||||
%button{ type: :button }= t('generic.copy')
|
%button{ type: :button }= t('generic.copy')
|
||||||
|
|
||||||
- if invite.valid_for_use?
|
- if invite.valid_for_use?
|
||||||
|
|
|
@ -3,5 +3,5 @@
|
||||||
%p= t('doorkeeper.authorizations.show.title')
|
%p= t('doorkeeper.authorizations.show.title')
|
||||||
.input-copy
|
.input-copy
|
||||||
.input-copy__wrapper
|
.input-copy__wrapper
|
||||||
%input.oauth-code{ type: 'text', spellcheck: 'false', readonly: true, value: params[:code] }
|
= copyable_input value: params[:code], class: 'oauth-code'
|
||||||
%button{ type: :button }= t('generic.copy')
|
%button{ type: :button }= t('generic.copy')
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
.input-copy.lead
|
.input-copy.lead
|
||||||
.input-copy__wrapper
|
.input-copy__wrapper
|
||||||
%input{ type: :text, maxlength: '999', spellcheck: 'false', readonly: 'true', value: link_to('Mastodon', ActivityPub::TagManager.instance.url_for(@account), rel: 'me').to_str }
|
= copyable_input value: link_to('Mastodon', ActivityPub::TagManager.instance.url_for(@account), rel: :me)
|
||||||
%button{ type: :button }= t('generic.copy')
|
%button{ type: :button }= t('generic.copy')
|
||||||
|
|
||||||
%p.lead= t('verification.extra_instructions_html')
|
%p.lead= t('verification.extra_instructions_html')
|
||||||
|
|
Loading…
Reference in a new issue