Moves sponsor email attribute from conference to contact

This commit is contained in:
Chrisbr 2014-09-30 11:59:02 +02:00 committed by chrisbr
parent c0cdf3e6e5
commit 9376fe57e3
10 changed files with 49 additions and 11 deletions

View file

@ -15,7 +15,7 @@ class Conference < ActiveRecord::Base
:use_difficulty_levels, :use_vpositions, :use_vdays, :vdays_attributes,
:vpositions_attributes, :use_volunteers, :color,
:sponsorship_levels_attributes, :sponsors_attributes,
:sponsor_email, :photos_attributes, :targets, :targets_attributes,
:photos_attributes, :targets, :targets_attributes,
:campaigns, :campaigns_attributes
has_paper_trail

View file

@ -1,5 +1,7 @@
class Contact < ActiveRecord::Base
attr_accessible :conference_id, :social_tag, :email, :facebook, :googleplus, :twitter, :instagram, :public
attr_accessible :conference_id, :social_tag, :email, :facebook, :googleplus, :twitter,
:instagram, :public, :sponsor_email
belongs_to :conference
validates :conference, presence: true

View file

@ -11,5 +11,4 @@
= 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 :end_date, :as => :string, :input_html => { :id => "conference-end-datepicker", :readonly => "readonly" }
= f.input :sponsor_email, hint: 'This will appear in the sponsor segment of the splash for the sponsors to contact to the organizers'
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}

View file

@ -3,6 +3,7 @@
= semantic_form_for(@contact, :url => admin_conference_contact_path(@conference.short_title),:html => {:multipart => true}) do |f|
= f.inputs :name => 'Contact' do
= f.input :email, hint: 'Contact email address for your conference. Will be used as reply-to address in emails sent out by the system.'
= f.input :sponsor_email, hint: 'This will appear in the sponsor segment of the splash for the sponsors to contact to the organizers'
= f.inputs :name => 'Social Media' do
= f.input :social_tag, hint: "The hashtag you'll use on Twitter and Google+. Don't include the '#' sign!'"
= f.input :facebook, hint: 'This will appear in the social media section as link to the Facebook page of your Conference'

View file

@ -4,6 +4,11 @@
= link_to "#{ @contact.email }" do
%i.fa.fa-envelope.fa-3x
= @contact.email
- unless @contact.sponsor_email.blank?
%li
= link_to "#{ @contact.sponsor_email }" do
%i.fa.fa-money.fa-3x
= @contact.sponsor_email
- unless @contact.social_tag.blank?
%li
= link_to "#{ @contact.social_tag }" do

View file

@ -8,8 +8,8 @@
-if !@conference.splashpage.sponsor_description.blank?
.lead
= markdown(@conference.splashpage.sponsor_description)
-if !@conference.sponsor_email.blank?
%h3= mail_to "#{ @conference.sponsor_email }", 'Become a Sponsor'
-if @conference.contact && @conference.contact.sponsor_email.present?
%h3= mail_to "#{ @conference.contact.sponsor_email }", 'Become a Sponsor'
- if !@conference.sponsorship_levels.blank?
- @conference.sponsorship_levels.each do |l|
- if !l.sponsors.blank?