aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorjpl2016-11-28 17:25:44 +0100
committerjpl2016-11-28 17:25:44 +0100
commit05de27da96fb3cb3fae944403224e7b61535d0a0 (patch)
treeb3e6bcb2135c405d2c48e13385395c69b2b9dd64 /app/views
parentae9f75fb405fc0a61b79ca4862d9f052a1fb4fea (diff)
downloadchouette-core-05de27da96fb3cb3fae944403224e7b61535d0a0.tar.bz2
Refs #2019: updating ref_companies with table_builder, fixing pagination issues on ref_networks
Diffstat (limited to 'app/views')
-rw-r--r--app/views/referential_companies/_companies.html.slim14
-rw-r--r--app/views/referential_companies/_company.html.slim18
-rw-r--r--app/views/referential_companies/index.html.slim9
-rw-r--r--app/views/referential_companies/index.js.slim2
-rw-r--r--app/views/referential_lines/index.html.slim2
-rw-r--r--app/views/referential_networks/_networks.html.slim7
-rw-r--r--app/views/referential_networks/index.html.slim8
-rw-r--r--app/views/referential_networks/index.js.slim2
8 files changed, 26 insertions, 36 deletions
diff --git a/app/views/referential_companies/_companies.html.slim b/app/views/referential_companies/_companies.html.slim
index 0a8c681f2..aadbc7b78 100644
--- a/app/views/referential_companies/_companies.html.slim
+++ b/app/views/referential_companies/_companies.html.slim
@@ -1,9 +1,7 @@
-.page_info
- span.search = t('will_paginate.page_entries_info.search')
- = page_entries_info(@companies)
+= table_builder @companies,
+ { 'Oid' => Proc.new { |n| n.objectid.local_id }, Chouette::Company.human_attribute_name(:name) => 'name', Chouette::Company.human_attribute_name(:code) => 'code' },
+ [:show, :edit, :delete],
+ 'table table-bordered'
-.companies.paginated_content
- = paginated_content(@companies)
-
-.pagination
- = will_paginate @companies, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
+.text-center
+ = will_paginate @companies, container: false, renderer: RemoteBootstrapPaginationLinkRenderer
diff --git a/app/views/referential_companies/_company.html.slim b/app/views/referential_companies/_company.html.slim
deleted file mode 100644
index e6090540d..000000000
--- a/app/views/referential_companies/_company.html.slim
+++ /dev/null
@@ -1,18 +0,0 @@
-#index_item.company.panel.panel-default
- .panel-heading
- .panel-title.clearfix
- span.pull-right
- - if policy(company).update?
- = link_to edit_referential_company_path(@referential, company), class: 'btn btn-default btn-sm' do
- span.fa.fa-pencil
- - if policy(company).destroy?
- = link_to referential_company_path(@referential, company), :method => :delete, :data => {:confirm => t('companies.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do
- span.fa.fa-trash-o
- h5
- = link_to [@referential, company], class: 'preview', title: "#{Chouette::Company.model_name.human.capitalize} #{company.name}" do
- span.name
- = truncate(company.name, length: 20)
- .panel-body
- p
- = company.human_attribute_name('code')
- = company.code
diff --git a/app/views/referential_companies/index.html.slim b/app/views/referential_companies/index.html.slim
index 6af6d7fc8..a47c5242c 100644
--- a/app/views/referential_companies/index.html.slim
+++ b/app/views/referential_companies/index.html.slim
@@ -14,7 +14,16 @@
/ <!-- <a data-toggle="collapse" data-parent="#search" href="#advanced_search"> -->
/ <!-- <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %> -->
/ <!-- </a> -->
+
#companies
+ / = table_builder @companies,
+ / { 'Oid' => Proc.new { |n| n.objectid.local_id }, Chouette::Company.human_attribute_name(:name) => 'name', Chouette::Company.human_attribute_name(:code) => 'code' },
+ / [:show, :edit, :delete],
+ / 'table table-bordered'
+ /
+ / .text-center
+ / = will_paginate @companies, container: false, renderer: RemoteBootstrapPaginationLinkRenderer
+
= render partial: 'companies', object: @companies
- content_for :sidebar do
diff --git a/app/views/referential_companies/index.js.slim b/app/views/referential_companies/index.js.slim
index 3a1739abf..601e2bd08 100644
--- a/app/views/referential_companies/index.js.slim
+++ b/app/views/referential_companies/index.js.slim
@@ -1 +1 @@
-/ | $('#companies').html("= escape_javascript(render('companies'))");
+| $('#companies').html("#{escape_javascript(render('companies'))}");
diff --git a/app/views/referential_lines/index.html.slim b/app/views/referential_lines/index.html.slim
index 9facb1a73..1da5b7e3a 100644
--- a/app/views/referential_lines/index.html.slim
+++ b/app/views/referential_lines/index.html.slim
@@ -13,7 +13,7 @@
- if policy(Chouette::Line).destroy?
#multiple_selection_menu
- h4> = t(".multi_selection")
+ h4 = t(".multi_selection")
.disabled
a.enable href="#"
diff --git a/app/views/referential_networks/_networks.html.slim b/app/views/referential_networks/_networks.html.slim
new file mode 100644
index 000000000..fc462c171
--- /dev/null
+++ b/app/views/referential_networks/_networks.html.slim
@@ -0,0 +1,7 @@
+= table_builder @networks,
+ { 'Oid' => Proc.new { |n| n.objectid.local_id }, Chouette::Network.human_attribute_name(:name) => 'name' },
+ [:show, :edit, :delete],
+ 'table table-bordered'
+
+.text-center
+ = will_paginate @networks, container: false, renderer: RemoteBootstrapPaginationLinkRenderer
diff --git a/app/views/referential_networks/index.html.slim b/app/views/referential_networks/index.html.slim
index a550ac7af..b39a1fd01 100644
--- a/app/views/referential_networks/index.html.slim
+++ b/app/views/referential_networks/index.html.slim
@@ -14,13 +14,7 @@
/ <!-- </a> -->
#networks
- = table_builder @networks,
- { 'Oid' => Proc.new { |n| n.objectid.local_id }, Chouette::Network.human_attribute_name(:name) => 'name' },
- [:show, :edit, :delete],
- 'table table-bordered'
-
- .text-center
- = will_paginate @networks, container: false, renderer: RemoteBootstrapPaginationLinkRenderer
+ = render partial: 'networks', object: @networks
- content_for :sidebar do
ul.actions
diff --git a/app/views/referential_networks/index.js.slim b/app/views/referential_networks/index.js.slim
index 930880dfa..3302a0f2e 100644
--- a/app/views/referential_networks/index.js.slim
+++ b/app/views/referential_networks/index.js.slim
@@ -1 +1 @@
-| $('#networks').html("#{escape_javascript(render('networks'))}"); \ No newline at end of file
+| $('#networks').html("#{escape_javascript(render('networks'))}");