Added registration segment to display description, period
Controller test for Conference#show houndci fixes Rebased with single entry for navigation branding Conditional rendering of splash navbar
This commit is contained in:
parent
25a56097c5
commit
abfb0884a1
6 changed files with 34 additions and 2 deletions
|
|
@ -9,7 +9,7 @@ class Conference < ActiveRecord::Base
|
|||
:questions_attributes, :question_ids, :answers_attributes, :answer_ids,
|
||||
:difficulty_levels_attributes, :use_difficulty_levels,
|
||||
:use_vpositions, :use_vdays, :vdays_attributes, :vpositions_attributes, :use_volunteers,
|
||||
:media_id, :media_type, :color, :description
|
||||
:media_id, :media_type, :color, :description, :registration_description
|
||||
|
||||
has_paper_trail
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ class Conference < ActiveRecord::Base
|
|||
# Checks if the user is registered to the conference
|
||||
#
|
||||
# ====Args
|
||||
# * +user+ -> The user we check for
|
||||
# * +user+ -> The user we check for
|
||||
# ====Returns
|
||||
# * +nil+ -> If the user doesn't exist
|
||||
# * +false+ -> If the user is registered
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
= f.input :end_date, :as => :string, :input_html => { :id => "conference-end-datepicker", :readonly => "readonly" }
|
||||
= f.input :registration_start_date, :as => :string, :input_html => { :id => "conference-reg-start-datepicker", :readonly => "readonly" }
|
||||
= f.input :registration_end_date, :as => :string, :input_html => { :id => "conference-reg-end-datepicker", :readonly => "readonly" }
|
||||
= f.input :registration_description, hint: 'This description will appear in registration segment of the splash'
|
||||
|
||||
= f.inputs :name => "Media" do
|
||||
- if !@conference.logo.blank?
|
||||
|
|
|
|||
12
app/views/conference/_registration.html.haml
Normal file
12
app/views/conference/_registration.html.haml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
= content_for :splash_nav do
|
||||
%li
|
||||
%a{ href: '#registration' } Registration
|
||||
%div.container.text-center
|
||||
%div.row
|
||||
%h2 Registration
|
||||
- if !@conference.registration_description.blank?
|
||||
%p
|
||||
= @conference.registration_description
|
||||
%h4 Registration period #{ date_string(@conference.registration_start_date, @conference.registration_end_date) }
|
||||
- if @conference.registration_open?
|
||||
= link_to "Register for #{@conference.short_title}", register_conference_path(@conference.short_title), :class =>"btn btn-success btn-lg", target: '_blank'
|
||||
|
|
@ -2,3 +2,6 @@
|
|||
= link_to @conference.title, conference_url(@conference.short_title), class: 'navbar-brand'
|
||||
%div#program
|
||||
= render 'program'
|
||||
%div#registration
|
||||
= render 'registration'
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
class AddRegistrationDescriptionToConference < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :conferences, :registration_description, :text
|
||||
end
|
||||
end
|
||||
|
|
@ -7,4 +7,15 @@ describe 'conference/show.html.haml' do
|
|||
expect(render).to include("#{@conference.description}")
|
||||
expect(view).to render_template(partial: 'conference/_program')
|
||||
end
|
||||
|
||||
it 'renders registration partial' do
|
||||
@conference = create(:conference, registration_description: 'Lorem Ipsum Dolor',
|
||||
registration_start_date: Date.today,
|
||||
registration_end_date: Date.tomorrow)
|
||||
assign :conference, @conference
|
||||
render
|
||||
expect(rendered).to include("#{@conference.registration_description}")
|
||||
expect(rendered).to include("Register for #{@conference.short_title}")
|
||||
expect(view).to render_template(partial: 'conference/_registration')
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue