diff options
Diffstat (limited to 'app')
| -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 | 9 |
3 files changed, 18 insertions, 15 deletions
diff --git a/app/views/companies/index.html.slim b/app/views/companies/index.html.slim index 1b35ba7fe..97d70190a 100644 --- a/app/views/companies/index.html.slim +++ b/app/views/companies/index.html.slim @@ -8,8 +8,8 @@ / PageContent .page_content .container-fluid - - if @companies.any? - .row + - if params[:q].present? or @companies.any? + .row.mb-sm .col-lg-5.col-md-6.col-sm-6.col-xs-8 = search_form_for @q, url: line_referential_companies_path(@line_referential), html: {method: :get} do |f| .input-group.search_bar @@ -22,17 +22,18 @@ .col-lg-7.col-md-6.col-sm-6.col-xs-4.text-right = new_pagination @companies - .row.mt-sm + - if @companies.any? + .row .col-lg-12 = table_builder @companies, - { 'Oid' => Proc.new { |n| n.try(:objectid).try(:local_id) }, @companies.human_attribute_name(:name) => 'name', @companies.human_attribute_name(:code) => 'code' }, + { 'Oid' => Proc.new { |n| n.try(:objectid).try(:local_id) }, @companies.human_attribute_name(:name) => 'name' }, [:show, :edit, :delete], [], 'table' = new_pagination @companies, 'pull-right' - - else + - unless @companies.any? .row .col-lg-12 = replacement_msg t('companies.search_no_results') diff --git a/app/views/lines/index.html.slim b/app/views/lines/index.html.slim index e9b8902b4..6e32d9ac1 100644 --- a/app/views/lines/index.html.slim +++ b/app/views/lines/index.html.slim @@ -8,8 +8,8 @@ / PageContent .page_content .container-fluid - - if @lines.any? - .row + - if params[:q].present? or @lines.any? + .row.mb-sm .col-lg-5.col-md-6.col-sm-6.col-xs-8 = search_form_for @q, url: line_referential_lines_path(@line_referential), html: {method: :get} do |f| .input-group.search_bar @@ -22,13 +22,14 @@ .col-lg-7.col-md-6.col-sm-6.col-xs-4.text-right = new_pagination @lines - .row.mt-sm + - if @lines.any? + .row .col-lg-12 = render 'filters' = table_builder @lines, - { 'Oid' => Proc.new { |n| n.objectid.local_id }, @lines.human_attribute_name(:id) => 'id', - @lines.human_attribute_name(:number) => 'number', @lines.human_attribute_name(:name) => 'name', @lines.human_attribute_name(:network) => Proc.new { |n| n.try(:network).try(:name) }, + { 'Oid' => Proc.new { |n| n.objectid.local_id }, + @lines.human_attribute_name(:name) => 'name', @lines.human_attribute_name(:network) => Proc.new { |n| n.try(:network).try(:name) }, @lines.human_attribute_name(:company) => Proc.new { |n| n.try(:company).try(:name) }, @lines.human_attribute_name(:transport_mode) => Proc.new { |n| n.transport_mode.nil? ? '-' : t("enumerize.line.transport_mode.#{n.try(:transport_mode)}") }, @lines.human_attribute_name(:transport_submode) => Proc.new { |n| n.transport_submode.nil? ? '-' : t("enumerize.line.transport_submode.#{n.try(:transport_submode)}") } }, @@ -38,7 +39,7 @@ = new_pagination @lines, 'pull-right' - - else + - unless @lines.any? .row .col-lg-12 = replacement_msg t('referential_lines.search_no_results') diff --git a/app/views/networks/index.html.slim b/app/views/networks/index.html.slim index 89c5d0751..2bc934f61 100644 --- a/app/views/networks/index.html.slim +++ b/app/views/networks/index.html.slim @@ -8,8 +8,8 @@ / PageContent .page_content .container-fluid - - if @networks.any? - .row + - if params[:q].present? or @networks.any? + .row.mb-sm .col-lg-5.col-md-6.col-sm-6.col-xs-8 = search_form_for @q, url: line_referential_networks_path(@line_referential), html: {method: :get} do |f| .input-group.search_bar @@ -22,7 +22,8 @@ .col-lg-7.col-md-6.col-sm-6.col-xs-4.text-right = new_pagination @networks - .row.mt-sm + - if @networks.any? + .row .col-lg-12 = table_builder @networks, { 'Oid' => Proc.new { |n| n.try(:objectid).try(:local_id) }, @networks.human_attribute_name(:name) => 'name' }, @@ -32,7 +33,7 @@ = new_pagination @networks, 'pull-right' - - else + - unless @networks.any? .row .col-lg-12 = replacement_msg t('networks.search_no_results') |
