Initial commit — AsadiTools v1.0
Full ASP.NET Core 10 Razor Pages app for آساد ابزار tool repair shop in Karaj, Iran (official DeWalt representative). Features: - Homepage, Services, DeWalt page, Shop (pagination + images) - 10 brand SEO pages (/brands/*) with rich Persian content + FAQ schema - Blog engine with admin management (/blog, /Admin/Blog) - Cart, Checkout, Contact (OpenStreetMap embed) - Admin panel: Products CRUD, Orders, Blog, Change Password - Jalali date formatting, product images, SiteData centralised contact - Docker + docker-compose with healthcheck - Gitea CI/CD via .gitea/workflows/ci-cd.yml (NuGet through Nexus mirror) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
@page
|
||||
@model AsadiTools.Pages.Admin.Orders.OrdersIndexModel
|
||||
@{ ViewData["Title"] = "سفارشها"; Layout = "_AdminLayout"; }
|
||||
|
||||
<div class="p-6 md:p-8">
|
||||
<h1 class="text-2xl font-extrabold text-gray-900 mb-8">سفارشها</h1>
|
||||
|
||||
@if (!Model.Orders.Any())
|
||||
{
|
||||
<div class="text-center py-20 text-gray-400">
|
||||
<div class="text-5xl mb-4">📦</div>
|
||||
<p>هنوز سفارشی ثبت نشده</p>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="space-y-4">
|
||||
@foreach (var o in Model.Orders)
|
||||
{
|
||||
<div class="bg-white rounded-2xl border border-gray-100 p-6">
|
||||
<div class="flex flex-wrap items-start justify-between gap-4 mb-4">
|
||||
<div>
|
||||
<div class="flex items-center gap-3 mb-1">
|
||||
<span class="font-mono text-sm text-gray-500">@o.OrderNumber</span>
|
||||
<span class="text-xs px-2 py-0.5 rounded-full font-medium @SiteData.OrderStatusBadge(o.Status)">
|
||||
@SiteData.OrderStatusLabel(o.Status)
|
||||
</span>
|
||||
</div>
|
||||
<div class="font-bold text-gray-900">@o.CustomerName</div>
|
||||
<div class="text-sm text-gray-500">@o.CustomerPhone</div>
|
||||
@if (o.CustomerAddress != null) { <div class="text-xs text-gray-400 mt-1">@o.CustomerAddress</div> }
|
||||
</div>
|
||||
<div class="text-left">
|
||||
<div class="text-xl font-extrabold text-blue-700">@SiteData.FormatPrice(o.Total)</div>
|
||||
<div class="text-xs text-gray-400 mt-1">@SiteData.ToJalaliWithTime(o.CreatedAt)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Items -->
|
||||
<div class="bg-gray-50 rounded-xl p-4 mb-4">
|
||||
<p class="text-xs text-gray-500 font-bold mb-2">اقلام سفارش:</p>
|
||||
<ul class="space-y-1">
|
||||
@foreach (var item in o.Items)
|
||||
{
|
||||
<li class="flex justify-between text-sm">
|
||||
<span class="text-gray-700">@item.ProductNameFa × @item.Quantity</span>
|
||||
<span class="text-gray-500">@SiteData.FormatPrice(item.Subtotal)</span>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@if (o.Notes != null) { <p class="text-sm text-gray-500 mb-4">یادداشت: @o.Notes</p> }
|
||||
|
||||
<!-- Status update -->
|
||||
<form method="post" asp-page-handler="UpdateStatus" class="flex items-center gap-3">
|
||||
@Html.AntiForgeryToken()
|
||||
<input type="hidden" name="id" value="@o.Id" />
|
||||
<span class="text-sm text-gray-500 font-medium">وضعیت:</span>
|
||||
<select name="status" class="border border-gray-200 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
||||
@foreach (var s in Enum.GetValues<AsadiTools.Models.OrderStatus>())
|
||||
{
|
||||
<option value="@s" selected="@(o.Status == s)">@SiteData.OrderStatusLabel(s)</option>
|
||||
}
|
||||
</select>
|
||||
<button type="submit" class="bg-blue-700 text-white px-4 py-1.5 rounded-lg text-sm font-medium hover:bg-blue-800 transition-colors">
|
||||
ذخیره
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
Reference in New Issue
Block a user