{% extends "base.html.twig" %}
{% block title %}Leaderboard{% endblock %}
{% block bodyClass %}leaderboard{% endblock %}
{% block body %}
<section id="leaderboard" class="leaderboard">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="vertical-tab" role="tabpanel">
<!-- Nav tabs -->
<ul id="leaderboardTab" class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#rappersLeaderboardTab" aria-controls="leaderboard" role="tab" data-toggle="tab">Rappers Leaderboard</a></li>
<li role="presentation"><a href="#crewsLeaderboardTab" aria-controls="leaderboard" role="tab" data-toggle="tab">Crews Leaderboard</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content tabs">
<div role="tabpanel" class="tab-pane fade in active" id="rappersLeaderboardTab">
<div class="row">
<div class="col-lg-11 m-auto">
<h3>Rappers Leaderboard</h3>
<div class="table-responsive">
<table class="table">
<thead class="bg-custom">
<tr>
<th class="text-right text-bold" style="width: 10%" scope="col"><h6>Position</h6></th>
<th class="text-bold" scope="col"><h6>Rapper</h6></th>
<th class="text-right text-bold" scope="col"><h6>Rank points</h6></th>
</tr>
</thead>
<tbody>
{% if rappers|length > 0 %}
{% for rapper in rappers %}
<tr>
<th class="text-right text-bold" scope="row"><h5>#{{ loop.index }}</h5></th>
<td><a href="{{ path('rapperDetail', {id: rapper.id}) }}">{{ rapper.pseudoname }}</a></td>
<td class="text-right" >{{ rapper.rank }}</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td></td>
<td class="text-center w-100">No rappers :(</td>
<td></td>
</tr>
{% endif %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane fade" id="crewsLeaderboardTab">
<div class="row">
<div class="col-lg-11 m-auto">
<h3>Crews Leaderboard</h3>
<div class="row">
<div class="table-responsive">
<table class="table">
<thead class="bg-custom">
<tr>
<th class="text-right text-bold" style="width: 10%" scope="col"><h6>Position</h6></th>
<th class="text-bold" scope="col"><h6>Crew</h6></th>
<th class="text-bold" scope="col"><h6>Crew members</h6></th>
<th class="text-right text-bold" scope="col"><h6>Rank points</h6></th>
</tr>
</thead>
<tbody>
{% if crews|length > 0 %}
{% for crew in crews %}
<tr>
<th class="text-right text-bold" scope="row"><h5>#{{ loop.index }}</h5></th>
<td><a href="{{ path('crewDetail', {id: crew.id}) }}">{{ crew.name }}</a></td>
<td>{{ crew.rappers|length }}</td>
<td class="text-right" >{{ crew.rank }}</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td></td>
<td class="text-center w-100">No crews :(</td>
<td></td>
</tr>
{% endif %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
{% endblock %}