aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/companies
diff options
context:
space:
mode:
authorLuc Donnet2016-10-12 23:06:15 +0200
committerLuc Donnet2016-10-12 23:06:15 +0200
commit56e6b5146aca41563b8e64ce95a7cd183fe80b13 (patch)
treed3a845d76419a77fafbda66b9bf08f5379ce1ca5 /app/views/companies
parentc2403fa61c0639d2165af57e6db993a429ae5984 (diff)
parentd66abf8f9b58ddeeabc4e53e8ed1fd382b9f1907 (diff)
downloadchouette-core-56e6b5146aca41563b8e64ce95a7cd183fe80b13.tar.bz2
Merge branch 'master' into staging
Diffstat (limited to 'app/views/companies')
-rw-r--r--app/views/companies/_companies.html.slim11
-rw-r--r--app/views/companies/index.html.slim7
-rw-r--r--app/views/companies/show.html.slim21
3 files changed, 23 insertions, 16 deletions
diff --git a/app/views/companies/_companies.html.slim b/app/views/companies/_companies.html.slim
index bcd471cc7..a83b3bada 100644
--- a/app/views/companies/_companies.html.slim
+++ b/app/views/companies/_companies.html.slim
@@ -1,9 +1,12 @@
.page_info
span.search = t('will_paginate.page_entries_info.search')
- = page_entries_info(@companies)
+ = page_entries_info @companies
-.companies.paginated_content
- = paginated_content(@companies)
+.companies.paginated_content style="margin-top:20px;"
+ = table_builder CompanyDecorator.decorate_collection(@companies),
+ [:name, :edited_at, :published_at, :validity_period, :linecount, :transporter, :status],
+ ["show", "delete"],
+ 'table table-bordered'
.pagination
- = will_paginate @companies, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer \ No newline at end of file
+ = will_paginate @companies, container: false, renderer: RemoteBootstrapPaginationLinkRenderer
diff --git a/app/views/companies/index.html.slim b/app/views/companies/index.html.slim
index bf295dee7..1b616a6c8 100644
--- a/app/views/companies/index.html.slim
+++ b/app/views/companies/index.html.slim
@@ -20,6 +20,7 @@
- content_for :sidebar do
ul.actions
- li
- = link_to t('companies.actions.new'), new_line_referential_company_path(@line_referential), class: 'add'
- br \ No newline at end of file
+ - if policy(Chouette::Company).create?
+ li
+ = link_to t('companies.actions.new'), new_line_referential_company_path(@line_referential), class: 'add'
+ br
diff --git a/app/views/companies/show.html.slim b/app/views/companies/show.html.slim
index 693cea352..1c244a53a 100644
--- a/app/views/companies/show.html.slim
+++ b/app/views/companies/show.html.slim
@@ -44,12 +44,15 @@
- content_for :sidebar do
ul.actions
- li
- = link_to t('companies.actions.new'), new_line_referential_company_path(@line_referential), class: 'add'
- li
- = link_to t('companies.actions.edit'), edit_line_referential_company_path(@line_referential, @company), class: 'edit'
- li
- = link_to t('companies.actions.destroy'), line_referential_company_path(@line_referential, @company), :method => :delete, :data => {:confirm => t('companies.actions.destroy_confirm')}, class: 'remove'
- br
-
- = creation_tag(@company) \ No newline at end of file
+ - if policy(Chouette::Company).create?
+ li
+ = link_to t('companies.actions.new'), new_line_referential_company_path(@line_referential), class: 'add'
+ - if policy(@company).update?
+ li
+ = link_to t('companies.actions.edit'), edit_line_referential_company_path(@line_referential, @company), class: 'edit'
+ - if policy(@company).destroy?
+ li
+ = link_to t('companies.actions.destroy'), line_referential_company_path(@line_referential, @company), :method => :delete, :data => {:confirm => t('companies.actions.destroy_confirm')}, class: 'remove'
+ br
+
+ = creation_tag(@company)