Tell users that there is no help in mobile version, allow to switch to desktop, fixes #4821

This commit is contained in:
flaburgan 2022-11-01 00:37:13 +01:00
parent 6af305b2be
commit 3d84ae18a7
4 changed files with 14 additions and 7 deletions

View file

@ -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))

View file

@ -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))

View file

@ -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?"

View file

@ -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