Changeset 1310

Show
Ignore:
Timestamp:
08/02/08 21:37:30 (4 months ago)
Author:
alban
Message:

Affichage de toutes les images avec pagination dans image/list. Affichage des dernieres images modifiees dans l'emission. Refs #15

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/controllers/image_controller.rb

    r1193 r1310  
    22 
    33  def list 
    4     @images = current_user.shows.find(params[:show]).images 
     4    @show = current_user.shows.find(params[:show]) 
     5    @images = @show.images.paginate(:per_page => 10, :page => (params[:page] or 1), :order => 'created_at desc') 
    56  end 
    67 
  • trunk/app/views/show/show.rhtml

    r1308 r1310  
    4646<h3>Images</h3> 
    4747 
    48 <p>Les derniÚres images ajoutées :</p> 
    4948 
    5049<% unless @show.images.empty? %> 
     50  <p>Les derniÚres images modifiées :</p> 
     51 
    5152  <ul class="images"> 
    52     <% for image in @show.images %> 
     53    <% for image in @show.images.find(:all, :order => 'updated_at desc', :limit => 5) %> 
    5354      <li> 
    5455        <%= image_tag image.public_filename(:thumb) %> 
    55         <%= h image.title %> 
     56        <div> 
     57          <%= h image.title %> 
     58          <br/>modifiée <%= format_date(image.updated_at) %> 
     59        </div> 
    5660      </li> 
    5761    <% end %> 
     
    5963<% end %> 
    6064 
    61 <p>Ajouter <%= link_to("une nouvelle image", :controller => "image", :action => "create", :show => @show) %></p> 
     65<div class="actions"> 
     66  <%= link_to "Toutes les images", :controller => "image", :action => "list", :show => @show %> 
     67  <%= link_to("Ajouter une nouvelle image", :controller => "image", :action => "create", :show => @show) %> 
     68</div> 
    6269 
    6370<h3>Statistiques</h3> 
  • trunk/public/stylesheets/screen.css

    r1307 r1310  
    6969#content li.hreview abbr.rating { float: right; margin: 0; border: none; } 
    7070#content li.hreview blockquote.description { margin: 2px 0 6px 56px; padding: 0; line-height: 1.5em; } 
     71#content ul.images li img { float: left; margin-right: 15px; } 
     72#content ul.images li { clear: both; } 
    7173#content #filter { float: right; margin: 0; } 
    7274#content #filter p { margin: 0; }