@@ -6,7 +6,7 @@
<%= label cvf, :week_start_at, "Week starts at", class: "form-label" %>
- <%= icon_div @socket, "bi-calendar2-range", [class: "icon is-left text-muted fs-5"] %>
+
<%= select cvf, :week_start_at, week_start_options(),
value: @current_user.week_start_at,
class: "form-select"
diff --git a/lib/shift73k_web/live/user_management/index.html.leex b/lib/shift73k_web/live/user_management/index.html.heex
similarity index 72%
rename from lib/shift73k_web/live/user_management/index.html.leex
rename to lib/shift73k_web/live/user_management/index.html.heex
index 9e16d581..912bb88b 100644
--- a/lib/shift73k_web/live/user_management/index.html.leex
+++ b/lib/shift73k_web/live/user_management/index.html.heex
@@ -17,7 +17,7 @@
- Listing Users
+ Listing Users
<%# filtering and new item creation %>
@@ -26,7 +26,7 @@
<%= live_patch to: Routes.user_management_index_path(@socket, :new, Enum.into(@query, [])),
class: "btn btn-primary mb-3 mb-md-0" do %>
- New User
+ New User
<% end %>
@@ -34,10 +34,10 @@
<%= form_for :sort, "#", [phx_change: "sort-by-change"], fn srt -> %>
<%= label srt, :sort_by, class: "visually-hidden" %>
- <%= icon_div @socket, "bi-arrow-down-up", [class: "icon is-left text-muted fs-5", style: "z-index:1001;"], [style: "padding: 1px;"] %>
- <%= Phoenix.HTML.Form.select srt, :sort_by, ["Email": "email", "Role": "role", "Created at": "inserted_at"], value: @query.sort_by, class: "form-select" %>
+
+ <%= Phoenix.HTML.Form.select srt, :sort_by, ["Email": "email", "Role": "role", "Created at": "inserted_at"], value: @query.sort_by, class: "form-select rounded-start" %>
- <%= icon_div @socket, (@query.sort_order == "desc" && "bi-sort-up-alt" || "bi-sort-down-alt"), [class: "icon baseline"] %>
+
<% end %>
@@ -47,9 +47,9 @@
<%= form_for :filter, "#", [phx_change: "filter-change"], fn flt -> %>
<%= label flt, :filter, class: "visually-hidden" %>
-
+
<%= if @query.filter != "" do %>
- <%= icon_div @socket, "bi-x-circle-fill", [class: "icon is-right text-primary fs-5"], [role: "img", aria_hidden: false, aria_label: "Clear filter", class: "cursor-pointer pe-auto", phx_click: "filter-clear"] %>
+
<% end %>
<%= text_input flt, :filter,
name: "filter",
@@ -90,21 +90,19 @@
<%= user.confirmed_at && "Yes" || "No" %>
- disabled>
+
<%= if Roles.can?(@current_user, user, :edit) do %>
<%= live_patch to: Routes.user_management_index_path(@socket, :edit, user.id, Enum.into(@query, [])), 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, user, :delete) do %>
-
- <%= icon_div @socket, "bi-trash", [class: "icon baseline"] %>
- Delete
+
+ Delete
<% end %>
@@ -124,28 +122,25 @@
-
+
Email
- <%= if @query.sort_by == "email", do: icon_div @socket,
- (@query.sort_order == "desc" && "bi-sort-up-alt" || "bi-sort-down-alt"),
- [class: "icon baseline ms-1"]
- %>
+ <%= if @query.sort_by == "email" do %>
+
+ <% end %>
-
+
Role
- <%= if @query.sort_by == "role", do: icon_div @socket,
- (@query.sort_order == "desc" && "bi-sort-up-alt" || "bi-sort-down-alt"),
- [class: "icon baseline ms-1"]
- %>
+ <%= if @query.sort_by == "role" do %>
+
+ <% end %>
-
+
Created at
- <%= if @query.sort_by == "inserted_at", do: icon_div @socket,
- (@query.sort_order == "desc" && "bi-sort-up-alt" || "bi-sort-down-alt"),
- [class: "icon baseline ms-1"]
- %>
+ <%= if @query.sort_by == "inserted_at" do %>
+
+ <% end %>
Confirmed?
@@ -166,27 +161,25 @@
<% else %>
<%= for user <- @page.entries do %>
-
+
<%= user.email %>
<%= user.role |> Atom.to_string() |> String.capitalize() %>
<%= dt_out(user.inserted_at) %>
<%= user.confirmed_at && "Confirmed" || "Not confirmed" %>
- disabled>
+
<%= if Roles.can?(@current_user, user, :edit) do %>
<%= live_patch to: Routes.user_management_index_path(@socket, :edit, user.id, Enum.into(@query, [])), class: "btn btn-outline-primary btn-sm text-nowrap" do %>
- <%= icon_div @socket, "bi-pencil", [class: "icon baseline"] %>
- Edit
+ Edit
<% end %>
<% end %>
<%= if Roles.can?(@current_user, user, :delete) do %>
-
- <%= icon_div @socket, "bi-trash", [class: "icon baseline"] %>
- Delete
+
+ Delete
<% end %>
@@ -225,16 +218,16 @@
diff --git a/lib/shift73k_web/templates/user_confirmation/new.html.heex b/lib/shift73k_web/templates/user_confirmation/new.html.heex
index 0c543099..1155cd44 100644
--- a/lib/shift73k_web/templates/user_confirmation/new.html.heex
+++ b/lib/shift73k_web/templates/user_confirmation/new.html.heex
@@ -2,7 +2,7 @@
- Resend confirmation instructions
+ Resend confirmation instructions
We'll send you another email with instructions to confirm your email address.
diff --git a/lib/shift73k_web/templates/user_reset_password/new.html.heex b/lib/shift73k_web/templates/user_reset_password/new.html.heex
index 84d64187..8bcab246 100644
--- a/lib/shift73k_web/templates/user_reset_password/new.html.heex
+++ b/lib/shift73k_web/templates/user_reset_password/new.html.heex
@@ -2,7 +2,7 @@
- Forgot your password?
+ Forgot your password?
We'll send you an email with instructions to reset your password.
diff --git a/lib/shift73k_web/templates/user_shifts_csv/new.html.heex b/lib/shift73k_web/templates/user_shifts_csv/new.html.heex
index ceeb6862..0a3d98ac 100644
--- a/lib/shift73k_web/templates/user_shifts_csv/new.html.heex
+++ b/lib/shift73k_web/templates/user_shifts_csv/new.html.heex
@@ -2,7 +2,7 @@
- CSV Export
+ CSV Export
Select a date range for which to export a CSV of your scheduled shifts, or click "Export All" to export everything.
diff --git a/lib/shift73k_web/templates/user_shifts_ics/index.html.heex b/lib/shift73k_web/templates/user_shifts_ics/index.html.heex
index bdc56c14..e6fc92d1 100644
--- a/lib/shift73k_web/templates/user_shifts_ics/index.html.heex
+++ b/lib/shift73k_web/templates/user_shifts_ics/index.html.heex
@@ -2,7 +2,7 @@
- User Shifts ICS
+ User Shifts ICS
Shifts for user: <%= @user.email %>
Calendar slug: <%= @slug %>
diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs
index a2062be5..6c143b84 100644
--- a/priv/repo/seeds.exs
+++ b/priv/repo/seeds.exs
@@ -51,8 +51,10 @@ mock_users = users_json |> File.read!() |> Jason.decode!() |> Enum.take_random(c
extra_mock_users = ~s([
{"email":"adam@73k.us","password":"adamadamA1","role":"admin","inserted_at":"2018-12-14T01:01:01Z","confirmed_at":true},
- {"email":"karen@73k.us","password":"karenkarenA1","role":"manager","inserted_at":"2018-12-14T01:06:01Z","confirmed_at":true},
- {"email":"kat@73k.us","password":"katkatA1","role":"manager","inserted_at":"2018-12-14T01:06:01Z","confirmed_at":true}
+ {"email":"kat@73k.us","password":"katkatA1","role":"manager","inserted_at":"2018-12-14T01:06:01Z","confirmed_at":true},
+ {"email":"babka@73k.us","password":"Babka2020","role":"user","inserted_at":"2018-12-14T01:06:01Z","confirmed_at":false},
+ {"email":"malcolm@73k.us","password":"Malc2018","role":"user","inserted_at":"2018-12-14T01:06:01Z","confirmed_at":false},
+ {"email":"casio@73k.us","password":"Casio2011","role":"user","inserted_at":"2018-12-14T01:06:01Z","confirmed_at":false}
])
# for random week_start_at values