aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorjpl2017-03-02 15:28:52 +0100
committerjpl2017-03-02 15:28:52 +0100
commita33b8a193f357224c13a74ae1741a9d9da461946 (patch)
treeb0327d3c66ae42214a3979d401fd808c09a93b37 /app/views
parent1238523513a6699bfdbb7bc1baf63044ed3aab9e (diff)
downloadchouette-core-a33b8a193f357224c13a74ae1741a9d9da461946.tar.bz2
Refs #2704: updating filter/search bars on every instance
Diffstat (limited to 'app/views')
-rw-r--r--app/views/companies/index.html.slim11
-rw-r--r--app/views/lines/index.html.slim13
-rw-r--r--app/views/networks/index.html.slim11
-rw-r--r--app/views/referential_companies/index.html.slim11
-rw-r--r--app/views/referential_lines/show.html.slim12
-rw-r--r--app/views/referential_networks/index.html.slim11
-rw-r--r--app/views/referentials/show.html.slim13
-rw-r--r--app/views/stop_areas/index.html.slim13
-rw-r--r--app/views/workbenches/show.html.slim6
9 files changed, 52 insertions, 49 deletions
diff --git a/app/views/companies/index.html.slim b/app/views/companies/index.html.slim
index 97d70190a..b07696a79 100644
--- a/app/views/companies/index.html.slim
+++ b/app/views/companies/index.html.slim
@@ -10,7 +10,11 @@
.container-fluid
- if params[:q].present? or @companies.any?
.row.mb-sm
- .col-lg-5.col-md-6.col-sm-6.col-xs-8
+ .col-lg-12.text-right
+ = new_pagination @companies
+
+ .row
+ .col-lg-12
= search_form_for @q, url: line_referential_companies_path(@line_referential), html: {method: :get} do |f|
.input-group.search_bar
= f.search_field :name_or_objectid_cont, placeholder: t('.name_or_objectid'), class: 'form-control'
@@ -19,9 +23,6 @@
button.btn.btn-default#search-btn type='submit'
span.fa.fa-search
- .col-lg-7.col-md-6.col-sm-6.col-xs-4.text-right
- = new_pagination @companies
-
- if @companies.any?
.row
.col-lg-12
@@ -29,7 +30,7 @@
{ 'Oid' => Proc.new { |n| n.try(:objectid).try(:local_id) }, @companies.human_attribute_name(:name) => 'name' },
[:show, :edit, :delete],
[],
- 'table'
+ 'table has-search'
= new_pagination @companies, 'pull-right'
diff --git a/app/views/lines/index.html.slim b/app/views/lines/index.html.slim
index 7fa9eb586..8e8a73e1b 100644
--- a/app/views/lines/index.html.slim
+++ b/app/views/lines/index.html.slim
@@ -10,7 +10,11 @@
.container-fluid
- if params[:q].present? or @lines.any?
.row.mb-sm
- .col-lg-5.col-md-6.col-sm-6.col-xs-8
+ .col-lg-12.text-right
+ = new_pagination @lines
+
+ .row
+ .col-lg-12
= search_form_for @q, url: line_referential_lines_path(@line_referential), html: {method: :get} do |f|
.input-group.search_bar
= f.search_field :name_or_objectid_cont, placeholder: t('lines.index.name_or_objectid'), class: 'form-control'
@@ -19,11 +23,6 @@
button.btn.btn-default#search-btn type='submit'
span.fa.fa-search
- .col-lg-7.col-md-6.col-sm-6.col-xs-4.text-right
- = new_pagination @lines
-
- .row
- .col-lg-12
= render 'filters'
- if @lines.any?
@@ -37,7 +36,7 @@
@lines.human_attribute_name(:transport_submode) => Proc.new { |n| n.transport_submode.nil? ? '-' : t("enumerize.line.transport_submode.#{n.try(:transport_submode)}") } },
[:show, :delete],
[],
- 'table'
+ 'table has-filter has-search'
= new_pagination @lines, 'pull-right'
diff --git a/app/views/networks/index.html.slim b/app/views/networks/index.html.slim
index 2bc934f61..d99f612bc 100644
--- a/app/views/networks/index.html.slim
+++ b/app/views/networks/index.html.slim
@@ -10,7 +10,11 @@
.container-fluid
- if params[:q].present? or @networks.any?
.row.mb-sm
- .col-lg-5.col-md-6.col-sm-6.col-xs-8
+ .col-lg-12.text-right
+ = new_pagination @networks
+
+ .row
+ .col-lg-12
= search_form_for @q, url: line_referential_networks_path(@line_referential), html: {method: :get} do |f|
.input-group.search_bar
= f.search_field :name_or_objectid_cont, placeholder: t('.name_or_objectid'), class: 'form-control'
@@ -19,9 +23,6 @@
button.btn.btn-default#search-btn type='submit'
span.fa.fa-search
- .col-lg-7.col-md-6.col-sm-6.col-xs-4.text-right
- = new_pagination @networks
-
- if @networks.any?
.row
.col-lg-12
@@ -29,7 +30,7 @@
{ 'Oid' => Proc.new { |n| n.try(:objectid).try(:local_id) }, @networks.human_attribute_name(:name) => 'name' },
[:show, :edit, :delete],
[],
- 'table'
+ 'table has-search'
= new_pagination @networks, 'pull-right'
diff --git a/app/views/referential_companies/index.html.slim b/app/views/referential_companies/index.html.slim
index 4f6040e5d..3b9f3bb06 100644
--- a/app/views/referential_companies/index.html.slim
+++ b/app/views/referential_companies/index.html.slim
@@ -10,7 +10,11 @@
.container-fluid
- if params[:q].present? or @companies.any?
.row.mb-sm
- .col-lg-5.col-md-6.col-sm-6.col-xs-8
+ .col-lg-12.text-right
+ = new_pagination @companies
+
+ .row
+ .col-lg-12
= search_form_for @q, url: referential_companies_path(@referential), html: {method: :get} do |f|
.input-group.search_bar
= f.text_field :name_or_objectid_cont, placeholder: t('.name_or_objectid'), class: 'form-control'
@@ -19,9 +23,6 @@
button.btn.btn-default#search-btn type="submit"
span.fa.fa-search
- .col-lg-7.col-md-6.col-sm-6.col-xs-4.text-right
- = new_pagination @companies
-
- if @companies.any?
.row
.col-lg-12
@@ -30,7 +31,7 @@
@companies.human_attribute_name(:name) => 'name', @companies.human_attribute_name(:phone) => 'phone', @companies.human_attribute_name(:email) => 'email', @companies.human_attribute_name(:url) => 'url' },
[:show, :edit, :delete],
[],
- 'table'
+ 'table has-search'
= new_pagination @companies, 'pull-right'
diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim
index c0acc6309..4fd1ff9ca 100644
--- a/app/views/referential_lines/show.html.slim
+++ b/app/views/referential_lines/show.html.slim
@@ -46,7 +46,11 @@
.col-lg-12
- if params[:q].present? or @routes.any?
.row.mb-sm
- .col-lg-5.col-md-6.col-sm-6.col-xs-8
+ .col-lg-12.text-right
+ = new_pagination @routes
+
+ .row
+ .col-lg-12
= search_form_for @q, url: referential_line_path(@referential, @line) do |f|
.input-group.search_bar
= f.search_field :name_cont, class: 'form-control', placeholder: "Indiquez un nom d'itinéraire..."
@@ -55,12 +59,10 @@
button.btn.btn-default type='submit'
span.fa.fa-search
- .col-lg-7.col-md-6.col-sm-6.col-xs-4.text-right
- = new_pagination @routes
- if @routes.any?
.row
- .col-lg-12
+ .col-lg-12
= table_builder @routes,
{ @routes.human_attribute_name(:number) => 'number', @routes.human_attribute_name(:name) => 'name',
'Arrêt de départ' => Proc.new{|r| r.try(:stop_points).first.try(:stop_area).try(:name)},
@@ -68,7 +70,7 @@
'Nb arrêts' => Proc.new{|r| r.try(:stop_points).count}, 'Nb missions' => Proc.new{|r| r.try(:journey_patterns).count} },
[:show, :edit, :delete],
[],
- 'table'
+ 'table has-search'
= new_pagination @routes, 'pull-right'
diff --git a/app/views/referential_networks/index.html.slim b/app/views/referential_networks/index.html.slim
index 9619035c4..ba2c5b2c1 100644
--- a/app/views/referential_networks/index.html.slim
+++ b/app/views/referential_networks/index.html.slim
@@ -10,7 +10,11 @@
.container-fluid
- if params[:q].present? or @networks.any?
.row.mb-sm
- .col-lg-5.col-md-6.col-sm-6.col-xs-8
+ .col-lg-12.text-right
+ = new_pagination @networks
+
+ .row
+ .col-lg-12
= search_form_for @q, url: referential_networks_path(@referential), html: {method: :get} do |f|
.input-group.search_bar
= f.text_field :name_or_objectid_cont, placeholder: t('.name_or_objectid'), class: 'form-control'
@@ -19,9 +23,6 @@
button.btn.btn-default#search_btn type="submit"
span.fa.fa-search
- .col-lg-7.col-md-6.col-sm-6.col-xs-4.text-right
- = new_pagination @networks
-
- if @networks.any?
.row
.col-lg-12
@@ -29,7 +30,7 @@
{ 'ID Codif' => Proc.new { |n| n.try(:objectid).try(:local_id) }, @networks.human_attribute_name(:name) => 'name' },
[:show, :edit, :delete],
[],
- 'table'
+ 'table has-search'
= new_pagination @networks, 'pull-right'
diff --git a/app/views/referentials/show.html.slim b/app/views/referentials/show.html.slim
index ff4d3e64b..8f2e7a8fd 100644
--- a/app/views/referentials/show.html.slim
+++ b/app/views/referentials/show.html.slim
@@ -35,7 +35,11 @@
- if params[:q].present? or @reflines.any?
.row.mb-sm
- .col-lg-5.col-md-6.col-sm-6.col-xs-8
+ .col-lg-12.text-right
+ = new_pagination @reflines
+
+ .row
+ .col-lg-12
= search_form_for @q, url: referential_path(@referential.id) do |f|
.input-group.search_bar
= f.search_field :name_cont, class: 'form-control', placeholder: 'Indiquez un nom de ligne'
@@ -44,11 +48,6 @@
button.btn.btn-default type='submit'
span.fa.fa-search
- .col-lg-7.col-md-6.col-sm-6.col-xs-4.text-right
- = new_pagination @reflines
-
- .row
- .col-lg-12
= render 'filters'
- if @reflines.any?
@@ -63,7 +62,7 @@
@reflines.human_attribute_name(:company) => Proc.new { |n| n.try(:company).try(:name) } },
[:show],
[],
- 'table'
+ 'table has-filter has-search'
= new_pagination @reflines, 'pull-right'
diff --git a/app/views/stop_areas/index.html.slim b/app/views/stop_areas/index.html.slim
index 8baa81ab0..4ca3007ed 100644
--- a/app/views/stop_areas/index.html.slim
+++ b/app/views/stop_areas/index.html.slim
@@ -10,7 +10,11 @@
.container-fluid
- if params[:q].present? or @stop_areas.any?
.row.mb-sm
- .col-lg-5.col-md-6.col-sm-6.col-xs-8
+ .col-lg-12.text-right
+ = new_pagination @stop_areas
+
+ .row
+ .col-lg-12
= search_form_for @q, url: stop_area_referential_stop_areas_path(@stop_area_referential), html: {method: :get} do |f|
.input-group.search_bar
= f.search_field :name_or_objectid_cont, placeholder: t('.name_or_objectid'), class: 'form-control'
@@ -19,11 +23,6 @@
button.btn.btn-default#search-btn type='submit'
span.fa.fa-search
- .col-lg-7.col-md-6.col-sm-6.col-xs-4.text-right
- = new_pagination @stop_areas
-
- .row
- .col-lg-12
= render 'filters'
- if @stop_areas.any?
@@ -34,7 +33,7 @@
@stop_areas.human_attribute_name(:city_name) => 'city_name', @stop_areas.human_attribute_name(:area_type) => Proc.new{|s| (s.area_type.nil? ? '-' : t("enumerize.stop_area.area_type.#{s.try(:area_type)}"))} },
[:show, :edit, :delete],
[],
- 'table'
+ 'table has-filter has-search'
= new_pagination @stop_areas, 'pull-right'
diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim
index c5d1da1cc..880b7d20b 100644
--- a/app/views/workbenches/show.html.slim
+++ b/app/views/workbenches/show.html.slim
@@ -13,11 +13,11 @@
.page_content
.container-fluid
- if params[:q].present? or @wbench_refs.any?
- .row.mb-md
+ .row.mb-sm
.col-lg-12.text-right
= new_pagination @wbench_refs
- .row.mb-sm
+ .row
.col-lg-12
= search_form_for @q, url: workbench_path(@workbench.id), builder: SimpleForm::FormBuilder do |f|
.input-group.search_bar
@@ -41,7 +41,7 @@
@wbench_refs.human_attribute_name(:published_at) => ''},
[:show, :edit, :archive, :unarchive, :delete],
[:delete],
- 'table'
+ 'table has-filter has-search'
= new_pagination @wbench_refs, 'pull-right'