Fixing a few bugs

This commit is contained in:
Matt Barringer 2013-02-12 19:17:19 +01:00
parent 045ffd3541
commit df0e75e03a
4 changed files with 14 additions and 7 deletions

View file

@ -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

View file

@ -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"

View file

@ -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."

View file

@ -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}