{% extends "default.html" %}
{% block content %}
<script src="{{ 'js/sort_table.js' | asset }}"></script>
<pre>


</pre>
<h1>User Badges</h1>
<div>This page describes the requirements for obtaining all profile badges.</div>
<pre>


</pre>
<div class="overflow-x-auto">
<table id="sortable_table" class="table table-striped mb-5">
<thead class="bg-primary text-white">
	<tr>
		<th>#</th>
		<th>Name</th>
		<th>Image</th>
		<th>Description</th>
		<th role="button" onclick="sort_table(4)">#</th>
		<th role="button" onclick="sort_table(5)">Rarity</th>
	</tr>
</thead>
{% for badge in badges %}
	<tr>
		<td>{{loop.index}}</td>
		<td>{{badge.name}}</td>
		<td><img alt="{{badge.name}}" loading="lazy" src="{{ ('images/badges/'~badge.id~'.webp') | asset }}" width=45.83 height=50>
		<td>{{badge.description}}</td>
		{%- set ct = counts[badge.id] if badge.id in counts else (0, 0) %}
		<td class="badges-rarity-qty">{{ ct[0] }}</td>
		<td class="badges-rarity-ratio">{{ "{:0.3f}".format(ct[1]) }}%</td>
	</tr>
{% endfor %}
</table>

{% endblock %}
