Permalink
Browse files

Update email for workshop confirmations. Also make talk proposals go

through the new proposals submission path instead of the old talk
submission path.  Remove the old talk submission path.  Make talk
submissions and workshop submission confirmation emails specific to each
format.
  • Loading branch information...
1 parent f8f636b commit c3f9fb80d3161dff73efa4f1a9f3adcc0c7e422b @marioaquino marioaquino committed Feb 28, 2012
@@ -1,41 +0,0 @@
-#- Copyright 2011 Strange Loop LLC
-#-
-#- Licensed under the Apache License, Version 2.0 (the "License");
-#- you may not use this file except in compliance with the License.
-#- You may obtain a copy of the License at
-#-
-#- http://www.apache.org/licenses/LICENSE-2.0
-#-
-#- Unless required by applicable law or agreed to in writing, software
-#- distributed under the License is distributed on an "AS IS" BASIS,
-#- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#- See the License for the specific language governing permissions and
-#- limitations under the License.
-#-
-
-
-
-class TalksController < ApplicationController
- expose(:talk) { build_talk(params) }
- expose(:speaker) { talk.speakers.first }
-
- def new
- end
-
- def create
- if talk.save
- Proposal.create :status => 'submitted', :talk => talk
- SpeakerMailer.talk_submission_email(talk).deliver
- else
- render :new
- end
- end
-
- private
- def build_talk(params)
- return Talk.new(:speakers => [Speaker.new]) if params[:talk].nil?
- image_param = params[:talk][:speakers_attributes]["0"].delete(:image)
- image = Image.new(image_param) if image_param
- Talk.new(params[:talk]).tap{|t| t.speakers.first.image = image if image}
- end
-end
@@ -32,7 +32,12 @@ def send_email_with_cc(talk, subject)
def talk_submission_email(talk)
@talk = talk
- send_email_with_cc(talk, "Your talk was successfully submitted")
+ send_email_with_cc(talk, "Your talk proposal was successfully submitted")
+ end
+
+ def workshop_submission_email(talk)
+ @talk = talk
+ send_email_with_cc(talk, "Your workshop proposal was successfully submitted")
end
def talk_accepted_email(talk, session_time)
@@ -7,7 +7,7 @@ eagerly await your words. In fact, during the review period
we only permit them to receive talk submissions and no
other contact with the outside world.
-The call for presentations ends on June 10th. The review
+The call for proposals ends on June 10th. The review
committee has promised to make all talk decisions by
June 24th, although they are highly motivated to escape
the bunker and may get back to you sooner.
@@ -19,7 +19,7 @@ Thanks for your interest in Strange Loop and good luck!
Alex Miller
-Below is the information you submitted for this talk:
+Below is the information you submitted for this talk proposal:
-----------------------------------------------------------------------------------
Title: <%= @talk.title %>
Abstract: <%= @talk.abstract %>
@@ -0,0 +1,22 @@
+Dear <%= @talk.speakers[0].first_name %>,
+
+Thank you for your Strange Loop 2012 workshop
+submission. Workshops are being reviewed on a rolling
+basis as they are submitted. You will be contacted
+no later than March 30th.
+
+If you decide you've made a horrible mistake or forgotten
+something important, please contact alex@thestrangeloop.com.
+
+Thanks for your interest in Strange Loop and good luck!
+
+Alex Miller
+
+
+
+
+Below is the information you submitted for this proposal:
+-----------------------------------------------------------------------------------
+Title: <%= @talk.title %>
+Abstract: <%= @talk.abstract %>
+Comments: <%= @talk.comments %>
@@ -34,8 +34,8 @@ def path_to(page_name)
# when /^(.*)'s profile page$/i
# user_profile_path(User.find_by_login($1))
- when /the new talks page/
- new_talk_path
+ when /the talk submission page/
+ new_proposal_of_path(:talk)
when /the new workshops page/
new_proposal_of_path(:workshop)
@@ -1,10 +1,10 @@
Feature: As an anonymous user I can enter a talk along with
speaker information so that it can be reviewed and determined
if it is appropriate for the conference
-
+
Scenario: Users can enter a talk
Given an admin exists
- And I go to the new talks page
+ And I go to the talk submission page
And I fill in the following:
| Title | Squashing NP Hard Problems with Clojure |
| Abstract | Using only functions, sequences and three toothpicks I will make 3 SAT solvable in O(n) time |
@@ -16,19 +16,19 @@ Feature: As an anonymous user I can enter a talk along with
| Email | clem_esterbill@fictionaldns.com |
| Twitter ID | clemtweets |
| Company | Clemalamadingdong |
- | Company Website | http://clem.com |
+ | Company Website | http://clem.com |
| Bio | Background info here |
| Phone | 555-555-5555 |
| City | St. Louis |
| State | MO |
-
+
And I select "Deep Dive" in "Talk Type"
And I select "No" in "Video Approval"
And I select "United States" in "Country"
And I fill in "Tags" with "theory, clojure"
And I should see "Max length: 2000 characters."
-
+
When I press "Send Talk Proposal"
Then I should see "Squashing NP Hard Problems with Clojure"
And I should see "Deep Dive"
@@ -44,10 +44,10 @@ Feature: As an anonymous user I can enter a talk along with
And I should see "MO"
And I should see "United States"
And I should see "theory"
- And I should see "clojure"
+ And I should see "clojure"
And an email should be sent
-
-
-
-
+
+
+
+
@@ -1,31 +0,0 @@
-#- Copyright 2011 Strange Loop LLC
-#-
-#- Licensed under the Apache License, Version 2.0 (the "License");
-#- you may not use this file except in compliance with the License.
-#- You may obtain a copy of the License at
-#-
-#- http://www.apache.org/licenses/LICENSE-2.0
-#-
-#- Unless required by applicable law or agreed to in writing, software
-#- distributed under the License is distributed on an "AS IS" BASIS,
-#- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#- See the License for the specific language governing permissions and
-#- limitations under the License.
-#-
-
-
-
-require 'spec_helper'
-
-describe TalksController do
- describe "#create" do
- before do
- @talk = Factory(:talk)
- @talk.id= nil
- end
- it "saves the talk" do
- pending
- post :create, :talk => @talk
- end
- end
-end
@@ -11,7 +11,8 @@ def new
def create
if talk.save
Proposal.create :status => 'submitted', :talk => talk, :format => format
- SpeakerMailer.talk_submission_email(talk).deliver
+ email_method = format == 'talk' ? 'talk_submission_email' : 'workshop_submission_email'
+ SpeakerMailer.send(email_method, talk).deliver
render "create_#{format}"
else
render "new_#{format}"
@@ -3,48 +3,51 @@
<div class="container_12">
<div class="grid_12">
- <%= semantic_form_for [talk], :html => {:multipart => true}, :validate => true do |talk_form| %>
- <%= talk_form.inputs do %>
- <%= talk_form.input :title, :label => t('.title'), :hint => t('.title_hint')%>
- <%= talk_form.input :abstract, :label => t('.abstract'),
- :input_html => { :class => "freetext" }, :hint => t('.abstract_hint')%>
- <%= talk_form.input :talk_type, :label => t('.talk_type'),
- :as => :select, :collection => Talk.talk_types %>
- <%= talk_form.input :video_approval, :label => t('.video_approval'),
- :as => :select, :collection => Talk.video_approvals, :hint => t('.video_approval_hint')%>
- <%= talk_form.input :comments, :label => t('.comments'),
- :hint => t('.comments_hint') , :input_html => { :class => "freetext" }%>
- <%= talk_form.input :prereqs, :label => t('.prereqs'),
- :hint => t('.prereq_hint') , :input_html => { :class => "freetext" }%>
- <%= talk_form.input :av_requirement, :label => t('.av_req'),
- :hint => t('.av_req_hint'), :input_html => { :class => "freetext" }%>
- <%= talk_form.input :tag_list, :label => t('.tags'),
- :as => :string, :hint => t('.tags_hint') %>
- <%= talk_form.inputs :name => t('.speaker'), :for => :speakers do |speaker_form| %>
- <%= speaker_form.input :first_name, :label => t('.fname') %>
- <%= speaker_form.input :last_name, :label => t('.lname') %>
- <%= speaker_form.input :email, :label => t('.email') %>
- <%= speaker_form.input :twitter_id, :label => t('.twitter_id') %>
- <%= speaker_form.input :company, :label => t('.company') %>
- <%= speaker_form.input :company_url, :label => t('.company_url') %>
- <%= speaker_form.input :bio, :label => t('.bio') , :input_html => { :class => "freetext" },
- :hint => t('.bio_hint')%>
- <%= speaker_form.input :phone, :label => t('.phone'),
- :hint => t('.phone_hint')%>
- <%= speaker_form.input :city, :label => t('.city'),
- :hint => t('.city_hint')%>
- <%= speaker_form.input :state, :label => t('.state') %>
- <%= speaker_form.input :country, :label => t('.country'),
- :as => :select, :collection => Carmen::country_names %>
- <%= speaker_form.inputs :name => t('.image'), :for => :image do |image_form| %>
- <%= image_form.input :image, :label => t('.image'),
- :as => :file, :hint => t('.image_hint'), :input_html => { :validate => false } %>
- <% end -%>
+ <%= semantic_form_for proposal, :html => {:multipart => true}, :validate => true do |proposal_form| %>
+ <%= proposal_form.inputs do %>
+ <%= proposal_form.input :format, :as => :hidden %>
+ <%= proposal_form.inputs :for => :talk do |talk_form| %>
+ <%= talk_form.input :title, :label => t('.title'), :hint => t('.title_hint')%>
+ <%= talk_form.input :abstract, :label => t('.abstract'),
+ :input_html => { :class => "freetext" }, :hint => t('.abstract_hint')%>
+ <%= talk_form.input :talk_type, :label => t('.talk_type'),
+ :as => :select, :collection => Talk.talk_types %>
+ <%= talk_form.input :video_approval, :label => t('.video_approval'),
+ :as => :select, :collection => Talk.video_approvals, :hint => t('.video_approval_hint')%>
+ <%= talk_form.input :comments, :label => t('.comments'),
+ :hint => t('.comments_hint') , :input_html => { :class => "freetext" }%>
+ <%= talk_form.input :prereqs, :label => t('.prereqs'),
+ :hint => t('.prereq_hint') , :input_html => { :class => "freetext" }%>
+ <%= talk_form.input :av_requirement, :label => t('.av_req'),
+ :hint => t('.av_req_hint'), :input_html => { :class => "freetext" }%>
+ <%= talk_form.input :tag_list, :label => t('.tags'),
+ :as => :string, :hint => t('.tags_hint') %>
+ <%= talk_form.inputs :name => t('.speaker'), :for => :speakers do |speaker_form| %>
+ <%= speaker_form.input :first_name, :label => t('.fname') %>
+ <%= speaker_form.input :last_name, :label => t('.lname') %>
+ <%= speaker_form.input :email, :label => t('.email') %>
+ <%= speaker_form.input :twitter_id, :label => t('.twitter_id') %>
+ <%= speaker_form.input :company, :label => t('.company') %>
+ <%= speaker_form.input :company_url, :label => t('.company_url') %>
+ <%= speaker_form.input :bio, :label => t('.bio') , :input_html => { :class => "freetext" },
+ :hint => t('.bio_hint')%>
+ <%= speaker_form.input :phone, :label => t('.phone'),
+ :hint => t('.phone_hint')%>
+ <%= speaker_form.input :city, :label => t('.city'),
+ :hint => t('.city_hint')%>
+ <%= speaker_form.input :state, :label => t('.state') %>
+ <%= speaker_form.input :country, :label => t('.country'),
+ :as => :select, :collection => Carmen::country_names %>
+ <%= speaker_form.inputs :name => t('.image'), :for => :image do |image_form| %>
+ <%= image_form.input :image, :label => t('.image'),
+ :as => :file, :hint => t('.image_hint'), :input_html => { :validate => false } %>
+ <% end -%>
+ <% end %>
+ <% end %>
+ <% end %>
+ <%= proposal_form.buttons do %>
+ <%= proposal_form.commit_button :label => t('.commit')%>
<% end %>
<% end %>
- <%= talk_form.buttons do %>
- <%= talk_form.commit_button :label => t('.commit')%>
- <% end %>
- <% end %>
</div>
</div>
@@ -25,7 +25,7 @@
Talk.stub(:new => mock_talk)
mock_talk.stub(:save => true, :tap => mock_talk)
Proposal.stub(:create)
- SpeakerMailer.stub_chain(:talk_submission_email, :deliver)
+ SpeakerMailer.stub_chain(:send, :deliver)
end
it 'creates a new talk' do
@@ -45,7 +45,7 @@
end
it 'sends an email to the speaker' do
- SpeakerMailer.should_receive(:talk_submission_email).with(mock_talk).and_return(mock_email)
+ SpeakerMailer.should_receive(:send).with("workshop_submission_email", mock_talk).and_return(mock_email)
mock_email.should_receive(:deliver)
post :create, params
end

0 comments on commit c3f9fb8

Please sign in to comment.