aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorjpl2017-02-02 17:57:25 +0100
committerjpl2017-02-02 17:57:25 +0100
commitf927afeb4fae68dea8bf621136f2708671d0e18e (patch)
tree48d29795e6332284e9a0c8106218201b8ed4a973 /app
parentbf02d526bd98f2e420b3e07fcc98e10b8ef409ce (diff)
downloadchouette-core-f927afeb4fae68dea8bf621136f2708671d0e18e.tar.bz2
Refs #2482: upd/fix for table builder
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/components/_buttons.sass21
-rw-r--r--app/helpers/newapplication_helper.rb18
-rw-r--r--app/views/workbenches/show.html.slim2
3 files changed, 36 insertions, 5 deletions
diff --git a/app/assets/stylesheets/components/_buttons.sass b/app/assets/stylesheets/components/_buttons.sass
index dfce916c7..b57a15994 100644
--- a/app/assets/stylesheets/components/_buttons.sass
+++ b/app/assets/stylesheets/components/_buttons.sass
@@ -61,4 +61,23 @@ table, .table
box-shadow: 0 0 3px rgba($darkgrey, 0.25)
> li > a
- padding: 3px 15px
+ padding: 5px 15px
+
+ > li.delete-action
+
+ > a
+ position: relative
+ margin-top: 11px
+
+ &:before
+ content: ''
+ display: block
+ position: absolute
+ left: 15px
+ right: 15px
+ top: -6px
+ height: 1px
+ background-color: $grey
+
+ .fa:first-child
+ margin-right: 0.5em
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
diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim
index c4b606b32..c5187c939 100644
--- a/app/views/workbenches/show.html.slim
+++ b/app/views/workbenches/show.html.slim
@@ -29,7 +29,7 @@
'Plage de validité' => Proc.new {|w| w.validity_period.nil? ? '-' : t('validity_range', debut: l(w.try(:validity_period).try(:begin), format: :short), end: l(w.try(:validity_period).try(:end), format: :short))},
@wbench_refs.human_attribute_name(:updated_at) => Proc.new {|w| l(w.updated_at, format: :short)},
'Publié le' => ''},
- [:edit],
+ [:show, :edit, :archive, :unarchive, :delete],
'table'
/ Old one