aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/newapplication_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/newapplication_helper.rb')
-rw-r--r--app/helpers/newapplication_helper.rb18
1 files changed, 15 insertions, 3 deletions
diff --git a/app/helpers/newapplication_helper.rb b/app/helpers/newapplication_helper.rb
index aadfc0b34..eee833562 100644
--- a/app/helpers/newapplication_helper.rb
+++ b/app/helpers/newapplication_helper.rb
@@ -53,7 +53,7 @@ module NewapplicationHelper
end
unless item.class.to_s == 'Calendar' or item.class.to_s == 'Referential'
- if item.respond_to? :current_referential
+ if current_referential
polymorph_url << current_referential
polymorph_url << item.line if item.respond_to? :line
elsif item.respond_to? :referential
@@ -68,10 +68,22 @@ module NewapplicationHelper
if action == :delete
if policy(item).present?
if policy(item).destroy?
- content_tag :li, link_to(t("table.#{action}"), polymorph_url, method: :delete, data: { confirm: 'Etes-vous sûr(e) de vouloir effectuer cette action ?' })
+ content_tag :li, '', class: 'delete-action' do
+ link_to(polymorph_url, method: :delete, data: { confirm: 'Etes-vous sûr(e) de vouloir effectuer cette action ?' }) do
+ txt = t("table.#{action}")
+ pic = content_tag :span, '', class: 'fa fa-trash'
+ pic + txt
+ end
+ end
end
else
- content_tag :li, link_to(t("table.#{action}"), polymorph_url, method: :delete, data: { confirm: 'Etes-vous sûr(e) de vouloir effectuer cette action ?' })
+ content_tag :li, '', class: 'delete-action' do
+ link_to(polymorph_url, method: :delete, data: { confirm: 'Etes-vous sûr(e) de vouloir effectuer cette action ?' }) do
+ txt = t("table.#{action}")
+ pic = content_tag :span, '', class: 'fa fa-trash'
+ pic + txt
+ end
+ end
end
elsif action == :edit