From dc80790e592093da5f15318134cc05d6e61bf41f Mon Sep 17 00:00:00 2001 From: Adam Piontek Date: Mon, 8 Mar 2021 23:46:37 -0500 Subject: [PATCH] fixed user_management modal issue on mobile by implementing non-table mobile view --- .../live/user_management/index.html.leex | 58 ++++++++++++++++++- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/lib/bones73k_web/live/user_management/index.html.leex b/lib/bones73k_web/live/user_management/index.html.leex index 2a6f10e..c3ef6c9 100644 --- a/lib/bones73k_web/live/user_management/index.html.leex +++ b/lib/bones73k_web/live/user_management/index.html.leex @@ -42,8 +42,62 @@ -<%# main data table %> -
+<%# mobile data cards %> +
+ + + <%= if !@page do %> +
+
+ Loading... +
+
+ <% else %> + <%= for user <- @page.entries do %> +
+
+
+
Email
+
<%= user.email %>
+
Role
+
<%= user.role |> Atom.to_string() |> String.capitalize() %>
+
Created at
+
<%= dt_out(user.inserted_at) %>
+
+ Confirmed? + <%= if user.confirmed_at do %> + Yes + <%= icon_div @socket, "bi-check", [class: "icon baseline fs-4 text-success"], [role: "img", aria_hidden: false] %> + <% else %> + No + <%= icon_div @socket, "bi-x", [class: "icon baseline fs-4 text-warning"], [role: "img", aria_hidden: false] %> + <% end %> +
+
+ + <%= 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", style: "margin-right:0.125rem;"] %> + Edit + <% end %> + <% end %> + + <%= if Roles.can?(@current_user, user, :delete) do %> + + <% end %> + +
+
+ <% end %> + <% end %> + +
+ +<%# non-mobile main data table %> +