Permalink
Browse files

Merge branch 'master' into submit_signature_via_ajax

  • Loading branch information...
2 parents a318cf9 + a5f46b5 commit 8bc83607e3b0ae6563c9333d030edb560f7a93dc @bguthrie bguthrie committed Sep 12, 2012
View
@@ -42,6 +42,7 @@ group :test, :development do
gem 'capybara'
gem 'capybara-webkit'
gem 'debugger'
+ gem 'shoulda-matchers'
end
gem 'haml'
View
@@ -297,6 +297,8 @@ GEM
libwebsocket (~> 0.1.3)
multi_json (~> 1.0)
rubyzip
+ shoulda-matchers (1.3.0)
+ activesupport (>= 3.0.0)
simple-random (0.9.3)
simple_form (2.0.2)
actionpack (~> 3.0)
@@ -388,6 +390,7 @@ DEPENDENCIES
sanitize
sass-rails (~> 3.2.3)
selenium-webdriver
+ shoulda-matchers
simple-random
simple_form
simplecov
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
@@ -115,10 +115,21 @@
.countdown-text { color: red; }
}
}
+
#thanksModal, #thanks-for-signing-message, #mobile_thanks {
- .btn.red_button, .btn.grey_button, .btn.grey_donate, .btn.green_donate, .btn.red_donate {
+ .btn {
margin: 0 auto 10px;
padding: 0;
+ box-shadow: none;
+ border: none;
+ &.inspirational {
+ margin: 20px auto 15px !important;
+ }
+ }
+}
+
+#thanksModal, #thanks-for-signing-message, #mobile_thanks {
+ .btn.fb_red_share, .btn.grey_button, .btn.grey_donate, .btn.green_donate, .btn.red_donate {
height: 51px;
width: 177px;
border: none;
@@ -150,10 +161,10 @@
background: url("donate_red_hover.png");
}
}
- .btn.red_button {
- background: url("fb_red_button.png");
+ .btn.fb_red_share {
+ background: url("fb_red.png");
&:hover {
- background: url("fb_red_button_hover.png");
+ background: url("fb_red_hover.png");
}
}
.btn.red_button.tw {
@@ -164,6 +175,51 @@
}
}
}
+#thanksModal, #thanks-for-signing-message, #mobile_thanks {
+ .btn.fb_f_share {
+ height: 70px;
+ width: 250px;
+ background: url("fb_f.png");
+ &:hover {
+ background: url("fb_f_hover.png");
+ }
+ }
+}
+
+#thanksModal, #thanks-for-signing-message, #mobile_thanks {
+ .btn.fb_no_f_shareonfacebook {
+ height: 63px;
+ width: 250px;
+ background: url("fb_no_f.png");
+ &:hover {
+ background: url("fb_no_f_hover.png");
+ }
+ }
+}
+
+#thanksModal, #thanks-for-signing-message, #mobile_thanks {
+ .btn.fb_clipped_f_shareonfacebook {
+ height: 46px;
+ width: 262px;
+ background: url("fb_clipped_f.png");
+ &:hover {
+ background: url("fb_clipped_f_hover.png");
+ }
+ }
+}
+
+#thanksModal, #thanks-for-signing-message, #mobile_thanks {
+ .btn.fb_24k_shareonfacebook {
+ height: 52px;
+ width: 285px;
+ background: url("fb_24k.png");
+ &:hover {
+ background: url("fb_24k_hover.png");
+ }
+ }
+}
+
+
#thanks-for-signing-message, #thanksModal, .signature-form, #ask-to-sign {
padding: 10px;
@@ -745,10 +801,22 @@
white-space: pre-line;
}
}
-.btn.inspirational.red_button {
- margin: 20px auto 15px !important;
+
+#thanks-for-signing-message , #thanksModal, #mobile_thanks {
+ .fb {
+ .text {
+ margin: 20px 0;
+ text-align: center;
+ font-size: 22px;
+ line-height: 25px;
+ }
+ }
+}
+#thanksModal .fb .image {
+ margin: 0 0 0 -10px;
}
+
#thanks-for-signing-message , #thanksModal, #mobile_thanks {
.melanie_1,.melanie_2 {
padding: 10px 10px 0;
@@ -775,12 +843,12 @@
line-height: 14px;
margin: 6px 0 0 3px;
}
- .btn.red_button { margin: 11px auto 0 !important; }
+ .btn { margin: 11px auto 0 !important; }
}
}
#mobile_thanks {
.melanie_1, .melanie_2 {
- .btn.red_button { margin-bottom: 10px !important; }
+ .btn.fb_red_share { margin-bottom: 10px !important; }
}
}
#thanks-for-signing-message .melanie_2, #thanksModal .melanie_2 {
@@ -806,3 +874,20 @@
}
}
#thanksModal .checklist { margin: 10px 85px 20px; }
+
+#location-options {
+ margin-left: 160px;
+ margin-bottom: 20px;
+ height: 20px;
+ span {
+ input {
+ margin: 0;
+ width: 20px;
+ }
+ label {
+ margin: 0;
+ padding: 0;
+ margin-right: 20px;
+ }
+ }
+}
@@ -30,6 +30,10 @@ def facebook_sharing_option
(winner == 'facebook_request') ? facebook_request_pick_vs_autofill : winner
end
+ def facebook_button_aesthetic
+ spin! 'facebook button aesthetic', :share, ["fb_f_share", "fb_no_f_shareonfacebook", "fb_clipped_f_shareonfacebook", "fb_24k_shareonfacebook", "fb_red_share"]
+ end
+
def facebook_button
button_hash = {
'facebook_share' => { button_class: 'fb_share', button_text: 'Share on Facebook' },
@@ -50,7 +54,7 @@ def fb_like(url, ref_hash, classes = nil, is_button_count = false)
def after_share_view
return 'thanks_for_signing' if browser.ie?
- spin! 'after share view 2', :share, ["thanks_for_signing", "button_is_most_effective_tool", "tell_two_friends", "signatures_stop_signatures_multiply", "signatures_stop_signatures_multiply_with_thanks", "mandela-time_ripe_to_do_right", "warhol-change_things_yourself", "teresa-stone_creates_ripples", "teresa-stone_creates_ripples-color", "gandhi-shake_the_world", "king-do_what_is_right", "melanie_1", "melanie_2", "most_people_will_share_will_you", "over_x_shares_and_counting", "over_x_shares_and_counting-with_counter", "if_facebook_is_slow_try_again_later", "tell_two_friends-sandwich-grey", "tell_two_friends-sandwich-green", "tell_two_friends-sandwich-red", "almost_there_one_thing_to_do", "checklist"]
+ spin! 'after share view 2', :share, ["thanks_for_signing", "button_is_most_effective_tool", "tell_two_friends", "signatures_stop_signatures_multiply", "signatures_stop_signatures_multiply_with_thanks", "mandela-time_ripe_to_do_right", "warhol-change_things_yourself", "teresa-stone_creates_ripples", "teresa-stone_creates_ripples-color", "gandhi-shake_the_world", "king-do_what_is_right", "melanie_1", "melanie_2", "most_people_will_share_will_you", "over_x_shares_and_counting", "over_x_shares_and_counting-with_counter", "if_facebook_is_slow_try_again_later", "tell_two_friends-sandwich-grey", "tell_two_friends-sandwich-green", "tell_two_friends-sandwich-red", "almost_there_one_thing_to_do", "checklist", "demand_progress_facebook_pictures", "demand_progress_facebook_pictures_with_thanks"]
end
def progress_option
@@ -22,8 +22,9 @@ def new_petition(petition, member)
@box_location = email_experiment.box_location
@show_ps_with_plain_text = email_experiment.show_ps_with_plain_text
@font_size_of_petition_link = "font-size:#{email_experiment.font_size_of_petition_link};"
+ @button_color = "background:#{email_experiment.button_color_for_petition_link};"
headers["List-Unsubscribe"] = "mailto:unsubscribe+" + sent_email_hash + "@appmail.watchdog.net"
-
+
mail(subject: email_experiment.subject, from: Settings.email.from_address, to: "\"#{member.full_name}\" <#{member.email}>").deliver
rescue => exception
Rails.logger.error "exception sending email: #{exception} #{exception.backtrace.join}"
@@ -37,6 +37,10 @@ def font_size_of_petition_link
spin! "font size of sign-this-petition link", :signature, font_size_options
end
+ def button_color_for_petition_link
+ spin! "button color for sign-this-petition link", :signature, button_color_options
+ end
+
def show_button_instead_of_link
spin! "show button instead of link", :signature
end
@@ -73,6 +77,10 @@ def font_size_options
["100%", "125%", "150%", "200%"]
end
+ def button_color_options
+ ["#990000", "#308014"]
+ end
+
# persisted experiments templates
def current_trials(goal)
View
@@ -3,7 +3,7 @@ class Petition < ActiveRecord::Base
include HtmlToPlainText
attr_accessible :description, :title, :facebook_description, :petition_titles_attributes, :petition_images_attributes, :short_summary
- attr_accessible :description, :title, :facebook_description, :petition_titles_attributes, :petition_images_attributes, :short_summary, :to_send, :as => :admin
+ attr_accessible :description, :title, :facebook_description, :petition_titles_attributes, :petition_images_attributes, :short_summary, :to_send, :location, :as => :admin
has_many :signatures
has_many :sent_emails
has_many :petition_titles, :dependent => :destroy
@@ -44,10 +44,16 @@ def facebook_description_for_sharing
end
def plain_text_description
- convert_to_text(description)
+ convert_to_text(description_lsub)
end
def plain_text_title
convert_to_text(title)
end
+
+ def description_lsub sub=''
+ bsub = "<br><br>#{sub}<br><br>".gsub /(<br>){4}/, '<br><br>'
+ description.gsub /(<br>){2}LINK(<br>){2}/, bsub
+ end
+
end
@@ -5,9 +5,12 @@
%span.summary-help-text (The summary can only be 255 characters long)
= f.input :short_summary, as: :string, :input_html => { :maxlength => 255 }
= f.input :description
+
- if is_admin
+ #location-options
+ = f.collection_radio_buttons :location, [["all", "All Countries"], ["non-us", "Non-United-States"], ["us", "United States"]], :first, :last
+
= f.input :to_send, label: 'Feature this petition'
- - if is_admin
- email_subject_title = PetitionTitle.full_name PetitionTitle::TitleType::EMAIL
.controls.toggle
= link_to_add_fields "Customize #{email_subject_title}", f, :petition_titles, {:class => "string", :id => 'email_subject_link'}, {:title_type => "email", :label_name => "#{email_subject_title}"}, "#email_subjects"
@@ -56,10 +59,8 @@
.controls
= link_to_add_fields "Add Image", f, :petition_images, {:class => "string btn btn-primary add_link"}, {:label_name => 'Image'}, "#sharing_images"
-
.controls.submit
-# trick not to submit the form on enter
= f.button :submit, class: 'btn btn-primary span2', id: "petition_submit", onmousedown: "this.title=1", onclick: "if(this.title!=1){return false;}"
- if is_admin
= link_to "Email a preview to #{current_user.email}", "#", :id => "email_preview_link", :data => { "preview-url" => url_for(:controller => "petitions", :action => "send_email_preview") }
-
Oops, something went wrong.

0 comments on commit 8bc8360

Please sign in to comment.