aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorteddywing2017-12-18 12:12:18 +0100
committerGitHub2017-12-18 12:12:18 +0100
commit1835256469af5f72ec50d986018554722b3b05cb (patch)
treef7580170910645004365885aaf83d430df1a7aed
parent6f6e60e920c6f16dc3ae580eb97d1abcdb54d2e5 (diff)
parent6d3e500736946404aa6f5f7aa461c04c8d935e11 (diff)
downloadchouette-core-1835256469af5f72ec50d986018554722b3b05cb.tar.bz2
Merge pull request #147 from af83/5300_company_index_action_btn
Fix duplicate link on dropdown menu & label
-rw-r--r--app/decorators/company_decorator.rb9
-rw-r--r--app/views/companies/index.html.slim2
-rw-r--r--app/views/referential_companies/index.html.slim2
3 files changed, 3 insertions, 10 deletions
diff --git a/app/decorators/company_decorator.rb b/app/decorators/company_decorator.rb
index 9416c73ae..50b82d276 100644
--- a/app/decorators/company_decorator.rb
+++ b/app/decorators/company_decorator.rb
@@ -18,13 +18,6 @@ class CompanyDecorator < Draper::Decorator
def action_links
links = []
- if h.policy(Chouette::Company).create?
- links << Link.new(
- content: h.t('companies.actions.new'),
- href: h.new_line_referential_company_path(context[:referential])
- )
- end
-
if h.policy(object).update?
links << Link.new(
content: h.t('companies.actions.edit'),
@@ -37,7 +30,7 @@ class CompanyDecorator < Draper::Decorator
if h.policy(object).destroy?
links << Link.new(
- content: t('companies.actions.destroy'),
+ content: h.destroy_link_content('companies.actions.destroy'),
href: h.line_referential_company_path(
context[:referential],
object
diff --git a/app/views/companies/index.html.slim b/app/views/companies/index.html.slim
index 5d746642f..e031f3776 100644
--- a/app/views/companies/index.html.slim
+++ b/app/views/companies/index.html.slim
@@ -34,7 +34,7 @@
end \
) \
],
- links: [:show, :edit],
+ links: [:show],
cls: 'table has-search'
= new_pagination @companies, 'pull-right'
diff --git a/app/views/referential_companies/index.html.slim b/app/views/referential_companies/index.html.slim
index de0f7de69..07de2bc9d 100644
--- a/app/views/referential_companies/index.html.slim
+++ b/app/views/referential_companies/index.html.slim
@@ -46,7 +46,7 @@
attribute: 'url' \
) \
],
- links: [:show, :edit],
+ links: [:show],
cls: 'table has-search'
= new_pagination @companies, 'pull-right'