Unverified Commit 4feab521 authored by flaburgan's avatar flaburgan Committed by Benjamin Neff
Browse files

Use a partial to share code between mobile and desktop, add the new route to...

Use a partial to share code between mobile and desktop, add the new route to the RegistrationController, drop flash message for closed registrations
parent 469983a6
Loading
Loading
Loading
Loading
+0 −23
Original line number Diff line number Diff line
@@ -106,26 +106,3 @@ 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;
  }
}
+10 −6
Original line number Diff line number Diff line
.page-registrations.action-new,
.page-registrations.action-create {
.page-registrations {
  .ball {
    background: image-url('branding/ball.png') no-repeat;
    background-size: contain;
@@ -12,19 +11,24 @@
    height: 633px;
  }

  @media (max-width: $screen-xs-max) {
    .v-center {
      height: auto;
    }
  }

  .content {
    display: table-cell;
    vertical-align: middle;

    h2 {
    h1 {
      font-size: 35px;
      margin: 12px;
      text-align: center;
      margin: 12px 0;
    }
  }

  form {
    max-width: 400px;
    max-width: 500px;
  }

  .captcha-img {
+8 −8
Original line number Diff line number Diff line
@@ -5,9 +5,9 @@
#   the COPYRIGHT file.

class RegistrationsController < Devise::RegistrationsController
  before_action :check_registrations_open_or_valid_invite!
  before_action :check_registrations_open_or_valid_invite!, except: :registrations_closed

  layout -> { request.format == :mobile ? "application" : "with_header" }
  layout -> { request.format == :mobile ? "application" : "with_header_with_footer" }

  def create
    @user = User.build(user_params)
@@ -28,17 +28,17 @@ class RegistrationsController < Devise::RegistrationsController
    end
  end

  def registrations_closed
    render "registrations/registrations_closed"
  end

  private

  def check_registrations_open_or_valid_invite!
    return true if AppConfig.settings.enable_registrations? || invite.try(:can_be_used?)

    if params[:invite]
      flash[:error] = t("registrations.invalid_invite")
      redirect_to new_user_session_path
    else
      redirect_to registration_closed_path
    end
    flash[:error] = t("registrations.invalid_invite") if params[:invite]
    redirect_to registrations_closed_path
  end

  def invite
+0 −25
Original line number Diff line number Diff line
- 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"))
  
  

+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
    - if mobile
      %legend
        = image_tag("branding/logos/header-logo2x.png", height: 40, width: 40)
        = t("aspects.aspect_stream.make_something")
        = AppConfig.settings.pod_name

    - if mobile
      = f.label :email, t("registrations.new.email"), class: "control-label", id: "emailLabel"
Loading