diff options
| author | jpl | 2017-08-16 16:52:56 +0200 | 
|---|---|---|
| committer | jpl | 2017-08-16 16:52:56 +0200 | 
| commit | cbb90d47fd539025180efb9d79262a9d4f2674be (patch) | |
| tree | 5c1a32cf92150c9c8ba7056ac369a54308261166 /app/decorators | |
| parent | f4f9f04f41696dd59cc982d8ea7a8ed862536622 (diff) | |
| download | chouette-core-cbb90d47fd539025180efb9d79262a9d4f2674be.tar.bz2 | |
Refs #4256: Fix table_builder link management, adding links to gear menu on imports#index
Diffstat (limited to 'app/decorators')
| -rw-r--r-- | app/decorators/import_decorator.rb | 32 | 
1 files changed, 22 insertions, 10 deletions
diff --git a/app/decorators/import_decorator.rb b/app/decorators/import_decorator.rb index 2cf1defc4..4f621f890 100644 --- a/app/decorators/import_decorator.rb +++ b/app/decorators/import_decorator.rb @@ -6,17 +6,29 @@ class ImportDecorator < Draper::Decorator    def action_links      links = [] -    if h.policy(object).destroy? -      links << Link.new( -        content: t('actions.destroy'), -        href: h.workbench_import_path( -          context[:workbench], -          object -        ), -        method: :delete, -        data: { confirm: h.t('imports.actions.destroy_confirm') } +    links << Link.new( +      content: h.t('imports.actions.show'), +      href: h.workbench_import_path( +        context[:workbench], +        object        ) -    end +    ) + +    links << Link.new( +      content: "Téléch. fichier source", +      href: object.file.url +    ) + +    # if h.policy(object).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') } +    )      links    end  | 
