diff options
| author | jpl | 2017-03-02 15:28:52 +0100 |
|---|---|---|
| committer | jpl | 2017-03-02 15:28:52 +0100 |
| commit | a33b8a193f357224c13a74ae1741a9d9da461946 (patch) | |
| tree | b0327d3c66ae42214a3979d401fd808c09a93b37 | |
| parent | 1238523513a6699bfdbb7bc1baf63044ed3aab9e (diff) | |
| download | chouette-core-a33b8a193f357224c13a74ae1741a9d9da461946.tar.bz2 | |
Refs #2704: updating filter/search bars on every instance
| -rw-r--r-- | app/assets/stylesheets/components/_forms.sass | 2 | ||||
| -rw-r--r-- | app/assets/stylesheets/components/_tables.sass | 6 | ||||
| -rw-r--r-- | app/views/companies/index.html.slim | 11 | ||||
| -rw-r--r-- | app/views/lines/index.html.slim | 13 | ||||
| -rw-r--r-- | app/views/networks/index.html.slim | 11 | ||||
| -rw-r--r-- | app/views/referential_companies/index.html.slim | 11 | ||||
| -rw-r--r-- | app/views/referential_lines/show.html.slim | 12 | ||||
| -rw-r--r-- | app/views/referential_networks/index.html.slim | 11 | ||||
| -rw-r--r-- | app/views/referentials/show.html.slim | 13 | ||||
| -rw-r--r-- | app/views/stop_areas/index.html.slim | 13 | ||||
| -rw-r--r-- | app/views/workbenches/show.html.slim | 6 |
11 files changed, 59 insertions, 50 deletions
diff --git a/app/assets/stylesheets/components/_forms.sass b/app/assets/stylesheets/components/_forms.sass index 14ede2860..307182082 100644 --- a/app/assets/stylesheets/components/_forms.sass +++ b/app/assets/stylesheets/components/_forms.sass @@ -254,7 +254,7 @@ $cbx-size: 20px display: block position: relative background-color: rgba($grey, 0.15) - padding-right: 167px + padding-right: 185px min-height: 42px border-top: 1px solid #fff diff --git a/app/assets/stylesheets/components/_tables.sass b/app/assets/stylesheets/components/_tables.sass index bfbc4183f..495e27951 100644 --- a/app/assets/stylesheets/components/_tables.sass +++ b/app/assets/stylesheets/components/_tables.sass @@ -8,6 +8,7 @@ font-size: $h2-size font-weight: 700 border-bottom: 2px solid $darkgrey + vertical-align: middle > a position: relative @@ -65,6 +66,11 @@ > td background-color: whitesmoke + &.has-filter, &.has-search + border-top: 2px solid $darkgrey + margin-top: 15px + + // select_toolbox .select_toolbox padding: 10px 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' |
