| + | |
|---|---|
| <%= gettext("Status") %> | +<%= raw( @translate_state.(@summary.state) <> @@ -216,6 +242,7 @@ ) %> |
| <%= gettext("Remaining Time") %> | +<%= round(@summary.time_to_full_charge * 60 * 60) |> Convert.sec_to_str() @@ -235,11 +263,14 @@ |> Enum.join(", ") %> |
| <%= gettext("Expected Finish Time") %> | +<%= formatted_finish_time %> |
| @@ -248,6 +279,7 @@ :rated -> gettext("Range (rated)") end %> | +<%= range = case @settings.preferred_range do @@ -263,9 +295,11 @@ |
| <%= gettext("Range (est.)") %> | +<%= if @settings.unit_of_length == :mi do "#{Convert.km_to_miles(@summary.est_battery_range_km, 1)} mi" @@ -275,25 +309,30 @@ |
| <%= gettext("Charged") %> | +<%= @summary.charge_energy_added %> kWh |
| <%= gettext("Charger Power") %> | +<%= @summary.charger_power %> kW |
| <%= gettext("Scheduled Charging") %> | +<%= tag(:span, data: [date: @summary.scheduled_charging_start_time |> DateTime.to_iso8601()], @@ -303,13 +342,16 @@ |
| <%= gettext("Charge Limit") %> | +<%= @summary.charge_limit_soc %>% |
| <%= gettext("State of Charge") %> | +<%= soc_text %> @@ -352,9 +395,11 @@ |
| <%= gettext("Speed") %> | +<%= if @settings.unit_of_length == :mi do "#{Convert.km_to_miles(@summary.speed, 0)} mph" @@ -364,10 +409,12 @@ |
| <%= gettext("Outside Temperature") %> | +<%= if @settings.unit_of_temperature == :F do "#{Convert.celsius_to_fahrenheit(@summary.outside_temp, 1)} °F" @@ -377,9 +424,11 @@ |
| <%= gettext("Inside Temperature") %> | +<%= if @settings.unit_of_temperature == :F do "#{Convert.celsius_to_fahrenheit(@summary.inside_temp, 1)} °F" @@ -390,9 +439,11 @@ |
| <%= gettext("Mileage") %> | +<%= if @settings.unit_of_length == :mi do "#{Convert.km_to_miles(@summary.odometer, 0)} mi" @@ -402,9 +453,11 @@ |
| <%= gettext("Version") %> | +<%= link(@summary.version, to: @@ -417,7 +470,7 @@ <% end %> |
+
-
+
-
+
@@ -24,7 +26,7 @@
style="height: 250px; position: relative;"
/>
- <%= text_input(:position, "#{@charging_process.id}",
+ <%= text_input(:position, "#{@charging_process.id}",
value:
"#{@charging_process.position.latitude},#{@charging_process.position.longitude}",
phx_hook: "TriggerChange",
@@ -36,9 +38,10 @@
+
<% end %>
-
+
-
+
<%= unless is_nil(@charging_process.charge_energy_added) do %>
<% end %>
-
+
<%= unless is_nil(@charging_process.duration_min) do %>
<% end %>
-
+
-
+
<%= unless is_nil(@charging_process.end_date) do %>
@@ -47,7 +50,7 @@
- <%= content_tag(:span, "–",
+ <%= content_tag(:span, "–",
data: [
start_date: DateTime.to_iso8601(@charging_process.start_date),
end_date: DateTime.to_iso8601(@charging_process.end_date)
@@ -59,22 +62,23 @@
- <%= @charging_process.car.name %>
+ <%= @charging_process.car.name %>
+
<%= Decimal.round(
Decimal.max(
@@ -87,23 +91,24 @@
- <%= @charging_process.duration_min %> min
+ <%= @charging_process.duration_min %> min
+
<%= case @charging_process do
%ChargingProcess{geofence: %GeoFence{name: name}} ->
@@ -126,11 +131,12 @@
<%= label(f, :cost, gettext("Cost"), class: "label") %>
+
@@ -142,6 +148,7 @@ ]) %>
+ +<%= error_tag(f, :cost) %>
+
-
+
-
+
-
+
<%= link(gettext("Back"), to: @redirect_to, class: "button") %>
+
<%= submit(if(is_nil(@notification), do: gettext("Save"), else: @notification.message),
phx_disable_with: gettext("Saving..."),
diff --git a/lib/teslamate_web/live/geofence_live/form.html.heex b/lib/teslamate_web/live/geofence_live/form.html.heex
index 9498c4ed..1f184825 100644
--- a/lib/teslamate_web/live/geofence_live/form.html.heex
+++ b/lib/teslamate_web/live/geofence_live/form.html.heex
@@ -1,7 +1,9 @@
-
+
<%= label class: "label" do
gettext("Name")
end %>
+
<%= label class: "label" do
gettext("Cost")
end %>
+
@@ -74,6 +82,7 @@ ]) %>
+ + <%= if @show_errors do %><%= error_tag(f, :cost_per_unit) %>
<% end %>
<%= label class: "label" do
gettext("Session fee")
end %>
+
@@ -108,15 +119,17 @@
placeholder: "0.00"
) %>
+
<%= if @show_errors do %>
<%= error_tag(f, :session_fee) %>
<% end %>
+
@@ -124,6 +137,7 @@
<%= gettext("Back") %>
+
<%= submit(gettext("Save"),
phx_disable_with: gettext("Saving..."),
@@ -150,13 +164,16 @@
{if @show_modal, do: [phx_window_keyup: "keyup"], else: []}
>
+