Sha256: 154df0a7bb5c8be70a65faaf074002e43a2b8228c431b62a12ab609bd841e0e1

Contents?: true

Size: 907 Bytes

Versions: 14

Compression:

Stored size: 907 Bytes

Contents

module Dugway
  module Drops
    class ContactDrop < BaseDrop
      def name
        params[:name] ||= ''
      end

      def email
        params[:email] ||= ''
      end

      def subject
        params[:subject] ||= ''
      end

      def message
        params[:message] ||= ''
      end

      def captcha
        %{<img id="captcha_image" src="https://s3.amazonaws.com/bigcartel/captcha/28e3d1288cbc70c0cd1a2d10845f8e11e1a90d14.png">}
      end

      def recaptcha
        @recaptcha ||= begin
          html = "This site is protected by reCAPTCHA and the Google "
          html += '<a href="https://policies.google.com/privacy">Privacy Policy</a> and '
          html += '<a href="https://policies.google.com/terms">Terms of Service</a> apply.'
          html
        end
      end

      def sent
        request.path == '/contact' && request.post? && errors.blank?
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
dugway-1.0.14 lib/dugway/liquid/drops/contact_drop.rb
dugway-1.0.13 lib/dugway/liquid/drops/contact_drop.rb
dugway-1.0.12 lib/dugway/liquid/drops/contact_drop.rb
dugway-1.0.10 lib/dugway/liquid/drops/contact_drop.rb
dugway-1.0.9 lib/dugway/liquid/drops/contact_drop.rb
dugway-1.0.8 lib/dugway/liquid/drops/contact_drop.rb
dugway-1.0.7 lib/dugway/liquid/drops/contact_drop.rb
dugway-1.0.6 lib/dugway/liquid/drops/contact_drop.rb
dugway-1.0.5 lib/dugway/liquid/drops/contact_drop.rb
dugway-1.0.4 lib/dugway/liquid/drops/contact_drop.rb
dugway-1.0.3 lib/dugway/liquid/drops/contact_drop.rb
dugway-1.0.2 lib/dugway/liquid/drops/contact_drop.rb
dugway-1.0.1 lib/dugway/liquid/drops/contact_drop.rb
dugway-1.0.0 lib/dugway/liquid/drops/contact_drop.rb