Move Conference contact details to Contact
This commit is contained in:
parent
eb3e6898d2
commit
5aa0d58c57
18 changed files with 67 additions and 58 deletions
|
|
@ -26,6 +26,7 @@ class Admin::ContactsController < ApplicationController
|
|||
end
|
||||
|
||||
private
|
||||
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_contact
|
||||
@contact = @conference.contact
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class ConferenceRegistrationController < ApplicationController
|
|||
if regs.where(email: user.email).count == 0
|
||||
redirect_to(register_conference_path(id: conference.short_title),
|
||||
alert: "This code is already in use.
|
||||
Please contact #{conference.contact_email} for assistance.")
|
||||
Please contact #{conference.contact.email} for assistance.")
|
||||
return
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -83,8 +83,8 @@ class Mailbot < ActionMailer::Base
|
|||
|
||||
def build_email(conference, to, subject, body)
|
||||
mail(to: to,
|
||||
from: conference.contact_email,
|
||||
reply_to: conference.contact_email,
|
||||
from: conference.contact.email,
|
||||
reply_to: conference.contact.email,
|
||||
subject: subject,
|
||||
body: body)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ class Conference < ActiveRecord::Base
|
|||
require 'uri'
|
||||
serialize :events_per_week, Hash
|
||||
|
||||
attr_accessible :title, :short_title, :social_tag, :contact_email, :timezone, :html_export_path,
|
||||
attr_accessible :title, :short_title, :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, :event_types_attributes,
|
||||
|
|
@ -14,14 +14,14 @@ class Conference < ActiveRecord::Base
|
|||
:use_difficulty_levels, :use_vpositions, :use_vdays, :vdays_attributes,
|
||||
:vpositions_attributes, :use_volunteers, :media_id, :media_type, :color,
|
||||
:description, :registration_description, :ticket_description,
|
||||
:sponsorship_levels_attributes, :sponsors_attributes, :facebook_url, :google_url,
|
||||
:twitter_url, :sponsor_description, :sponsor_email, :lodging_description,
|
||||
:sponsorship_levels_attributes, :sponsors_attributes,
|
||||
:sponsor_description, :sponsor_email, :lodging_description,
|
||||
:include_registrations_in_splash, :include_sponsors_in_splash,
|
||||
:include_tracks_in_splash, :include_tickets_in_splash,
|
||||
:include_social_media_in_splash, :include_program_in_splash,
|
||||
:include_program_in_splash,
|
||||
:make_conference_public, :photos_attributes, :banner_photo,
|
||||
:include_banner_in_splash, :targets, :targets_attributes, :campaigns,
|
||||
:campaigns_attributes, :instagram_url
|
||||
:campaigns_attributes
|
||||
|
||||
has_paper_trail
|
||||
|
||||
|
|
@ -83,13 +83,9 @@ class Conference < ActiveRecord::Base
|
|||
size: { in: 0..500.kilobytes }
|
||||
validates_presence_of :title,
|
||||
:short_title,
|
||||
: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
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
class Contact < ActiveRecord::Base
|
||||
attr_accessible :conference, :social_tag, :email, :facebook, :googleplus, :twitter, :instagram, :public
|
||||
attr_accessible :conference_id, :social_tag, :email, :facebook, :googleplus, :twitter, :instagram, :public
|
||||
belongs_to :conference
|
||||
|
||||
validates :conference, presence: true
|
||||
# Conferences only have one contact
|
||||
validates :conference_id, :uniqueness => {:message => "has already contact details"}
|
||||
validates :conference_id, uniqueness: {message: "has already contact details"}
|
||||
|
||||
validates :facebook, :twitter, :googleplus, :instagram,
|
||||
format: URI::regexp(%w(http https)), allow_blank: true
|
||||
end
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class ConferenceSerializer < ActiveModel::Serializer
|
|||
end
|
||||
|
||||
def socialtag
|
||||
object.social_tag
|
||||
object.contact.social_tag
|
||||
end
|
||||
|
||||
def revision
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
= f.input :include_program_in_splash, hint: 'On setting this true you will enable the program component to be displayed on the splash page.This component includes tracks, keynote speakers and the schedule'
|
||||
= f.input :title, :hint => "The full name of the conference, such as 'OpenSUSE Conference 2013'"
|
||||
= 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.input :color, :hint => "The color will be used eg for the dashboard.", :input_html => {:size => 6, :type => "color"}
|
||||
= f.inputs name: 'Banner for Splash' do
|
||||
= f.input :include_banner_in_splash, hint: 'This enable the Banner Photo with description to be displayed on the splash'
|
||||
|
|
@ -33,7 +31,6 @@
|
|||
= f.inputs :name => 'Social Media' do
|
||||
- if !@conference.logo.blank?
|
||||
= image_tag @conference.logo(:thumb)
|
||||
= f.input :include_social_media_in_splash, hint: 'On setting this true you will enable the social media links to be displayed on the splash page'
|
||||
= 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
|
||||
|
|
@ -43,8 +40,4 @@
|
|||
%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.input :instagram_url, hint: 'This will appear in the social media section as the link to the Instagram Page of your Conference'
|
||||
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@
|
|||
input_html: { required: 'required' }
|
||||
= 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!'",
|
||||
input_html: { required: 'required' }
|
||||
= 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 'Scheduling' do
|
||||
= f.input :timezone, as: :time_zone, hint: 'Please select in what time zone your conference will take place.'
|
||||
= f.input :start_date, as: :string, input_html: { id: 'conference-start-datepicker', required: 'required' }
|
||||
|
|
|
|||
|
|
@ -4,19 +4,19 @@
|
|||
|
||||
%div.container#social-media.text-center
|
||||
%div.row
|
||||
- unless @conference.facebook_url.blank?
|
||||
- unless @conference.contact.facebook.blank?
|
||||
%div.col-md-3
|
||||
= link_to "#{ @conference.facebook_url }" do
|
||||
= link_to "#{ @conference.contact.facebook }" do
|
||||
%i.fa.fa-facebook-square.fa-4x
|
||||
- unless @conference.twitter_url.blank?
|
||||
- unless @conference.contact.twitter.blank?
|
||||
%div.col-md-3
|
||||
= link_to "#{ @conference.twitter_url }" do
|
||||
= link_to "#{ @conference.contact.twitter }" do
|
||||
%i.fa.fa-twitter.fa-4x
|
||||
- unless @conference.instagram_url.blank?
|
||||
- unless @conference.contact.instagram.blank?
|
||||
%div.col-md-3
|
||||
= link_to "#{ @conference.instagram_url }" do
|
||||
= link_to "#{ @conference.contact.instagram }" do
|
||||
%i.fa.fa-instagram.fa-4x
|
||||
- unless @conference.google_url.blank?
|
||||
- unless @conference.contact.googleplus.blank?
|
||||
%div.col-md-3
|
||||
= link_to "#{ @conference.google_url }" do
|
||||
= link_to "#{ @conference.contact.googleplus }" do
|
||||
%i.fa.fa-google-plus-square.fa-4x
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
.pad
|
||||
= render 'sponsor'
|
||||
|
||||
- if @conference.include_social_media_in_splash?
|
||||
- if @conference.contact.public?
|
||||
%section{ id: 'social-media' }
|
||||
.pad
|
||||
= render 'social_media'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue