diff options
Diffstat (limited to 'app/views/pdfresources/show.html.erb')
-rw-r--r-- | app/views/pdfresources/show.html.erb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/app/views/pdfresources/show.html.erb b/app/views/pdfresources/show.html.erb index a4e1d04..525e5dd 100644 --- a/app/views/pdfresources/show.html.erb +++ b/app/views/pdfresources/show.html.erb @@ -29,8 +29,20 @@ <p class="text-gray-700"><%= @pdfresource.description %></p> </div> - <%= button_to "Add to basket", '#', - class: "bg-blue-500 hover:bg-blue-600 text-white font-semibold py-2 px-6 rounded-lg" %> + <div class="flex gap-4"> + <%= button_to "Add to basket", '#', + class: "bg-blue-500 hover:bg-blue-600 text-white font-semibold py-2 px-6 rounded-lg" %> + + <% if Current.session.user&.is_admin %> + <%= link_to "Edit", edit_pdfresource_path(@pdfresource), + class: "bg-gray-500 hover:bg-gray-600 text-white font-semibold py-2 px-6 rounded-lg" %> + + <%= button_to "Delete", @pdfresource, + method: :delete, + class: "bg-red-500 hover:bg-red-600 text-white font-semibold py-2 px-6 rounded-lg", + data: { turbo_confirm: "Are you sure you want to delete this resource?" } %> + <% end %> + </div> </div> </div> |