From 5654535728f3017615b801a1b9163d61f0cf623e Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 7 Jan 2019 15:36:26 +0100 Subject: [PATCH] Change remote interaction dialog to use specific actions (#9743) * Change remote interaction dialog to use specific actions Instead of just "interact", use different strings based on whether it's a reply, reblog or favourite. Add explanation why the step is necessary in the first place * Remove obsolete strings --- app/controllers/remote_interaction_controller.rb | 5 +++++ app/views/remote_follow/new.html.haml | 4 +++- app/views/remote_interaction/new.html.haml | 10 +++++++--- app/views/stream_entries/_detailed_status.html.haml | 6 +++--- app/views/stream_entries/_simple_status.html.haml | 6 +++--- config/locales/ar.yml | 3 --- config/locales/ast.yml | 3 --- config/locales/ca.yml | 3 --- config/locales/co.yml | 3 --- config/locales/cs.yml | 3 --- config/locales/cy.yml | 3 --- config/locales/da.yml | 3 --- config/locales/de.yml | 3 --- config/locales/el.yml | 3 --- config/locales/en.yml | 12 ++++++++++-- config/locales/eo.yml | 3 --- config/locales/es.yml | 3 --- config/locales/eu.yml | 3 --- config/locales/fa.yml | 3 --- config/locales/fr.yml | 3 --- config/locales/gl.yml | 3 --- config/locales/it.yml | 3 --- config/locales/ja.yml | 3 --- config/locales/ka.yml | 3 --- config/locales/ko.yml | 3 --- config/locales/nl.yml | 3 --- config/locales/oc.yml | 3 --- config/locales/pl.yml | 3 --- config/locales/pt-BR.yml | 3 --- config/locales/ru.yml | 3 --- config/locales/sk.yml | 3 --- config/locales/sl.yml | 2 -- config/locales/sr.yml | 3 --- 33 files changed, 31 insertions(+), 92 deletions(-) diff --git a/app/controllers/remote_interaction_controller.rb b/app/controllers/remote_interaction_controller.rb index 6299a1e13d..cc6993c52b 100644 --- a/app/controllers/remote_interaction_controller.rb +++ b/app/controllers/remote_interaction_controller.rb @@ -5,6 +5,7 @@ class RemoteInteractionController < ApplicationController layout 'modal' + before_action :set_interaction_type before_action :set_status before_action :set_body_classes @@ -45,4 +46,8 @@ class RemoteInteractionController < ApplicationController @body_classes = 'modal-layout' @hide_header = true end + + def set_interaction_type + @interaction_type = %w(reply reblog favourite).include?(params[:type]) ? params[:type] : 'reply' + end end diff --git a/app/views/remote_follow/new.html.haml b/app/views/remote_follow/new.html.haml index 9b679015f1..5cf6977ba1 100644 --- a/app/views/remote_follow/new.html.haml +++ b/app/views/remote_follow/new.html.haml @@ -16,4 +16,6 @@ .actions = f.button :button, t('remote_follow.proceed'), type: :submit - %p.hint.subtle-hint= t('remote_follow.no_account_html', sign_up_path: open_registrations? ? new_user_registration_path : 'https://joinmastodon.org/#getting-started') + %p.hint.subtle-hint + = t('remote_follow.reason_html', instance: site_hostname) + = t('remote_follow.no_account_html', sign_up_path: open_registrations? ? new_user_registration_path : 'https://joinmastodon.org/#getting-started') diff --git a/app/views/remote_interaction/new.html.haml b/app/views/remote_interaction/new.html.haml index 7357546b6e..a0b1068148 100644 --- a/app/views/remote_interaction/new.html.haml +++ b/app/views/remote_interaction/new.html.haml @@ -1,6 +1,6 @@ .form-container .follow-prompt - %h2= t('remote_interaction.prompt') + %h2= t("remote_interaction.#{@interaction_type}.prompt") .public-layout .activity-stream.activity-stream--highlighted @@ -9,9 +9,13 @@ = simple_form_for @remote_follow, as: :remote_follow, url: remote_interaction_path(@status) do |f| = render 'shared/error_messages', object: @remote_follow + = hidden_field_tag :type, @interaction_type + = f.input :acct, placeholder: t('remote_follow.acct'), input_html: { autocapitalize: 'none', autocorrect: 'off' } .actions - = f.button :button, t('remote_interaction.proceed'), type: :submit + = f.button :button, t("remote_interaction.#{@interaction_type}.proceed"), type: :submit - %p.hint.subtle-hint= t('remote_follow.no_account_html', sign_up_path: open_registrations? ? new_user_registration_path : 'https://joinmastodon.org/#getting-started') + %p.hint.subtle-hint + = t('remote_follow.reason_html', instance: site_hostname) + = t('remote_follow.no_account_html', sign_up_path: open_registrations? ? new_user_registration_path : 'https://joinmastodon.org/#getting-started') diff --git a/app/views/stream_entries/_detailed_status.html.haml b/app/views/stream_entries/_detailed_status.html.haml index b307299705..41d4714b90 100644 --- a/app/views/stream_entries/_detailed_status.html.haml +++ b/app/views/stream_entries/_detailed_status.html.haml @@ -43,7 +43,7 @@ - else = link_to status.application.name, status.application.website, class: 'detailed-status__application', target: '_blank', rel: 'noopener' · - = link_to remote_interaction_path(status), class: 'modal-button detailed-status__link' do + = link_to remote_interaction_path(status, type: :reply), class: 'modal-button detailed-status__link' do = fa_icon('reply') %span.detailed-status__reblogs>= number_to_human status.replies_count, strip_insignificant_zeros: true = " " @@ -55,12 +55,12 @@ %span.detailed-status__link< = fa_icon('lock') - else - = link_to remote_interaction_path(status), class: 'modal-button detailed-status__link' do + = link_to remote_interaction_path(status, type: :reblog), class: 'modal-button detailed-status__link' do = fa_icon('retweet') %span.detailed-status__reblogs>= number_to_human status.reblogs_count, strip_insignificant_zeros: true = " " · - = link_to remote_interaction_path(status), class: 'modal-button detailed-status__link' do + = link_to remote_interaction_path(status, type: :favourite), class: 'modal-button detailed-status__link' do = fa_icon('star') %span.detailed-status__favorites>= number_to_human status.favourites_count, strip_insignificant_zeros: true = " " diff --git a/app/views/stream_entries/_simple_status.html.haml b/app/views/stream_entries/_simple_status.html.haml index f92fac86b8..89a6fe0481 100644 --- a/app/views/stream_entries/_simple_status.html.haml +++ b/app/views/stream_entries/_simple_status.html.haml @@ -37,15 +37,15 @@ .status__action-bar .status__action-bar__counter - = link_to remote_interaction_path(status), class: 'status__action-bar-button icon-button modal-button', style: 'font-size: 18px; width: 23.1429px; height: 23.1429px; line-height: 23.15px;' do + = link_to remote_interaction_path(status, type: :reply), class: 'status__action-bar-button icon-button modal-button', style: 'font-size: 18px; width: 23.1429px; height: 23.1429px; line-height: 23.15px;' do = fa_icon 'reply fw' .status__action-bar__counter__label= obscured_counter status.replies_count - = link_to remote_interaction_path(status), class: 'status__action-bar-button icon-button modal-button', style: 'font-size: 18px; width: 23.1429px; height: 23.1429px; line-height: 23.15px;' do + = link_to remote_interaction_path(status, type: :reblog), class: 'status__action-bar-button icon-button modal-button', style: 'font-size: 18px; width: 23.1429px; height: 23.1429px; line-height: 23.15px;' do - if status.public_visibility? || status.unlisted_visibility? = fa_icon 'retweet fw' - elsif status.private_visibility? = fa_icon 'lock fw' - else = fa_icon 'envelope fw' - = link_to remote_interaction_path(status), class: 'status__action-bar-button icon-button modal-button', style: 'font-size: 18px; width: 23.1429px; height: 23.1429px; line-height: 23.15px;' do + = link_to remote_interaction_path(status, type: :favourite), class: 'status__action-bar-button icon-button modal-button', style: 'font-size: 18px; width: 23.1429px; height: 23.1429px; line-height: 23.15px;' do = fa_icon 'star fw' diff --git a/config/locales/ar.yml b/config/locales/ar.yml index 49ee567f36..8766190e37 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -730,9 +730,6 @@ ar: no_account_html: أليس عندك حساب بعدُ ؟ يُمْكنك التسجيل مِن هنا proceed: أكمل المتابعة prompt: 'إنك بصدد متابعة :' - remote_interaction: - proceed: إبدأ التفاعل - prompt: 'تريد التفاعُل مع هذا التبويق:' remote_unfollow: error: خطأ title: العنوان diff --git a/config/locales/ast.yml b/config/locales/ast.yml index c18c398eb9..6c7ffc9bdc 100644 --- a/config/locales/ast.yml +++ b/config/locales/ast.yml @@ -268,9 +268,6 @@ ast: no_account_html: "¿Nun tienes una cuenta? Pues rexistrate equí" proceed: Siguir prompt: 'Vas siguir a:' - remote_interaction: - proceed: Interactuar - prompt: 'Quies interactuar con esti toot:' remote_unfollow: error: Fallu sessions: diff --git a/config/locales/ca.yml b/config/locales/ca.yml index ed23a0e8be..9cb9722c1e 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -702,9 +702,6 @@ ca: no_account_html: No tens cap compte? Pots registrar-te aquí proceed: Comença a seguir prompt: 'Seguiràs a:' - remote_interaction: - proceed: Procedeix a interactuar - prompt: 'Vols interactuar amb aquest toot:' remote_unfollow: error: Error title: Títol diff --git a/config/locales/co.yml b/config/locales/co.yml index 47c094f43e..1529c4fa32 100644 --- a/config/locales/co.yml +++ b/config/locales/co.yml @@ -704,9 +704,6 @@ co: no_account_html: Ùn avete micca un contu? Pudete arregistravi quì proceed: Cuntinuà per siguità prompt: 'Avete da siguità:' - remote_interaction: - proceed: Cunfirmà l'interazzione - prompt: 'Vulete interagisce cù u statutu:' remote_unfollow: error: Errore title: Titulu diff --git a/config/locales/cs.yml b/config/locales/cs.yml index f7b1fbef0c..0b666a23b6 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -714,9 +714,6 @@ cs: no_account_html: Ještě nemáte účet? Můžete se registrovat zde proceed: Pokračovat ke sledování prompt: 'Budete sledovat:' - remote_interaction: - proceed: Pokračovat k interakci - prompt: 'Chcete interagovat s tímto tootem:' remote_unfollow: error: Chyba title: Nadpis diff --git a/config/locales/cy.yml b/config/locales/cy.yml index af37278e26..22b70d1fd6 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -660,9 +660,6 @@ cy: no_account_html: Heb gyfrif? Mae modd i chi gofrestru yma proceed: Ymlaen i ddilyn prompt: 'Yr ydych am ddilyn:' - remote_interaction: - proceed: Ymlaen i ryngweithio - prompt: 'Rydych eisiau rhyngweithio a''r tŵt hwn:' remote_unfollow: error: Gwall title: Teitl diff --git a/config/locales/da.yml b/config/locales/da.yml index 074a774f0d..5a9fb78818 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -675,9 +675,6 @@ da: no_account_html: Har du ikke en konto? Du kan oprette dig her proceed: Fortsæt for at følge prompt: 'Du er ved at følge:' - remote_interaction: - proceed: Fortsæt for at interagere - prompt: 'Du ønsker at interagere med dette trut:' remote_unfollow: error: Fejl title: Titel diff --git a/config/locales/de.yml b/config/locales/de.yml index 5be2928960..c505bd8bb7 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -704,9 +704,6 @@ de: no_account_html: Noch keinen Account? Du kannst dich hier anmelden proceed: Weiter prompt: 'Du wirst dieser Person folgen:' - remote_interaction: - proceed: Fortfahren zum Interagieren - prompt: 'Du wirst mit diesem Beitrag interagieren:' remote_unfollow: error: Fehler title: Titel diff --git a/config/locales/el.yml b/config/locales/el.yml index 9f2da4c732..e453b581f6 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -703,9 +703,6 @@ el: no_account_html: Δεν έχεις λογαριασμό; Μπορείς να γραφτείς εδώ proceed: Συνέχισε για να ακολουθήσεις prompt: 'Θα ακολουθήσεις:' - remote_interaction: - proceed: Συνέχισε για να αλληλεπιδράσεις - prompt: 'Θέλεις να αλληλεπιδράσεις με αυτό το τουτ:' remote_unfollow: error: Σφάλμα title: Τίτλος diff --git a/config/locales/en.yml b/config/locales/en.yml index 1f240f2726..0d01ad4666 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -723,9 +723,17 @@ en: no_account_html: Don't have an account? You can sign up here proceed: Proceed to follow prompt: 'You are going to follow:' + reason_html: "Why is this step necessary? %{instance} might not be the server where you are registered, so we need to redirect you to your home server first." remote_interaction: - proceed: Proceed to interact - prompt: 'You want to interact with this toot:' + favourite: + proceed: Proceed to favourite + prompt: 'You want to favourite this toot:' + reblog: + proceed: Proceed to boost + prompt: 'You want to boost this toot:' + reply: + proceed: Proceed to reply + prompt: 'You want to reply to this toot:' remote_unfollow: error: Error title: Title diff --git a/config/locales/eo.yml b/config/locales/eo.yml index 8e30ed6790..c05b21108e 100644 --- a/config/locales/eo.yml +++ b/config/locales/eo.yml @@ -696,9 +696,6 @@ eo: no_account_html: Ĉu vi ne havas konton? Vi povas registriĝi tie proceed: Daŭrigi por eksekvi prompt: 'Vi eksekvos:' - remote_interaction: - proceed: Efektivigi la interagon - prompt: 'Vi volas interagi kun ĉi tiu mesaĝo:' remote_unfollow: error: Eraro title: Titolo diff --git a/config/locales/es.yml b/config/locales/es.yml index 957d852b80..bf4cc29fe3 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -681,9 +681,6 @@ es: no_account_html: "¿No tienes una cuenta? Puedes registrarte aqui" proceed: Proceder a seguir prompt: 'Vas a seguir a:' - remote_interaction: - proceed: Proceder para interactuar - prompt: 'Quieres interactuar con este toot:' remote_unfollow: error: Error title: Título diff --git a/config/locales/eu.yml b/config/locales/eu.yml index 819e22b26d..78fd489588 100644 --- a/config/locales/eu.yml +++ b/config/locales/eu.yml @@ -698,9 +698,6 @@ eu: no_account_html: Ez duzu konturik? Izena eman dezakezu proceed: Ekin jarraitzeari prompt: 'Hau jarraituko duzu:' - remote_interaction: - proceed: Jarraitu interakziora - prompt: 'Toot honekin interakzioa nahi duzu:' remote_unfollow: error: Errorea title: Izenburua diff --git a/config/locales/fa.yml b/config/locales/fa.yml index d8f89a91bb..5fccefc6d0 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -681,9 +681,6 @@ fa: no_account_html: هنوز عضو نیستید؟ این‌جا می‌توانید حساب باز کنید proceed: درخواست پیگیری prompt: 'شما قرار است این حساب را پیگیری کنید:' - remote_interaction: - proceed: ادامهٔ برهم‌کنش - prompt: 'شما می‌خواهید دربارهٔ این بوق کاری کنید:' remote_unfollow: error: خطا title: عنوان diff --git a/config/locales/fr.yml b/config/locales/fr.yml index b38e9f8e44..8572881103 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -704,9 +704,6 @@ fr: no_account_html: Vous n’avez pas de compte ? Vous pouvez vous inscrire ici proceed: Confirmer l’abonnement prompt: 'Vous allez suivre :' - remote_interaction: - proceed: Confirmer l’interaction - prompt: 'Vous désirez interagir avec ce pouet :' remote_unfollow: error: Erreur title: Titre diff --git a/config/locales/gl.yml b/config/locales/gl.yml index ac7d55cda3..5908e773b9 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -704,9 +704,6 @@ gl: no_account_html: Non ten unha conta? Pode rexistrarse aquí proceed: Proceda para seguir prompt: 'Vostede vai seguir:' - remote_interaction: - proceed: Proceda para interactuar - prompt: 'Vostede quere interactuar con este toot:' remote_unfollow: error: Fallo title: Título diff --git a/config/locales/it.yml b/config/locales/it.yml index cc23b8cf7e..0b96ef46a2 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -660,9 +660,6 @@ it: no_account_html: Non hai un account? Puoi iscriverti qui proceed: Conferma prompt: 'Stai per seguire:' - remote_interaction: - proceed: Continua per interagire - prompt: 'Vuoi interagire con questo toot:' remote_unfollow: error: Errore title: Titolo diff --git a/config/locales/ja.yml b/config/locales/ja.yml index a8773c4d26..22965a5952 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -703,9 +703,6 @@ ja: no_account_html: アカウントをお持ちではないですか?こちらからサインアップできます proceed: フォローする prompt: 'フォローしようとしています:' - remote_interaction: - proceed: 進む - prompt: 'このトゥートに返信しようとしています:' remote_unfollow: error: エラー title: タイトル diff --git a/config/locales/ka.yml b/config/locales/ka.yml index 21e01c8c90..7dd586aee8 100644 --- a/config/locales/ka.yml +++ b/config/locales/ka.yml @@ -651,9 +651,6 @@ ka: no_account_html: არ გაქვთ ანგარიში? შეგიძლიათ დარეგისტრირდეთ აქ proceed: გააგრძელეთ გასაყოლად prompt: 'თქვენ გაჰყვებით:' - remote_interaction: - proceed: გააგრძელეთ ურთიერთქმედება - prompt: 'თქვენ გსურთ ურთიერთქმედება ამ ტუტთან:' remote_unfollow: error: შეცდომა title: სათაური diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 9ac1cd6b95..acfc811f3d 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -706,9 +706,6 @@ ko: no_account_html: 계정이 없나요? 여기에서 가입 할 수 있습니다 proceed: 팔로우 하기 prompt: '팔로우 하려 하고 있습니다:' - remote_interaction: - proceed: 진행 - prompt: '이 게시물에 상호작용하려 하고 있습니다:' remote_unfollow: error: 에러 title: 타이틀 diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 1d85ab4c90..92acb71d15 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -704,9 +704,6 @@ nl: no_account_html: Heb je geen account? Je kunt er hier een registreren proceed: Ga verder om te volgen prompt: 'Jij gaat volgen:' - remote_interaction: - proceed: Ga de interactie aan - prompt: 'Jij wilt de interactie aangaan met deze toot:' remote_unfollow: error: Fout title: Titel diff --git a/config/locales/oc.yml b/config/locales/oc.yml index daabea18ad..e81b10dac0 100644 --- a/config/locales/oc.yml +++ b/config/locales/oc.yml @@ -760,9 +760,6 @@ oc: no_account_html: Avètz pas cap de compte ? Podètz vos marcar aquí proceed: Clicatz per sègre prompt: 'Sètz per sègre :' - remote_interaction: - proceed: Confirmar l’interaccion - prompt: 'Volètz interagir amb aqueste tut :' remote_unfollow: error: Error title: Títol diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 7478d0ea76..80259d013a 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -715,9 +715,6 @@ pl: no_account_html: Nie masz konta? Możesz zarejestrować się tutaj proceed: Śledź prompt: 'Zamierzasz śledzić:' - remote_interaction: - proceed: Przejdź do interakcji - prompt: 'Chcesz dokonać interakcji z tym wpisem:' remote_unfollow: error: Błąd title: Tytuł diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index bd5cd7b36b..efb8b1bf88 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -702,9 +702,6 @@ pt-BR: no_account_html: Não tem uma conta? Você pode cadastrar-se aqui proceed: Prosseguir para seguir prompt: 'Você irá seguir:' - remote_interaction: - proceed: Continue para interagir - prompt: 'Você quer interagir com este toot:' remote_unfollow: error: Erro title: Título diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 3b81c9ebc7..40e66ceac9 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -683,9 +683,6 @@ ru: no_account_html: Нет учётной записи? Вы можете зарегистрироваться здесь proceed: Продолжить подписку prompt: 'Вы хотите подписаться на:' - remote_interaction: - proceed: Продолжить - prompt: 'Вы собираетесь взаимодействовать со статусом:' remote_unfollow: error: Ошибка title: Заголовок diff --git a/config/locales/sk.yml b/config/locales/sk.yml index d30978e465..36399d7523 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -714,9 +714,6 @@ sk: no_account_html: Nemáš ešte účet? Môžeš sa zaregistrovať tu proceed: Začni následovať prompt: 'Budeš sledovať:' - remote_interaction: - proceed: Pokračuj k interakcii - prompt: 'Chceš narábať s týmto príspevkom:' remote_unfollow: error: Chyba title: Názov diff --git a/config/locales/sl.yml b/config/locales/sl.yml index f35d5f09e2..594c58acc1 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -130,8 +130,6 @@ sl: most_recent_activity: Zadnja aktivnost most_recent_ip: Zadnji IP promote: Spodbujanje - remote_interaction: - prompt: 'Želite interakcijo s tem trobom:' statuses: pin_errors: ownership: Trob nekoga drugega ne more biti pripet diff --git a/config/locales/sr.yml b/config/locales/sr.yml index 8dc869c8f3..009281339d 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -701,9 +701,6 @@ sr: no_account_html: Немате налог? Можете се пријавити овде proceed: Наставите да би сте запратили prompt: 'Запратићете:' - remote_interaction: - proceed: Наставите за интеракцију - prompt: 'Желите да интерактирате са овом трубом:' remote_unfollow: error: Грешка title: Наслов