{% extends "base.html.twig" %}
{% block title %}Rapper detail{% endblock %}
{% block bodyClass %}rappersBody{% endblock %}
{% import "components/profileMacros.html.twig" as profileMacros %}
{# @var \App\Entity\Crew crew #}
{% block body %}
<section id="profile" class="profile" style="background-color: #eee;">
<div class="container py-5">
<div class="row">
<div class="col-lg-4">
<div class="card mb-4">
<div class="card-body text-center">
<div class="profile-img-wrapper" {% if crew.backgroundFileName!=null %} style="background: url('{{ asset('uploads/images/crews/'~crew.backgroundFileName) }}');" {% else %} style="background-image: url({{ asset('build/images/defaultBackground.png') }}); background-size: 102%; background-position: center center;" {% endif %} >
{% if crew.imageName!=null %}
<img src="{{ asset('uploads/images/crews/logos/'~crew.imageName) }}" alt="avatar" class="rounded-circle img-fluid" style="width: 200px;">
{% else %}
<img src="{{ asset('build/images/defaultAvatar.png') }}" alt="avatar" class="rounded-circle img-fluid" style="width: 200px;">
{% endif %}
</div>
<h5 class="my-3">{{ crew.name }}</h5>
<p class="text-muted mb-4">{{ crew.city }}{% if crew.country %},{{ crew.country.shortName }}{% endif %}</p>
{# {% if app.user and app.user.id != rapper.client.id %}#}
{# <div class="d-flex justify-content-center mb-2">#}
{# <button type="button" class="js-follow-rapper btn btn-primary" data-id="{{ rapper.id }}">Follow</button>#}
{# <button type="button" class="btn btn-outline-primary ms-1">Message</button>#}
{# </div>#}
{# {% endif %}#}
</div>
</div>
</div>
<div class="col-lg-8">
<div class="card mb-4">
<div class="card-body">
<div class="row">
<div class="col-sm-3">
<h6 class="mb-0">Crew Name</h6>
</div>
<div class="col-sm-9">
<p class="text-muted mb-0">{{ crew.name }}</p>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-3">
<h6 class="mb-0">Crew members</h6>
</div>
<div class="col-sm-9">
<p class="text-muted mb-0">{{ crew.rappers | length }}</p>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-3">
<h6 class="mb-0">Leaderboard position</h6>
</div>
<div class="col-sm-9">
<p class="text-muted mb-0">#{{ getCrewLeaderboardPosition(crew.id) }}</p>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-3">
<h6 class="mb-0">Origin</h6>
</div>
<div class="col-sm-9">
<p class="text-muted mb-0">{{ crew.city }}{% if crew.country %},{{ crew.country.name }}{% endif %}</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
{% if crew.rappers|length > 0 %}
<table class="crew-members-list table table-responsive">
<thead>
<tr class="crew-member-item-head">
<th class="rapper-name">
<h6>Rapper</h6>
</th>
<th class="rapper-rank">
<h6>Rapper rank</h6>
</th>
</tr>
</thead>
<tbody>
{% for rapper in crew.rappers %}
<tr class="crew-member-item {% if crew.createdBy == rapper.client %}owner{% endif %}">
<td class="rapper-name">
<a href="{{ path('rapperDetail',{id:rapper.id}) }}" class="{% if crew.createdBy == rapper.client %}text-white{% endif %}" > <p>{{ rapper.pseudoname }} {% if crew.createdBy == rapper.client %} (owner) {% endif %}</p></a>
</td>
<td class="rapper-rank">
<a href="{{ path('rapperDetail',{id:rapper.id}) }}" class="{% if crew.createdBy == rapper.client %}text-white{% endif %}"> <p>{{ rapper.rank }}</p></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="no-content-message">
<p>No crew members :(</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</section>
{% endblock %}