<%= icon_div @socket, "bi-calendar2-plus", [class: "icon baseline"] %> Assign Shift To Dates

<%= form_for :template_select, "#", [phx_change: "change-selected-template"], fn sts -> %> <%= label sts, :template, "Select shift template to assign to dates", class: "form-label" %> <%= select sts, :template, @shift_templates, value: @shift_template && @shift_template.id || (@shift_template_options |> hd() |> elem(1)), class: "form-select" %> <% end %>
" id="#templateDetailsCol" phx-hook="BsCollapse">
<%= form_for @shift_template_changeset, "#", [phx_change: "validate-shift-template"], fn stf -> %>
<%= label stf, :subject, "Subject/Title", class: "form-label" %>
<%= icon_div @socket, "bi-tag", [class: "icon is-left text-muted fs-5"] %> <%= text_input stf, :subject, value: input_value(stf, :subject), class: input_class(stf, :subject, "form-control"), phx_debounce: 250, disabled: @shift_template.id != @custom_shift.id, aria_describedby: error_ids(stf, :subject) %> <%= error_tag stf, :subject %>
<%= label stf, :time_start, "Start", class: "form-label" %> <%= time_input stf, :time_start, precision: :minute, value: input_value(stf, :time_start), class: input_class(stf, :time_start, "form-control"), disabled: @shift_template.id != @custom_shift.id, aria_describedby: error_ids(stf, :time_start) %>
<%= label stf, :time_end, "End", class: "form-label" %> <%= time_input stf, :time_end, precision: :minute, value: input_value(stf, :time_end), class: input_class(stf, :time_end, "form-control"), disabled: @shift_template.id != @custom_shift.id, aria_describedby: error_ids(stf, :time_end) %>
Shift length: <%= @shift_length %>
<%= error_tag stf, :time_start %>
<%= error_tag stf, :time_end %>
<%= label stf, :location, class: "form-label" %>
<%= icon_div @socket, "bi-geo", [class: "icon is-left text-muted fs-5"] %> <%= text_input stf, :location, value: input_value(stf, :location), class: input_class(stf, :location, "form-control"), phx_debounce: 250, disabled: @shift_template.id != @custom_shift.id, aria_describedby: error_ids(stf, :location) %> <%= error_tag stf, :location %>
<%= label stf, :time_zone, class: "form-label" %>
<%= icon_div @socket, "bi-map", [class: "icon is-left text-muted fs-5"] %> <%= text_input stf, :time_zone, value: input_value(stf, :time_zone), class: input_class(stf, :time_zone, "form-control"), disabled: @shift_template.id != @custom_shift.id, phx_debounce: 250, list: "tz_list" %> <%= for tz_name <- Timex.timezones() do %> <% end %> end <%= if @shift_template.id == @custom_shift.id do %>
Type to search & select from list of known <%= link "IANA tz database", to: "https://en.wikipedia.org/wiki/List_of_tz_database_time_zones", target: "_blank" %> time zones
<% end %> <%= error_tag stf, :time_zone %>
<%= label stf, :description, class: "form-label" %>
<%= textarea stf, :description, value: input_value(stf, :description), class: input_class(stf, :description, "form-control"), disabled: @shift_template.id != @custom_shift.id, phx_debounce: 250, aria_describedby: error_ids(stf, :description) %> <%= error_tag stf, :description %>
<% end %>
<%# month navigation %>

<%= Timex.format!(@cursor_date, "{Mfull} {YYYY}") %>

<%# calendar month table display %> <%= for {day_name, _i} <- Enum.with_index(@day_names) do %> <% end %> <%= for week <- @week_rows do %> <%= for day <- week do %> <%# day |> NaiveDateTime.to_date() |> IO.inspect() %> <% end %> <% end %>
<%= day_name %>
<%= Timex.format!(day, "{0D}") %><%= if day.month != @cursor_date.month, do: "-#{Timex.format!(day, "{Mshort}")}" %>