+<# TODO: check at some point if the nesting divs are intentional #>
+
+ {{leaderboard_table_header(column_name)}}
+
+ {% for user in lb %}
+ {% if v.id == user.id %}
+ {% set style="class=\"self\"" %}
+ {% endif %}
+ {{format_user_in_table(user, style, loop.index, getattr(user, attr_name))}}
+ {% endfor %}
+ {% if position %}
+ {{format_user_in_table(v, "style=\"border-top:2px solid var(--primary)\"", position, getattr(v, attr_name))}}
+ {% endif %}
+
+
+{% endmacro %}
+
+{{leaderboard_table(users1, pos1, 'coins', 25, 'coins', 'Coins', 'coins')}}
+{{leaderboard_table(users7, pos7, 'spent', 25, 'coins spent in shop', 'Coins', 'coins_spent')}}
+{{leaderboard_table(users10, pos10, 'truescore', 25, 'truescore', 'Truescore', 'truecoins')}}
+{{leaderboard_table(users2, pos2, 'followers', 25, 'followers', 'Followers', 'stored_subscriber_count')}}
+{{leaderboard_table(users3, pos3, 'posts', 25, 'post count', 'Posts', 'post_count')}}
+{{leaderboard_table(users4, pos4, 'comments', 25, 'comment count', 'Comments', 'comment_count')}}
+{{leaderboard_table(users5, pos5, 'awards', 25, 'received awards', 'Awards', 'awards')}}
+
+{% macro leaderboard_table_2(lb, position, id, total_count, header_name, column_name, user_relative_url) %}
+
+
+
+ {{leaderboard_table_header(column_name)}}
+
+ {% for user, num in lb %}
+ {% if v.id == user.id %}
+ {% set style="class=\"self\"" %}
+ {% endif %}
+ {{format_user_in_table(user, style, loop.index, num, user_relative_url)}}
+ {% endfor %}
+ {% if position and (position[0] > total_count or not position[1]) %}
+ {{format_user_in_table(v, "style=\"border-top:2px solid var(--primary)\"", position, position[1], user_relative_url)}}
+ {% endif %}
+
+{% endmacro %}
+
+{{leaderboard_table_2(users11, pos11, 'badges', 25, 'badges', 'Badges')}}
+{% if users12 %}
+ {{leaderboard_table_2(users12, pos12, 'marseys', 25, 'Marseys made', 'Marseys')}}
{% endif %}
-
-
-
-
-
-
- # |
- Name |
- Blocked By |
-
-
-{% for user, num in users16 %}
-
- {{loop.index}} |
- {% include "user_in_table.html" %} |
- {{"{:,}".format(num)}} |
-
-{% endfor %}
-{% if pos16 and (pos16[0] > 25 or not pos16[1]) %}
-
- {{pos16[0]}} |
-
- {% with user=v %}
- {% include "user_in_table.html" %}
- {% endwith %}
- |
- {{"{:,}".format(pos16[1])}} |
-
-{% endif %}
-
-
-
-
-
-
-
-
- # |
- Name |
- Owned Hats |
-
-
-{% for user,num in users17 %}
-
- {{loop.index}} |
- {% include "user_in_table.html" %} |
- {{"{:,}".format(num)}} |
-
-{% endfor %}
-{% if pos17 and (pos17[0] > 25 or not pos17[1]) %}
-
- {{pos17[0]}} |
-
- {% with user=v %}
- {% include "user_in_table.html" %}
- {% endwith %}
- |
- {{"{:,}".format(pos17[1])}} |
-
-{% endif %}
-
-
-
-
-
-
-
- # |
- Name |
- Designed Hats |
-
-
-{% for user,num in users18 %}
-
- {{loop.index}} |
- {% include "user_in_table.html" %} |
- {{"{:,}".format(num)}} |
-
-{% endfor %}
-{% if pos18 and (pos18[0] > 25 or not pos18[1]) %}
-
- {{pos18[0]}} |
-
- {% with user=v %}
- {% include "user_in_table.html" %}
- {% endwith %}
- |
- {{"{:,}".format(pos18[1])}} |
-
-{% endif %}
-
-
+{{leaderboard_table_2(users16, pos16, 'blocked', 25, 'most blocked', 'Blocked By', 'blockers')}}
+{{leaderboard_table_2(users17, pos17, 'owned-hats', 25, 'owned hats', 'Owned Hats')}}
+{{leaderboard_table_2(users18, pos18, 'designed-hats', 25, 'designed hats', 'Designed Hats')}}