root/app/views/galleries/show.html.erb~ @ 10

Revision 8, 1.2 kB (checked in by falcon, 17 years ago)

Tweaks and upgrades, routes/paginate/etc

Line 
1<div id="Gallery" name="<%= "Gallery_" + @gallery.id.to_s %>" >
2        <h1><%= @gallery.sTitle %></h1>
3
4        <p><%= @gallery.tDescription %></p>
5       
6        <h2>Media:</h2>
7        <p>
8                <% x = 0 %>
9                <span>
10                <% @medias = GalleryMedia.find(:all, :conditions => ["gallery_id = ?", @gallery.id]) %>
11                <% for @media in @medias %>
12                        <a href="<%= url_for_file_column("media", "medianame", "maximum") %>" class="noHighlight"
13                                rel="lightbox[GalleryMedia]"
14                                 title="<%= @media.sTitle.to_s + "<br/><br/>" + @media.tDescription.to_s if (@media.sTitle != nil  && @media.tDescription != nil)%>">
15                                        <img src="<%= url_for_file_column("media", "medianame", "thumb") %>"  />
16                         </a>
17                <% x = x + 1 %>
18                <%= "</span><span>" if x % 4 == 0 %>
19                <% end %>
20                </span>
21        </p>
22       
23        <h2>Files</h2>
24        <p>
25                <% @files = GalleryFiles.find(:all, :conditions => ["gallery_id = ?", @gallery.id]) %>
26                <ul>
27                <% for @file in @files %>
28                        <% fnames = @file.filename.split("/") %>
29                        <li><a href="<%= url_for_file_column("file", "filename") %>">
30                                <%= fnames[fnames.size - 1] %>
31                        </a></li>
32                <% end %>
33                </ul>
34        </p>
35</div>
36<% if logged_in? %>     
37        <%= link_to 'Edit', edit_gallery_path(@gallery) %> |
38        <%= link_to 'Back', galleries_path %>
39<% end %>
40
41
Note: See TracBrowser for help on using the browser.