diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/decorators/import_decorator.rb | 32 | ||||
| -rw-r--r-- | app/views/imports/show.html.slim | 9 |
2 files changed, 9 insertions, 32 deletions
diff --git a/app/decorators/import_decorator.rb b/app/decorators/import_decorator.rb index 440501fc1..58298b7a0 100644 --- a/app/decorators/import_decorator.rb +++ b/app/decorators/import_decorator.rb @@ -15,28 +15,14 @@ class ImportDecorator < AF83::Decorator l.class 'btn btn-primary' end - # def action_links - # policy = h.policy(object) - # links = [] - # - # links << Link.new( - # content: h.t('imports.actions.download'), - # href: object.file.url - # ) - # - # if policy.destroy? - # links << Link.new( - # content: h.destroy_link_content, - # href: h.workbench_import_path( - # context[:workbench], - # object - # ), - # method: :delete, - # data: { confirm: h.t('imports.actions.destroy_confirm') } - # ) - # end - # - # links - # end + with_instance_decorator do |instance_decorator| + instance_decorator.show_action_link do |l| + l.href { h.workbench_import_path(context[:workbench], object) } + end + instance_decorator.action_link secondary: :show do |l| + l.content t('imports.actions.download') + l.href { object.file.url } + end + end end diff --git a/app/views/imports/show.html.slim b/app/views/imports/show.html.slim index cf137867b..e59c0c8f6 100644 --- a/app/views/imports/show.html.slim +++ b/app/views/imports/show.html.slim @@ -1,13 +1,4 @@ - breadcrumb :import, @workbench, @import -- content_for :page_header_content do - .row - .col-lg-12.text-right.mb-sm - - @import.action_links.each do |link| - = link_to link.href, - method: link.method, - data: link.data, - class: 'btn btn-primary' do - = link.content - page_header_content_for @import |
