diff --git a/app/controllers/galleries_controller.rb b/app/controllers/galleries_controller.rb index 7a047ca..3e40570 100644 --- a/app/controllers/galleries_controller.rb +++ b/app/controllers/galleries_controller.rb @@ -59,9 +59,9 @@ class GalleriesController < ApplicationController end # Hier ausrechnen welche angezeigt werden sollen - @toolbar_elements << {:hicon=>'icon-plus', :text=> I18n.t('fotos.new-fotos'), :path=>new_gallery_foto_path(@gallery)} - @toolbar_elements << {:hicon=>'icon-pencil', :text => I18n.t('common.edit'), :path=>edit_gallery_path(@gallery)} - @toolbar_elements << {:hicon=>'icon-arrow-left', :text=>I18n.t('common.back'), :path=>galleries_path()} + @toolbar_elements << {:hicon=>'icon-plus', :text=> I18n.t('fotos.new-fotos'), :path=>new_gallery_foto_path(@gallery)} if can? :create, @gallery + @toolbar_elements << {:hicon=>'icon-pencil', :text => I18n.t('common.edit'), :path=>edit_gallery_path(@gallery)} if can? :edit, @gallery + @toolbar_elements << {:hicon=>'icon-arrow-left', :text=>I18n.t('common.back'), :path=>galleries_path()} @toolbar_elements << {:hicon => 'icon-remove-circle', :text => I18n.t('common.delete'), :path => gallery_path(@gallery),:confirm=>'Sure?', :method=>:delete} if can? :delete, Gallery respond_to do |format| diff --git a/app/views/galleries/show.html.erb b/app/views/galleries/show.html.erb index c529363..1725938 100644 --- a/app/views/galleries/show.html.erb +++ b/app/views/galleries/show.html.erb @@ -101,7 +101,7 @@ <%= link_to ff_icon('icon-circle-arrow-down').html_safe, f.datei.url, :class=>"btn-small",title: I18n.t('fotos.download')+': '+f.title, rel: 'tooltip' %> <%= link_to ff_icon('icon-remove-circle').html_safe, gallery_foto_path(@gallery, f), - :method => :delete, :class=>"btn-small btn-danger",title: I18n.t('fotos.delete')+': '+f.title, rel: 'tooltip', confirm: I18n.t('fotos.delete')+': '+f.title+', Sicher?'%> + :method => :delete, :class=>"btn-small btn-danger",title: I18n.t('fotos.delete')+': '+f.title, rel: 'tooltip', confirm: I18n.t('fotos.delete')+': '+f.title+', Sicher?' if can?(:delete,f) %>

<% end %>