move more fully to runtime config with release, improved docker build, updated phx liveview js

This commit is contained in:
Adam Piontek 2023-01-28 08:14:32 -05:00
commit 573a1e9cfe
38 changed files with 428 additions and 205 deletions
lib/shift73k_web/live
shift_assign_live
shift_import_live
shift_template_live
user
user_management

View file

@ -1,6 +1,6 @@
defmodule Shift73kWeb.ShiftAssignLive.Index do
use Shift73kWeb, :live_view
import Shift73k, only: [app_time_zone: 0]
import Shift73k, only: [get_app_time_zone: 0]
alias Shift73k.Repo
alias Shift73k.Shifts

View file

@ -127,7 +127,7 @@
disabled: @shift_template.id != @custom_shift.id,
phx_debounce: 250,
list: "tz_list",
placeholder: "Default: #{app_time_zone()}"
placeholder: "Default: #{get_app_time_zone()}"
%>
<datalist id="tz_list">
<%= for tz_name <- Tzdata.zone_list() do %>

View file

@ -33,7 +33,7 @@
<div class="inner-addon left-addon mb-3">
<i class="bi bi-map icon is-left text-muted fs-5"></i>
<%= text_input iimf, :time_zone,
value: Shift73k.app_time_zone(),
value: Shift73k.get_app_time_zone(),
class: @tz_valid && "form-control" || "form-control is-invalid",
phx_debounce: 250,
aria_describedby: "ics-import-tz-error",

View file

@ -1,6 +1,6 @@
defmodule Shift73kWeb.ShiftTemplateLive.FormComponent do
use Shift73kWeb, :live_component
import Shift73k, only: [app_time_zone: 0]
import Shift73k, only: [get_app_time_zone: 0]
alias Shift73k.Shifts.Templates
alias Shift73k.Shifts.Templates.ShiftTemplate

View file

@ -88,7 +88,7 @@
class: input_class(f, :time_zone, "form-control"),
phx_debounce: 250,
list: "tz_list",
placeholder: "Default: #{app_time_zone()}"
placeholder: "Default: #{get_app_time_zone()}"
%>
<datalist id="tz_list">
<%= for tz_name <- Tzdata.zone_list() do %>

View file

@ -1,11 +1,11 @@
defmodule Shift73kWeb.UserLive.ResetPassword do
use Shift73kWeb, :live_view
import Shift73k, only: [get_app_allow_reg: 0]
alias Shift73k.Accounts
alias Shift73k.Accounts.User
@app_vars Application.compile_env(:shift73k, :app_global_vars, allow_registration: :true)
@app_allow_registration @app_vars[:allow_registration]
@impl true
def mount(_params, session, socket) do
@ -41,5 +41,5 @@ defmodule Shift73kWeb.UserLive.ResetPassword do
end
end
def allow_registration, do: @app_allow_registration
def allow_registration, do: get_app_allow_reg()
end

View file

@ -198,7 +198,7 @@ defmodule Shift73kWeb.UserManagementLive.Index do
def dt_out(ndt) do
ndt
|> DateTime.from_naive!(Shift73k.app_time_zone())
|> DateTime.from_naive!(Shift73k.get_app_time_zone())
|> Calendar.strftime("%Y %b %-d, %-I:%M %p")
end
end