Websites/app/views/yiff_rest/api_v2/manage/index.html.erb
Donovan Daniels b1c702e3cd
Add image management ui
poorly tested but it worked well enough, I'm sure I'll be patching bugs over the next few weeks
Also remove turbo because it sucks
Also changed the way we handle hosts in dev
2024-05-06 03:25:17 -05:00

41 lines
1.4 KiB
Plaintext

<%= render "yiff_rest/api_v2/manage/nav" %>
<table class="category-list table table-striped table-dark">
<thead>
<tr>
<th style="width: 70%;">Category Name</th>
<th style="width: 20%;">Details</th>
<th style="width: 10%;"></th>
</tr>
</thead>
<tbody>
<% @categories.each do |category| %>
<% total = category.real_count %>
<tr>
<td><%= category.name %></td>
<td>
<ul class="details">
<li>ID: <b><%= category.db %></b></li>
<li>Count: <b><%= total %></b> (cache: <b><%= category.count %>)</b></li>
<li>Created At: <b><%= compact_time(category.created_at) %></b></li>
<li>Updated At: <b><%= compact_time(category.updated_at) %></b></li>
<li>SFW: <b><%= category.sfw ? "Yes" : "No" %></b></li>
<li>
Sources:
<ul>
<% category.sources.each do |source| %>
<li><%= source[:name] %>: <b><%= source[:count] %></b>
<%# no point in having a percentage since they won't add up to 100 %>
<%# ((source[:count].to_f / total.to_f) * 100).round(0) %>
</li>
<% end %>
</ul>
</li>
</ul>
</td>
<td><%= link_to "Manage", yiff_rest_api_v2_manage_images_path(search: { category: category.db }) %></td>
</tr>
<% end %>
</tbody>
</table>