Commit 469983a6 authored by alebor-5's avatar alebor-5 Committed by Benjamin Neff

Improve communication about signing up on closed pods

fixes #7767
parent 6826e89a
......@@ -106,3 +106,26 @@ ul#help_nav {
}
}
}
.ball{
background: image-url('branding/ball.png') no-repeat;
background-size: contain;
height: 633px;
max-width: 100%;
}
.v-center {
display: table;
height: 633px;
}
.content {
display: table-cell;
vertical-align: middle;
h2 {
font-size: 35px;
margin: 12px;
text-align: left;
}
}
......@@ -33,8 +33,12 @@ class RegistrationsController < Devise::RegistrationsController
def check_registrations_open_or_valid_invite!
return true if AppConfig.settings.enable_registrations? || invite.try(:can_be_used?)
flash[:error] = params[:invite] ? t("registrations.invalid_invite") : t("registrations.closed")
redirect_to new_user_session_path
if params[:invite]
flash[:error] = t("registrations.invalid_invite")
redirect_to new_user_session_path
else
redirect_to registration_closed_path
end
end
def invite
......
- content_for :page_title do
= AppConfig.settings.pod_name + " - " + t("devise.shared.links.sign_up_closed")
.container
.row
.col-md-10.offset1
.col-md-7.hidden-phone
%h1.ball
.col-md-5.v-center
.content
%h2
= t("devise.shared.links.sign_up_closed")
!= t("help.closed_pod",
wiki: link_to("another pod", "https://diasporafoundation.org/getting_started/sign_up"))
!= t("help.find_pods",
poduptime: link_to("Poduptime", "https://podupti.me/"))
!= t("help.other_questions",
wiki: link_to("Wiki", "https://wiki.diasporafoundation.org/Choosing_a_pod"))
%h2
= t("devise.shared.links.sign_up_closed")
!= t("help.closed_pod",
wiki: link_to("another pod", "https://diasporafoundation.org/getting_started/sign_up"))
!= t("help.find_pods",
poduptime: link_to("Poduptime", "https://podupti.me/"))
!= t("help.other_questions",
wiki: link_to("Wiki", "https://wiki.diasporafoundation.org/Choosing_a_pod"))
%ul.nav.navbar-nav.navbar-right
- if AppConfig.settings.enable_registrations? && !current_page?(controller: "/registrations", action: :new)
- unless 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"
......@@ -346,6 +346,10 @@ en:
tutorials: "tutorials"
tutorial: "tutorial"
irc: "IRC"
closed_pod: "This pod is currently closed to new registrations. However, you can still join the diaspora* network by registering on %{wiki}. Because all pods are interconnected, you will have access to the same content there."
find_pods: "You can find pods at %{poduptime}."
other_questions: "If you have any other questions regarding choosing a pod, checkout our %{wiki}."
choose_another: "Please, choose another pod"
wiki: "wiki"
faq: "FAQ"
markdown: "Markdown"
......
......@@ -205,6 +205,7 @@ Rails.application.routes.draw do
# Help
get 'help' => 'help#faq', :as => 'help'
get "help/registration_closed" => "help#registration_closed", :as => "registration_closed"
get 'help/:topic' => 'help#faq'
#Protocol Url
......
......@@ -25,16 +25,14 @@ describe RegistrationsController, type: :controller do
AppConfig.settings.enable_registrations = false
end
it "redirects #new to the login page" do
it "redirects #new to the registration closed page" do
get :new
expect(flash[:error]).to eq(I18n.t("registrations.closed"))
expect(response).to redirect_to new_user_session_path
expect(response).to redirect_to registration_closed_path
end
it "redirects #create to the login page" do
it "redirects #create to the registration closed page" do
post :create, params: valid_params
expect(flash[:error]).to eq(I18n.t("registrations.closed"))
expect(response).to redirect_to new_user_session_path
expect(response).to redirect_to registration_closed_path
end
it "does not redirect if there is a valid invite token" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment