philomena/lib/philomena_web/templates/admin/badge/index.html.heex

49 lines
1.2 KiB
Text
Raw Normal View History

2024-06-02 05:50:36 +02:00
<h2>
Badges
</h2>
<% route = fn p -> ~p"/admin/badges?#{p}" end %>
<% pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @badges, route: route, conn: @conn) %>
<div class="block">
<div class="block__header">
<a href={~p"/admin/badges/new"}>
2024-06-02 05:50:49 +02:00
<i class="fa fa-plus"></i> New Badge
2024-06-02 05:50:36 +02:00
</a>
<%= pagination %>
</div>
<div class="block__content">
<table class="table">
<thead>
<tr>
<th>
Badge
</th>
<th>
Image
</th>
<th>
Options
</th>
</tr>
</thead>
<tbody>
<%= for badge <- @badges do %>
<tr>
<td>
<%= badge.title %>
</td>
<td>
<%= badge_image(badge, width: 32, height: 32) %>
</td>
<td>
2024-06-02 05:50:49 +02:00
<%= link("Users", to: ~p"/admin/badges/#{badge}/users") %> &bull; <%= link("Edit", to: ~p"/admin/badges/#{badge}/edit") %>
2024-06-02 05:50:36 +02:00
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="block__header block__header--light">
<%= pagination %>
</div>
</div>