From: Andy Allan Date: Wed, 20 Dec 2023 18:06:48 +0000 (+0000) Subject: Merge pull request #4284 from grekko/add_user_mute X-Git-Tag: live~1161 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/e1d681db3316673d8c3f26c2b0efc4a1382ddb73?hp=d0ec5d143726daf3f98b0ca8d4f5aab24c897023 Merge pull request #4284 from grekko/add_user_mute Add UserMute to control message visibility --- diff --git a/app/assets/images/key/mapnik/runway.png b/app/assets/images/key/mapnik/runway.png deleted file mode 100644 index c65672806..000000000 Binary files a/app/assets/images/key/mapnik/runway.png and /dev/null differ diff --git a/app/assets/images/key/mapnik/runway11.svg b/app/assets/images/key/mapnik/runway11.svg new file mode 100644 index 000000000..088893c51 --- /dev/null +++ b/app/assets/images/key/mapnik/runway11.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/images/key/mapnik/runway12.svg b/app/assets/images/key/mapnik/runway12.svg new file mode 100644 index 000000000..205a18e4a --- /dev/null +++ b/app/assets/images/key/mapnik/runway12.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/images/key/mapnik/runway13.svg b/app/assets/images/key/mapnik/runway13.svg new file mode 100644 index 000000000..e4d712772 --- /dev/null +++ b/app/assets/images/key/mapnik/runway13.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/images/key/mapnik/runway14.svg b/app/assets/images/key/mapnik/runway14.svg new file mode 100644 index 000000000..dc9958d76 --- /dev/null +++ b/app/assets/images/key/mapnik/runway14.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 6a6e45186..d598d10e3 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -562,16 +562,6 @@ header .search_forms, display: none; } -/* Rules for the map key which appears in the popout sidebar */ - -#mapkey { - .mapkey-table-key img { - display: block; - margin-left: auto; - margin-right: auto; - } -} - /* Rules for search sidebar */ #sidebar .search_results_entry { diff --git a/app/helpers/svg_helper.rb b/app/helpers/svg_helper.rb new file mode 100644 index 000000000..abb512f0d --- /dev/null +++ b/app/helpers/svg_helper.rb @@ -0,0 +1,7 @@ +module SvgHelper + def solid_svg_tag(width, height, fill, **options) + tag.svg :width => width, :height => height, **options do + tag.rect :width => "100%", :height => "100%", :fill => fill + end + end +end diff --git a/app/views/site/key.html.erb b/app/views/site/key.html.erb index 60eff9a44..8b61b92bf 100644 --- a/app/views/site/key.html.erb +++ b/app/views/site/key.html.erb @@ -1,16 +1,16 @@
- +
<% @key.each do |layer_name, layer_data| %> <% layer_data.each do |entry| %> <%= tag.tr :class => "mapkey-table-entry", :data => { :layer => layer_name, :zoom_min => entry["min_zoom"], :zoom_max => entry["max_zoom"] } do %> - - <% end %> diff --git a/config/key.yml b/config/key.yml index 236576333..266279f19 100644 --- a/config/key.yml +++ b/config/key.yml @@ -20,7 +20,10 @@ mapnik: - { min_zoom: 15, name: tram_only, image: tram15.svg } - { min_zoom: 17, name: tram_only, width: 52, height: 2, fill: "#6e6e6e" } - { min_zoom: 12, name: cable, image: cable.png } - - { min_zoom: 11, name: runway, image: runway.png } + - { min_zoom: 11, name: runway, image: runway11.svg } + - { min_zoom: 12, name: runway, image: runway12.svg } + - { min_zoom: 13, name: runway, image: runway13.svg } + - { min_zoom: 14, name: runway, image: runway14.svg } - { min_zoom: 11, name: apron_only, width: 26, height: 10, fill: "#dadae0" } # landcover.mss # administrative boundaries: admin.mss - { name: admin, width: 52, height: 2, fill: "#8d618b88" } @@ -85,29 +88,29 @@ mapnik: - { min_zoom: 15, name: destination, image: destination.png } - { min_zoom: 12, name: construction, image: construction.png } cyclemap: - - { min_zoom: 0, name: motorway, width: 50, height: 3, fill: "#9a9ab1" } + - { min_zoom: 5, name: motorway, width: 50, height: 3, fill: "#9a9ab1" } - { min_zoom: 12, name: motorway, image: motorway12.png } - - { min_zoom: 0, name: trunk, width: 50, height: 2, fill: "#c8d8c8" } + - { min_zoom: 6, name: trunk, width: 50, height: 2, fill: "#c8d8c8" } - { min_zoom: 12, name: trunk, image: trunk12.png } - - { min_zoom: 7, name: primary, width: 50, height: 2, fill: "#d8c8c8" } + - { min_zoom: 8, name: primary, width: 50, height: 2, fill: "#d8c8c8" } - { min_zoom: 12, name: primary, image: primary12.png } - - { min_zoom: 9, name: secondary, width: 50, height: 1, fill: "#dadacc" } + - { min_zoom: 10, name: secondary, width: 50, height: 1, fill: "#dadacc" } - { min_zoom: 12, name: secondary, image: secondary12.png } - { min_zoom: 15, name: pedestrian, image: pedestrian.svg } - { min_zoom: 13, name: track, image: track.png } - { min_zoom: 8, name: cycleway, image: cycleway.png } - { min_zoom: 5, name: cycleway_national, width: 50, height: 2, fill: "#fe0000" } - { min_zoom: 13, name: cycleway_national, width: 50, height: 4, fill: "#ffb3b3" } - - { min_zoom: 5, name: cycleway_regional, width: 50, height: 2, fill: "#b638fb" } + - { min_zoom: 7, name: cycleway_regional, width: 50, height: 2, fill: "#b638fb" } - { min_zoom: 13, name: cycleway_regional, width: 50, height: 4, fill: "#ddb5d9" } - { min_zoom: 8, name: cycleway_local, width: 50, height: 2, fill: "#0100fe" } - { min_zoom: 13, name: cycleway_local, width: 50, height: 4, fill: "#b2b2ff" } - { min_zoom: 13, name: footway, image: footway.svg } - { min_zoom: 7, name: rail, image: rail.png } - { min_zoom: 14, name: rail, image: rail14.png } - - { min_zoom: 9, name: forest, width: 26, height: 10, fill: "#cde1c4" } - - { min_zoom: 10, name: common, width: 26, height: 10, fill: "#bcdd92" } - - { min_zoom: 7, name: lake, width: 26, height: 10, fill: "#b5d0d0" } + - { min_zoom: 9, name: forest, width: 26, height: 10, fill: "#b3d6a4" } + - { min_zoom: 10, name: common, width: 26, height: 10, fill: "#c0de9c" } + - { min_zoom: 1, name: lake, width: 26, height: 10, fill: "#addeff" } - { min_zoom: 14, name: bicycle_shop, image: bicycle_shop.png } - { min_zoom: 14, name: bicycle_parking, image: bicycle_parking.png } - { min_zoom: 16, name: toilets, image: toilets.png }
+ <% if entry["width"] && entry["height"] && entry["fill"] %> - <%= image_tag "data:image/svg+xml,#{u("")}" %> + <%= solid_svg_tag entry["width"], entry["height"], entry["fill"], :class => "d-block mx-auto" %> <% else %> - <%= image_tag "key/#{layer_name}/#{entry['image']}" %> + <%= image_tag "key/#{layer_name}/#{entry['image']}", :class => "d-block mx-auto" %> <% end %> + <%= Array(t(".table.entry.#{entry['name']}")).to_sentence %>