Browse Source

Added page titles to registration page

development
Godwin 8 years ago
parent
commit
8267d7411d
  1. 26
      app/assets/stylesheets/_application.scss
  2. 8
      app/controllers/conference_administration_controller.rb
  3. 12
      app/controllers/conferences_controller.rb
  4. 6
      app/controllers/workshops_controller.rb
  5. 4
      app/models/conference.rb
  6. 2
      config/locales/en.yml

26
app/assets/stylesheets/_application.scss

@ -1536,7 +1536,7 @@ fieldset {
@include _(flex-direction, column); @include _(flex-direction, column);
@include _(align-items, stretch); @include _(align-items, stretch);
color: inherit; color: inherit;
margin: 0.5em; margin: 0.5em 0;
border: 0.1em solid $light-gray; border: 0.1em solid $light-gray;
border-bottom: 0; border-bottom: 0;
@include default-box-shadow(top, 2); @include default-box-shadow(top, 2);
@ -1552,10 +1552,9 @@ fieldset {
} }
svg, img { svg, img {
width: 5em;
height: 5em; height: 5em;
margin: 0.5em; width: 100%;
float: left; margin: 1em 0 0;
} }
svg { svg {
@ -3881,7 +3880,6 @@ body.policy .policy-agreement ul {
> div { > div {
vertical-align: top; vertical-align: top;
padding: 2em 0;
h3, p:first-child { h3, p:first-child {
margin-top: 0; margin-top: 0;
@ -3913,7 +3911,7 @@ body.policy .policy-agreement ul {
} }
.actions { .actions {
margin-top: 1em; margin: 1em 0;
} }
} }
@ -4726,7 +4724,7 @@ html[data-ontop] {
} }
.info { .info {
padding-left: 1em; padding: 2em 1em 2em 0;
} }
} }
@ -4938,6 +4936,20 @@ html[data-ontop] {
@include _(transform, none); @include _(transform, none);
} }
} }
.actions {
&.figures {
.figure {
margin: 0 0 1em;
}
svg, img {
width: 5em;
margin: 0.5em;
float: left;
}
}
}
} }
@include breakpoint(large) { @include breakpoint(large) {

8
app/controllers/conference_administration_controller.rb

@ -68,13 +68,7 @@ class ConferenceAdministrationController < ApplicationController
end end
rescue_from ActiveRecord::PremissionDenied do |exception| rescue_from ActiveRecord::PremissionDenied do |exception|
if logged_in? do_403
redirect_to :register
else
@register_template = :confirm_email
@page_title = "articles.conference_registration.headings.#{@this_conference.registration_status == :open ? '': 'Pre_'}Registration_Details"
render :register
end
end end
rescue_from ActiveRecord::RecordNotFound do |exception| rescue_from ActiveRecord::RecordNotFound do |exception|

12
app/controllers/conferences_controller.rb

@ -302,6 +302,8 @@ class ConferencesController < ApplicationController
@page_title = 'articles.conference_registration.headings.Policy_Agreement' @page_title = 'articles.conference_registration.headings.Policy_Agreement'
when :confirm_email when :confirm_email
@page_title = "articles.conference_registration.headings.#{@this_conference.registration_status == :open ? '': 'Pre_'}Registration_Details" @page_title = "articles.conference_registration.headings.#{@this_conference.registration_status == :open ? '': 'Pre_'}Registration_Details"
@main_title = "articles.conference_registration.headings.#{@this_conference.registration_status == :open ? '': 'Pre_'}Register"
@main_title_vars = { vars: { title: @this_conference.title } }
end end
end end
@ -361,12 +363,16 @@ class ConferencesController < ApplicationController
end end
rescue_from ActiveRecord::PremissionDenied do |exception| rescue_from ActiveRecord::PremissionDenied do |exception|
if logged_in? if !@this_conference.can_register?
redirect_to :register do_404
elsif logged_in?
redirect_to 'conferences/register'
else else
@register_template = :confirm_email @register_template = :confirm_email
@page_title = "articles.conference_registration.headings.#{@this_conference.registration_status == :open ? '': 'Pre_'}Registration_Details" @page_title = "articles.conference_registration.headings.#{@this_conference.registration_status == :open ? '': 'Pre_'}Registration_Details"
render :register @main_title = "articles.conference_registration.headings.#{@this_conference.registration_status == :open ? '': 'Pre_'}Register"
@main_title_vars = { vars: { title: @this_conference.title } }
render 'conferences/register'
end end
end end

6
app/controllers/workshops_controller.rb

@ -354,11 +354,15 @@ class WorkshopsController < ApplicationController
end end
rescue_from ActiveRecord::PremissionDenied do |exception| rescue_from ActiveRecord::PremissionDenied do |exception|
if logged_in? if !@this_conference.can_register?
do_404
elsif logged_in?
redirect_to 'conferences/register' redirect_to 'conferences/register'
else else
@register_template = :confirm_email @register_template = :confirm_email
@page_title = "articles.conference_registration.headings.#{@this_conference.registration_status == :open ? '': 'Pre_'}Registration_Details" @page_title = "articles.conference_registration.headings.#{@this_conference.registration_status == :open ? '': 'Pre_'}Registration_Details"
@main_title = "articles.conference_registration.headings.#{@this_conference.registration_status == :open ? '': 'Pre_'}Register"
@main_title_vars = { vars: { title: @this_conference.title } }
render 'conferences/register' render 'conferences/register'
end end
end end

4
app/models/conference.rb

@ -76,6 +76,10 @@ class Conference < ActiveRecord::Base
registration_status == :open registration_status == :open
end end
def can_register?
registration_status == :open || registration_status == :pre
end
def registration_status def registration_status
s = read_attribute(:registration_status) s = read_attribute(:registration_status)
s.present? ? s.to_sym : nil s.present? ? s.to_sym : nil

2
config/locales/en.yml

@ -1150,6 +1150,8 @@ en:
Workshops_You_Have_Requested: Workshops you have Requested to Facilitate Workshops_You_Have_Requested: Workshops you have Requested to Facilitate
Pre_Registration_Details: Pre-Registration is now open! Pre_Registration_Details: Pre-Registration is now open!
Registration_Details: Registration is now open! Registration_Details: Registration is now open!
Pre_Register: Pre-Register for %{title}
Register: Register for %{title}
Verify_Account: Verify your account Verify_Account: Verify your account
Hosting: Hosting Hosting: Hosting
can_provide_housing: Can you provide housing to attendees visiting the city? can_provide_housing: Can you provide housing to attendees visiting the city?

Loading…
Cancel
Save