Files
archived-hipudding-teslamate/lib/teslamate_web/live/geofence_live/index.html.heex
JakobLichterfeld 2a922e321c feat: update to Phoenix HTML 4.1, bump dependencies (#4277)
* feat: update to Phenix HTML 4.1

* fix: updating to the new Gettext.Backend approach

* chore: update pot files ro locale version 45.0.0

* fix: downgrade cloack back to 1.1.2

* revert: merge of mix.lock

* fix: new syntax for field name generation for phx-feedback-for

* Revert "fix: new syntax for field name generation for phx-feedback-for"

This reverts commit 4d95e4f1c9367d2d5c606ced2190ab23edcb971b.

* fix: downgrade floki back to 0.35.2

* Revert "fix: downgrade floki back to 0.35.2"

This reverts commit a4f0b6bf4b32099d89003c3d20f72333d510e109.

* fix: ensure floki nil is handled

* style: linter findings

* Revert "fix: ensure floki nil is handled"

* fix: new syntax for field name generation for phx-feedback-for

* debug: floki paramter error

* Revert "debug: floki paramter error"

This reverts commit 61920267edf5186b593920bde7d87e8b30af55aa.

* fix: Remove unnecessary code in settings_test.exs which breaks floki 0.36+
2024-10-27 08:17:49 +01:00

73 lines
2.5 KiB
Plaintext

<nav class="breadcrumb" aria-label="breadcrumbs">
<ul>
<li><.link navigate={~p"/"}><%= gettext("Home") %></.link></li>
<li class="is-active">
<.link navigate={~p"/geo-fences"}><%= gettext("Geo-Fences") %></.link>
</li>
</ul>
</nav>
<.link
navigate={Routes.live_path(@socket, TeslaMateWeb.GeoFenceLive.Form)}
class="button is-info is-small is-rounded is-pulled-right mb-4"
>
<span><%= gettext("Create") %></span>
<span class="icon">
<span class="mdi mdi-plus"></span>
</span>
</.link>
<table class="table is-fullwidth">
<thead class="is-hidden-mobile">
<tr>
<th><%= gettext("Name") %></th>
<th><%= gettext("Position") %></th>
<th><%= gettext("Radius") %></th>
<th></th>
</tr>
</thead>
<tbody style="font-variant-numeric: tabular-nums;">
<%= for geofence <- @geofences do %>
<tr>
<td class="has-text-weight-medium is-truncated" style="min-width: 0; max-width: 180px">
<%= geofence.name %>
</td>
<td class="is-hidden-mobile has-text-weight-light" style="width: 30%">
<%= geofence.latitude %>, <%= geofence.longitude %>
</td>
<td class="is-hidden-mobile has-text-weight-light" style="width: 10%">
<%= case @unit_of_length do
:ft -> geofence.radius |> Convert.m_to_ft() |> round()
:m -> geofence.radius |> round()
end %> <%= @unit_of_length %>
</td>
<td>
<div class="field is-grouped is-pulled-right">
<p class="control">
<.link
navigate={Routes.live_path(@socket, TeslaMateWeb.GeoFenceLive.Form, geofence, [])}
class="button is-info is-small is-inverted is-light"
>
<span class="icon"><span class="mdi mdi-square-edit-outline"></span></span>
</.link>
</p>
<p class="control">
<%= link(raw("<span class='icon'><span class='mdi mdi-trash-can'></span></span>"),
to: "#",
phx_hook: "ConfirmGeoFenceDeletion",
data: [
id: geofence.id,
msg: gettext("Delete '%{geo_fence}'?", geo_fence: geofence.name)
],
type: "button",
id: "delete_#{geofence.id}",
class: "button is-danger is-small is-inverted is-light"
) %>
</p>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>