diff --git a/app/controllers/proposal_controller.rb b/app/controllers/proposal_controller.rb index ae219ff7..7bb678e9 100644 --- a/app/controllers/proposal_controller.rb +++ b/app/controllers/proposal_controller.rb @@ -142,7 +142,7 @@ class ProposalController < ApplicationController begin @event.confirm! rescue Exception => e - redirect_to(conference_proposal_index_path(:conference_id => @conference.short_title), :alert => 'Event was NOT confirmed: #{e.message}') + redirect_to(conference_proposal_index_path(:conference_id => @conference.short_title), :alert => "Event was NOT confirmed: #{e.message}") return end diff --git a/app/models/event.rb b/app/models/event.rb index c16b65de..e653c4c7 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -47,7 +47,7 @@ class Event < ActiveRecord::Base transitions :to => :review, :from=>[:confirmed] end event :confirm do - transitions :to => :confirmed, :from => :unconfirmed + transitions :to => :confirmed, :from => :unconfirmed, :on_transition => :process_confirmation end event :cancel do transitions :to => :canceled, :from => [:unconfirmed, :confirmed] @@ -98,6 +98,13 @@ class Event < ActiveRecord::Base self.class.state_machine.events_for(self.current_state).include?(transition) end + def process_confirmation + if self.conference.email_settings.send_on_confirmed_without_registration? + if self.conference.registrations.where(:person_id => self.submitter.id).first.nil? + Mailbot.confirm_reminder_mail(self).deliver + end + end + end def process_acceptance(options) if options[:send_mail] == "true" Rails.logger.debug "Sending acceptance mail" diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml index 26990e5f..a68a1e0d 100644 --- a/app/views/devise/registrations/edit.html.haml +++ b/app/views/devise/registrations/edit.html.haml @@ -6,7 +6,7 @@ = p.input :first_name, :as => :string = p.input :last_name, :as => :string = p.input :public_name, :as => :string - = p.input :irc_nickname, :label => "IRC nick:" + = p.input :irc_nickname, :label => "IRC nick:", :as => :string = p.input :company, :label => "Affiliation", :as => :string, :hint => "This could be a company, a user group, or nothing at all." = image_tag current_user.person.avatar(:small) = p.input :avatar, :label => "Picture", :hint => "Upload a new picture." diff --git a/app/views/proposal/_proposal_form.html.haml b/app/views/proposal/_proposal_form.html.haml index 77498e49..2c36f243 100644 --- a/app/views/proposal/_proposal_form.html.haml +++ b/app/views/proposal/_proposal_form.html.haml @@ -2,8 +2,8 @@ = semantic_form_for(@event, :url => @url) do |f| %section#basic = f.inputs :name => "Session Information" do - = f.input :title, :required => true - = f.input :subtitle + = f.input :title, :as => :string, :required => true + = f.input :subtitle, :as => :string %section#details = f.input :event_type_id,:as => :select, :collection => @event_types, :include_blank => false, :label => "Session Type" = f.input :abstract, :input_html => {:rows => 5}, @@ -23,8 +23,8 @@ %section#information = f.inputs :name => "Your Information" do = semantic_fields_for @person do |p| - = p.input :public_name, :required => true - = p.input :company, :label => "Affiliation", :hint => "This could be a company, a user group, or nothing at all." + = p.input :public_name, :as => :string, :required => true + = p.input :company, :as => :string, :label => "Affiliation", :hint => "This could be a company, a user group, or nothing at all." = p.input :biography, :required => true, :input_html => {:rows => 5, "onkeyup" => "word_count(this, 'biography-count', 150)"} You have used %span#biography-count #{@person.biography_word_count}