Permalink
Browse files

Added poster "tiles" to home page.

  • Loading branch information...
1 parent e0d327a commit 51c930b248b4b013b37c99525c8d2cd46f957d9b @toddmazierski toddmazierski committed May 20, 2012
Showing with 51 additions and 3 deletions.
  1. +8 −0 app/controllers/home_controller.rb
  2. +4 −0 app/uploaders/poster_uploader.rb
  3. +39 −3 app/views/home/index.html.erb
@@ -1,2 +1,10 @@
class HomeController < ApplicationController
+
+ caches_action :index, :expires_in => 15.minutes
+
+ def index
+ # TODO: Replace with random poster picker (once more are uploaded).
+ @posters = Array.new
+ 2.times { @posters += Poster.poster_uploaded }
+ end
end
@@ -37,6 +37,10 @@ def default_url
process :resize_to_fit => [240, 300]
end
+ version :tile, :from_version => :small do
+ process :resize_to_fill => [110, 110]
+ end
+
# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
# def extension_white_list
@@ -1,7 +1,43 @@
<% content_for :title, 'Home' %>
<div id="home">
- <p>Welcome to the Buffalo &amp; Erie County Public Library's World War I Poster Collection. The library has held posession of these posters for over 80 years.</p>
- <p>During World War I, the impact of the poster as a means of communication was greater than at any other time during history. The ability of posters to inspire, inform, and persuade combined with vibrant design trends in many of the participating countries to produce thousands of interesting visual works.</p>
- <p>The Library of Congress Prints &amp; Photographs Division makes available online approximately 1,900 posters created between 1914 and 1920. Most relate directly to the war, but some German posters date from the post-war period and illustrate events such as the rise of Bolshevism and Communism, the 1919 General Assembly election and various plebiscites.</p>
+ <div class="row">
+
+ <div class="span3">
+ <div class="tiles">
+ <ul>
+ <% @posters[0..11].each do |poster| %>
+ <li>
+ <%= link_to poster_path(poster) do %>
+ <% image_tag poster.poster_url(:tile), :alt => poster.short_title %>
+ <% end %>
+ </li>
+ <% end %>
+ </ul>
+ </div>
+ </div>
+
+ <div class="span6">
+ <div id="welcome">
+ <p>Welcome to the Buffalo &amp; Erie County Public Library's World War I Poster Collection. The library has held posession of these posters for over 80 years.</p>
+ <p>During World War I, the impact of the poster as a means of communication was greater than at any other time during history. The ability of posters to inspire, inform, and persuade combined with vibrant design trends in many of the participating countries to produce thousands of interesting visual works.</p>
+ <p>The Library of Congress Prints &amp; Photographs Division makes available online approximately 1,900 posters created between 1914 and 1920. Most relate directly to the war, but some German posters date from the post-war period and illustrate events such as the rise of Bolshevism and Communism, the 1919 General Assembly election and various plebiscites.</p>
+ </div>
+ </div>
+
+ <div class="span3">
+ <div class="tiles">
+ <ul>
+ <% @posters[12..23].each do |poster| %>
+ <li>
+ <%= link_to poster_path(poster) do %>
+ <% image_tag poster.poster_url(:tile), :alt => poster.short_title %>
+ <% end %>
+ </li>
+ <% end %>
+ </ul>
+ </div>
+ </div>
+
+ </div>
</div>

0 comments on commit 51c930b

Please sign in to comment.