mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Merge pull request #227 from gopesht/social_segment
Add social url to conference
This commit is contained in:
commit
f8ba5db48e
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"}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
class AddSocialUrlsToConference < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :conferences, :twitter_url, :string
|
||||
add_column :conferences, :facebook_url, :string
|
||||
add_column :conferences, :google_url, :string
|
||||
end
|
||||
end
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20140605125153) do
|
||||
ActiveRecord::Schema.define(version: 20140612181230) do
|
||||
|
||||
create_table "answers", force: true do |t|
|
||||
t.string "title"
|
||||
|
|
@ -81,6 +81,9 @@ ActiveRecord::Schema.define(version: 20140605125153) do
|
|||
t.text "description"
|
||||
t.text "registration_description"
|
||||
t.text "ticket_description"
|
||||
t.string "twitter_url"
|
||||
t.string "facebook_url"
|
||||
t.string "google_url"
|
||||
end
|
||||
|
||||
create_table "conferences_questions", id: false, force: true do |t|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue