Add social url to conference
This commit is contained in:
parent
4e7dd5a8a7
commit
6d2576421b
4 changed files with 22 additions and 2 deletions
|
|
@ -2,6 +2,8 @@
|
|||
# This class represents a conference
|
||||
|
||||
class Conference < ActiveRecord::Base
|
||||
require 'uri'
|
||||
|
||||
attr_accessible :title, :short_title, :social_tag, :contact_email, :timezone, :html_export_path,
|
||||
:start_date, :end_date, :rooms_attributes, :tracks_attributes, :dietary_choices_attributes,
|
||||
:use_dietary_choices, :use_supporter_levels, :supporter_levels_attributes, :social_events_attributes,
|
||||
|
|
@ -12,7 +14,8 @@ class Conference < ActiveRecord::Base
|
|||
:media_id, :media_type, :color, :description,
|
||||
:registration_description, :ticket_description,
|
||||
:sponsorship_levels_attributes,
|
||||
:sponsors_attributes
|
||||
:sponsors_attributes, :facebook_url,
|
||||
:google_url, :twitter_url
|
||||
|
||||
has_paper_trail
|
||||
|
||||
|
|
@ -65,6 +68,10 @@ class Conference < ActiveRecord::Base
|
|||
:social_tag,
|
||||
:start_date,
|
||||
:end_date
|
||||
|
||||
validates :facebook_url, :twitter_url, :google_url,
|
||||
format: URI::regexp(%w(http https)), allow_blank: true
|
||||
|
||||
validates_uniqueness_of :short_title
|
||||
validates_format_of :short_title, :with => /\A[a-zA-Z0-9_-]*\z/
|
||||
before_create :generate_guid
|
||||
|
|
|
|||
|
|
@ -29,4 +29,7 @@
|
|||
%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.input :facebook_url, hint: 'This will appear in the social media section as link to the Facebook page of your Conference'
|
||||
= f.input :google_url, label: 'Google+ Url', hint: 'This will appear in the social media section as the link to the Google+ Page of your Conference'
|
||||
= f.input :twitter_url, hint: 'This will appear in the social media section as the link to the Twitter Page of your Conference'
|
||||
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue