From 62ba143c3c0b7608dcd41f9604fe35ca22d126b4 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Fri, 20 Oct 2023 16:38:25 +0300 Subject: [PATCH] Remove some search/directions custom css --- app/assets/javascripts/index/directions.js | 4 ++-- app/assets/stylesheets/common.scss | 12 ++---------- app/helpers/geocoder_helper.rb | 2 +- app/views/geocoder/error.html.erb | 2 +- test/controllers/geocoder_controller_test.rb | 2 +- test/helpers/geocoder_helper_test.rb | 12 ++++++------ 6 files changed, 13 insertions(+), 21 deletions(-) diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index c86c8ad02..ef37e73ca 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -244,7 +244,7 @@ OSM.Directions = function (map) { map.removeLayer(polyline); if (reportErrors) { - $("#sidebar_content").html("

" + I18n.t("javascripts.directions.errors.no_route") + "

"); + $("#sidebar_content").html("
" + I18n.t("javascripts.directions.errors.no_route") + "
"); } return; @@ -307,7 +307,7 @@ OSM.Directions = function (map) { var row = $(""); row.append("
"); row.append("" + instruction); - row.append("" + dist); + row.append("" + dist); row.on("click", function () { popup diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index a366a1bc1..4a0352c85 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -638,9 +638,8 @@ header .search_forms, /* Rules for search sidebar */ #sidebar .search_results_entry { - ul li { - cursor: pointer; - &.selected { background: $list-highlight; } + ul li.selected { + background: $list-highlight; } .search_more .loader { @@ -648,11 +647,6 @@ header .search_forms, } } -.search_results_error { - color: #f00; - padding: 10px 20px; -} - /* Rules for routing */ div.direction { @@ -666,8 +660,6 @@ div.direction.i#{$i} { background-position: #{($i)*-20}px 0px; } } td.distance { - color: $darkgrey; - text-align: right; font-size: x-small; } tr.turn { diff --git a/app/helpers/geocoder_helper.rb b/app/helpers/geocoder_helper.rb index 1826b08a4..f819c1ac5 100644 --- a/app/helpers/geocoder_helper.rb +++ b/app/helpers/geocoder_helper.rb @@ -1,6 +1,6 @@ module GeocoderHelper def result_to_html(result) - html_options = { :class => "set_position", :data => {} } + html_options = { :class => "set_position stretched-link", :data => {} } url = if result[:type] && result[:id] url_for(:controller => :browse, :action => result[:type], :id => result[:id]) diff --git a/app/views/geocoder/error.html.erb b/app/views/geocoder/error.html.erb index c4b6f8964..37a2f869e 100644 --- a/app/views/geocoder/error.html.erb +++ b/app/views/geocoder/error.html.erb @@ -1 +1 @@ -

<%= h(@error) %>

+
<%= h(@error) %>
diff --git a/test/controllers/geocoder_controller_test.rb b/test/controllers/geocoder_controller_test.rb index dd740e570..d62eb35b7 100644 --- a/test/controllers/geocoder_controller_test.rb +++ b/test/controllers/geocoder_controller_test.rb @@ -415,6 +415,6 @@ class GeocoderControllerTest < ActionDispatch::IntegrationTest assert_response :success assert_template :error assert_template :layout => nil - assert_select "p.search_results_error", error + assert_select ".alert.alert-danger", error end end diff --git a/test/helpers/geocoder_helper_test.rb b/test/helpers/geocoder_helper_test.rb index e7ef18065..1be1b72a5 100644 --- a/test/helpers/geocoder_helper_test.rb +++ b/test/helpers/geocoder_helper_test.rb @@ -3,21 +3,21 @@ require "test_helper" class GeocoderHelperTest < ActionView::TestCase def test_result_to_html html = result_to_html(:lat => 1.23, :lon => 4.56, :zoom => 16, :name => "Name") - assert_dom_equal 'Name', html + assert_dom_equal 'Name', html html = result_to_html(:lat => 1.23, :lon => 4.56, :zoom => 16, :prefix => "Prefix", :name => "Name") - assert_dom_equal 'Prefix Name', html + assert_dom_equal 'Prefix Name', html html = result_to_html(:lat => 1.23, :lon => 4.56, :zoom => 16, :name => "Name", :suffix => "Suffix") - assert_dom_equal 'Name Suffix', html + assert_dom_equal 'Name Suffix', html html = result_to_html(:lat => 1.23, :lon => 4.56, :zoom => 16, :prefix => "Prefix", :name => "Name", :suffix => "Suffix") - assert_dom_equal 'Prefix Name Suffix', html + assert_dom_equal 'Prefix Name Suffix', html html = result_to_html(:type => "node", :id => 123456, :name => "Name") - assert_dom_equal 'Name', html + assert_dom_equal 'Name', html html = result_to_html(:min_lat => 1.23, :max_lat => 4.56, :min_lon => -1.23, :max_lon => 2.34, :name => "Name") - assert_dom_equal 'NameName