VRFS-1193 fixed landing page promo buzz image display

This commit is contained in:
Jonathan Kolyer 2014-02-20 09:07:59 -06:00
parent b8a4b823d0
commit d831cae7c7
4 changed files with 25 additions and 1 deletions

View File

@ -50,6 +50,7 @@ gem 'filepicker-rails', '0.1.0'
gem 'aws-sdk', '1.29.1'
gem 'aasm', '3.0.16'
gem 'carrierwave'
gem 'carrierwave_direct'
gem 'fog'
gem 'haml-rails'
gem 'unf' #optional fog dependency

View File

@ -0,0 +1,20 @@
# encoding: utf-8
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWaveDirect::Uploader
include CarrierWave::MimeTypes
process :set_content_type
def initialize(*)
super
JamRuby::UploaderConfiguration.set_aws_public_configuration(self)
end
# Add a white list of extensions which are allowed to be uploaded.
def extension_white_list
%w(jpg jpeg gif png)
end
end

View File

@ -1,7 +1,7 @@
<!-- buzz item -->
<%= content_tag(:div, :class => "buzz-item small", :data => { :buzz_item => buzz_item.id}) do %>
<%= content_tag(:div, image_tag(buzz_item.image), :class => "avatar_large mr20") %>
<%= content_tag(:div, image_tag(buzz_item.image_url, :size => '54x54'), :class => "avatar_large mr20") %>
<%= content_tag(:div, buzz_item.text_long, :class => "buzz-item-text") %>
<%= content_tag(:div, "--#{buzz_item.text_short}", :class => "right", :style => "margin-top:6px;") %>
<%= content_tag(:div, nil, :class => "clearall") %>

View File

@ -0,0 +1,3 @@
class JamRuby::PromoBuzz < JamRuby::Promotional
mount_uploader :image, ImageUploader
end