Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: danielweinmann/catarse
base: fdb0a7cea9
head fork: danielweinmann/catarse
compare: f8a204156b
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
7 app/controllers/projects_controller.rb
@@ -56,9 +56,16 @@ def start
def send_mail
current_user.update_attribute :email, params[:contact] if
+ params[:how_much_you_need],
+ params[:category],
+ params[:video],
+ params[:twitter],
+ params[:blog],
+ params[:know_us_via],
+ params[:how_works],
9 app/mailers/projects_mailer.rb
@@ -1,10 +1,17 @@
class ProjectsMailer < ActionMailer::Base
include ERB::Util
- def start_project_email(about, rewards, links, contact, user, user_url)
+ def start_project_email(how_much_you_need, category, about, rewards, video, twitter, blog, links, know_us_via, how_works, contact, user, user_url)
+ @how_much_you_need = h(how_much_you_need)
+ @category = h(category)
@about = h(about).gsub("\n", "<br>").html_safe
@rewards = h(rewards).gsub("\n", "<br>").html_safe
+ @video = h(video)
+ @twitter = h(twitter)
+ @blog = h(blog)
@links = h(links).gsub("\n", "<br>").html_safe
+ @know_us_via = h(know_us_via).gsub("\n", "<br>").html_safe
+ @how_works = h(how_works).gsub("\n", "<br>").html_safe
@contact = contact
@user = user
@user_url = user_url
14 app/views/projects_mailer/start_project_email.html.haml
@@ -3,11 +3,25 @@
%meta{:content => "text/html; charset=UTF-8", 'http-equiv' => "Content-Type"}
%h1= t('.subject_html', :link => link_to(@user.display_name, @user_url))
+ %h2= t('projects.start.how_much_you_need')
+ %p= @how_much_you_need
+ %h2= t('projects.start.category')
+ %p= @category
%h2= t('projects.start.about')
%p= @about
%h2= t('projects.start.rewards')
%p= @rewards
+ %h2= t('')
+ %p= @video
+ %h2= t('projects.start.twitter')
+ %p= @twitter
+ %h2= t('')
+ %p= @blog
%h2= t('projects.start.links')
%p= @links
+ %h2= t('projects.start.know_us_via')
+ %p= @know_us_via
+ %h2= t('projects.start.how_works')
+ %p= @how_works
%h2= t('')
%p= @contact
7 config/locales/en.yml
@@ -599,10 +599,17 @@ en:
title: "Be part of it and share this project"
about: "Describe your project and how much do you need"
+ category: "Project category"
+ how_much_you_need: "How much do you want to raise?"
about_hint: "Tell us a little about what you want to do, how much you need and what for. Be brief and punctual, but don't forget to give the readers something that moves them. After all, it's your creation and they need to see your passion taking place!"
contact: "Leave us your email address so we can contact you"
links: "Where can we find more about you and your project?"
links_hint: "Leave us as many links as you have, so we can get to know your work and your project better. Doesn't have to be something formal or fancy, just a few useful links."
+ video: "Your project already have a video?"
+ twitter: "Have twitter account?"
+ blog: "Have a blog about the project?"
+ know_us_via: "How did you meet Catarse?"
+ how_works: "How to mobilize backers to raise $ needed for enforcement?"
content_html: "Want to have your project selected? Don't forget to read %{link}."
help_link: "our guide"
11 spec/mailers/projects_mailer_spec.rb
@@ -2,16 +2,25 @@
describe ProjectsMailer do
it "should send project, with HTML-safe fields and converting new lines to <br>" do
+ how_much_you_need = "1000 <javascript>"
+ category = "art <javascript>"
about = "About the project\n<javascript>"
rewards = "Rewards of the project\n<javascript>"
+ video = " <javascript>"
+ twitter = "username <javascript>"
+ blog = " <javascript>"
links = "Links of the project\n<javascript>"
+ know_us_via = "My friends\n<javascript>"
+ how_works = "Through social networks\n<javascript>"
contact = ""
user = Factory(:user)
- email = ProjectsMailer.start_project_email(about, rewards, links, contact, user, "#{I18n.t('site.base_url')}#{user_path(user)}").deliver
+ email = ProjectsMailer.start_project_email(how_much_you_need, category, about, rewards, video, twitter, blog, links, know_us_via, how_works, contact, user, "#{I18n.t('site.base_url')}#{user_path(user)}").deliver
ActionMailer::Base.deliveries.should_not be_empty
+ email.encoded.should =~ /1000 &lt;javascript&gt;/
email.encoded.should =~ /About the project\<br\>&lt;javascript&gt;/
email.encoded.should =~ /Rewards of the project\<br\>&lt;javascript&gt;/
email.encoded.should =~ /Links of the project\<br\>&lt;javascript&gt;/
+ email.encoded.should =~ /Through social networks\<br\>&lt;javascript&gt;/
email.encoded.should =~ /
email[:from].to_s.should == "#{I18n.t('')} <#{I18n.t('')}>"

No commit comments for this range

Something went wrong with that request. Please try again.