parent
6826e89a95
commit
469983a623
8 changed files with 75 additions and 9 deletions
|
|
@ -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!
|
def check_registrations_open_or_valid_invite!
|
||||||
return true if AppConfig.settings.enable_registrations? || invite.try(:can_be_used?)
|
return true if AppConfig.settings.enable_registrations? || invite.try(:can_be_used?)
|
||||||
|
|
||||||
flash[:error] = params[:invite] ? t("registrations.invalid_invite") : t("registrations.closed")
|
if params[:invite]
|
||||||
redirect_to new_user_session_path
|
flash[:error] = t("registrations.invalid_invite")
|
||||||
|
redirect_to new_user_session_path
|
||||||
|
else
|
||||||
|
redirect_to registration_closed_path
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def invite
|
def invite
|
||||||
|
|
|
||||||
25
app/views/help/registration_closed.html.haml
Normal file
25
app/views/help/registration_closed.html.haml
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
- 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"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
11
app/views/help/registration_closed.mobile.haml
Normal file
11
app/views/help/registration_closed.mobile.haml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
%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"))
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
%ul.nav.navbar-nav.navbar-right
|
%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"
|
%li= link_to t("devise.shared.links.sign_up"), new_user_registration_path, class: "login"
|
||||||
- unless current_page?(controller: "/sessions", action: :new)
|
- unless current_page?(controller: "/sessions", action: :new)
|
||||||
%li= link_to t("devise.shared.links.sign_in"), new_user_session_path, class: "login"
|
%li= link_to t("devise.shared.links.sign_in"), new_user_session_path, class: "login"
|
||||||
|
|
|
||||||
|
|
@ -346,6 +346,10 @@ en:
|
||||||
tutorials: "tutorials"
|
tutorials: "tutorials"
|
||||||
tutorial: "tutorial"
|
tutorial: "tutorial"
|
||||||
irc: "IRC"
|
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"
|
wiki: "wiki"
|
||||||
faq: "FAQ"
|
faq: "FAQ"
|
||||||
markdown: "Markdown"
|
markdown: "Markdown"
|
||||||
|
|
|
||||||
|
|
@ -205,6 +205,7 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
# Help
|
# Help
|
||||||
get 'help' => 'help#faq', :as => 'help'
|
get 'help' => 'help#faq', :as => 'help'
|
||||||
|
get "help/registration_closed" => "help#registration_closed", :as => "registration_closed"
|
||||||
get 'help/:topic' => 'help#faq'
|
get 'help/:topic' => 'help#faq'
|
||||||
|
|
||||||
#Protocol Url
|
#Protocol Url
|
||||||
|
|
|
||||||
|
|
@ -25,16 +25,14 @@ describe RegistrationsController, type: :controller do
|
||||||
AppConfig.settings.enable_registrations = false
|
AppConfig.settings.enable_registrations = false
|
||||||
end
|
end
|
||||||
|
|
||||||
it "redirects #new to the login page" do
|
it "redirects #new to the registration closed page" do
|
||||||
get :new
|
get :new
|
||||||
expect(flash[:error]).to eq(I18n.t("registrations.closed"))
|
expect(response).to redirect_to registration_closed_path
|
||||||
expect(response).to redirect_to new_user_session_path
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it "redirects #create to the login page" do
|
it "redirects #create to the registration closed page" do
|
||||||
post :create, params: valid_params
|
post :create, params: valid_params
|
||||||
expect(flash[:error]).to eq(I18n.t("registrations.closed"))
|
expect(response).to redirect_to registration_closed_path
|
||||||
expect(response).to redirect_to new_user_session_path
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it "does not redirect if there is a valid invite token" do
|
it "does not redirect if there is a valid invite token" do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue