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

8
app/controllers/conference_administration_controller.rb

@ -68,13 +68,7 @@ class ConferenceAdministrationController < ApplicationController
end
rescue_from ActiveRecord::PremissionDenied do |exception|
if logged_in?
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
do_403
end
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'
when :confirm_email
@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
@ -361,12 +363,16 @@ class ConferencesController < ApplicationController
end
rescue_from ActiveRecord::PremissionDenied do |exception|
if logged_in?
redirect_to :register
if !@this_conference.can_register?
do_404
elsif logged_in?
redirect_to 'conferences/register'
else
@register_template = :confirm_email
@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

6
app/controllers/workshops_controller.rb

@ -354,11 +354,15 @@ class WorkshopsController < ApplicationController
end
rescue_from ActiveRecord::PremissionDenied do |exception|
if logged_in?
if !@this_conference.can_register?
do_404
elsif logged_in?
redirect_to 'conferences/register'
else
@register_template = :confirm_email
@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'
end
end

4
app/models/conference.rb

@ -76,6 +76,10 @@ class Conference < ActiveRecord::Base
registration_status == :open
end
def can_register?
registration_status == :open || registration_status == :pre
end
def registration_status
s = read_attribute(:registration_status)
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
Pre_Registration_Details: Pre-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
Hosting: Hosting
can_provide_housing: Can you provide housing to attendees visiting the city?

Loading…
Cancel
Save