Revision 3523460d
Added by Marc Dequènes over 15 years ago
- ID 3523460d77cf32102dc14d7a9e4b0504652cb41a
app/controllers/view_controller.rb | ||
---|---|---|
class ViewController < ApplicationController
|
||
def set
|
||
@artwork_set = ArtworkSet.find(params[:id])
|
||
end
|
||
end
|
app/views/view/set.rhtml | ||
---|---|---|
<h1><%= sprintf(_("View of set '%s'"), @artwork_set.name) %></h1>
|
||
|
||
<h2><%= _("Groups:") %></h2>
|
||
<p>
|
||
<% @artwork_set.artwork_groups.each do |group| %>
|
||
<%= display_artwork_frame(group.artworks.last, :frame_type => :float, :size => :thumb_small, :force_title => group.name, :display_size => false) %>
|
||
<% end %>
|
||
<br style="clear: both;"/>
|
||
</p>
|
||
|
||
<h2><%= _("Artworks:") %></h2>
|
||
<p>
|
||
<% @artwork_set.artworks.each do |artwork| %>
|
||
<%= display_artwork_frame(artwork, :frame_type => :float, :size => :thumb_small, :display_size => false) %>
|
||
<% end %>
|
||
<br style="clear: both;"/>
|
||
</p>
|
||
|
app/views/view/tree.rhtml | ||
---|---|---|
|
||
<table>
|
||
<% ArtworkSet.find(:all, :order => 'name ASC').each do |set| %>
|
||
<tr><th><%= display_artwork_frame(set.artworks.last, :frame_type => :cell, :size => :thumb_small, :force_title => set.name, :display_size => false) %></th>
|
||
<tr><th><%= link_to(display_artwork_frame(set.artworks.last, :frame_type => :cell, :size => :thumb_small, :force_title => set.name, :display_size => false), :action => 'set', :id => set.id) %></th>
|
||
<% unless set.artwork_groups.empty? %>
|
||
<% set.artwork_groups.each do |group| %>
|
||
<td><%= display_artwork_frame(group.artworks.last, :frame_type => :cell, :size => :thumb_small, :force_title => group.name, :display_size => false) %></td>
|
Also available in: Unified diff
[evol] added set view and linked it from tree view