lib/generators/dust/albums/templates/app/views/view_albums/show.html.erb in dust-generators-0.2.3 vs lib/generators/dust/albums/templates/app/views/view_albums/show.html.erb in dust-generators-0.2.4
- old
+ new
@@ -1,20 +1,31 @@
-<% title @album.title %>
-<% heading @album.title %>
-<%= @album.desc %>
+<%% title @<%=parent_singular_name%>.title %>
+<%% heading @<%=parent_singular_name%>.heading %>
-<% content_for :head do -%>
- <%= stylesheet_link_tag 'dust_album' %>
-<% end -%>
+<%% content_for :head do %>
+ <%%= stylesheet_link_tag 'dust_<%=parent_singular_name%>_app' %>
+<%% end -%>
-<%= will_paginate @photos %>
+<%%= @<%=parent_singular_name%>.desc %>
+<%%= will_paginate @<%=child_plural_name%> %>
+
<div id="uploads">
- <% @photos.each do |photo| %>
- <div class="photo">
- <%= link_to image_tag(photo.file.url(:thumb), :alt => photo.title), photo.file.url(:original), :id => 'single_image' %>
+ <%% @<%=child_plural_name%>.each do |<%=child_singular_name%>| %>
+ <div class="<%=child_singular_name%>">
+ <%%= link_to image_tag(<%=child_singular_name%>.file.url(:thumb), :alt => <%=child_singular_name%>.desc), <%=child_singular_name%>.file.url(:large), :class => 'group', :rel => "#{@<%=parent_singular_name%>.title}" %><br />
+ <%%= truncate <%=child_singular_name%>.title, :length => 23 %>
</div>
- <% end -%>
+ <%% end -%>
</div>
<div class="clear"></div>
-<%= will_paginate @photos %>
\ No newline at end of file
+<%%= will_paginate @<%=child_plural_name%> %>
+
+<%% if permitted_to? :manage, :<%=parent_plural_name%> %>
+ <p>
+ <%%= link_to "Manage <%=child_plural_class_name%>", @<%=parent_singular_name%> %> |
+ <%%= link_to "Edit", edit_<%=parent_singular_name%>_path(@<%=parent_singular_name%>) %> |
+ <%%= link_to "Destroy", @<%=parent_singular_name%>, :confirm => 'Are you sure?', :method => :delete %> |
+ <%%= link_to "View All", <%=parent_plural_name%>_path %>
+ </p>
+<%% end %>