|
|
@@ -1,53 +1,69 @@
|
|
|
{% extends 'base.html.twig' %}
|
|
|
|
|
|
-{% block title %}Profil de {{username}}{% endblock %}
|
|
|
+{% block title %}Profil de
|
|
|
+ {{profileusername}}
|
|
|
+{% endblock %}
|
|
|
|
|
|
{% block body %}
|
|
|
-<a href="{{ path('home') }}">Retourner au flux de messages</a><br>
|
|
|
-Bonjour {{sessionUser}}, <a href="{{ path('disconnect') }}">Se déconnecter</a>
|
|
|
-<h1>{{ username }}</h1>
|
|
|
-{% if me %}
|
|
|
- <a href="{{ path('parameters', {'username': username }) }}">Paramètres</a>
|
|
|
-{% endif %}
|
|
|
-{% if not me %}
|
|
|
- {% if not follow %}
|
|
|
- <a href="{{ path('follow',{'username': username }) }}">S'abonner</a>
|
|
|
-
|
|
|
- {% else %}
|
|
|
- <a href="{{ path('unfollow',{'username': username }) }}">Se désabonner</a>
|
|
|
- {% endif %}
|
|
|
-{% endif %}
|
|
|
-<dl>
|
|
|
- <dt>Description :</dt>
|
|
|
- <dd>{{ description }}</dd>
|
|
|
- <dt>Ce profil est :</dt>
|
|
|
- {% if isPrivate %}
|
|
|
- <dd>Privé</dd>
|
|
|
- {% else %}
|
|
|
- <dd>Public</dd>
|
|
|
- {% endif %}
|
|
|
-</dl>
|
|
|
-<h2>Abonnés :</h2>
|
|
|
-<ul>
|
|
|
- {% for follow in followersList %}
|
|
|
- <li>{{ follow.username }}</li>
|
|
|
- {% endfor %}
|
|
|
-</ul>
|
|
|
-<h2>Abonnements :</h2>
|
|
|
-<ul>
|
|
|
-{% for sub in subscriptionsList %}
|
|
|
- <li>{{ sub.username }}</li>
|
|
|
-{% endfor %}
|
|
|
-</ul>
|
|
|
-<h2>Messages :</h2>
|
|
|
- {% if not privateNotAllowed %}
|
|
|
- <ul>
|
|
|
- {% for msg in messages %}
|
|
|
- <li>
|
|
|
- <a href={{ path('profile', {'username': msg.sender.getUsername() }) }}>{{ msg.sender.getUsername() }}</a>
|
|
|
- <div>{{ msg.text | striptags('<a>') | raw }}</div>
|
|
|
- </li>
|
|
|
- {% endfor %}
|
|
|
- </ul>
|
|
|
- {% endif %}
|
|
|
+ <div class="d-flex flex-column align-items-center">
|
|
|
+ <div class="card" style="width: 75rem;">
|
|
|
+ <div class="card-body">
|
|
|
+ <h5 class="card-title">{{ profileusername }}</h5>
|
|
|
+ <p class="card-text">{{ description }}</p>
|
|
|
+ {% if isPrivate %}
|
|
|
+ <p class="card-text">Ce profil est privé.</p>
|
|
|
+ {% else %}
|
|
|
+ <p class="card-text">Ce profil est public.</p>
|
|
|
+ {% endif %}
|
|
|
+ {% if not me %}
|
|
|
+ {% if not follow %}
|
|
|
+ <p class="card-text">
|
|
|
+ <a href="{{ path('follow',{'username': profileusername }) }}">S'abonner</a>
|
|
|
+ </p>
|
|
|
+ {% else %}
|
|
|
+ <p class="card-text">
|
|
|
+ <a href="{{ path('unfollow',{'username': profileusername }) }}">Se désabonner</a>
|
|
|
+ </p>
|
|
|
+ {% endif %}
|
|
|
+ {% endif %}
|
|
|
+ <h5 class="card-title">Abonnements</h5>
|
|
|
+ <div class="card-group">
|
|
|
+ {% for follow in followersList %}
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-body">
|
|
|
+ <a href="{{ path('profile', {'username': follow.username }) }}">{{ follow.username }}</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ {% endfor %}
|
|
|
+ </div>
|
|
|
+ <h5 class="card-title">Abonnés</h5>
|
|
|
+ <div class="card-group">
|
|
|
+ {% for sub in subscriptionsList %}
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-body">
|
|
|
+ <a href="{{ path('profile', {'username': sub.username }) }}">{{ sub.username }}</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ {% endfor %}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ {% if not privateNotAllowed %}
|
|
|
+ <h2>Messages</h2>
|
|
|
+ <div>
|
|
|
+ {% for msg in messages %}
|
|
|
+ <div class="card" style="width: 75rem;">
|
|
|
+ <div class="card-body">
|
|
|
+ <h5 class="card-title">
|
|
|
+ <a href={{ path('profile', {'username': msg.sender.getUsername() } ) }}>{{ msg.sender.getUsername() }}</a>
|
|
|
+ </h5>
|
|
|
+ <h6 class="card-subtitle mb-2 text-muted">{{ msg.getDate()|date('H:i - d/m/Y') }}</h6>
|
|
|
+ <p class="card-text">{{ msg.text | striptags('<a>') | raw }}</p>
|
|
|
+ <a href="#" class="card-link">RT</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ {% endfor %}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ {% endif %}
|
|
|
{% endblock %}
|