Edit

kmx.io/kmxgit/lib/kmxgit_web/templates/admin/user/index.html.heex

Branch :

  • lib/kmxgit_web/templates/admin/user/index.html.heex
  • <div class="container-fluid">
      <div class="row">
        <div class="col col-md-7">
          <h1>Users</h1>
        </div>
        <div class="col col-md-5">
          <%= link gettext("Create user"), to: Routes.admin_user_path(@conn, :new), class: "btn btn-primary" %>
        </div>
      </div>
      <%= render(KmxgitWeb.LayoutView, "search.html", assigns) %>
      <%= render("pagination.html", assigns) %>
      <table class="table admin-index">
        <thead>
          <tr>
            <th><%= link gettext("Id"), to: Routes.admin_user_path(@conn, :index, search: @search, sort: "id#{if @index.column == "id" && !@index.reverse, do: "-"}") %><%= if @index.column == "id" do %><%= if @index.reverse do %> <i class="fa fa-angle-down"></i><% else %> <i class="fa fa-angle-up"></i><% end %><% end %></th>
            <th><%= link gettext("Name"), to: Routes.admin_user_path(@conn, :index, search: @search, sort: "name#{if @index.column == "name" && !@index.reverse, do: "-"}") %><%= if @index.column == "name" do %><%= if @index.reverse do %> <i class="fa fa-angle-down"></i><% else %> <i class="fa fa-angle-up"></i><% end %><% end %></th>
            <th><%= link gettext("Email"), to: Routes.admin_user_path(@conn, :index, search: @search, sort: "email#{if @index.column == "email" && !@index.reverse, do: "-"}") %><%= if @index.column == "email" do %><%= if @index.reverse do %> <i class="fa fa-angle-down"></i><% else %> <i class="fa fa-angle-up"></i><% end %><% end %></th>
            <th><%= link gettext("Login"), to: Routes.admin_user_path(@conn, :index, search: @search, sort: "login#{if @index.column == "login" && !@index.reverse, do: "-"}") %><%= if @index.column == "login" do %><%= if @index.reverse do %> <i class="fa fa-angle-down"></i><% else %> <i class="fa fa-angle-up"></i><% end %><% end %></th>
            <th><%= link gettext("2FA"), to: Routes.admin_user_path(@conn, :index, search: @search, sort: "mfa#{if @index.column == "mfa" && !@index.reverse, do: "-"}") %><%= if @index.column == "mfa" do %><%= if @index.reverse do %> <i class="fa fa-angle-down"></i><% else %> <i class="fa fa-angle-up"></i><% end %><% end %></th>
            <th><%= link gettext("Admin"), to: Routes.admin_user_path(@conn, :index, search: @search, sort: "admin#{if @index.column == "admin" && !@index.reverse, do: "-"}") %><%= if @index.column == "admin" do %><%= if @index.reverse do %> <i class="fa fa-angle-down"></i><% else %> <i class="fa fa-angle-up"></i><% end %><% end %></th>
            <th><%= link gettext("Deploy"), to: Routes.admin_user_path(@conn, :index, search: @search, sort: "deploy#{if @index.column == "deploy" && !@index.reverse, do: "-"}") %><%= if @index.column == "deploy" do %><%= if @index.reverse do %> <i class="fa fa-angle-down"></i><% else %> <i class="fa fa-angle-up"></i><% end %><% end %></th>
            <th><%= gettext "Actions" %></th>
          </tr>
        </thead>
        <tbody>
          <%= for user <- @pagination.result do %>
            <tr>
              <td><%= link user.id, to: Routes.admin_user_path(@conn, :show, user) %></td>
              <td><%= link user.name, to: Routes.admin_user_path(@conn, :show, user) %></td>
              <td><%= link user.email, to: "mailto:#{user.email}" %></td>
              <td><%= link User.login(user), to: Routes.admin_user_path(@conn, :show, user) %></td>
              <td><%= if user.totp_last != 0, do: "TOTP", else: "none" %></td>
              <td><%= user.is_admin %></td>
              <td><%= user.deploy_only %></td>
              <td><%= link gettext("Show"), to: Routes.slug_path(@conn, :show, User.login(user) || ""), class: "btn btn-sm btn-primary" %></td>
            </tr>
          <% end %>
        </tbody>
      </table>
      <%= render("pagination.html", assigns) %>
    </div>