diff --git a/app/views/albums/show.html.erb b/app/views/albums/show.html.erb index b892544..6872f10 100644 --- a/app/views/albums/show.html.erb +++ b/app/views/albums/show.html.erb @@ -24,6 +24,7 @@ <% content_for :action_links do %> <% if has_role?("admin") %> +<%= link_to "PDF", album_path(@album, :format => 'pdf') %> |  <%= link_to "Edit album", edit_album_path(@album) %> |  <%= link_to "Edit all photos", edit_multiple_album_photos_path(@album) %> |  <%= link_to "Add photos", upload_album_photos_path(@album) %> diff --git a/app/views/albums/show.pdf.erb b/app/views/albums/show.pdf.erb index 8a40e71..064d7d0 100644 --- a/app/views/albums/show.pdf.erb +++ b/app/views/albums/show.pdf.erb @@ -1,3 +1,3 @@

<%= @album.title %>

-<%= render :partial => @album.photos.find(:all, :limit => 10) %> \ No newline at end of file +<%= render :partial => @album.photos %> \ No newline at end of file diff --git a/app/views/collections/show.html.erb b/app/views/collections/show.html.erb index 02e8724..1765b2e 100644 --- a/app/views/collections/show.html.erb +++ b/app/views/collections/show.html.erb @@ -15,6 +15,7 @@ <% content_for :action_links do %> <% if has_role?("admin") %> +<%= link_to "PDF", collection_path(@collection, :format => 'pdf') %> |  <%= link_to "Edit collection", edit_collection_path(@collection) %> | <%= link_to "New album", new_collection_album_path(@collection) %> <% end %> diff --git a/app/views/collections/show.pdf.erb b/app/views/collections/show.pdf.erb new file mode 100644 index 0000000..6f5b146 --- /dev/null +++ b/app/views/collections/show.pdf.erb @@ -0,0 +1,8 @@ +

<%= h @collection.title %>

+

<%= h @collection.description %>

+ +<% for album in @collection.albums %> +

<%= album.title %>

+

<%= render :partial => album.photos %>

+ +<% end %> \ No newline at end of file diff --git a/app/views/photos/_photo.pdf.erb b/app/views/photos/_photo.pdf.erb index 53a2bf2..1803291 100644 --- a/app/views/photos/_photo.pdf.erb +++ b/app/views/photos/_photo.pdf.erb @@ -1 +1 @@ -<%= image_tag photo.public_path_original %>
\ No newline at end of file +<%= image_tag photo.path_modified_public("single") %>
\ No newline at end of file