index_live.html.leex 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <button phx-click="trigger_all">Trigger all</button>
  2. <button phx-click="reload_file">Reload file</button>
  3. <%= if @is_local? do %><button phx-click="toggle_form">Display/hide form</button><% end %>
  4. <%= if @display_cs do %>
  5. <%= f = form_for @location_cs, "#", [phx_submit: :add_location] %>
  6. <%= label f, :name %>
  7. <%= text_input f, :name %>
  8. <%= error_tag f, :name %>
  9. <%= label f, :location %>
  10. <%= text_input f, :location %>
  11. <%= error_tag f, :location %>
  12. <%= label f, :booking_page %>
  13. <%= url_input f, :booking_page %>
  14. <%= error_tag f, :booking_page %>
  15. <%= label f, :raw_query %>
  16. <%= url_input f, :raw_query %>
  17. <%= error_tag f, :raw_query %>
  18. <%= submit "send" %>
  19. </form>
  20. <% end %>
  21. <table class="locations-list">
  22. <thead>
  23. <tr><%= VaccinsWeb.LocationComponent.render_table_header() %></tr>
  24. </thead>
  25. <tbody>
  26. <%= for l <- assigns |> locations_by_availability do %>
  27. <tr><%= live_component @socket, VaccinsWeb.LocationComponent, id: l.id, location: l, render_as: :table_row, is_local?: @is_local? %></tr>
  28. <% end %>
  29. </tbody>
  30. </table>