From f7d295b41bd068aba80f8ebfdb6a9380e3c7220f Mon Sep 17 00:00:00 2001 From: songtianlun Date: Wed, 22 Jan 2025 14:12:29 +0800 Subject: [PATCH] feat: enhance cities filtering interface - Introduce dropdown menus for region and country selection - Adjust padding on title section for better layout - Update filter navigation structure to improve UX This commit refines the user interface for filtering cities by allowing users to select regions and countries from dropdown menus. The filtering options are now easier to navigate and maintain a consistent aesthetic with adjusted padding for better visual hierarchies. --- app/views/cities/index.html.erb | 139 ++++++++++++++++---------------- 1 file changed, 71 insertions(+), 68 deletions(-) diff --git a/app/views/cities/index.html.erb b/app/views/cities/index.html.erb index 399d8de..ebabcd8 100644 --- a/app/views/cities/index.html.erb +++ b/app/views/cities/index.html.erb @@ -8,13 +8,12 @@
<%= image_tag featured_art.image, class: "w-full h-full object-cover object-center" %> -
<% end %> -
+

@@ -39,83 +38,87 @@

- -
+ +
-
- -
- <%= link_to cities_path, - class: "btn btn-sm #{'btn-primary' unless @current_region} btn-outline" do %> - - - - All Regions - <% end %> - - <% @regions.each do |region| %> - <%= link_to region.name, - cities_path(region: region.slug), - class: "btn btn-sm #{'btn-primary' if @current_region == region} btn-outline" %> - <% end %> -
- - - <% if @current_region %> -
- <%= link_to cities_path(region: @current_region.slug), - class: "btn btn-sm btn-ghost #{'btn-active' unless @current_country}" do %> - All in <%= @current_region.name %> - <% end %> - - <% @current_region.countries.order(:name).each do |country| %> - <%= link_to country.name, - cities_path(region: @current_region.slug, country: country.slug), - class: "btn btn-sm btn-ghost #{'btn-active' if @current_country == country}" %> - <% end %> -
- <% end %> - - - <% if @current_region || @current_country %> -
-
- -
- Showing <%= @cities.count %> <%= 'city'.pluralize(@cities.count) %> - <% if @current_country %> - in <%= @current_country.name %> - <% elsif @current_region %> - in <%= @current_region.name %> - <% end %> -
- -
<%= render partial: 'city', collection: @cities %>