Revision 2e9b8af0
Added by Marc Dequènes over 15 years ago
- ID 2e9b8af06f26816ec635ea9d23977419014262f3
app/controllers/view_controller.rb | ||
---|---|---|
def set
|
||
@artwork_set = ArtworkSet.find(params[:id])
|
||
end
|
||
|
||
def group
|
||
@artwork_group = ArtworkGroup.find(params[:id])
|
||
end
|
||
end
|
app/views/view/group.rhtml | ||
---|---|---|
<h1><%= sprintf(_("View of group '%s'"), @artwork_group.name) %></h1>
|
||
|
||
<p>
|
||
<%= sprintf(_("This group is part of the '%s' set"), link_to(@artwork_group.artwork_set.name, :action => 'set', :id => @artwork_group.artwork_set.id)) %>
|
||
</p>
|
||
|
||
<h2><%= _("Artworks:") %></h2>
|
||
<p>
|
||
<% @artwork_group.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/set.rhtml | ||
---|---|---|
<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) %>
|
||
<%= link_to(display_artwork_frame(group.artworks.last, :frame_type => :float, :size => :thumb_small, :force_title => group.name, :display_size => false), :action => 'group', :id => group.id) %>
|
||
<% end %>
|
||
<br style="clear: both;"/>
|
||
</p>
|
app/views/view/tree.rhtml | ||
---|---|---|
<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>
|
||
<td><%= link_to(display_artwork_frame(group.artworks.last, :frame_type => :cell, :size => :thumb_small, :force_title => group.name, :display_size => false), :action => 'group', :id => group.id) %></td>
|
||
<% end %>
|
||
<% end %>
|
||
</tr>
|
Also available in: Unified diff
[evol] added group view and linked it from the tree and set views