This commit is contained in:
Gopesh Tulsyan 2014-05-26 12:12:39 +00:00
commit 0043505cd0
18 changed files with 118 additions and 11 deletions

View file

@ -50,3 +50,8 @@ body > #messages {
display: block;
}
}
/*spalsh page css*/
.speaker-pic{
margin: 0 auto;
}

View file

@ -1,5 +1,6 @@
class ConferenceController < ApplicationController
def show
@conference = Conference.find_by_short_title(params[:id])
@keynote_speakers = @conference.registrations.joins(:person).where('featured=?', true)
end
end

View file

@ -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
:media_id, :media_type, :description
has_paper_trail
@ -57,7 +57,8 @@ class Conference < ActiveRecord::Base
:short_title,
:social_tag,
:start_date,
:end_date
:end_date,
:description
validates_uniqueness_of :short_title
validates_format_of :short_title, :with => /\A[a-zA-Z0-9_-]*\z/
before_create :generate_guid

View file

@ -2,7 +2,9 @@ class Person < ActiveRecord::Base
include Gravtastic
gravtastic :size => 32
attr_accessible :email, :first_name, :last_name, :public_name, :biography, :company, :avatar, :irc_nickname, :mobile, :tshirt, :languages, :volunteer_experience
attr_accessible :email, :first_name, :last_name, :public_name, :biography,
:company, :avatar, :irc_nickname, :mobile, :tshirt,
:languages, :volunteer_experience, :featured
belongs_to :user, :inverse_of => :person
has_many :event_people, :dependent => :destroy

View file

@ -1,6 +1,6 @@
class Track < ActiveRecord::Base
attr_accessible :name, :description, :color
validates :description, presence: true
belongs_to :conference
before_create :generate_guid

View file

@ -4,6 +4,7 @@
= f.inputs 'Basic Information' do
= f.input :title, hint: "The name of your conference as it shall appear throughout the site. Example: 'OpenSUSE Conference 2013'",
input_html: { required: 'required' }
= f.input :description, hint: 'Required for program section in the splash page'
= f.input :short_title, hint: "A short and unique handle for your conference, using only lower-case letters, numbers and underscores. This will be used to identify your conference in URLs etc. Example: 'froscon2011'",
input_html: { required: 'required' }
= f.input :social_tag, hint: "The hashtag you'll use on Twitter and Google+. Don't include the '#' sign!'",

View file

@ -1,3 +1,31 @@
.row
.col-md-8
%h1 Dashboard for #{@conference.title}
%h1 Dashboard for #{@conference.title}
.col-md-9
= semantic_form_for(@conference, :url => admin_conference_path(@conference.short_title),:html => {:multipart => true}) do |f|
= f.input :title, :hint => "The full name of the conference, such as 'OpenSUSE Conference 2013'"
= f.input :description, hint: 'Required for program section in the splash page'
= f.input :short_title, :hint => "A short title, such as 'osc2013', to be used in URLs"
= f.input :social_tag, :hint => "The hashtag you'll use on Twitter and Google+. Don't include the '#' sign!'"
= f.input :contact_email, :hint => "Contact email address for your conference. Will be used as reply-to address in emails sent out by the system."
= f.inputs :name => "Scheduling" do
= f.input :timezone, :as => :time_zone, :hint => "The conference time zone"
= f.input :start_date, :as => :string, :input_html => { :id => "conference-start-datepicker", :readonly => "readonly" }
= 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.inputs :name => "Media" do
- if !@conference.logo.blank?
= image_tag @conference.logo(:thumb)
= f.input :logo, :label => "Conference Logo", :hint => "This will be displayed on the front page."
= f.input :media_type, :as => :select, :label => "Conference Promo Media Type", :class=>"form-control", :collection => Conference.media_types.values, :include_blank => false, :hint => "This media-item will be used to represent this conference at various places in OSEM."
= f.input :media_id, :label => "Conference Promo Media ID", :as => :string
%p{:class => "help-block media-type", :id => "youtube-help"} Go to your YouTube video, click on "share" and copy everything behind http://youtu.be/"
%p{:class => "help-block media-type", :id => "slideshare-help", :style => "display:none"} Go to your SlideShare, click on "share" -> "embed" and copy the id
%p{:class => "help-block media-type", :id => "flickr-help", :style => "display:none"} Go to your flickr image, click on "Grab the link" -> "Show short url" and copy everything behind https://flic.kr/p/
%p{:class => "help-block media-type", :id => "vimeo-help", :style => "display:none"} Go to your vimeo video, click on "share" and copy everything behind http://vimeo.com/
%p{:class => "help-block media-type", :id => "speakerdeck-help", :style => "display:none"} Go to your SpeakerDeck, click on "share" -> "embed" and copy the data-id
%p{:class => "help-block media-type", :id => "instagram-help", :style => "display:none"} Go to your Instagram photo page and copy everything behind instagram.com/p/ (without trailing /# hash symbol)
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}

View file

@ -1,5 +1,6 @@
= semantic_form_for [:admin, @person] do |f|
= f.inputs "Basic Information" do
= f.input :featured, label: "Keynote Speaker"
= f.input :first_name, :as => :string
= f.input :last_name, :as => :string
= f.input :public_name, :as => :string

View file

@ -1,3 +1,34 @@
= content_for :splash_logo do
= link_to @conference.title, "#", :class => 'navbar-brand'
= render :partial => "home/conference_details", :locals => {:conference => @conference}
= content_for :splash_header do
%ul.nav.navbar-nav
%li
%a{ href: '#program' } Program
%div.container#program.text-center
%div.row
%div.col-md-12
%h1 Program
%p
= @conference.description
%span You can find the complete schedule in our
%span
= link_to 'Master Schedule', conference_schedule_path(@conference.short_title)
- if !@keynote_speakers.blank?
%div.row
%h2 Keynote Speakers
- @keynote_speakers.each do |k|
%div.col-lg-3.text-center
= image_tag(k.person.gravatar_url(size: '140'), class: 'img-responsive img-circle speaker-pic')
%h4
= k.person.first_name
= k.person.last_name
-if !@conference.tracks.blank?
%div.row
%div.col-md-12
%h2 Tracks
- @conference.tracks.each do |t|
%div.col-md-4
%h4
= t.name
%p
= t.description

View file

@ -0,0 +1,5 @@
class AddFeaturedToPeople < ActiveRecord::Migration
def change
add_column :people, :featured, :boolean, default: false
end
end

View file

@ -0,0 +1,5 @@
class AddDescriptionToConference < ActiveRecord::Migration
def change
add_column :conferences, :description, :string
end
end

View file

@ -1,9 +1,10 @@
require 'spec_helper'
describe ConferenceController do
let(:conference) { create(:conference_with_registration) }
describe 'GET #show' do
it 'returns http success' do
get :show, id: 'sample'
get :show, id: conference.short_title
expect(response).to be_success
end
end

View file

@ -6,8 +6,19 @@ FactoryGirl.define do
sequence(:short_title) { |n| "dps#{n}14" }
social_tag 'dps14'
timezone 'Amsterdam'
description 'Lorem Ipsum dolsum'
contact_email 'admin@example.com'
start_date Date.today
end_date Date.tomorrow
factory :conference_with_registration do
after(:build) do |conference|
create(:participant_role)
create(:admin_role)
user = build(:user)
conference.registrations << build(:registration,
conference: conference,
person: user.person)
end
end
end
end

9
spec/factories/person.rb Normal file
View file

@ -0,0 +1,9 @@
FactoryGirl.define do
factory :person do
first_name 'Example first_name'
last_name 'Example last_name'
sequence(:email) { |n| "example#{n}@example.com" }
featured true
user
end
end

View file

@ -0,0 +1,6 @@
FactoryGirl.define do
factory :registration do
person
conference
end
end

View file

@ -2,7 +2,7 @@
FactoryGirl.define do
factory :user do
email 'example@example.com'
sequence(:email) { |n| "example#{n}@example.com" }
password 'changeme'
password_confirmation 'changeme'
confirmed_at Time.now

View file

@ -16,7 +16,7 @@ feature Conference do
fill_in 'conference_title', with: 'Example Con'
fill_in 'conference_short_title', with: 'ExCon'
fill_in 'conference_social_tag', with: 'ExCon'
fill_in 'conference_description', with: 'ExCon description'
select('(GMT+01:00) Berlin', from: 'conference[timezone]')
today = Date.today - 1

View file

@ -1,10 +1,10 @@
require 'spec_helper'
describe 'conference/show.html.haml' do
it 'renders conference details' do
@conference = create(:conference)
@conference = create(:conference, description: 'Lorem Ipsum dolsum')
assign :conference, @conference
render
expect(render).to include("#{@conference.title}")
expect(render).to include("#{@conference.description}")
end
end