diff --git a/assets/css/app.scss b/assets/css/app.scss index 5b3e9cfd..92603ab4 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -64,3 +64,7 @@ .right-addon select { padding-right: 2rem; } + +.shift-description p:last-child { + margin-bottom: 0; +} diff --git a/assets/js/app.js b/assets/js/app.js index 77095f5d..3af08964 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -58,7 +58,6 @@ import "../node_modules/bootstrap-icons/icons/card-list.svg"; import "../node_modules/bootstrap-icons/icons/file-earmark-spreadsheet.svg"; import "../node_modules/bootstrap-icons/icons/box-arrow-in-left.svg"; import "../node_modules/bootstrap-icons/icons/link.svg"; -import "../node_modules/bootstrap-icons/icons/link-45deg.svg"; // webpack automatically bundles all modules in your // entry points. Those entry points can be configured diff --git a/lib/shift73k_web/live/shift_live/index.html.leex b/lib/shift73k_web/live/shift_live/index.html.leex index 344583c7..5e0191e4 100644 --- a/lib/shift73k_web/live/shift_live/index.html.leex +++ b/lib/shift73k_web/live/shift_live/index.html.leex @@ -35,53 +35,117 @@ -
<%= for day <- Enum.to_list(@date_range) do %> <%= if Date.day_of_week(day, @current_user.week_start_at) == 1 do %>
<% end %> -
+

<%= Calendar.strftime(day, "%A, %b %-d") %> -

+ <% day_shifts = Enum.filter(@shifts, fn s -> s.date == day end) %> <%= if !Enum.empty?(day_shifts) do %> -
- <%= for shift <- day_shifts do %> -
-
-
- <%= format_shift_time(shift.time_start) %> - — - <%= format_shift_time(shift.time_end) %> -
-
<%= shift.time_zone %>
-
-
-
+ + + <%= for shift <- day_shifts do %> + + +
+
+
+ <%= icon_div @socket, "bi-tag", [class: "icon baseline text-muted me-1"] %> <%= shift.subject %> - <%= if shift.location do %> - (<%= shift.location %>) +
+ + + + + + + + + + + + + + + + + + + +
+ <%= icon_div @socket, "bi-hourglass", [class: "icon baseline text-muted"] %> + Hours: + + <%= format_shift_time(shift.time_start) %> + — + <%= format_shift_time(shift.time_end) %> + + Shift length: + (<%= format_shift_length(shift) %>) + + TZ: <%= shift.time_zone %> +
+ <%= 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 %> + <%= text_to_html shift.description %> + <% else %> + none + <% end %> +
+ + <%#= if Roles.can?(@current_user, template, :edit) do %> + <%#= live_patch to: Routes.shift_template_index_path(@socket, :edit, template), class: "btn btn-primary btn-sm text-nowrap" do %> + <%#= icon_div @socket, "bi-pencil", [class: "icon baseline"] %> + <%# Edit %> + <%# end %> + <%# end %> + + <%#= if Roles.can?(@current_user, template, :delete) do %> + <%# %> + <%# end %> + + <%= button to: "#", phx_click: "delete", phx_value_id: shift.id, data: [confirm: "Are you sure?"], class: "btn btn-outline-danger btn-sm text-nowrap" do %> + <%= icon_div @socket, "bi-trash", [class: "icon baseline"] %> + Delete <% end %> -
- <%= if shift.description do %> -
- <%= text_to_html shift.description %> -
- <% end %> -
- <%= link "Delete", to: "#", phx_click: "delete", phx_value_id: shift.id, data: [confirm: "Are you sure?"] %> -
+ + +
- <% end %> -
+ + + + <% end %> + + + + + <% else %> -
Nothing scheduled
+

Nothing scheduled

<% end %> <% end %> -