Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added poster "tiles" to home page.

  • Loading branch information...
commit 51c930b248b4b013b37c99525c8d2cd46f957d9b 1 parent e0d327a
Todd Mazierski toddmazierski authored
8 app/controllers/home_controller.rb
... ... @@ -1,2 +1,10 @@
1 1 class HomeController < ApplicationController
  2 +
  3 + caches_action :index, :expires_in => 15.minutes
  4 +
  5 + def index
  6 + # TODO: Replace with random poster picker (once more are uploaded).
  7 + @posters = Array.new
  8 + 2.times { @posters += Poster.poster_uploaded }
  9 + end
2 10 end
4 app/uploaders/poster_uploader.rb
@@ -37,6 +37,10 @@ def default_url
37 37 process :resize_to_fit => [240, 300]
38 38 end
39 39
  40 + version :tile, :from_version => :small do
  41 + process :resize_to_fill => [110, 110]
  42 + end
  43 +
40 44 # Add a white list of extensions which are allowed to be uploaded.
41 45 # For images you might use something like this:
42 46 # def extension_white_list
42 app/views/home/index.html.erb
... ... @@ -1,7 +1,43 @@
1 1 <% content_for :title, 'Home' %>
2 2
3 3 <div id="home">
4   - <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>
5   - <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>
6   - <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>
  4 + <div class="row">
  5 +
  6 + <div class="span3">
  7 + <div class="tiles">
  8 + <ul>
  9 + <% @posters[0..11].each do |poster| %>
  10 + <li>
  11 + <%= link_to poster_path(poster) do %>
  12 + <% image_tag poster.poster_url(:tile), :alt => poster.short_title %>
  13 + <% end %>
  14 + </li>
  15 + <% end %>
  16 + </ul>
  17 + </div>
  18 + </div>
  19 +
  20 + <div class="span6">
  21 + <div id="welcome">
  22 + <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>
  23 + <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>
  24 + <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>
  25 + </div>
  26 + </div>
  27 +
  28 + <div class="span3">
  29 + <div class="tiles">
  30 + <ul>
  31 + <% @posters[12..23].each do |poster| %>
  32 + <li>
  33 + <%= link_to poster_path(poster) do %>
  34 + <% image_tag poster.poster_url(:tile), :alt => poster.short_title %>
  35 + <% end %>
  36 + </li>
  37 + <% end %>
  38 + </ul>
  39 + </div>
  40 + </div>
  41 +
  42 + </div>
7 43 </div>

0 comments on commit 51c930b

Please sign in to comment.
Something went wrong with that request. Please try again.