hesabixSite/templates/post/blog_home.html.twig

173 lines
8 KiB
Twig
Raw Normal View History

2025-01-10 20:17:54 +03:30
{% extends 'base.html.twig' %}
{% block title %}
وبلاگ
{% endblock %}
{% block des %}
جدیدترین اطلاعات و خبرها از دنیای حسابداری
{% endblock %}
{% block body %}
2025-09-05 11:52:08 +03:30
<main class="min-h-screen bg-gray-50">
<!-- هدر وبلاگ -->
<div class="relative bg-gradient-to-br from-blue-600 via-purple-600 to-indigo-700 overflow-hidden">
<div class="absolute inset-0 bg-black/40"></div>
<div class="relative container mx-auto px-4 py-20 lg:py-24">
<div class="text-center text-white">
<h1 class="text-4xl lg:text-6xl font-bold mb-6 animate-fade-in-up">
وبلاگ حسابیکس
</h1>
<p class="text-lg lg:text-xl text-blue-100 max-w-2xl mx-auto animate-fade-in-up" style="animation-delay: 0.2s;">
جدیدترین اطلاعات و خبرها از دنیای حسابداری
</p>
2025-01-10 20:17:54 +03:30
</div>
2025-04-06 19:17:37 +03:30
</div>
</div>
2025-09-05 11:52:08 +03:30
<!-- محتوای اصلی -->
<div class="container mx-auto px-4 py-12">
<!-- جستجو -->
<div class="mb-8">
<form method="GET" action="{{ path('app_blog_home') }}" class="max-w-md mx-auto">
<div class="relative">
<input type="text"
name="search"
value="{{ search }}"
placeholder="جستجو در وبلاگ..."
class="w-full px-4 py-3 pr-12 border border-gray-300 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 text-right">
<button type="submit"
class="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-blue-600 transition-colors duration-200">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
</svg>
</button>
</div>
</form>
</div>
<!-- لیست پست‌ها -->
{% if posts|length > 0 %}
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-12">
{% for post in posts %}
<article class="group bg-white rounded-2xl shadow-soft hover:shadow-medium transition-all duration-300 overflow-hidden hover-lift">
<!-- تصویر پست -->
<div class="relative overflow-hidden">
<img src="{{asset('uploaded/'~ post.mainPic)}}"
alt="{{post.title}}"
class="w-full h-48 object-cover group-hover:scale-105 transition-transform duration-300">
<div class="absolute top-4 right-4 flex flex-wrap gap-2">
{% for tree in post.tree %}
<span class="px-3 py-1 bg-blue-600 text-white text-xs font-medium rounded-full shadow-lg">
{{ tree.label }}
</span>
{% endfor %}
</div>
<div class="absolute inset-0 bg-gradient-to-t from-black/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
</div>
<!-- محتوای کارت -->
<div class="p-6">
<!-- متا اطلاعات -->
<div class="flex items-center justify-between text-sm text-gray-500 mb-4">
<div class="flex items-center space-x-2 space-x-reverse">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
</svg>
2025-09-05 18:03:55 +03:30
<span>{{ Jdate.jdate('Y/n/d',post.dateSubmit|date('U')) }}</span>
2025-04-06 19:17:37 +03:30
</div>
2025-09-05 11:52:08 +03:30
<div class="flex items-center space-x-2 space-x-reverse">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"></path>
</svg>
<span>{{ post.views }}</span>
2025-04-06 19:17:37 +03:30
</div>
2025-09-05 11:52:08 +03:30
</div>
<!-- عنوان و توضیحات -->
<h3 class="text-xl font-bold text-gray-900 mb-3 line-clamp-2 group-hover:text-blue-600 transition-colors duration-200">
{{ post.title }}
</h3>
<p class="text-gray-600 mb-6 line-clamp-3 leading-relaxed">
{{ post.intro }}
</p>
<!-- دکمه ادامه مطلب -->
<a href="{{path('app_blog_post',{'url':post.url})}}"
class="inline-flex items-center space-x-2 space-x-reverse text-blue-600 hover:text-blue-700 font-medium transition-colors duration-200 group">
<span>ادامه مطلب</span>
<svg class="w-4 h-4 transform group-hover:translate-x-1 transition-transform duration-200" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
</svg>
</a>
</div>
</article>
{% endfor %}
</div>
<!-- صفحه‌بندی -->
{% if maxpages > 1 %}
<nav class="flex justify-center" aria-label="صفحه‌بندی">
<div class="flex items-center space-x-2 space-x-reverse">
<!-- دکمه صفحه قبل -->
{% if page > 1 %}
<a href="{{ path('app_blog_home',{'page':page -1})}}"
class="flex items-center space-x-2 space-x-reverse px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 hover:text-gray-700 transition-all duration-200">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
</svg>
<span>قبلی</span>
</a>
{% endif %}
<!-- شماره صفحات -->
<div class="flex items-center space-x-1 space-x-reverse">
{% for i in range(1, maxpages) %}
{% if i == page %}
<span class="px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-blue-600 rounded-lg">
{{ i }}
</span>
{% elseif i <= page + 2 and i >= page - 2 %}
<a href="{{ path('app_blog_home',{'page':i})}}"
class="px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 hover:text-gray-700 transition-all duration-200">
{{ i }}
</a>
{% endif %}
{% endfor %}
2025-04-06 19:17:37 +03:30
</div>
2025-09-05 11:52:08 +03:30
<!-- دکمه صفحه بعد -->
{% if page < maxpages %}
<a href="{{ path('app_blog_home',{'page':page +1})}}"
class="flex items-center space-x-2 space-x-reverse px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 hover:text-gray-700 transition-all duration-200">
<span>بعدی</span>
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path>
</svg>
</a>
{% endif %}
</div>
</nav>
{% endif %}
{% else %}
<!-- پیام عدم وجود پست -->
<div class="text-center py-16">
<div class="max-w-md mx-auto">
<svg class="w-16 h-16 text-gray-400 mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
</svg>
<h3 class="text-xl font-semibold text-gray-900 mb-2">هیچ پستی یافت نشد</h3>
<p class="text-gray-600">
{% if search %}
برای عبارت "{{ search }}" هیچ نتیجه‌ای یافت نشد.
{% else %}
هنوز هیچ پستی منتشر نشده است.
{% endif %}
</p>
2025-04-06 19:17:37 +03:30
</div>
2025-01-10 20:17:54 +03:30
</div>
2025-09-05 11:52:08 +03:30
{% endif %}
2025-01-10 20:17:54 +03:30
</div>
</main>
{% endblock %}