diff --git a/Changelog.md b/Changelog.md index aaa0bfcd3..b7d629eca 100644 --- a/Changelog.md +++ b/Changelog.md @@ -35,6 +35,7 @@ Although the chat was never enabled per default and was marked as experimental, ## Bug fixes * Fix error while trying to fetch some sites with invalid OpenGraph data [#8049](https://github.com/diaspora/diaspora/pull/8049) +* Don't show sign up link on mobile when registrations are disabled [#8060](https://github.com/diaspora/diaspora/pull/8060) ## Features * Add cronjob to cleanup pending photos which were never posted [#8041](https://github.com/diaspora/diaspora/pull/8041) diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb index 5d2de6259..53d3e2bcb 100644 --- a/app/helpers/sessions_helper.rb +++ b/app/helpers/sessions_helper.rb @@ -11,7 +11,7 @@ module SessionsHelper end def display_registration_link? - AppConfig.settings.enable_registrations? && devise_mapping.registerable? && controller_name != "registrations" + AppConfig.settings.enable_registrations? && controller_name != "registrations" end def display_password_reset_link? diff --git a/app/views/layouts/_header_not_connected.haml b/app/views/layouts/_header_not_connected.haml index 4ed08291c..6968de5a5 100644 --- a/app/views/layouts/_header_not_connected.haml +++ b/app/views/layouts/_header_not_connected.haml @@ -1,5 +1,5 @@ %ul.nav.navbar-nav.navbar-right - - unless current_page?(controller: "/registrations", action: :new) + - if display_registration_link? && !current_page?(controller: "/registrations", action: :new) %li= link_to t("devise.shared.links.sign_up"), new_user_registration_path, class: "login" - unless current_page?(controller: "/sessions", action: :new) %li= link_to t("devise.shared.links.sign_in"), new_user_session_path, class: "login"