diff --git a/lib/shift73k_web/live/shift_template_live/delete_component.html.heex b/lib/shift73k_web/live/shift_template_live/delete_component.html.heex new file mode 100644 index 00000000..a2cf1369 --- /dev/null +++ b/lib/shift73k_web/live/shift_template_live/delete_component.html.heex @@ -0,0 +1,23 @@ +
+ + + + +
diff --git a/lib/shift73k_web/live/shift_template_live/delete_component.html.leex b/lib/shift73k_web/live/shift_template_live/delete_component.html.leex deleted file mode 100644 index 8c121a75..00000000 --- a/lib/shift73k_web/live/shift_template_live/delete_component.html.leex +++ /dev/null @@ -1,19 +0,0 @@ - - diff --git a/lib/shift73k_web/live/shift_template_live/form_component.html.heex b/lib/shift73k_web/live/shift_template_live/form_component.html.heex new file mode 100644 index 00000000..a2ce3b52 --- /dev/null +++ b/lib/shift73k_web/live/shift_template_live/form_component.html.heex @@ -0,0 +1,123 @@ +
+ + <%= form_for @changeset, "#", [ + id: "shift_template-form", + phx_target: @myself, + phx_change: "validate", + phx_submit: "save" + ], fn f -> %> + + + + + <% end %> + +
diff --git a/lib/shift73k_web/live/shift_template_live/form_component.html.leex b/lib/shift73k_web/live/shift_template_live/form_component.html.leex deleted file mode 100644 index d6d10a87..00000000 --- a/lib/shift73k_web/live/shift_template_live/form_component.html.leex +++ /dev/null @@ -1,116 +0,0 @@ -<%= f = form_for @changeset, "#", - id: "shift_template-form", - phx_target: @myself, - phx_change: "validate", - phx_submit: "save" %> - - - - - diff --git a/lib/shift73k_web/live/shift_template_live/index.html.leex b/lib/shift73k_web/live/shift_template_live/index.html.heex similarity index 70% rename from lib/shift73k_web/live/shift_template_live/index.html.leex rename to lib/shift73k_web/live/shift_template_live/index.html.heex index bd4c1b1b..45faa445 100644 --- a/lib/shift73k_web/live/shift_template_live/index.html.leex +++ b/lib/shift73k_web/live/shift_template_live/index.html.heex @@ -20,12 +20,10 @@

- <%= icon_div @socket, "bi-clock-history", [class: "icon baseline"] %> - My Shift Templates + My Shift Templates

<%= live_patch to: Routes.shift_template_index_path(@socket, :new), class: "btn btn-primary" do %> - <%= icon_div @socket, "bi-plus-circle-dotted", [class: "icon baseline"] %> - New Shift Template + New Shift Template <% end %>
@@ -39,13 +37,13 @@
Subject: - <%= icon_div @socket, "bi-tag", [class: "icon baseline me-1"] %> +
<%= template.subject %>
- <%= if template.id == @current_user.fave_shift_template_id do %> - <%= icon_div @socket, "bi-star-fill", [class: "icon baseline text-primary align-self-start ms-2"], [role: "img", aria_hidden: false, aria_label: "Unset as favorite", phx_click: "unset-user-fave-shift-template", class: "cursor-pointer"] %> - <% else %> - <%= icon_div @socket, "bi-star", [class: "icon baseline text-primary align-self-start ms-2"], [role: "img", aria_hidden: false, aria_label: "Set as favorite", phx_click: "set-user-fave-shift-template", phx_value_id: template.id, class: "cursor-pointer"] %> - <% end %> + <% fav_icon_data = if template.id == @current_user.fave_shift_template_id, do: + {"bi-star-fill", "Unset as favorite", "unset-user-fave-shift-template"}, else: + {"bi-star", "Set as favorite", "set-user-fave-shift-template"} + %> +
@@ -53,7 +51,7 @@ - <%= icon_div @socket, "bi-hourglass", [class: "icon baseline text-muted"] %> + Hours: @@ -70,7 +68,7 @@ - <%= icon_div @socket, "bi-geo", [class: "icon baseline text-muted"] %> + Location: @@ -83,7 +81,7 @@ - <%= icon_div @socket, "bi-justify-left", [class: "icon baseline text-muted"] %> + Description: @@ -99,24 +97,19 @@ <%= 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 + Edit <% end %> <% end %> <%= if Roles.can?(@current_user, template, :clone) do %> <%= live_patch to: Routes.shift_template_index_path(@socket, :clone, template), class: "btn btn-outline-primary btn-sm text-nowrap" do %> - <%= icon_div @socket, "bi-clipboard-plus", [class: "icon baseline"] %> - Clone + Clone <% end %> <% end %> - <%#= button "" %> - <%= if Roles.can?(@current_user, template, :delete) do %> - <% end %> diff --git a/lib/shift73k_web/templates/layout/navbar/_nouser_menu.html.heex b/lib/shift73k_web/templates/layout/navbar/_nouser_menu.html.heex index 59203835..3157ab0c 100644 --- a/lib/shift73k_web/templates/layout/navbar/_nouser_menu.html.heex +++ b/lib/shift73k_web/templates/layout/navbar/_nouser_menu.html.heex @@ -1,10 +1,10 @@