unclesp1d3r/CipherSwarm

View on GitHub
app/views/admin/index.html.erb

Summary

Maintainability
Test Coverage
<%= render Railsboot::HeaderComponent.new do |header| %>
  <% header.with_heading do %>
    <%= title "Admin" %>
  <% end %>
<% end %>


<h2>Users</h2>
<% if can? :create, :user %>
  <div class="btn-group btn-group-sm">
    <%= link_to new_user_path, class: "btn btn-primary", data: { turbo_frame: "remote_modal" } do %>
      <%= icon("plus-circle-fill") %>
      New User
    <% end %>
  </div>
<% end %>
<table class="table table-striped table-bordered table-sm">
  <thead>
  <tr>
    <th>id</th>
    <th>User Name</th>
    <th>Email</th>
    <th>Role</th>
    <th>Projects</th>
    <th>Last Login</th>
    <th>Actions</th>
  </tr>
  </thead>
  <tbody class="table-group-divider">
  <%= render partial: "user", collection: @users, cache: true %>
  </tbody>
</table>
<h2>Projects</h2>
<% if can? :create, :project %>
  <div class="btn-group btn-group-sm">
    <%= link_to new_project_path, class: "btn btn-primary btn-sm" do %>
      <%= icon("plus-circle-fill") %>
      New Project
    <% end %>
  </div>
<% end %>
<table class="table table-striped table-bordered table-sm">
  <thead>
  <tr>
    <th>id</th>
    <th>Project Name</th>
    <th>Users</th>
    <th>Last Activity</th>
    <th>Actions</th>
  </tr>
  </thead>
  <tbody class="table-group-divider">
  <%= render partial: "project", collection: @projects, cache: true %>
  </tbody>
</table>