Add conference wide media, fix proposal#show view
This commit is contained in:
parent
4592802411
commit
633fff59d8
10 changed files with 82 additions and 54 deletions
|
|
@ -4,6 +4,11 @@ $(function() {
|
||||||
$('#' + $(this).val().toLowerCase() + '-help').show();
|
$('#' + $(this).val().toLowerCase() + '-help').show();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#conference_media_type").change(function () {
|
||||||
|
$(".media-type").hide();
|
||||||
|
$('#' + $(this).val().toLowerCase() + '-help').show();
|
||||||
|
});
|
||||||
|
|
||||||
$('.dropdown-toggle').dropdown();
|
$('.dropdown-toggle').dropdown();
|
||||||
$("#conference-start-datepicker").datepicker({
|
$("#conference-start-datepicker").datepicker({
|
||||||
dateFormat: 'yy/mm/dd',
|
dateFormat: 'yy/mm/dd',
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,10 @@ background-image: -webkit-gradient(
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.speakerinfo {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
.schedule-title, .schedule-subtitle, .schedule-speaker, .schedule-track {
|
.schedule-title, .schedule-subtitle, .schedule-speaker, .schedule-track {
|
||||||
clear: none;
|
clear: none;
|
||||||
display: block;
|
display: block;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,8 @@ class Conference < ActiveRecord::Base
|
||||||
:event_types_attributes, :registration_start_date, :registration_end_date, :logo,
|
:event_types_attributes, :registration_start_date, :registration_end_date, :logo,
|
||||||
:questions_attributes, :question_ids, :answers_attributes, :answer_ids,
|
:questions_attributes, :question_ids, :answers_attributes, :answer_ids,
|
||||||
:difficulty_levels_attributes, :use_difficulty_levels,
|
:difficulty_levels_attributes, :use_difficulty_levels,
|
||||||
:use_vpositions, :use_vdays, :vdays_attributes, :vpositions_attributes, :use_volunteers
|
:use_vpositions, :use_vdays, :vdays_attributes, :vpositions_attributes, :use_volunteers,
|
||||||
|
:media_id, :media_type
|
||||||
|
|
||||||
has_paper_trail
|
has_paper_trail
|
||||||
|
|
||||||
|
|
@ -64,6 +65,12 @@ class Conference < ActiveRecord::Base
|
||||||
before_create :create_venue
|
before_create :create_venue
|
||||||
before_create :create_email_settings
|
before_create :create_email_settings
|
||||||
|
|
||||||
|
def self.media_types
|
||||||
|
media_types = {:youtube => 'YouTube', :slideshare => 'SlideShare', :flickr => 'Flickr', :vimeo => 'Vimeo', :speakerdeck => 'Speakerdeck', :instagram => 'Instagram'}
|
||||||
|
return media_types
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Checks if the user is registered to the conference
|
# Checks if the user is registered to the conference
|
||||||
#
|
#
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ class EmailSettings < ActiveRecord::Base
|
||||||
|
|
||||||
def parse_template(text, values)
|
def parse_template(text, values)
|
||||||
values.each do |key, value|
|
values.each do |key, value|
|
||||||
text = text.gsub"{#{key}}", value
|
text = text.gsub"{#{key}}", value unless text.blank?
|
||||||
end
|
end
|
||||||
text
|
text
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -25,16 +25,11 @@ class Event < ActiveRecord::Base
|
||||||
accepts_nested_attributes_for :people
|
accepts_nested_attributes_for :people
|
||||||
before_create :generate_guid
|
before_create :generate_guid
|
||||||
|
|
||||||
def self.media_types
|
|
||||||
media_types = {:youtube => 'YouTube', :slideshare => 'SlideShare', :flickr => 'Flickr', :vimeo => 'Vimeo', :speakerdeck => 'Speakerdeck', :instagram => 'Instagram'}
|
|
||||||
return media_types
|
|
||||||
end
|
|
||||||
|
|
||||||
validate :abstract_limit
|
validate :abstract_limit
|
||||||
validate :biography_exists
|
validate :biography_exists
|
||||||
validates :title, :presence => true
|
validates :title, :presence => true
|
||||||
validates :abstract, :presence => true
|
validates :abstract, :presence => true
|
||||||
validates :media_type, :allow_nil => true, inclusion: {in: self.media_types.values}
|
validates :media_type, :allow_nil => true, inclusion: {in: Conference.media_types.values}
|
||||||
|
|
||||||
scope :confirmed, where(:state => "confirmed")
|
scope :confirmed, where(:state => "confirmed")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,24 @@
|
||||||
= f.input :short_title, :hint => "A short title, such as 'osc2013', to be used in URLs"
|
= 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 :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.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 :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 :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 :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_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_end_date, :as => :string, :input_html => { :id => "conference-reg-end-datepicker", :readonly => "readonly" }
|
||||||
|
|
||||||
|
= f.inputs :name => "Media" do
|
||||||
- if !@conference.logo.blank?
|
- if !@conference.logo.blank?
|
||||||
= image_tag @conference.logo(:thumb)
|
= image_tag @conference.logo(:thumb)
|
||||||
= f.input :logo, :label => "Conference Logo", :hint => "This will be displayed on the front page."
|
= f.input :logo, :label => "Conference Logo", :hint => "This will be displayed on the front page."
|
||||||
= f.input :html_export_path, :hint => "The path for static HTML exports"
|
= 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"}
|
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
|
||||||
|
|
|
||||||
|
|
@ -23,30 +23,18 @@
|
||||||
%span.label{:style =>"background-color: #{@event.track.color};"}
|
%span.label{:style =>"background-color: #{@event.track.color};"}
|
||||||
= @event.track.name
|
= @event.track.name
|
||||||
.col-md-9
|
.col-md-9
|
||||||
-unless @event.media_id
|
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
%h5.text-error
|
- if @event.media_id.blank?
|
||||||
|
%h5.text-warning
|
||||||
No video of the event yet, sorry! Meanwhile...
|
No video of the event yet, sorry! Meanwhile...
|
||||||
.row
|
|
||||||
.col-md-13
|
|
||||||
-if not @event.media_id.blank?
|
|
||||||
.flexvideo
|
.flexvideo
|
||||||
-if @event.media_type == Event.media_types[:slideshare]
|
= render partial: "shared/media_item", locals: {media_type: @conference.media_type, media_id: @conference.media_id}
|
||||||
%iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> (request.ssl? ? "https://" : "http://") + "www.slideshare.net/slideshow/embed_code/#{@event.media_id}"}
|
|
||||||
-elsif @event.media_type == Event.media_types[:flickr]
|
|
||||||
%iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> (request.ssl? ? "https://" : "http://") + "flic.kr/p/#{@event.media_id}/player/268a054da2"}
|
|
||||||
-elsif @event.media_type == Event.media_types[:vimeo]
|
|
||||||
%iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> "//player.vimeo.com/video/#{@event.media_id}"}
|
|
||||||
-elsif @event.media_type == Event.media_types[:speakerdeck]
|
|
||||||
%iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> "//speakerdeck.com/player/#{@event.media_id}?"}
|
|
||||||
-elsif @event.media_type == Event.media_types[:instagram]
|
|
||||||
%iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :scrolling =>"no", :allowtransparency=>"true", :src=> "//instagram.com/p/#{@event.media_id}/embed/"}
|
|
||||||
- else
|
- else
|
||||||
%iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> (request.ssl? ? "https://" : "http://") + "www.youtube.com/embed/#{@event.media_id}?rel=0"}
|
.flexvideo
|
||||||
-else
|
= render partial: "shared/media_item", locals: {media_type: @event.media_type, media_id: @event.media_id}
|
||||||
%div.well.well-lg="No video of the event yet, sorry! Meanwhile..."
|
|
||||||
.row
|
.row
|
||||||
|
.speakerinfo
|
||||||
.col-md-8
|
.col-md-8
|
||||||
%h3
|
%h3
|
||||||
by
|
by
|
||||||
|
|
@ -60,5 +48,3 @@
|
||||||
= simple_format(@speaker.biography)
|
= simple_format(@speaker.biography)
|
||||||
.col-md-4
|
.col-md-4
|
||||||
= image_tag @speaker.gravatar_url(:size => 200), :class => "img-responsive img-rounded"
|
= image_tag @speaker.gravatar_url(:size => 200), :class => "img-responsive img-rounded"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
12
app/views/shared/_media_item.html.haml
Normal file
12
app/views/shared/_media_item.html.haml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
-if media_type == Conference.media_types[:slideshare]
|
||||||
|
%iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> (request.ssl? ? "https://" : "http://") + "www.slideshare.net/slideshow/embed_code/#{media_id}"}
|
||||||
|
-elsif media_type == Conference.media_types[:flickr]
|
||||||
|
%iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> (request.ssl? ? "https://" : "http://") + "flic.kr/p/#{media_id}/player/268a054da2"}
|
||||||
|
-elsif media_type == Conference.media_types[:vimeo]
|
||||||
|
%iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> "//player.vimeo.com/video/#{media_id}"}
|
||||||
|
-elsif media_type == Conference.media_types[:speakerdeck]
|
||||||
|
%iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> "//speakerdeck.com/player/#{media_id}?"}
|
||||||
|
-elsif media_type == Conference.media_types[:instagram]
|
||||||
|
%iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :scrolling =>"no", :allowtransparency=>"true", :src=> "//instagram.com/p/#{media_id}/embed/"}
|
||||||
|
-else
|
||||||
|
%iframe{:width=>"560", :height=>"315", :frameborder=>"0", :allowfullscreen=>"true", :src=> (request.ssl? ? "https://" : "http://") + "www.youtube.com/embed/#{media_id}?rel=0"}
|
||||||
6
db/migrate/20140414131028_add_video_to_conferences.rb
Normal file
6
db/migrate/20140414131028_add_video_to_conferences.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
class AddVideoToConferences < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :conferences, :media_id, :string
|
||||||
|
add_column :conferences, :media_type, :string
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20140401094729) do
|
ActiveRecord::Schema.define(:version => 20140414131028) do
|
||||||
|
|
||||||
create_table "answers", :force => true do |t|
|
create_table "answers", :force => true do |t|
|
||||||
t.string "title"
|
t.string "title"
|
||||||
|
|
@ -77,6 +77,8 @@ ActiveRecord::Schema.define(:version => 20140401094729) do
|
||||||
t.boolean "use_vdays", :default => false
|
t.boolean "use_vdays", :default => false
|
||||||
t.boolean "use_difficulty_levels", :default => false
|
t.boolean "use_difficulty_levels", :default => false
|
||||||
t.boolean "use_volunteers"
|
t.boolean "use_volunteers"
|
||||||
|
t.string "media_id"
|
||||||
|
t.string "media_type"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "conferences_questions", :id => false, :force => true do |t|
|
create_table "conferences_questions", :id => false, :force => true do |t|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue