<%= icon_div @socket, "bi-hourglass", [class: "icon baseline text-muted"] %>
Hours
|
<%= shift.start_time |> Calendar.strftime("%I:%M%P") %>
—
<%=
shift.start_time
|> Time.add((60 * 60 * shift.length_hours) + ((shift.length_minutes || 0) * 60))
|> Calendar.strftime("%I:%M%P")
%>
|
<%= icon_div @socket, "bi-geo", [class: "icon baseline text-muted"] %>
Location
|
<%= if shift.location do %>
<%= shift.location %>
<% else %>
none
<% end %>
|
<%= icon_div @socket, "bi-justify-left", [class: "icon baseline text-muted"] %>
Description
|
<%= if shift.description do %>
<%= shift.description %>
<% else %>
none
<% end %>
|
<%= if Roles.can?(@current_user, shift, :delete) do %>
<%= link to: "#", phx_click: "delete", phx_value_id: shift.id, data: [confirm: "Are you sure?"], class: "btn btn-outline-danger" do %>
<%= icon_div @socket, "bi-trash", [class: "icon baseline", style: "margin-right:0.125rem;"] %>
Delete
<% end %>
<% end %>
<%= if Roles.can?(@current_user, shift, :edit) do %>
<%= live_patch to: Routes.shift_template_index_path(@socket, :edit, shift), class: "btn btn-primary" do %>
<%= icon_div @socket, "bi-pencil", [class: "icon baseline", style: "margin-right:0.125rem;"] %>
Edit
<% end %>
<% end %>