aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert2017-06-23 16:02:40 +0200
committerRobert2017-06-23 16:02:40 +0200
commit673d546c627dcf3f51a29579fd8e4c705d703ef7 (patch)
tree80d781b9f49c328cccd462e7a5108d620bacc243
parent763ba5430c9babc38ef816f9cd3b4abe9b250f88 (diff)
downloadchouette-core-673d546c627dcf3f51a29579fd8e4c705d703ef7.tar.bz2
Fixes: #3478@1h
-rw-r--r--app/decorators/referential_decorator.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/app/decorators/referential_decorator.rb b/app/decorators/referential_decorator.rb
index 9107de0b3..b95b04f9f 100644
--- a/app/decorators/referential_decorator.rb
+++ b/app/decorators/referential_decorator.rb
@@ -17,15 +17,6 @@ class ReferentialDecorator < Draper::Decorator
end
if h.policy(object).edit?
- links << HTMLElement.new(
- :button,
- 'Purger',
- type: 'button',
- data: {
- toggle: 'modal',
- target: '#purgeModal'
- }
- )
if object.archived?
links << Link.new(
@@ -34,6 +25,15 @@ class ReferentialDecorator < Draper::Decorator
method: :put
)
else
+ links << HTMLElement.new(
+ :button,
+ 'Purger',
+ type: 'button',
+ data: {
+ toggle: 'modal',
+ target: '#purgeModal'
+ }
+ )
links << Link.new(
content: h.t('actions.archive'),
href: h.archive_referential_path(object.id),
@@ -42,7 +42,7 @@ class ReferentialDecorator < Draper::Decorator
end
end
- if h.policy(object).destroy?
+ if h.policy(object).destroy? && !object.archived?
links << Link.new(
content: h.destroy_link_content,
href: h.referential_path(object),