From 767868b5184400bd213cfe943c23ab1d0df0e939 Mon Sep 17 00:00:00 2001 From: Andy Eblin Date: Sat, 23 Nov 2013 14:44:21 -0800 Subject: [PATCH 1/2] Upgraded to Bootstrap 3. --- .env.example | 2 +- Gemfile | 4 +- Gemfile.lock | 9 +- app/assets/javascripts/admin.js.coffee | 2 +- app/assets/stylesheets/admin.css.scss | 71 ++-- .../{application.css => application.css.scss} | 0 app/assets/stylesheets/campaigns.css.scss | 69 ++- app/assets/stylesheets/flash.css.scss | 18 - app/assets/stylesheets/main.css.scss | 3 +- app/assets/stylesheets/navbar.css.scss | 23 +- app/assets/stylesheets/primitives.css.scss | 32 +- app/controllers/admin/campaigns_controller.rb | 22 +- app/controllers/admin_controller.rb | 17 +- app/controllers/application_controller.rb | 6 +- app/controllers/campaigns_controller.rb | 24 +- app/models/campaign.rb | 7 +- app/views/admin/admin_bank_account.html.erb | 16 +- .../admin/admin_processor_setup.html.erb | 8 +- app/views/admin/admin_website.html.erb | 6 +- app/views/admin/campaigns/_form.html.erb | 54 +-- app/views/campaigns/checkout_amount.html.erb | 186 ++++---- .../campaigns/checkout_confirmation.html.erb | 85 ++-- app/views/campaigns/checkout_payment.html.erb | 399 ++++++++++-------- app/views/devise/registrations/edit.html.erb | 32 +- app/views/layouts/_navbar.html.erb | 36 +- app/views/layouts/_social_js.html.erb | 2 +- app/views/layouts/application.html.erb | 3 + app/views/shared/_share_buttons.html.erb | 13 +- .../theme/assets/stylesheets/base.css.scss | 25 +- .../assets/stylesheets/campaign.css.scss | 123 +++--- .../theme/assets/stylesheets/header.css.scss | 14 - .../assets/stylesheets/homepage.css.scss | 4 +- app/views/theme/views/_header.html.erb | 14 +- app/views/theme/views/campaign.html.erb | 361 +++++++++------- app/views/theme/views/homepage.html.erb | 13 +- 35 files changed, 858 insertions(+), 845 deletions(-) rename app/assets/stylesheets/{application.css => application.css.scss} (100%) mode change 100644 => 100755 delete mode 100644 app/assets/stylesheets/flash.css.scss diff --git a/.env.example b/.env.example index 19c9e0d2..85572af8 100644 --- a/.env.example +++ b/.env.example @@ -9,4 +9,4 @@ MAILGUN_DOMAIN=myawesomeapp.mailgun.org MAILGUN_PASSWORD=smtp_pass MAILGUN_USERNAME=postmaster@myawesomeapp.mailgun.org MAILGUN_API_KEY=key-mailgunapikey -SECRET_TOKEN=secrettoken +SECRET_TOKEN=secrettoken \ No newline at end of file diff --git a/Gemfile b/Gemfile index c5c61dbe..4ead659f 100644 --- a/Gemfile +++ b/Gemfile @@ -3,8 +3,10 @@ ruby "1.9.3" gem 'unicorn' +#Adding support for bootstrap 3.0 and bourbon gem 'rails', '3.2.13' -gem 'bootstrap-sass', '2.1' +gem 'bootstrap-sass', '~> 3.0.2.0' +gem 'bourbon' gem 'devise' gem 'email_spec' gem 'nokogiri' diff --git a/Gemfile.lock b/Gemfile.lock index 6e0d8aaa..81a51714 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -50,7 +50,11 @@ GEM nokogiri (>= 1.4.4) uuidtools (~> 2.1) bcrypt-ruby (3.0.1) - bootstrap-sass (2.1.0.0) + bootstrap-sass (3.0.2.1) + sass (~> 3.2) + bourbon (3.1.8) + sass (>= 3.2.0) + thor builder (3.0.4) capybara (2.1.0) mime-types (>= 1.16) @@ -241,7 +245,8 @@ DEPENDENCIES active_model_serializers asset_sync aws-sdk - bootstrap-sass (= 2.1) + bootstrap-sass (~> 3.0.2.0) + bourbon capybara ckeditor coffee-rails (~> 3.2.1) diff --git a/app/assets/javascripts/admin.js.coffee b/app/assets/javascripts/admin.js.coffee index d2c80243..3f57ad31 100644 --- a/app/assets/javascripts/admin.js.coffee +++ b/app/assets/javascripts/admin.js.coffee @@ -79,7 +79,7 @@ Crowdhoster.admin = $('#reward-add').on 'click', (e) -> e.preventDefault() - $('#rewards ul').append('
  • RewardNumber ClaimedDelete?
    $




    0
  • ') + $('#rewards ul').append('
  • RewardNumber ClaimedDelete?
    $




    0
  • ') $('.faq.sortable').sortable stop: (e, ui) -> diff --git a/app/assets/stylesheets/admin.css.scss b/app/assets/stylesheets/admin.css.scss index 4e337970..1fbd47e0 100644 --- a/app/assets/stylesheets/admin.css.scss +++ b/app/assets/stylesheets/admin.css.scss @@ -23,6 +23,18 @@ } #admin_website, #admin_campaigns { + + /* Setting width for forms without additional divs for columns */ + + .input-group .form-control { + width: 37.5%; + } + + .form-control { + width: 40%; + } + + /* Done setting form widths */ fieldset { margin-bottom: 30px; @@ -40,7 +52,7 @@ .explanation { float: right; - width: 400px; + width: 40%; } .explanation.inline { @@ -48,9 +60,16 @@ width: 100%; } + .explanation-left { + @extend .explanation; + float: left; + } + label { - margin-bottom: 15px; + display: block; + margin-bottom: 8px; font-size: 18px; + font-weight: 300; } label.inline { @@ -60,30 +79,12 @@ .additional_info_input { margin-top: 20px; - textarea { - width: 360px; - } } #preset-amount, #min-amount { margin-left: 20px; } - .currency { - position: relative; - - input { - padding-left: 24px; - width: 192px; - } - - span { - position: absolute; - top: 5px; - left: 10px; - } - } - #rewards { .reference { margin: 20px 0px; @@ -127,18 +128,16 @@ vertical-align: middle; cursor: move; - textarea { - width: 400px; - max-width: 400px; - margin-bottom: 0px; - } - .faq-delete { opacity: 0.5; &:hover { opacity: 1; } } + .form-control { + display: inline-block; + margin-right: 1%; + } } } @@ -217,23 +216,3 @@ font-size: 14px; } } - -.admin-alert { - margin-top: 30px!important; -} - -.admin-alert.alert.alert-success { - background: rgba(115, 211, 107, 1)!important; - text-shadow: none; -} - -.admin-alert.alert.alert-notice { - background: rgba(211, 211, 136, 1)!important; - text-shadow: none; -} - -.admin-alert.alert.alert-error { - background: rgba(219, 94, 94, 1)!important; - color: white; - text-shadow: none; -} diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css.scss old mode 100644 new mode 100755 similarity index 100% rename from app/assets/stylesheets/application.css rename to app/assets/stylesheets/application.css.scss diff --git a/app/assets/stylesheets/campaigns.css.scss b/app/assets/stylesheets/campaigns.css.scss index 3bbef620..6ab77a4c 100644 --- a/app/assets/stylesheets/campaigns.css.scss +++ b/app/assets/stylesheets/campaigns.css.scss @@ -2,25 +2,26 @@ width: 100%; padding: 50px 0; - .main_content { - width: 560px; - float: left; - h3 { - margin: 0px 0px 30px; - color: #4b4b4b; - a { - color: #4b4b4b; - text-decoration: none; - &:hover { - text-decoration: none; - } + h3 { + margin: 0px 0px 30px; + text-align: center; + color: #4b4b4b; + a { + color: #4b4b4b; + text-decoration: none; + &:hover { + text-decoration: none; } } + } + + .main_content { .checkout_block { - background-color: #ffffff; - padding: 30px; - margin-bottom: 0px; + margin-bottom: 15px; + label { + font-weight: 300; + } } p { @@ -40,18 +41,7 @@ .amount_input { position: relative; - display: inline-block; - - input { - padding-left: 24px; - width: 200px; - } - span { - position: absolute; - top: 5px; - left: 10px; - } } #reward_select { @@ -67,11 +57,12 @@ display: inline; float: left; margin-left: 10px; + margin-right: 10px; font-weight: bold; } .reward_description { - margin-left: 120px; - width: 320px; + margin-left: 20%; + width: 70%; p { font-size: 14px; margin: 0px; @@ -99,10 +90,7 @@ } } .reward_edit { - display: block; - position: absolute; - top: 15px; - right: 25px; + display: inline-block; } } &.active { @@ -121,7 +109,7 @@ } .btn { - margin-top: 20px; + margin-top: 15px; } h4 { @@ -136,11 +124,7 @@ } fieldset { - display: inline-block; - } - - #fullname, #email, #address_one, #address_two, #additional_info{ - width: 480px; + display: block; } .billing_address { @@ -179,13 +163,11 @@ } .sidebar { - float: right; - width: 345px; .crowdtilt-powered { - margin-bottom: 34px; + margin-bottom: 30px; img { - float: right; + max-width: 317px; } } @@ -227,10 +209,7 @@ } .confirmation_sidebar { - float: left; background: white; - margin-left: 20px; - width: 315px; p { font-size: 14px; } diff --git a/app/assets/stylesheets/flash.css.scss b/app/assets/stylesheets/flash.css.scss deleted file mode 100644 index ef27a289..00000000 --- a/app/assets/stylesheets/flash.css.scss +++ /dev/null @@ -1,18 +0,0 @@ -.alert { - padding: 10px; - color: black; - text-align: center; - margin-bottom: 0px; -} - -.alert.alert-success { - background: rgba(0, 128, 0, 0.25); -} - -.alert.alert-notice { - background: rgba(255, 255, 0, 0.25); -} - -.alert.alert-error { - background: rgba(255, 0, 0, 0.25); -} \ No newline at end of file diff --git a/app/assets/stylesheets/main.css.scss b/app/assets/stylesheets/main.css.scss index af49896d..fe86548e 100644 --- a/app/assets/stylesheets/main.css.scss +++ b/app/assets/stylesheets/main.css.scss @@ -6,10 +6,9 @@ /* Top level layout sections */ @import "navbar"; -@import "flash"; /* Non-customizable section styles */ @import "devise"; @import "admin"; @import "campaigns"; -@import "users"; +@import "users"; \ No newline at end of file diff --git a/app/assets/stylesheets/navbar.css.scss b/app/assets/stylesheets/navbar.css.scss index 2d8b657e..6a10aaa6 100644 --- a/app/assets/stylesheets/navbar.css.scss +++ b/app/assets/stylesheets/navbar.css.scss @@ -1,8 +1,12 @@ #navbar { - .navbar-inner { + .navbar { min-height: 30px; } + .navbar-left > li { + float: left; + } + .navbar .nav > li > a { padding: 5px 15px; display: inline-block; @@ -18,18 +22,15 @@ vertical-align: bottom; } + .navbar-btn { + margin-top: 4px; + margin-bottom: 0px; + margin-right: 8px; + } + .status { - color: white; - margin-top: 5px; - border-radius: 5px; + margin-top: 7px; margin-right:8px; - padding: 0px 10px; - } - .status.red { - background-color: red; - } - .status.green { - background-color: green; } } \ No newline at end of file diff --git a/app/assets/stylesheets/primitives.css.scss b/app/assets/stylesheets/primitives.css.scss index aad72227..d99ced95 100644 --- a/app/assets/stylesheets/primitives.css.scss +++ b/app/assets/stylesheets/primitives.css.scss @@ -16,9 +16,13 @@ $tertiary_font: "Arial"; .alert { padding: 10px; - color: black; + margin-bottom: 0px; text-align: center; - margin-bottom: 40px; +} + +// Adding form-control bootstrap styling to necessary input fields and selects +textarea, input[type=text], input[type=email], input[type=password], select { + @extend .form-control; } #main { @@ -26,7 +30,8 @@ $tertiary_font: "Arial"; } .content_box { - padding: 30px; + padding-top: 15px; + padding-bottom: 15px; -webkit-border-radius: 8px; -moz-border-radius: 8px; border-radius: 8px; @@ -114,27 +119,6 @@ select.error { border-color: #b94a48; } -#share_buttons { - - position: relative; - .like { - position: absolute; - top: 0px; - left: 0px; - } - - .tweet { - position: absolute; - top: 0px; - left: 110px; - } - - .pin { - position: absolute; - top: 0px; - left: 225px; - } -} /* Time Picker */ .ui-datepicker {font-size: 12px} diff --git a/app/controllers/admin/campaigns_controller.rb b/app/controllers/admin/campaigns_controller.rb index bda5c99e..fd41f917 100644 --- a/app/controllers/admin/campaigns_controller.rb +++ b/app/controllers/admin/campaigns_controller.rb @@ -28,7 +28,7 @@ def copy Crowdtilt.sandbox response = Crowdtilt.post('/campaigns', {campaign: campaign}) rescue => exception - redirect_to admin_campaigns, :flash => { :error => "An error occurred" } + redirect_to admin_campaigns, :flash => { :danger => "An error occurred" } else @campaign.update_api_data(response['campaign']) @campaign.save @@ -62,7 +62,7 @@ def create @campaign.errors.each do |key, error| message = message + key.to_s.humanize + ' ' + error.to_s + ', ' end - flash.now[:error] = message[0...-2] + flash.now[:danger] = message[0...-2] render action: "new" return end @@ -87,7 +87,7 @@ def create @campaign.production_flag ? Crowdtilt.production(@settings) : Crowdtilt.sandbox response = Crowdtilt.post('/campaigns', {campaign: campaign}) rescue => exception - flash.now[:error] = exception.to_s + flash.now[:danger] = exception.to_s render action: "new" return else @@ -123,7 +123,7 @@ def create @campaign.errors.each do |key, error| message = message + key.to_s.humanize + ' ' + error.to_s + ', ' end - flash.now[:error] = message[0...-2] + flash.now[:danger] = message[0...-2] render action: "new" return end @@ -136,7 +136,7 @@ def create end @settings.save - redirect_to campaign_home_url(@campaign), :flash => { :notice => "Campaign updated!" } + redirect_to campaign_home_url(@campaign), :flash => { :success => "Campaign updated!" } return end end @@ -188,7 +188,7 @@ def update r.number = reward['number'].to_i r.price = reward['price'].to_f unless r.save - flash.now[:error] = "Invalid rewards" + flash.now[:danger] = "Invalid rewards" render action: "edit" return end @@ -210,7 +210,7 @@ def update @campaign.errors.each do |key, error| message = message + key.to_s.humanize + ' ' + error.to_s + ', ' end - flash.now[:error] = message[0...-2] + flash.now[:danger] = message[0...-2] render action: "edit" return end @@ -246,12 +246,12 @@ def update response = Crowdtilt.put('/campaigns/' + @campaign.ct_campaign_id, {campaign: campaign}) end rescue => exception - flash.now[:error] = exception.to_s + flash.now[:danger] = exception.to_s render action: "edit" and return else @campaign.update_api_data(response['campaign']) @campaign.save - redirect_to campaign_home_url(@campaign), :flash => { :notice => "Campaign updated!" } and return + redirect_to campaign_home_url(@campaign), :flash => { :success => "Campaign updated!" } and return end end @@ -269,7 +269,7 @@ def payments # @contributors = response['payments'] # @page = response['pagination']['page'].to_i # @total_pages = response['pagination']['total_pages'].to_i -# flash.now[:error] = "Contributor not found for " + params[:payment_id] +# flash.now[:danger] = "Contributor not found for " + params[:payment_id] # else # @contributors = [response['payment']] # @page = @total_pages = 1 @@ -287,7 +287,7 @@ def payments @payments = [payment] else @payments = @campaign.payments_completed.order("created_at ASC") - flash.now[:error] = "Contributor not found for " + params[:payment_id] + flash.now[:danger] = "Contributor not found for " + params[:payment_id] end elsif params.has_key?(:email) && !params[:email].blank? @payments = @campaign.payments_completed.where("lower(email) = ?", params[:email].downcase) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index ed6f277a..403868bb 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -14,25 +14,25 @@ def admin_website @settings.errors.each do |key, error| message = message + key.to_s.humanize + ' ' + error.to_s + ', ' end - flash.now[:error] = message[0...-2] + flash.now[:danger] = message[0...-2] end end end def admin_processor_setup if request.post? - flash.now[:error] = "Invalid credentials" and return if params[:ct_prod_api_key].blank? || params[:ct_prod_api_secret].blank? + flash.now[:danger] = "Invalid credentials" and return if params[:ct_prod_api_key].blank? || params[:ct_prod_api_secret].blank? if @settings.activate_payments(params[:ct_prod_api_key], params[:ct_prod_api_secret]) flash.now[:success] = "Your payment processor is all set up!" else - flash.now[:error] = "Invalid credentials" + flash.now[:danger] = "Invalid credentials" end end end def create_admin_bank_account if params[:ct_bank_id].blank? - flash = { :error => "Looks like you have JavaScript disabled. JavaScript is required for bank account setup." } + flash = { :danger => "Looks like you have JavaScript disabled. JavaScript is required for bank account setup." } else begin bank = { @@ -40,7 +40,7 @@ def create_admin_bank_account } Crowdtilt.post('/users/' + @ct_admin_id + '/banks/default', {bank: bank}) rescue => exception - flash = { :error => "An error occurred, please contact team@crowdhoster.com: #{exception.message}" } + flash = { :danger => "An error occurred, please contact team@crowdhoster.com: #{exception.message}" } else flash = { :success => "Your bank account is all set up!" } end @@ -50,8 +50,9 @@ def create_admin_bank_account def admin_bank_account unless @settings.payments_activated? - redirect_to admin_processor_setup_url, flash: { error: "Please set up your payment processor before providing your bank details" } and return + redirect_to admin_processor_setup_url, flash: { danger: "Please set up your payment processor before providing your bank details" } and return end + @bank = {} begin response = Crowdtilt.get('/users/' + @ct_admin_id + '/banks/default') @@ -61,7 +62,7 @@ def admin_bank_account if response['bank'] # default bank is already set up @bank = response['bank'] else - flash.now[:error] = "An error occurred, please contact team@crowdhoster.com" # this should never happen + flash.now[:danger] = "An error occurred, please contact team@crowdhoster.com" # this should never happen end end end @@ -118,7 +119,7 @@ def admin_notification_setup if current_user.update_attributes(params[:user]) flash.now[:success] = "Notification settings saved!" else - flash.now[:error] = "There was an error saving your notification settings. Please try again!" + flash.now[:danger] = "There was an error saving your notification settings. Please try again!" end end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a2fd74ac..65cff58a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -27,7 +27,7 @@ def after_sign_in_path_for(resource) def verify_admin if !current_user.admin? - redirect_to root_url, :flash => { :notice => "You must be an admin to access that page" } + redirect_to root_url, :flash => { :warning => "You must be an admin to access that page" } end end @@ -62,7 +62,7 @@ def check_init rescue => exception @settings.update_attribute :initialized_flag, false sign_out current_user - redirect_to new_user_registration_url, :flash => { :error => "An error occurred, please contact team@crowdhoster.com: #{exception.message}" } + redirect_to new_user_registration_url, :flash => { :danger => "An error occurred, please contact team@crowdhoster.com: #{exception.message}" } return else @settings.update_attribute :ct_sandbox_guest_id, sandbox_guest['user']['id'] @@ -73,7 +73,7 @@ def check_init # Put user back on admin area redirect_to admin_website_url, :flash => { :success => "Nice! Your app is now initialized." } else - redirect_to new_user_registration_url, :flash => { :error => "Please create an account below to initialize the app." } + redirect_to new_user_registration_url, :flash => { :danger => "Please create an account below to initialize the app." } end end end diff --git a/app/controllers/campaigns_controller.rb b/app/controllers/campaigns_controller.rb index 8f66aa0a..11e4b96c 100644 --- a/app/controllers/campaigns_controller.rb +++ b/app/controllers/campaigns_controller.rb @@ -17,7 +17,7 @@ def checkout_amount @reward = Reward.find_by_id(params[:reward]) unless @reward && @reward.campaign_id == @campaign.id && !@reward.sold_out? @reward = false - flash.now[:notice] = "Please select a different reward" + flash.now[:warning] = "Please select a different reward" end end end @@ -29,7 +29,7 @@ def checkout_payment @quantity = params[:quantity].to_i @amount = ((@quantity * @campaign.fixed_payment_amount.to_f)*100).ceil/100.0 else - redirect_to checkout_amount_url(@campaign), flash: { error: "Invalid quantity!" } + redirect_to checkout_amount_url(@campaign), flash: { danger: "Invalid quantity!" } return end elsif params.has_key?(:amount) && params[:amount].to_f >= @campaign.min_payment_amount @@ -40,17 +40,17 @@ def checkout_payment begin @reward = Reward.find(params[:reward]) rescue => exception - redirect_to checkout_amount_url(@campaign), flash: { error: "Please select a different reward" } + redirect_to checkout_amount_url(@campaign), flash: { danger: "Please select a different reward" } return end unless @reward && @reward.campaign_id == @campaign.id && !@reward.sold_out? && @reward.price <= @amount - redirect_to checkout_amount_url(@campaign), flash: { error: "Invalid reward!" } + redirect_to checkout_amount_url(@campaign), flash: { danger: "Invalid reward!" } return end end else - redirect_to checkout_amount_url(@campaign), flash: { error: "Invalid amount!" } + redirect_to checkout_amount_url(@campaign), flash: { danger: "Invalid amount!" } return end @@ -88,7 +88,7 @@ def checkout_process if params[:reward].to_i != 0 @reward = Reward.find_by_id(params[:reward]) unless @reward && @reward.campaign_id == @campaign.id && !@reward.sold_out? && @reward.price <= amount - redirect_to checkout_amount_url(@campaign), flash: { error: "Please select a different reward" } and return + redirect_to checkout_amount_url(@campaign), flash: { danger: "Please select a different reward" } and return end end @@ -124,7 +124,7 @@ def checkout_process @payment.errors.each do |key, error| message = message + key.to_s.humanize + ' ' + error.to_s + ', ' end - redirect_to checkout_amount_url(@campaign), flash: { error: message[0...-2] } and return + redirect_to checkout_amount_url(@campaign), flash: { danger: message[0...-2] } and return end # Check if there's an existing payment with the same payment_params and client_timestamp. @@ -134,7 +134,7 @@ def checkout_process when nil flash_msg = { info: "Your payment is still being processed! If you have not received a confirmation email, please try again or contact support by emailing team@crowdhoster.com" } when 'error' - flash_msg = { error: "There was an error processing your payment. Please try again or contact support by emailing team@crowdhoster.com." } + flash_msg = { danger: "There was an error processing your payment. Please try again or contact support by emailing team@crowdhoster.com." } else # A status other than nil or 'error' indicates success! Treat as original payment redirect_to checkout_confirmation_url(@campaign), :status => 303, :flash => { payment_guid: @payment.ct_payment_id } and return @@ -173,7 +173,7 @@ def checkout_process rescue => exception @payment.update_attribute(:status, 'error') logger.info "ERROR WITH POST TO /payments: #{exception.message}" - redirect_to checkout_amount_url(@campaign), flash: { error: "There was an error processing your payment. Please try again or contact support by emailing team@crowdhoster.com" } and return + redirect_to checkout_amount_url(@campaign), flash: { danger: "There was an error processing your payment. Please try again or contact support by emailing team@crowdhoster.com" } and return end # Sync payment data @@ -216,15 +216,15 @@ def load_campaign def check_published if !@campaign.published_flag unless user_signed_in? && current_user.admin? - redirect_to root_url, :flash => { :error => "Campaign is no longer available" } + redirect_to root_url, :flash => { :danger => "Campaign is no longer available" } end end end def check_exp if @campaign.expired? - redirect_to campaign_home_url(@campaign), :flash => { :error => "Campaign is expired!" } + redirect_to campaign_home_url(@campaign), :flash => { :danger => "Campaign is expired!" } end end -end +end \ No newline at end of file diff --git a/app/models/campaign.rb b/app/models/campaign.rb index ff4ab739..d5cf011d 100644 --- a/app/models/campaign.rb +++ b/app/models/campaign.rb @@ -27,12 +27,13 @@ class Campaign < ActiveRecord::Base before_validation { main_image.clear if main_image_delete == '1' } before_validation { video_placeholder.clear if video_placeholder_delete == '1' } before_validation { facebook_image.clear if facebook_image_delete == '1' } - + + #The hash indicates cropping, use ! for forced scaling, use ^ to preserve aspect ratio has_attached_file :main_image, - styles: { main: "512x385!", medium: "640x360!", small: "190x143!", thumb: "100x100#" } + styles: { main: "512x385^", medium: "640x360^", small: "190x143^", thumb: "100x100^" } has_attached_file :video_placeholder, - styles: { main: "512x385!", medium: "640x360!", thumb: "100x100#" } #The hash indicates cropping, use ! for forced scaling + styles: { main: "512x385^", medium: "640x360^", thumb: "100x100^" } has_attached_file :facebook_image, styles: { thumb: "100x100#" } diff --git a/app/views/admin/admin_bank_account.html.erb b/app/views/admin/admin_bank_account.html.erb index 84bdac96..f5a94281 100644 --- a/app/views/admin/admin_bank_account.html.erb +++ b/app/views/admin/admin_bank_account.html.erb @@ -32,31 +32,31 @@
    -
    +
    -
    +
    -
    +
    -
    +
    -
    +
    -
    +
    @@ -85,12 +85,12 @@

    Banking Information

    -
    +
    -
    +
    diff --git a/app/views/admin/admin_processor_setup.html.erb b/app/views/admin/admin_processor_setup.html.erb index eddff725..7cc117fa 100644 --- a/app/views/admin/admin_processor_setup.html.erb +++ b/app/views/admin/admin_processor_setup.html.erb @@ -25,15 +25,15 @@

    Crowdhoster is set up to use the Crowdtilt API for credit card transactions and bank payouts. Please contact support.api@crowdtilt.com to request production Crowdtilt API credentials.

    -
    +
    - +
    -
    +
    - +
    diff --git a/app/views/admin/admin_website.html.erb b/app/views/admin/admin_website.html.erb index f5c1d2a4..8ddc87e9 100644 --- a/app/views/admin/admin_website.html.erb +++ b/app/views/admin/admin_website.html.erb @@ -13,7 +13,7 @@

    This will be used as the page title (for SEO) and the name in the header. Your site name is also what contributors will see on their credit card statements.

    - <%= f.text_field :site_name %> + <%= f.text_field :site_name %>
    @@ -131,13 +131,13 @@

    Add your own CSS styles to fully customize the look and feel of your site.

    - <%= f.text_area :custom_css, rows: 3, style: "width:400px; height: 200px", :placeholder => "#campaign #funding_area { background: white; }" %> + <%= f.text_area :custom_css, rows: 8, :placeholder => "#campaign #funding_area { background: white; }" %>

    Add your own JavaScript here. Use this field to paste in scripts for analytics tracking, retargeting, etc.

    - <%= f.text_area :custom_js, rows: 3, style: "width:400px; height: 200px", :placeholder => "" %> + <%= f.text_area :custom_js, rows: 8, :placeholder => "" %>
    diff --git a/app/views/admin/campaigns/_form.html.erb b/app/views/admin/campaigns/_form.html.erb index c2714021..dcb9d819 100644 --- a/app/views/admin/campaigns/_form.html.erb +++ b/app/views/admin/campaigns/_form.html.erb @@ -22,10 +22,10 @@ -
    "> +
    "> + $ <%= f.text_field :goal_dollars, value: (number_with_precision(f.object.goal_dollars, :precision => 2) || 0) %> - $ -
    +
    @@ -52,16 +52,22 @@
    "> - - <%= f.text_field :min_payment_amount, value: (number_with_precision(f.object.min_payment_amount, :precision => 2) || 0) %> + +
    + $ + <%= f.text_field :min_payment_amount, value: (number_with_precision(f.object.min_payment_amount, :precision => 2) || 0) %> +
    "> - - <%= f.text_field :fixed_payment_amount, value: (number_with_precision(f.object.fixed_payment_amount, :precision => 2) || 0) %> + +
    + $ + <%= f.text_field :fixed_payment_amount, value: (number_with_precision(f.object.fixed_payment_amount, :precision => 2) || 0) %> +
    @@ -115,22 +121,22 @@ - -
    - - $ + +
    + $ +
    -
    +
    -
    +
    -
    +
    -
    +
    - - + + <%= reward.payments.length %> @@ -231,18 +237,18 @@
  • <%= iterator %> - - - + + +
  • <% iterator+=1 %> <% end %>
  • <%= @campaign.faqs.count + 1 %> - - - + + +
  • Add FAQ @@ -336,7 +342,7 @@ <%= f.check_box :production_flag %> <% else %> - You must set up your payment processor before activating payments. Visit "Payment Settings" from the admin menu to do this. +

    You must set up your payment processor before activating payments. Visit "Payment Settings" from the admin menu to do this.

    <% end %> <% else %>

    You have activated payments for this campaign, which means transactions WILL be processed. This cannot be undone for this campaign. If you activated payments by mistake, we recommend ending and un-publishing this campaign and creating a new one.

    diff --git a/app/views/campaigns/checkout_amount.html.erb b/app/views/campaigns/checkout_amount.html.erb index b1eaf4d9..50a8e0e8 100644 --- a/app/views/campaigns/checkout_amount.html.erb +++ b/app/views/campaigns/checkout_amount.html.erb @@ -1,99 +1,105 @@
    -
    -
    -

    <%= @campaign.name %>

    - -
    -
    - - <% if @campaign.payment_type == 'fixed' %> - -
    -

    Please choose a quantity:

    -
    - - $<%= number_with_precision(@campaign.fixed_payment_amount, precision: 2) %>  x   - -   =  $<%= number_with_precision(@campaign.fixed_payment_amount, precision: 2) %> - -
    - - - - <% else %> - -
    -

    Please enter an amount:

    -
    -
    -    - $ -
    - Minimum is $<%= number_with_precision(@campaign.min_payment_amount, precision: 2) %> - -
    - - - <% end %> - - <% if @campaign.rewards? %> -
    -

    Select your <%= @campaign.reward_reference %>:

    -
      -
    • - - -
      -

      No <%= @campaign.reward_reference %>

      -
      - -
    • - <% @campaign.rewards.order("price ASC").each do |reward| %> - <% if reward.visible? %> -
    • - <%= raw('checked="checked"') if @reward && @reward.id == reward.id %>> - -
      -

      <%= reward.title %>

      -

      - <%= reward.payments.length %> <%= "of #{reward.number}" unless reward.unlimited? %> claimed - <% if reward.sold_out? %> (All gone!) <% end %> -

      -

      <%= reward.description %>

      -

      Estimated Delivery: <%= reward.delivery_date %>

      -
      - edit -
    • - <% end %> - <% end %> -
    -
    - <% end %> - +
    + + - +
    +
    + +
    + + + <% if @campaign.payment_type == 'fixed' %> + +
    +

    Please choose a quantity:

    +
    + + $<%= number_with_precision(@campaign.fixed_payment_amount, precision: 2) %>  x   + +   =  $<%= number_with_precision(@campaign.fixed_payment_amount, precision: 2) %> + +
    + + + + <% else %> + +
    +

    Please enter an amount:

    +
    +
    + $ + +
    + +
    + + + <% end %> + + <% if @campaign.rewards? %> +
    +

    Select your <%= @campaign.reward_reference %>:

    +
      +
    • + + +
      +

      No <%= @campaign.reward_reference %>

      + +
      +
    • + <% @campaign.rewards.order("price ASC").each do |reward| %> + <% if reward.visible? %> +
    • + <%= raw('checked="checked"') if @reward && @reward.id == reward.id %>> + +
      +

      <%= reward.title %>

      +

      + <%= reward.payments.length %> <%= "of #{reward.number}" unless reward.unlimited? %> claimed + <% if reward.sold_out? %> (All gone!) <% end %> +

      +

      <%= reward.description %>

      +

      Estimated Delivery: <%= reward.delivery_date %>

      + Edit +
      +
    • + <% end %> + <% end %> +
    +
    + <% end %> + + + + + +
    -
    -
    - -
    diff --git a/app/views/campaigns/checkout_confirmation.html.erb b/app/views/campaigns/checkout_confirmation.html.erb index e6807fa6..904386a5 100644 --- a/app/views/campaigns/checkout_confirmation.html.erb +++ b/app/views/campaigns/checkout_confirmation.html.erb @@ -1,45 +1,50 @@
    -
    - <%= raw(@campaign.confirmation_page_content) %> -
    diff --git a/app/views/campaigns/checkout_payment.html.erb b/app/views/campaigns/checkout_payment.html.erb index 25129700..b5fbe603 100644 --- a/app/views/campaigns/checkout_payment.html.erb +++ b/app/views/campaigns/checkout_payment.html.erb @@ -1,215 +1,244 @@
    -
    + + -
    +
    +
    -
    +
    - -

    Contact Information

    + -
    - - + +

    Contact Information

    - - +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    - <% if @campaign.collect_additional_info %> -

    Additional Information

    + <% if @campaign.collect_additional_info %> +

    Additional Information

    - - - <% end %> -
    - - <% if @campaign.collect_shipping %> -

    Shipping Address

    - -
    -
    - - - - - -
    -
    -
    -
    - - -
    -
    - - -
    -
    -
    -
    - - -
    -
    - - -
    -
    - <% end %> + + + <% end %> +
    -

    Credit/Debit Card

    + <% if @campaign.collect_shipping %> +

    Shipping Address

    -
    -
    -
    - - -
    -
    - - - -
    -
    -
    -
    -
    -
    - - +
    +
    +
    + + +
    +
    +
    +
    Address2 + +
    -
    - - +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    + <% end %> + +

    Credit/Debit Card

    + +
    +
    +
    +
    + + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    + +
    +
    +
    +
    + + + +
    +
    + + + +
    +
    +
    + + + + + + + + + + + <% if !@campaign.production_flag %> +
    This campaign is in sandbox mode, your card will not actually be charged.
    + <% end%> + +
    + + +
    -
    - - - - - - - - - - - - - <% if !@campaign.production_flag %> -
    This campaign is in sandbox mode, your card will not actually be charged.
    - <% end%> - -
    - - - -
    - - - -
    <%= image_tag 'crowdtilt_badge_no_card_logos.png', width: "120px", height: "36px" %>
    -
    - -
    + + + +
    <%= image_tag 'crowdtilt_badge_no_card_logos.png', width: "120px", height: "36px" %>
    +
    - - <% end %> -
    - <%= raw(@campaign.checkout_sidebar_content) %> +
    + <%= raw(@campaign.checkout_sidebar_content) %> +
    -
    diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 1e79a011..22199199 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -8,21 +8,31 @@ <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %> <%= devise_error_messages! %> -
    <%= f.label :fullname, "Full Name" %> - <%= f.text_field :fullname, :autofocus => true %>
    +
    + <%= f.label :fullname, "Full Name" %> + <%= f.text_field :fullname, :autofocus => true %> +
    -
    <%= f.label :email %> - <%= f.email_field :email, :autofocus => true %>
    +
    + <%= f.label :email %> + <%= f.email_field :email, :autofocus => true %> +

    Change your password:

    -
    <%= f.label :password, "Enter your new password" %> - <%= f.password_field :password, :autocomplete => "off" %>
    - -
    <%= f.label :password_confirmation, "Re-enter your new password" %> - <%= f.password_field :password_confirmation %>
    +
    + <%= f.label :password, "Enter your new password" %> + <%= f.password_field :password, :autocomplete => "off" %> +
    + +
    + <%= f.label :password_confirmation, "Re-enter your new password" %> + <%= f.password_field :password_confirmation %> +


    -
    <%= f.label :current_password, "Current Password (we need this to confirm your changes)" %> - <%= f.password_field :current_password %>
    +
    + <%= f.label :current_password, "Current Password (we need this to confirm your changes)" %> + <%= f.password_field :current_password %> +
    <% end %> diff --git a/app/views/layouts/_navbar.html.erb b/app/views/layouts/_navbar.html.erb index d904182c..56e425ae 100644 --- a/app/views/layouts/_navbar.html.erb +++ b/app/views/layouts/_navbar.html.erb @@ -1,49 +1,59 @@ <% if user_signed_in? && current_user.admin? %> <% end %> \ No newline at end of file diff --git a/app/views/layouts/_social_js.html.erb b/app/views/layouts/_social_js.html.erb index 5021741a..d3c0f6b2 100644 --- a/app/views/layouts/_social_js.html.erb +++ b/app/views/layouts/_social_js.html.erb @@ -13,7 +13,7 @@ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; - js.src = "//connect.facebook.net/en_US/all.js"; + js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 7419c63e..6977cfeb 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -2,6 +2,9 @@ + + + <%= @settings.site_name %> <% if @settings.indexable == false %> diff --git a/app/views/shared/_share_buttons.html.erb b/app/views/shared/_share_buttons.html.erb index 8b565717..e032b1bb 100644 --- a/app/views/shared/_share_buttons.html.erb +++ b/app/views/shared/_share_buttons.html.erb @@ -1,5 +1,12 @@
    - - -
    + +
    + +
    +
    + +
    \ No newline at end of file diff --git a/app/views/theme/assets/stylesheets/base.css.scss b/app/views/theme/assets/stylesheets/base.css.scss index e82a94e4..bc129228 100644 --- a/app/views/theme/assets/stylesheets/base.css.scss +++ b/app/views/theme/assets/stylesheets/base.css.scss @@ -4,6 +4,7 @@ $h3_color: #4B4B4B; $h4_color: #292929; $h5_color: #4B4B4B; + $text_color: #6B6B6B; $link_color: #0008D6; $text_shadow: 0 1px 0px #fff; @@ -14,6 +15,7 @@ $primary_font: "Helvetica Neue"; $secondary_font: "Helvetica"; $tertiary_font: "Arial"; + // FAQ Entry $summary_color: #0088D6; @@ -28,30 +30,30 @@ $gray_background_bottom_color: #FAFAFA; $gray_background_border_color: #C4C4C4; // Button colors/background/border -$button_color: white; +$button_color: #FFFFFF; $button_background_color: #0088d6; $button_hovered_color: #0088d6; $button_active_border: #C8C8C8; // This only affects .blue_button, which is the "Reserve Now" button you see on Lockitron's homepage -$button_text_shadow_color: rgba(0,0,0,.37); +$button_text_shadow_color: rgba(0,0,0,.37); $button_box_shadow_color: rgba(255,255,255,.92); $button_box_shadow_inset_color: rgba(0,0,0,.22); $button_border_radius: 10px; // Default State -$button_ie9_gradient: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+PGxpbmVhckdyYWRpZW50IGlkPSJoYXQwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjEwMCUiIHgyPSI1MCUiIHkyPSIwJSI+CjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiMwZTk2ZTQiIHN0b3Atb3BhY2l0eT0iMSIvPgo8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMmEwZmEiIHN0b3Atb3BhY2l0eT0iMSIvPgogICA8L2xpbmVhckdyYWRpZW50PgoKPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNoYXQwKSIgLz4KPC9zdmc+); +$button_ie9_gradient: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+PGxpbmVhckdyYWRpZW50IGlkPSJoYXQwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjEwMCUiIHgyPSI1MCUiIHkyPSIwJSI+CjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiMwZTk2ZTQiIHN0b3Atb3BhY2l0eT0iMSIvPgo8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMmEwZmEiIHN0b3Atb3BhY2l0eT0iMSIvPgogICA8L2xpbmVhckdyYWRpZW50PgoKPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNoYXQwKSIgLz4KPC9zdmc+); $button_top_gradient: #0E96E4; -$button_bottom_gradient: #02A0FA; +$button_bottom_gradient: #02A0FA; // Hover State $button_ie9_gradient_hover: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+PGxpbmVhckdyYWRpZW50IGlkPSJoYXQwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjEwMCUiIHgyPSI1MCUiIHkyPSIwJSI+CjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiMyZGE0ZTkiIHN0b3Atb3BhY2l0eT0iMSIvPgo8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMyMWFlZmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogICA8L2xpbmVhckdyYWRpZW50PgoKPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNoYXQwKSIgLz4KPC9zdmc+); $button_top_gradient_hover: #2DA4E9; -$button_bottom_gradient_hover: #21AEFF; +$button_bottom_gradient_hover: #21AEFF; // Active State $button_ie9_gradient_active: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+PGxpbmVhckdyYWRpZW50IGlkPSJoYXQwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjEwMCUiIHgyPSI1MCUiIHkyPSIwJSI+CjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiMwMzlmZjciIHN0b3Atb3BhY2l0eT0iMSIvPgo8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMzlmZjciIHN0b3Atb3BhY2l0eT0iMSIvPgogICA8L2xpbmVhckdyYWRpZW50PgoKPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNoYXQwKSIgLz4KPC9zdmc+); -$button_top_gradient_active: #039FF7; +$button_top_gradient_active: #039FF7; $button_bottom_gradient_active: #039ff7; // Used in the FAQ @@ -124,7 +126,8 @@ body.lt-ie9 { margin-top: 20px; margin-bottom: 20px; padding: 15px 15px; - width: 274px; + width: 80%; + max-width: 500px; font-size: 32px; line-height: 32px; @@ -140,10 +143,10 @@ body.lt-ie9 { 0 1px 1px $button_box_shadow_color /* drop shadow */, inset 0 -1px 1px $button_box_shadow_inset_color /* inner shadow */; background-image: $button_ie9_gradient_hover; /* gradient fill */ - background-image: -moz-linear-gradient(90deg, $button_top_gradient_hover 0%, $button_bottom_gradient_hover 100%); /* gradient fill */ - background-image: -o-linear-gradient(90deg, $button_top_gradient_hover 0%, $button_bottom_gradient_hover 100%); /* gradient fill */ - background-image: -webkit-linear-gradient(90deg, $button_top_gradient_hover 0%, $button_bottom_gradient_hover 100%); /* gradient fill */ - background-image: linear-gradient(90deg, $button_top_gradient_hover 0%, $button_bottom_gradient_hover 100%); /* gradient fill */ + background-image: -moz-linear-gradient(180deg, $button_top_gradient_hover 0%, $button_bottom_gradient_hover 100%); /* gradient fill */ + background-image: -o-linear-gradient(180deg, $button_top_gradient_hover 0%, $button_bottom_gradient_hover 100%); /* gradient fill */ + background-image: -webkit-linear-gradient(180deg, $button_top_gradient_hover 0%, $button_bottom_gradient_hover 100%); /* gradient fill */ + background-image: linear-gradient(180deg, $button_top_gradient_hover 0%, $button_bottom_gradient_hover 100%); /* gradient fill */ text-decoration: none; } diff --git a/app/views/theme/assets/stylesheets/campaign.css.scss b/app/views/theme/assets/stylesheets/campaign.css.scss index 681b2a28..5477f076 100644 --- a/app/views/theme/assets/stylesheets/campaign.css.scss +++ b/app/views/theme/assets/stylesheets/campaign.css.scss @@ -19,11 +19,28 @@ } } } + + #media { + margin-bottom: 20px; + } + + #video { + position: relative; + padding-bottom: 56.25%; + padding-top: 30px; height: 0; overflow: hidden; + } + + #video iframe, + #video object, + #video embed { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } #video { - float: left; - width: 512px; - height: 385px; background: #fff; -moz-box-shadow: 0 2px 6px rgba(0,0,0,.39); /* drop shadow */ -webkit-box-shadow: 0 2px 6px rgba(0,0,0,.39); /* drop shadow */ @@ -36,12 +53,16 @@ } #image { - float: left; - width: 512px; - height: 385px; + max-width: 100%; + height: auto; + display: inline-block; -moz-box-shadow: 0 2px 6px rgba(0,0,0,.39); /* drop shadow */ -webkit-box-shadow: 0 2px 6px rgba(0,0,0,.39); /* drop shadow */ box-shadow: 0 2px 6px rgba(0,0,0,.39); /* drop shadow */ + img { + max-width: 100%; + height: auto; + } } #reserve_container { @@ -66,9 +87,6 @@ } #backing { - float: left; - width: 392px; - margin: 20px 0 0 34px; ul { margin: 0; @@ -76,10 +94,6 @@ #backers { border-left: none; - padding-left: 0; - ul { - float: left; - } } #days { @@ -114,70 +128,34 @@ body.lt-ie9 { - #progress { + .progress-bar { background-image: none !important; background-color: #1392dc !important; } } - #progress_bg { - overflow: hidden; + .progress { + background-color: #efefef; margin-top: 20px; - float: left; - height: 40px; - -moz-box-shadow: 0 1px 1px rgba(0,0,0,.41); /* drop shadow */ - -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.41); /* drop shadow */ - box-shadow: 0 1px 1px rgba(0,0,0,.41); /* drop shadow */ - -webkit-border-radius: 30px; - -moz-border-radius: 30px; - border-radius: 30px; - width: 383px; - background: #dbdbdb; - - #progress { - height: 40px; - -moz-box-shadow: 0 1px 1px rgba(0,0,0,.59); /* drop shadow */ - -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.59); /* drop shadow */ - box-shadow: 0 1px 1px rgba(0,0,0,.59); /* drop shadow */ - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+PGxpbmVhckdyYWRpZW50IGlkPSJoYXQwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjEwMCUiIHgyPSI1MCUiIHkyPSIwJSI+CjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiMxMzkyZGMiIHN0b3Atb3BhY2l0eT0iMSIvPgo8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwNjlkZjQiIHN0b3Atb3BhY2l0eT0iMSIvPgogICA8L2xpbmVhckdyYWRpZW50PgoKPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNoYXQwKSIgLz4KPC9zdmc+); /* gradient fill */ - background-image: -moz-linear-gradient(90deg, #1392dc 0%, #069df4 100%); /* gradient fill */ - background-image: -o-linear-gradient(90deg, #1392dc 0%, #069df4 100%); /* gradient fill */ - background-image: -webkit-linear-gradient(90deg, #1392dc 0%, #069df4 100%); /* gradient fill */ - background-image: linear-gradient(90deg, #1392dc 0%, #069df4 100%); /* gradient fill */ - -webkit-border-radius: 30px; - -moz-border-radius: 30px; - border-radius: 30px; - min-width: 2%; - width: 100%; - max-width: 100%; - display: inline-block; - } + margin-bottom: 0px; + } - #progress_text { - margin: 0 auto; - width: 100%; - font-size: 14pt; - display: inline-block; - color: white; - text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.37); - text-align: center; - position: relative; - top: -35px; - } + #progress_text { + margin: 0 auto; + width: 100%; + font-size: 14pt; + display: inline-block; + color: white; + text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.37); + text-align: center; + position: relative; + top: -35px; } .small { height: 20px !important; - - #progress { - height: 20px !important; - } } - .share { - margin-left: 100px; - margin-top: 24px; - } } /************************************* @@ -191,22 +169,20 @@ .main_content { .tabbable { width: 100%; - float: left; } - } - .main_content.narrow { - width: 620px; - float: left; + .tab-content { + margin-top: 15px; + } } .rewards_sidebar { - float: right; - width: 280px; background: #f6f6f6; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; + display: inline-block; h3 { margin: 20px 0px 0px 20px; + padding-top: 10px; } ul { margin: 0px; @@ -295,12 +271,9 @@ ul { margin-top: 30px; - float: left; - width: 45%; li { - width: 400px; - margin: 0 49px 30px 0; + margin-bottom: 30px; padding-left: 18px; background: image-url('bullet.png') no-repeat left 8px; diff --git a/app/views/theme/assets/stylesheets/header.css.scss b/app/views/theme/assets/stylesheets/header.css.scss index 518d3869..abdf0a5a 100644 --- a/app/views/theme/assets/stylesheets/header.css.scss +++ b/app/views/theme/assets/stylesheets/header.css.scss @@ -7,18 +7,4 @@ box-shadow: 0 1px 2px rgba(0,0,0,0.29); background: #ffffff; position: relative; - .container { - position: relative; - - h1 { - width: 800px; - } - - .header_link { - position: absolute; - top: 6px; - right: 0px; - } - } - } \ No newline at end of file diff --git a/app/views/theme/assets/stylesheets/homepage.css.scss b/app/views/theme/assets/stylesheets/homepage.css.scss index 13ddb91a..a679a8a9 100644 --- a/app/views/theme/assets/stylesheets/homepage.css.scss +++ b/app/views/theme/assets/stylesheets/homepage.css.scss @@ -30,8 +30,8 @@ img { margin-bottom: 5px; - width: 190px; - height: 143px; + width: 100%; + height: auto; background-color: #cecece; display:block; } diff --git a/app/views/theme/views/_header.html.erb b/app/views/theme/views/_header.html.erb index 7c6c5a71..b12b2e72 100644 --- a/app/views/theme/views/_header.html.erb +++ b/app/views/theme/views/_header.html.erb @@ -1,20 +1,20 @@ \ No newline at end of file diff --git a/app/views/theme/views/campaign.html.erb b/app/views/theme/views/campaign.html.erb index ee25f786..10e2ff48 100644 --- a/app/views/theme/views/campaign.html.erb +++ b/app/views/theme/views/campaign.html.erb @@ -6,105 +6,134 @@

    <%= @campaign.name %>

    -
    - <% if @campaign.media_type == 'video' %> +
    +
    +
    + <% if @campaign.media_type == 'video' %> -
    - <% if @campaign.video_placeholder.file? %> -
    - <%= image_tag @campaign.video_placeholder.url(:main), alt: "video_place_holder" %> -
    - <% if !@campaign.video_embed_id.blank? %> - - <% end %> - <% else %> - <% if !@campaign.video_embed_id.blank? %> - - <% end %> - <% end %> -
    +
    + <% if @campaign.video_placeholder.file? %> +
    + <%= image_tag @campaign.video_placeholder.url(:main), alt: "video_place_holder" %> +
    + <% if !@campaign.video_embed_id.blank? %> + + <% end %> + <% else %> + <% if !@campaign.video_embed_id.blank? %> + + <% end %> + <% end %> +
    + + <% else %> - <% else %> +
    + <%= image_tag @campaign.main_image.url(:main), alt: "project_image" %> +
    -
    - <%= image_tag @campaign.main_image.url(:main), alt: "project_image" %> + <% end %> +
    - <% end %> +
    +
    + +
    + <%# If Goal is Dollars %> + <% if @campaign.goal_type == 'dollars' %> +
    + <%= number_with_delimiter @campaign.number_of_contributions.to_i, :delimiter => "," %> + <%= @campaign.contributor_reference.pluralize(@campaign.number_of_contributions.to_i) %> +
    +
    + <%= number_to_currency @campaign.raised_amount.ceil, :precision => 0 %> + of <%= number_to_currency @campaign.goal_dollars.ceil, :precision => 0 %> +
    -
    -
      + <%# Checking to see if Campaign is Expired %> + <% if !@campaign.expired? %> +
      + <%= distance_of_time_in_words_to_now(@campaign.expiration_date).gsub(/\D/, "") %> + <%= distance_of_time_in_words_to_now(@campaign.expiration_date).gsub(/\d/, "").gsub("about", "") %> left +
      + <% else %> +
      + No + days left! +
      + <% end %> + <%# End Expiration Check %> - <% if @campaign.goal_type == 'dollars' %> -
    • - <%= number_with_delimiter @campaign.number_of_contributions.to_i, :delimiter => "," %> - <%= @campaign.contributor_reference.pluralize(@campaign.number_of_contributions.to_i) %> -
    • -
    • - <%= number_to_currency @campaign.raised_amount.ceil, :precision => 0 %> - of <%= number_to_currency @campaign.goal_dollars.ceil, :precision => 0 %> -
    • - <% else %> -
    • - <%= @campaign.orders %> <%= @campaign.contributor_reference.pluralize(@campaign.orders) %> - of <%= @campaign.goal_orders %> needed -
    • - <% end %> + <% else %> + <%# Else, Goal is in Orders %> +
      + <%= @campaign.orders %> <%= @campaign.contributor_reference.pluralize(@campaign.orders) %> + of <%= @campaign.goal_orders %> needed +
      - <% if !@campaign.expired? %> -
    • - <%= distance_of_time_in_words_to_now(@campaign.expiration_date).gsub(/\D/, "") %> - <%= distance_of_time_in_words_to_now(@campaign.expiration_date).gsub(/\d/, "").gsub("about", "") %> left -
    • - <% else %> -
    • - No - days left! -
    • - <% end %> -
    + <%# Checking to see if Campaign is Expired %> + <% if !@campaign.expired? %> +
    + <%= distance_of_time_in_words_to_now(@campaign.expiration_date).gsub(/\D/, "") %> + <%= distance_of_time_in_words_to_now(@campaign.expiration_date).gsub(/\d/, "").gsub("about", "") %> left +
    + <% else %> +
    + No + days left! +
    + <% end %> + <%# End Expiration Check %> - <% if @campaign.raised_amount < @campaign.goal_dollars %> -
    -
    -
    -
    - <% else %> -
    -
    + <% end %> + <%# End If/Else %>
    -
    <%= @campaign.tilt_percent.ceil %>% <%= @campaign.progress_text %>
    -
    - <% end %> -
    -
    - <% if @campaign.expired? %> - - <%= @campaign.primary_call_to_action_button %> - + <% if @campaign.raised_amount < @campaign.goal_dollars %> +
    +
    + <%= @campaign.tilt_percent.to_i %>% Complete +
    +
    <% else %> - - <%= @campaign.primary_call_to_action_button %> - +
    +
    + 100% Complete (Success!) +
    +
    <%= @campaign.tilt_percent.ceil %>% <%= @campaign.progress_text %>
    +
    <% end %> + +
    +
    + <% if @campaign.expired? %> + + <%= @campaign.primary_call_to_action_button %> + + <% else %> + + <%= @campaign.primary_call_to_action_button %> + + <% end %> +
    +
    + <%= raw(@campaign.primary_call_to_action_description) %> +
    + +
    -
    - <%= raw(@campaign.primary_call_to_action_description) %> -
    -
    -
    -
    -
    @@ -112,69 +141,73 @@
    -
    - <% if @campaign.include_comments %> -
    - -
    -
    - <%= raw(@campaign.main_content) %> -
    -
    -
    -
    - - +
    +
    + <% if @campaign.include_comments %> +
    + +
    +
    + <%= raw(@campaign.main_content) %>
    +
    +
    +
    + + +
    +
    + <% else %> + <%= raw(@campaign.main_content) %> + <% end %> +
    + + <% if @campaign.rewards? %> + <% end %>
    - - <% if @campaign.rewards? %> - - <% end %>
    @@ -201,26 +234,32 @@

    Frequently Asked Questions

    -
      - <% for i in 0...(@campaign.faqs.count/2.0).ceil %> -
    • -
      - <%= @campaign.faqs[i].question %> -

      <%= raw(@campaign.faqs[i].answer.gsub("\n", '
      ')) %>

      -
      -
    • - <% end %> -
    -
      - <% for i in (@campaign.faqs.count/2.0).ceil...@campaign.faqs.count %> -
    • -
      - <%= @campaign.faqs[i].question %> -

      <%= raw(@campaign.faqs[i].answer.gsub("\n", '
      ')) %>

      -
      -
    • - <% end %> -
    +
    +
    +
      + <% for i in 0...(@campaign.faqs.count/2.0).ceil %> +
    • +
      + <%= @campaign.faqs[i].question %> +

      <%= raw(@campaign.faqs[i].answer.gsub("\n", '
      ')) %>

      +
      +
    • + <% end %> +
    +
    +
    +
      + <% for i in (@campaign.faqs.count/2.0).ceil...@campaign.faqs.count %> +
    • +
      + <%= @campaign.faqs[i].question %> +

      <%= raw(@campaign.faqs[i].answer.gsub("\n", '
      ')) %>

      +
      +
    • + <% end %> +
    +
    +
    <% end %> diff --git a/app/views/theme/views/homepage.html.erb b/app/views/theme/views/homepage.html.erb index e7a4b8c1..8e2a3d34 100644 --- a/app/views/theme/views/homepage.html.erb +++ b/app/views/theme/views/homepage.html.erb @@ -6,10 +6,12 @@
    +
    <% if @campaigns.count > 0 %> <% @campaigns.each do |campaign| %> <% if campaign.published_flag %> +
    <% if campaign.media_type == 'video' && !campaign.video_embed_id.blank?%> @@ -35,15 +37,15 @@

    <% if campaign.raised_amount.to_f/100 < campaign.goal_dollars.to_f %> -
    -
    +
    +
    <% else %> -
    <% end %> <% else %> From 032c8ace831589e8e51c653810e6ca6b11f539c6 Mon Sep 17 00:00:00 2001 From: Andy Eblin Date: Tue, 7 Jan 2014 15:03:37 -0800 Subject: [PATCH 2/2] Added max-width:100% height:auto responsive fix for reward images --- app/views/theme/assets/stylesheets/campaign.css.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/theme/assets/stylesheets/campaign.css.scss b/app/views/theme/assets/stylesheets/campaign.css.scss index 5477f076..5f8a3b43 100644 --- a/app/views/theme/assets/stylesheets/campaign.css.scss +++ b/app/views/theme/assets/stylesheets/campaign.css.scss @@ -226,6 +226,10 @@ } &.image { margin-bottom: 12px; + img { + max-width: 100%; + height: auto; + } } &.description { margin-bottom: 12px;