hesabixSite/templates/customer/dashboard.html.twig
Hesabix 1467e83ccf
Some checks are pending
PHP Composer / build (push) Waiting to run
remove bootstrap
2025-09-05 11:52:08 +03:30

242 lines
16 KiB
Twig

{% extends 'base.html.twig' %}
{% block title %}داشبورد - باشگاه مشتریان حسابیکس{% endblock %}
{% block stylesheets %}
{{ parent() }}
{% endblock %}
{% block body %}
<div class="min-h-screen py-10 font-yekan" dir="rtl">
<div class="container mx-auto px-4">
<div class="bg-gradient-to-r from-green-500 to-teal-500 text-white p-6 rounded-xl mb-10">
<h4 class="text-xl font-bold mb-2 flex items-center gap-2">
<img src="{{ asset('/img/icons/heart.svg') }}" alt="قلب" class="w-5 h-5"> از عضویت شما در باشگاه مشتریان حسابیکس سپاسگزاریم!
</h4>
<p class="mb-0">در این بخش می‌توانید اطلاعات حساب کاربری خود را مشاهده و مدیریت کنید.</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div class="w-full">
<div class="card hover:shadow-lg transition-shadow duration-300">
<h3 class="text-primary-600 mb-6 text-xl font-bold flex items-center gap-2">
<img src="{{ asset('/img/icons/user.svg') }}" alt="کاربر" class="w-5 h-5"> اطلاعات شخصی
</h3>
<div class="flex justify-between items-center py-4 border-b border-gray-200">
<span class="font-semibold text-gray-700">نام و نام خانوادگی:</span>
<span class="text-gray-600">{{ user.name }}</span>
</div>
<div class="flex justify-between items-center py-4 border-b border-gray-200">
<span class="font-semibold text-gray-700">پست الکترونیکی:</span>
<span class="text-gray-600">{{ user.email }}</span>
</div>
<div class="flex justify-between items-center py-4 border-b border-gray-200">
<span class="font-semibold text-gray-700">شماره موبایل:</span>
<span class="text-gray-600">{{ user.phone }}</span>
</div>
<div class="flex justify-between items-center py-4">
<span class="font-semibold text-gray-700">وضعیت حساب:</span>
<span class="px-4 py-2 rounded-full text-sm font-bold {{ user.isActive ? 'bg-blue-100 text-blue-800' : 'bg-red-100 text-red-800' }}">
{{ user.isActive ? 'فعال' : 'غیرفعال' }}
</span>
</div>
</div>
</div>
<div class="w-full">
<div class="card hover:shadow-lg transition-shadow duration-300">
<h3 class="text-primary-600 mb-6 text-xl font-bold flex items-center gap-2">
<img src="{{ asset('/img/icons/calendar.svg') }}" alt="تقویم" class="w-5 h-5"> اطلاعات عضویت
</h3>
<div class="flex justify-between items-center py-4 border-b border-gray-200">
<span class="font-semibold text-gray-700">تاریخ عضویت:</span>
<span class="text-gray-600">{{ user.createdAt|date('Y/m/d') }}</span>
</div>
<div class="flex justify-between items-center py-4">
<span class="font-semibold text-gray-700">آخرین ورود:</span>
<span class="text-gray-600">
{{ user.lastLoginAt ? user.lastLoginAt|date('Y/m/d H:i') : 'هنوز وارد نشده' }}
</span>
</div>
<div class="flex justify-between items-center py-4 border-b border-gray-200">
<span class="font-semibold text-gray-700">تایید ایمیل:</span>
<span class="px-4 py-2 rounded-full text-sm font-bold {{ user.emailVerifiedAt ? 'bg-blue-100 text-blue-800' : 'bg-red-100 text-red-800' }}">
{{ user.emailVerifiedAt ? 'تایید شده' : 'تایید نشده' }}
</span>
</div>
{% if user.subscriptionType %}
<div class="flex justify-between items-center py-4">
<span class="font-semibold text-gray-700">نوع اشتراک:</span>
<span class="text-gray-600">{{ user.subscriptionType }}</span>
</div>
{% endif %}
</div>
</div>
</div>
<!-- بخش کیف پول‌ها -->
<div class="w-full mt-8">
<div class="card">
<h3 class="text-primary-600 mb-6 text-xl font-bold flex items-center gap-2">
<img src="{{ asset('/img/icons/wallet.svg') }}" alt="کیف پول" class="w-5 h-5"> مدیریت کیف پول‌ها
</h3>
<!-- فرم اتصال کیف پول جدید -->
<div class="bg-white p-6 rounded-xl border border-gray-200 mb-6"
data-controller="wallet-connect"
data-wallet-connect-sign-message-value="{{ signMessage }}"
data-wallet-connect-csrf-token-value="{{ csrf_token('wallet_connect_form') }}">
<h5 class="text-lg font-semibold mb-4">اتصال کیف پول جدید</h5>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label for="walletType" class="form-label">نوع کیف پول</label>
<select class="form-control" id="walletType" data-wallet-connect-target="walletType" data-action="change->wallet-connect#onWalletTypeChange">
<option value="">انتخاب کنید...</option>
<option value="metamask">MetaMask</option>
<option value="trust">Trust Wallet</option>
<option value="walletconnect">WalletConnect</option>
<option value="coinbase">Coinbase Wallet</option>
<option value="other">سایر</option>
</select>
</div>
<div>
<label class="form-label">آدرس کیف پول</label>
<div class="relative">
<div class="absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none">
<i class="fas fa-wallet text-gray-400"></i>
</div>
<input type="text"
class="form-control pr-10"
id="walletAddress"
data-wallet-connect-target="walletAddress"
placeholder="آدرس کیف پول پس از اتصال نمایش داده می‌شود"
readonly>
</div>
<p class="text-sm text-gray-500 mt-2">آدرس کیف پول شما پس از اتصال به صورت خودکار پر می‌شود</p>
</div>
<div class="col-span-2">
<button type="button"
class="btn-primary w-full py-3 text-lg"
id="connectBtn"
data-wallet-connect-target="connectBtn"
data-action="click->wallet-connect#connectWallet"
disabled>
نوع کیف پول را انتخاب کنید
</button>
</div>
</div>
<input type="hidden" data-wallet-connect-target="signature">
</div>
<!-- لیست کیف پول‌های متصل -->
<div class="mt-6">
<h5 class="text-lg font-semibold mb-4">کیف پول‌های متصل ({{ user.wallets|length }}/5)</h5>
{% if user.wallets|length > 0 %}
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">آدرس کیف پول</th>
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">نوع</th>
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">وضعیت</th>
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">تاریخ اتصال</th>
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">عملیات</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
{% for wallet in user.wallets %}
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<code class="text-sm bg-gray-100 px-2 py-1 rounded">{{ wallet.shortAddress }}</code>
{% if wallet.isPrimary %}
<span class="bg-primary-100 text-primary-800 text-xs px-2 py-1 rounded-full mr-2">اصلی</span>
{% endif %}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<span class="bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded-full">{{ wallet.walletType }}</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<span class="px-2 py-1 rounded-full text-xs font-medium {{ wallet.isActive ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800' }}">
{{ wallet.isActive ? 'فعال' : 'غیرفعال' }}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ wallet.connectedAt|date('Y/m/d H:i') }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<div class="flex gap-2">
{% if not wallet.isPrimary and wallet.isActive %}
<button class="btn-outline-primary text-xs px-3 py-1"
data-wallet-id="{{ wallet.id }}"
data-action="click->wallet-connect#setPrimaryWallet">
<i class="fas fa-star"></i> اصلی
</button>
{% endif %}
<button class="btn-outline-warning text-xs px-3 py-1"
data-wallet-id="{{ wallet.id }}"
data-action="click->wallet-connect#toggleWalletStatus">
<i class="fas fa-{{ wallet.isActive ? 'pause' : 'play' }}"></i>
{{ wallet.isActive ? 'غیرفعال' : 'فعال' }}
</button>
<button class="btn-outline-danger text-xs px-3 py-1"
data-wallet-id="{{ wallet.id }}"
data-action="click->wallet-connect#deleteWallet">
<i class="fas fa-trash"></i> حذف
</button>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="text-center text-gray-500 py-12">
<i class="fas fa-wallet text-6xl mb-4 text-gray-300"></i>
<h5 class="text-gray-500 text-lg mb-2">هنوز هیچ کیف پولی متصل نشده است</h5>
<p class="text-gray-400">برای شروع، نوع کیف پول خود را انتخاب کنید و روی دکمه اتصال کلیک کنید</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
<div class="w-full mt-8">
<div class="card">
<h3 class="text-primary-600 mb-6 text-xl font-bold flex items-center gap-2">
<img src="{{ asset('/img/icons/cogs.svg') }}" alt="تنظیمات" class="w-5 h-5"> عملیات
</h3>
<div class="flex flex-wrap gap-4 justify-center">
<a href="{{ path('customer_forgot_password') }}" class="btn-primary flex items-center gap-2">
<img src="{{ asset('/img/icons/key.svg') }}" alt="کلید" class="w-4 h-4"> بازیابی کلمه عبور
</a>
<a href="{{ path('app_home') }}" class="btn-primary flex items-center gap-2">
<img src="{{ asset('/img/icons/home.svg') }}" alt="خانه" class="w-4 h-4"> بازگشت به صفحه اصلی
</a>
<a href="{{ path('customer_logout') }}" class="bg-gradient-to-r from-red-500 to-red-600 text-white px-6 py-3 rounded-lg font-medium transition-all duration-300 hover:shadow-lg hover:-translate-y-0.5 flex items-center gap-2">
<img src="{{ asset('/img/icons/sign-out.svg') }}" alt="خروج" class="w-4 h-4"> خروج
</a>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block javascripts %}
{{ parent() }}
{% endblock %}