<p></p>
<p><b>@tomhughes</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5652#discussion_r1970511085">app/views/layouts/_search.html.erb</a>:</p>
<pre style='color:#555'>> + </defs>
+ </svg>
+ </div>
+ <div class="btn-group routing_modes" role="group">
+ <% %w[car bicycle foot]
+ .map { |id| { :id => id, :title => t("site.search.modes.#{id}") } }
+ .sort_by { |mode| mode[:title] }
+ .each do |mode| %>
+ <input type="radio" class="btn-check" name="modes" id="<%= mode[:id] %>" autocomplete="off" disabled>
+ <label class="btn btn-outline-secondary px-2" for="<%= mode[:id] %>" title="<%= mode[:title] %>">
+ <svg class="d-block" width="16" height="16" fill="currentColor">
+ <use href="#icon-<%= mode[:id] %>"></use>
+ </svg>
+ </label>
+ <% end %>
+ </div>
</pre>
<p dir="auto">This goes to the previous discussion about sorting, but the above is far more complicated than it really needs to be, and all so we can put the icons in a different order for different languages which seems quite mad to me.</p>
<p dir="auto">I would just make this a fixed order then we don't need to predefined the icons in a hidden block so that we can sort them.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5652#discussion_r1970513044">app/views/layouts/_search.html.erb</a>:</p>
<pre style='color:#555'>> + <% %w[car bicycle foot]
+ .map { |id| { :id => id, :title => t("site.search.modes.#{id}") } }
+ .sort_by { |mode| mode[:title] }
+ .each do |mode| %>
+ <input type="radio" class="btn-check" name="modes" id="<%= mode[:id] %>" autocomplete="off" disabled>
+ <label class="btn btn-outline-secondary px-2" for="<%= mode[:id] %>" title="<%= mode[:title] %>">
+ <svg class="d-block" width="16" height="16" fill="currentColor">
+ <use href="#icon-<%= mode[:id] %>"></use>
+ </svg>
+ </label>
+ <% end %>
+ </div>
+ <select class="routing_engines form-select py-1 px-2" name="routing_engines">
+ <% %w[fossgis_osrm graphhopper fossgis_valhalla]
+ .map { |id| { :id => id, :title => t("site.search.providers.#{id}") } }
+ .sort_by { |engine| engine[:title] }
</pre>
<p dir="auto">I guess this does need some sort of order to be applied because the order in which the engines are registered is probably not well defined but I'd be inclined to sort by the provider ID rather than the translated name so that the order is consistent across languages.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5652#pullrequestreview-2642410302">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMHUSEGXNTAIRM33AT2RTIQ7AVCNFSM6AAAAABW4RZANOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMNBSGQYTAMZQGI">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLO56LAFMSK5XUA2PPL2RTIQ7A5CNFSM6AAAAABW4RZANOWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTU5P75T4.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5652/review/2642410302</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5652#pullrequestreview-2642410302",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5652#pullrequestreview-2642410302",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>