|
{% extends "layout.html" %} |
|
|
|
{% block title %}Mes Publications - Forum Communautaire{% endblock %} |
|
|
|
{% block breadcrumb %} |
|
<a href="{{ url_for('forum.index') }}" class="hover:text-blue-600">Accueil</a> |
|
<span class="mx-2">/</span> |
|
<a href="{{ url_for('user.profile', username=current_user.username) }}" class="hover:text-blue-600">Profil</a> |
|
<span class="mx-2">/</span> |
|
<span>Mes Publications</span> |
|
{% endblock %} |
|
|
|
{% block content %} |
|
<div class="bg-white rounded-lg shadow overflow-hidden"> |
|
<div class="px-6 py-4 border-b border-gray-200 bg-blue-50 flex justify-between items-center"> |
|
<h1 class="text-xl font-bold text-gray-800">Mes Publications</h1> |
|
</div> |
|
|
|
{% if posts.items %} |
|
<div class="divide-y divide-gray-200"> |
|
{% for post in posts.items %} |
|
<div class="p-4 hover:bg-gray-50"> |
|
<div> |
|
<div class="flex justify-between items-start mb-2"> |
|
<div> |
|
<a href="{{ url_for('forum.topic_view', id=post.topic_id) }}" class="text-lg font-medium text-gray-800 hover:text-blue-600"> |
|
Re: {{ post.topic.title }} |
|
</a> |
|
</div> |
|
<div class="text-xs text-gray-500"> |
|
{{ post.created_at.strftime('%d %b %Y %H:%M') }} |
|
</div> |
|
</div> |
|
|
|
<div class="text-gray-700 line-clamp-3 text-sm mb-2"> |
|
{{ post.content|striptags|truncate(250) }} |
|
</div> |
|
|
|
<div class="text-xs text-gray-500"> |
|
Publié dans: <a href="{{ url_for('forum.category_view', id=post.topic.category_id) }}" class="text-blue-600 hover:underline">{{ post.topic.category.name }}</a> |
|
<a href="{{ url_for('forum.topic_view', id=post.topic_id) }}#post-{{ post.id }}" class="text-blue-600 hover:underline ml-2"> |
|
Voir le message <i data-feather="arrow-right" class="w-3 h-3 inline"></i> |
|
</a> |
|
</div> |
|
</div> |
|
</div> |
|
{% endfor %} |
|
</div> |
|
|
|
|
|
{% if posts.pages > 1 %} |
|
<div class="px-6 py-4 bg-gray-50 border-t border-gray-200"> |
|
<div class="flex justify-center"> |
|
<nav class="inline-flex rounded-md shadow"> |
|
{% if posts.has_prev %} |
|
<a href="{{ url_for('user.user_posts', page=posts.prev_num) }}" class="px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-l-md hover:bg-gray-50"> |
|
Précédent |
|
</a> |
|
{% else %} |
|
<span class="px-4 py-2 text-sm font-medium text-gray-400 bg-gray-100 border border-gray-300 rounded-l-md cursor-not-allowed"> |
|
Précédent |
|
</span> |
|
{% endif %} |
|
|
|
{% for page_num in posts.iter_pages(left_edge=1, right_edge=1, left_current=2, right_current=2) %} |
|
{% if page_num %} |
|
{% if page_num == posts.page %} |
|
<span class="px-4 py-2 text-sm font-medium text-blue-600 bg-blue-50 border border-gray-300"> |
|
{{ page_num }} |
|
</span> |
|
{% else %} |
|
<a href="{{ url_for('user.user_posts', page=page_num) }}" class="px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 hover:bg-gray-50"> |
|
{{ page_num }} |
|
</a> |
|
{% endif %} |
|
{% else %} |
|
<span class="px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300"> |
|
… |
|
</span> |
|
{% endif %} |
|
{% endfor %} |
|
|
|
{% if posts.has_next %} |
|
<a href="{{ url_for('user.user_posts', page=posts.next_num) }}" class="px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-r-md hover:bg-gray-50"> |
|
Suivant |
|
</a> |
|
{% else %} |
|
<span class="px-4 py-2 text-sm font-medium text-gray-400 bg-gray-100 border border-gray-300 rounded-r-md cursor-not-allowed"> |
|
Suivant |
|
</span> |
|
{% endif %} |
|
</nav> |
|
</div> |
|
</div> |
|
{% endif %} |
|
|
|
{% else %} |
|
<div class="p-6 text-center text-gray-500"> |
|
Vous n'avez pas encore créé de publications. |
|
</div> |
|
{% endif %} |
|
</div> |
|
{% endblock %} |