浏览代码

Homogeneize usage of "area" instead of "zone"

theenglishway (time) 4 年之前
父节点
当前提交
5d962d0e90
共有 3 个文件被更改,包括 8 次插入8 次删除
  1. 1 1
      assets/css/app.scss
  2. 4 4
      lib/vaccins_web/live/index.ex
  3. 3 3
      lib/vaccins_web/live/index_live.html.leex

+ 1 - 1
assets/css/app.scss

@@ -128,7 +128,7 @@ ul.slots-list > li ~ li {
   margin-left:  0.5em;
 }
 
-select#zones_filter_zones {
+select#areas_filter_areas {
   height: min-content;
   width: auto;
 }

+ 4 - 4
lib/vaccins_web/live/index.ex

@@ -52,13 +52,13 @@ defmodule VaccinsWeb.IndexLive do
   end
 
   @impl true
-  def handle_event("zones_filter_change", %{"zones_filter" => %{"zones" => zones}}, socket) do
+  def handle_event("areas_filter_change", %{"areas_filter" => %{"areas" => areas}}, socket) do
     {:noreply,
-     socket |> push_patch(to: Routes.index_path(socket, :index, geographic_areas: zones))}
+     socket |> push_patch(to: Routes.index_path(socket, :index, geographic_areas: areas))}
   end
 
-  def handle_event("zones_filter_change", params, socket)
-      when not is_map_key(params, "zones_filter") do
+  def handle_event("areas_filter_change", params, socket)
+      when not is_map_key(params, "areas_filter") do
     {:noreply, socket |> push_patch(to: Routes.index_path(socket, :index))}
   end
 

+ 3 - 3
lib/vaccins_web/live/index_live.html.leex

@@ -60,9 +60,9 @@
   </form>
 <% end %>
 
-<%= f = form_for :zones_filter, "#", [phx_change: :zones_filter_change] %>
-  <%= label f, :zones, "Filtrer par zones" %>
-  <%= multiple_select f, :zones, @all_areas |> Enum.map(& {&1, &1}), selected: @area_filters |> MapSet.to_list %>
+<%= f = form_for :areas_filter, "#", [phx_change: :areas_filter_change] %>
+  <%= label f, :areas, "Filtrer par zone géographique" %>
+  <%= multiple_select f, :areas, @all_areas |> Enum.map(& {&1, &1}), selected: @area_filters |> MapSet.to_list %>
 </form>
 
 <table class="locations-list">