Browse files

Add option to disable text on front-end.

  • Loading branch information...
1 parent 92fe835 commit 518006eaaf699b10e0fd55ea6da08b66fe7de554 @robyurkowski robyurkowski committed Mar 20, 2012
View
17 app/views/refinery/portfolio/galleries/_gallery.html.erb
@@ -1,11 +1,18 @@
<li id="<%= dom_id(gallery) %>" class="gallery">
<%= link_to refinery.portfolio_gallery_path(gallery) do %>
<% if gallery.cover_image.present? %>
- <div class="image"><%= image_fu gallery.cover_image.image, ::Refinery::Portfolio.cover_image_thumb_size %></div>
+ <div class="image">
+ <%= image_fu gallery.cover_image.image,
+ ::Refinery::Portfolio.cover_image_thumb_size,
+ {:title => gallery.cover_image.title} %>
+ </div>
<% end %>
- <div class="details">
- <h2><%= gallery.title %></h2>
- <%= raw gallery.description %>
- </div>
+
+ <div class="details">
+ <h2><%= gallery.title %></h2>
+ <% if ::Refinery::Portfolio.display_gallery_text %>
+ <%= raw gallery.description %>
+ <% end %>
+ </div>
<% end %>
</li>
View
10 app/views/refinery/portfolio/items/_item.html.erb
@@ -1,2 +1,10 @@
-<li><%= image_tag(item.image.url, {:id => dom_id(item)}) %><div class='label_text'><h2><%= item.title %></h2><p><%= raw item.caption %></p></div></li>
+<li>
+ <%= image_tag(item.image.url, {:id => dom_id(item), :title => item.title}) %>
+ <% if ::Refinery::Portfolio.display_item_text %>
+ <div class='label_text'>
+ <h2><%= item.title %></h2>
+ <p><%= raw item.caption %></p>
+ </div>
+ <% end %>
+</li>
View
11 lib/generators/refinery/portfolio/templates/config/initializers/refinery/portfolio.rb.erb
@@ -1,7 +1,16 @@
Refinery::Portfolio.configure do |config|
+ # How many images should we display in the back end?
# config.items_per_page = <%= Refinery::Portfolio.items_per_page.inspect %>
+
+ # How big should gallery thumbs be?
# config.cover_image_thumb_size = <%= Refinery::Portfolio.cover_image_thumb_size.inspect %>
-
+
# See http://thiagosf.net/projects/jquery/skitter/ for terrible documentation.
# config.skitter_options = <%= Refinery::Portfolio.skitter_options.inspect %>
+
+ # Display image title and description?
+ # config.display_item_text = <%= Refinery::Portfolio.display_item_text.inspect %>
+
+ # Display gallery description?
+ # config.display_gallery_text = <%= Refinery::Portfolio.display_gallery_text.inspect %>
end
View
6 lib/refinery/portfolio/configuration.rb
@@ -2,7 +2,8 @@ module Refinery
module Portfolio
include ActiveSupport::Configurable
- config_accessor :items_per_page, :cover_image_thumb_size, :skitter_options
+ config_accessor :items_per_page, :cover_image_thumb_size, :skitter_options,
+ :display_item_text, :display_gallery_text
self.items_per_page = 20
self.cover_image_thumb_size = '300x200'
@@ -19,5 +20,8 @@ module Portfolio
:numbers_align => :center # Nav placement (left, right, center)
# :structure => "" # Use this to override the HTML if utterly necessary.
}
+
+ self.display_item_text = true
+ self.display_gallery_text = true
end
end

0 comments on commit 518006e

Please sign in to comment.