Projects (GanjooRazor -> DiwanRazor, GanjoorService.sln -> DiwanService.sln), files, folders, classes, namespaces, settings, API routes (/api/diwan) and DB tables (Diwan*). External addresses (ganjoor.net, github.com/ganjoor) unchanged. Migrations renamed consistently (no pending model changes); requires a fresh database. Upstream RUNNING_LOCALLY/SEMANTIC_SEARCH docs archived unmodified under docs/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
70 lines
2.7 KiB
Plaintext
70 lines
2.7 KiB
Plaintext
@page
|
|
@model DiwanRazor.Areas.Admin.Pages.BannersModel
|
|
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
|
@{
|
|
Layout = "_AdminLayout";
|
|
ViewData["Title"] = "آگاهیها";
|
|
ViewData["WideShell"] = true;
|
|
}
|
|
|
|
<div class="up-page-header">
|
|
<h1>@ViewData["Title"]</h1>
|
|
</div>
|
|
|
|
@if (!string.IsNullOrEmpty(Model.LastMessage))
|
|
{
|
|
<div class="up-alert up-alert--danger">@Model.LastMessage</div>
|
|
}
|
|
|
|
<div class="up-card">
|
|
<h2 class="up-card__title">آگاهی جدید</h2>
|
|
<form method="post" enctype="multipart/form-data" class="up-form">
|
|
@Html.AntiForgeryToken()
|
|
<div class="up-field">
|
|
<label for="Upload_Image">تصویر</label>
|
|
<input type="file" asp-for="Upload.Image" />
|
|
</div>
|
|
<div class="up-field">
|
|
<label for="Upload_Alt">متن جایگزین</label>
|
|
<input asp-for="Upload.Alt" />
|
|
</div>
|
|
<div class="up-field up-field--ltr">
|
|
<label for="Upload_Url">نشانی مقصد</label>
|
|
<input asp-for="Upload.Url" />
|
|
</div>
|
|
<div class="up-form-actions">
|
|
<input type="submit" value="بارگذاری" class="up-btn up-btn--success" />
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
@if (Model.Banners != null && Model.Banners.Length > 0)
|
|
{
|
|
<table>
|
|
@foreach (var banner in Model.Banners)
|
|
{
|
|
<tr id="tr-@banner.Id">
|
|
<td>متن جایگزین: <input type="text" name="alt-@banner.Id" id="alt-@banner.Id" value="@banner.AlternateText" /> </td>
|
|
<td>نشانی مقصد:<input type="text" name="url-@banner.Id" id="url-@banner.Id" style="text-align:left;direction:ltr;" value=@banner.TargetUrl /> </td>
|
|
<td><img src="@($"{DiwanRazor.APIRoot.InternetUrl}/{banner.ImageUrl}")" alt="@banner.AlternateText" width="200" /></td>
|
|
@if (banner.Active)
|
|
{
|
|
<td>فعال <input type="checkbox" name="active-@banner.Id" id="active-@banner.Id" checked /> </td>
|
|
}
|
|
else
|
|
{
|
|
<td>فعال <input type="checkbox" name="active-@banner.Id" id="active-@banner.Id" /> </td>
|
|
}
|
|
<td>
|
|
<a role="button" onclick="editBanner(@banner.Id)" class="up-icon-btn" title="ویرایش" aria-label="ویرایش این آگاهی">✎</a>
|
|
<a role="button" onclick="deleteBanner(@banner.Id)" class="up-icon-btn" title="حذف" aria-label="حذف این آگاهی">🗑</a>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</table>
|
|
}
|
|
else
|
|
{
|
|
<partial name="_EmptyState" model="@("هنوز آگاهیای ثبت نشده است.")" />
|
|
}
|