%= if @live_action in [:new, :edit] do %> <%= live_modal @socket, Bones73kWeb.UserManagement.FormComponent, id: @user.id || :new, title: @page_title, action: @live_action, user: @user, current_user: @current_user %> <% end %>
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"] %> | 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"] %> | 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"] %> | Confirmed? | |
---|---|---|---|---|
<%= user.email %> | <%= user.role |> Atom.to_string() |> String.capitalize() %> | <%= dt_out(user.inserted_at) %> | <%= 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 %> | <%= live_patch to: Routes.user_management_index_path(@socket, :edit, user.id, Enum.into(@query, [])), class: "btn btn-outline-primary btn-sm" do %> <%= icon_div @socket, "bi-pencil", [class: "icon baseline", style: "margin-right:0.125rem;"] %> Edit <% end %> <%= if Roles.can?(@current_user, user, :delete) do %> <%= link to: "#", phx_click: "delete", phx_value_id: user.id, phx_value_email: user.email, data: [confirm: "Are you sure you want to delete this user? \"#{user.email}\""], class: "btn btn-outline-danger btn-sm" do %> <%= icon_div @socket, "bi-trash", [class: "icon baseline", style: "margin-right:0.125rem;"] %> Delete <% end %> <% end %> |