Selaa lähdekoodia

Add even more information on remote connection

theenglishway (time) 4 vuotta sitten
vanhempi
commit
5b268997f2

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

@@ -1,6 +1,6 @@
-<button phx-click="trigger_all">Trigger all</button>
-<button phx-click="reload_file">Reload file</button>
-<%= if @is_local? do %><button phx-click="toggle_form">Display/hide form</button><% end %>
+<button phx-click="trigger_all">Tout rafraîchir</button>
+<%= if @is_local? do %><button phx-click="reload_file">Recharger le fichier</button>
+<button phx-click="toggle_form">Montrer le formulaire (ou pas)</button><% end %>
 
 <%= if @display_cs do %>
   <%= f = form_for @location_cs, "#", [phx_submit: :add_location] %>
@@ -26,7 +26,7 @@
 
 <table class="locations-list">
   <thead>
-    <tr><%= VaccinsWeb.LocationComponent.render_table_header() %></tr>
+    <tr><%= VaccinsWeb.LocationComponent.render_table_header(@is_local?) %></tr>
   </thead>
   <tbody>
     <%= for l <- assigns |> locations_by_availability do %>

+ 4 - 6
lib/vaccins_web/live/location_component.ex

@@ -80,11 +80,11 @@ defmodule VaccinsWeb.LocationComponent do
       <td><%= link "Résa.", to: @location.booking_page %></td>
       <td><%= render_slots_before(assigns) %></td>
       <td><%= render_slots_after(assigns) %></td>
-      <td><%= render_action_list(assigns) %></td>
+      <%= if @is_local? do %><td><%= render_action_list(assigns) %></td><% end %>
     """
   end
 
-  def render_table_header(),
+  def render_table_header(is_local?),
     do: ~E"""
       <th>Nom</th>
       <th>Lieu</th>
@@ -93,7 +93,7 @@ defmodule VaccinsWeb.LocationComponent do
       <th>Lien résa</th>
       <th>Slots avant 24h</th>
       <th>Slots après 24h</th>
-      <th>Actions</th>
+      <%= if is_local? do %><th>Actions</th><% end %>
     """
 
   defp render_status(assigns),
@@ -121,9 +121,7 @@ defmodule VaccinsWeb.LocationComponent do
       <ul class="actions-list">
         <li><button phx-click="trigger_query" phx-target="<%= @myself %>">Trigger</button></li>
         <li><a href="<%= @location |> to_json_query %>"><button>Debug</button></a></li>
-        <%= if @is_local? do %>
-          <li><button class="alert-danger" phx-click="delete" phx-target="<%= @myself %>" data-confirm="Etes-vous sur?">Delete</button></li>
-        <% end %>
+        <li><button class="alert-danger" phx-click="delete" phx-target="<%= @myself %>" data-confirm="Etes-vous sur?">Delete</button></li>
       </ul>
     """