Merge branch 'develop' of bitbucket.org:jamkazam/jam-cloud into develop
This commit is contained in:
commit
3c3f191239
|
|
@ -134,4 +134,5 @@ fix_max_mind_isp_and_geo.sql
|
|||
update_get_work_for_client_type.sql
|
||||
events.sql
|
||||
cascading_delete_constraints_for_release.sql
|
||||
events_social_description.sql
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE events ADD COLUMN social_description TEXT;
|
||||
|
|
@ -1,9 +1,15 @@
|
|||
class JamRuby::Event < ActiveRecord::Base
|
||||
|
||||
attr_accessible :slug, :title, :description, :show_sponser, as: :admin
|
||||
attr_accessible :slug, :title, :description, :show_sponser, :social_description, as: :admin
|
||||
|
||||
validates :slug, uniqueness: true, presence: true
|
||||
validates :show_sponser, :inclusion => {:in => [true, false]}
|
||||
|
||||
before_validation :sanitize_active_admin
|
||||
|
||||
def sanitize_active_admin
|
||||
self.social_description = nil if self.social_description == ''
|
||||
end
|
||||
|
||||
has_many :event_sessions, class_name: 'JamRuby::EventSession'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,20 @@
|
|||
- provide(:title, @event.title)
|
||||
|
||||
|
||||
-content_for :social_meta do
|
||||
%meta{property: 'fb_app_id', content: Rails.application.config.facebook_app_id}
|
||||
%meta{property: 'og:title', content: 'JamKazam'}
|
||||
%meta{property: 'og:url', content: request.original_url}
|
||||
%meta{property: 'og:description', content: @event.social_description || "Play music together over the Internet as if in the same room."}
|
||||
%meta{property: 'og:image', content: request.protocol + request.host_with_port + image_path("web/logo-256.png")}
|
||||
%meta{property: 'og:image:width', content: '256'}
|
||||
%meta{property: 'og:image:height', content: '256'}
|
||||
%meta{property: 'og:type', content: 'website'}
|
||||
%meta{property: 'twitter:card', content: 'summary'}
|
||||
%meta{property: 'twitter:site', content: '@jamkazam'}
|
||||
%meta{property: 'twitter:title', content: 'JamKazam'}
|
||||
%meta{property: 'twitter:description',content: @event.social_description || "Play music together over the Internet as if in the same room."}
|
||||
|
||||
.landing-content
|
||||
%h1= @event.title
|
||||
%p.w60= raw(@event.description)
|
||||
|
|
|
|||
Loading…
Reference in New Issue