diff --git a/app/controllers/conference_controller.rb b/app/controllers/conference_controller.rb index 34f2adc6..07cea9ae 100644 --- a/app/controllers/conference_controller.rb +++ b/app/controllers/conference_controller.rb @@ -1,7 +1,9 @@ class ConferenceController < ApplicationController load_and_authorize_resource find_by: :short_title - def show; end + def show + @keynote_speakers = @conference.keynote_speakers + end def subscribe conference = Conference.find_by_short_title(params[:id]) diff --git a/app/models/conference.rb b/app/models/conference.rb index 2e73ad45..f53a1c1c 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -556,6 +556,10 @@ class Conference < ActiveRecord::Base email_settings.updated_conference_registration_dates_template end + def keynote_speakers + User.with_role(:keynote_speaker, self) + end + private after_create do diff --git a/app/views/conference/_keynote_speakers.html.haml b/app/views/conference/_keynote_speakers.html.haml new file mode 100644 index 00000000..8fe8931c --- /dev/null +++ b/app/views/conference/_keynote_speakers.html.haml @@ -0,0 +1,11 @@ +%div.row.text-center + %div.col-md-12 + %h3 Keynote Speakers + - @keynote_speakers.each do |k| + %div{ class: (@keynote_speakers.count.to_i <= 2 ? "col-md-#{12/@keynote_speakers.count.to_i}" : "col-md-4") } + = image_tag(k.gravatar_url(size: '80'), class: 'img-circle') unless k.gravatar_url.blank? + %h4 + = k.name + -unless k.biography.blank? + %p + = k.biography diff --git a/app/views/conference/_program.html.haml b/app/views/conference/_program.html.haml index 20468a0d..dfa2cc31 100644 --- a/app/views/conference/_program.html.haml +++ b/app/views/conference/_program.html.haml @@ -12,6 +12,10 @@ = link_to 'Schedule', conference_schedule_path(@conference.short_title), target: '_blank' - else %span The schedule is not ready yet. Stay tuned! + + - unless @keynote_speakers.blank? + = render 'keynote_speakers' + -unless @conference.tracks.blank? - if @conference.splashpage.include_tracks = render 'tracks'