From 3d84ae18a7cae4a47cdbde1ed8051366138d548e Mon Sep 17 00:00:00 2001 From: flaburgan Date: Tue, 1 Nov 2022 00:37:13 +0100 Subject: Tell users that there is no help in mobile version, allow to switch to desktop, fixes #4821 --- app/views/admins/pods.mobile.haml | 4 +++- app/views/help/faq.mobile.haml | 6 ++++++ config/locales/diaspora/en.yml | 4 ++-- spec/controllers/help_controller_spec.rb | 7 +++---- 4 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 app/views/help/faq.mobile.haml diff --git a/app/views/admins/pods.mobile.haml b/app/views/admins/pods.mobile.haml index 97a3ceeb7..23a7ea8e4 100644 --- a/app/views/admins/pods.mobile.haml +++ b/app/views/admins/pods.mobile.haml @@ -2,4 +2,6 @@ = t(".pod_network") .alert.alert-warning - != t(".pod_desktop_view", desktop_link: link_to(t(".pod_desktop_link"), toggle_mobile_path)) + != t("error_messages.mobile_not_available", + desktop_link: link_to(t("error_messages.desktop_view_link"), + toggle_mobile_path)) diff --git a/app/views/help/faq.mobile.haml b/app/views/help/faq.mobile.haml new file mode 100644 index 000000000..6efaff27a --- /dev/null +++ b/app/views/help/faq.mobile.haml @@ -0,0 +1,6 @@ +%h1= t("_help") + +.alert.alert-warning + != t("error_messages.mobile_not_available", + desktop_link: link_to(t("error_messages.desktop_view_link"), + toggle_mobile_path)) diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index f79db200e..e47713b4f 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -89,6 +89,8 @@ en: correct_the_following_errors_and_try_again: "Correct the following errors and try again." need_javascript: "This website requires JavaScript to function properly. If you disabled JavaScript, please enable it and refresh this page." csrf_token_fail: "The CSRF token is invalid. Please sign in and try again." + mobile_not_available: "This page is not available on mobile view, please switch to %{desktop_link}." + desktop_view_link: "desktop view" admins: admin_bar: @@ -192,8 +194,6 @@ en: tag_name: "Tag name: %{name_tag} Count: %{count_tag}" pods: pod_network: "Pod network" - pod_desktop_view: "This page is not available on mobile view, please switch to %{desktop_link}." - pod_desktop_link: "desktop view" aspects: edit: confirm_remove_aspect: "Are you sure you want to delete this aspect?" diff --git a/spec/controllers/help_controller_spec.rb b/spec/controllers/help_controller_spec.rb index a4d1c03c4..959049ad0 100644 --- a/spec/controllers/help_controller_spec.rb +++ b/spec/controllers/help_controller_spec.rb @@ -7,10 +7,9 @@ describe HelpController, type: :controller do expect(response).to be_successful end - it "fails on mobile" do - expect { - get :faq, format: :mobile - }.to raise_error ActionController::UnknownFormat + it "succeeds on mobile" do + get :faq, format: :mobile + expect(response).to be_successful end end end -- cgit v1.2.3