From 68594d1697e5180ea90e78eb7a4c0ff330f53e42 Mon Sep 17 00:00:00 2001 From: Anas Rashid Date: Mon, 5 Oct 2026 00:24:30 +0200 Subject: [PATCH] Museum subsystem: remove public UI, keep backend dormant (#5) - poem page: drop manuscripts/images tab and Pinterest/museum image suggestion form - remove image recommendation (Pin) page and route - museum API, services and tables stay dormant (no schema change) Co-Authored-By: Claude Opus 5.5 --- .../Pages/ImageRecommendation/Pin.cshtml | 102 -------------- .../Pages/ImageRecommendation/Pin.cshtml.cs | 84 ------------ .../PageTypes/_PoemPagePartial.cshtml | 127 +----------------- DiwanRazor/Startup.cs | 1 - 4 files changed, 1 insertion(+), 313 deletions(-) delete mode 100644 DiwanRazor/Pages/ImageRecommendation/Pin.cshtml delete mode 100644 DiwanRazor/Pages/ImageRecommendation/Pin.cshtml.cs diff --git a/DiwanRazor/Pages/ImageRecommendation/Pin.cshtml b/DiwanRazor/Pages/ImageRecommendation/Pin.cshtml deleted file mode 100644 index 888a2e77..00000000 --- a/DiwanRazor/Pages/ImageRecommendation/Pin.cshtml +++ /dev/null @@ -1,102 +0,0 @@ -@page -@model DiwanRazor.Pages.PinModel -@{ - Layout = null; -} - - - - - - پیشنهاد شعر مرتبط با تصویر - - - - - - - - - - - - -
-
- - - - @if (Model.Succeeded) - { -

با تشکر، تصویر پیشنهادی جهت بررسی ارسال شد.

-

لطفاً توجه فرمایید که تصاویر دارای واترمارک نازیبا یا دارای کیفیت پایین یا دارای مشکلات دیگر تأیید نخواهند شد.

-

تصویر ارسالی:

- } - else - { -

- @Model.LastError -

- -
- @Html.AntiForgeryToken() - - - - - نشانی سایت منبع (در این صفحه می‌بایست تصویر دیده شود): - نشانی تصویر (در مرحلهٔ بعد با توجه به این نشانی باید تصویر نمایش داده شود): -
- توضیحات (می‌توانید اطلاعاتی مانند نام هنرمند و ... را اضافه کنید.): - -
- -
- } - - @if (Model.RelatedImageSuggestionModel.PinterestUrl != "manual") - { - - } - - -
-
- - \ No newline at end of file diff --git a/DiwanRazor/Pages/ImageRecommendation/Pin.cshtml.cs b/DiwanRazor/Pages/ImageRecommendation/Pin.cshtml.cs deleted file mode 100644 index f0794694..00000000 --- a/DiwanRazor/Pages/ImageRecommendation/Pin.cshtml.cs +++ /dev/null @@ -1,84 +0,0 @@ -using DiwanRazor.Models.MuseumLink; -using DiwanRazor.Utils; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Newtonsoft.Json; -using RMuseum.Models.DiwanIntegration.ViewModels; -using System.Net; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; - -namespace DiwanRazor.Pages -{ - public class PinModel : PageModel - { - /// - /// related image suggestion model - /// - [BindProperty] - public RelatedImageSuggestionModel RelatedImageSuggestionModel { get; set; } - - /// - /// ارسال موفق - /// - public bool Succeeded { get; set; } - - /// - /// خطا - /// - public string LastError { get; set; } - - /// - /// is logged on - /// - public bool LoggedIn { get; set; } - - public async Task OnPostAsync() - { - Succeeded = false; - LastError = ""; - LoggedIn = !string.IsNullOrEmpty(Request.Cookies["Token"]); - if(!LoggedIn) - { - LastError = $"اشعار سے متعلق تصاویر تجویز کرنے کے لیے پہلے دیوان میں داخل ہوں.

دیوان میں داخلہ"; - } - else - if (Request.Query["final"] == "1") - { - using (HttpClient secureClient = new HttpClient(new DiwanReloginHandler(Request, Response))) - { - if(await DiwanSessionChecker.PrepareClient(secureClient, Request, Response)) - { - PinterestLinkViewModel model = new PinterestLinkViewModel() - { - DiwanPostId = RelatedImageSuggestionModel.PoemId, - DiwanUrl = $"https://ganjoor.net{RelatedImageSuggestionModel.DiwanUrl}", - DiwanTitle = RelatedImageSuggestionModel.DiwanTitle, - AltText = RelatedImageSuggestionModel.AltText, - LinkType = RMuseum.Models.DiwanIntegration.LinkType.Pinterest, - PinterestUrl = RelatedImageSuggestionModel.PinterestUrl, - PinterestImageUrl = RelatedImageSuggestionModel.PinterestImageUrl - }; - var stringContent = new StringContent(JsonConvert.SerializeObject(model), Encoding.UTF8, "application/json"); - var response = await secureClient.PostAsync($"{APIRoot.Url}/api/artifacts/pinterest", stringContent); - - if (response.StatusCode != HttpStatusCode.OK) - { - LastError = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); - } - else - { - Succeeded = true; - } - } - else - { - LastError = "براہِ کرم دیوان سے خروج کر کے دوبارہ داخل ہوں."; - } - } - } - return Page(); - } - } -} diff --git a/DiwanRazor/Pages/Partials/DiwanPage/PageTypes/_PoemPagePartial.cshtml b/DiwanRazor/Pages/Partials/DiwanPage/PageTypes/_PoemPagePartial.cshtml index 81c0dfd3..5bc56d07 100644 --- a/DiwanRazor/Pages/Partials/DiwanPage/PageTypes/_PoemPagePartial.cshtml +++ b/DiwanRazor/Pages/Partials/DiwanPage/PageTypes/_PoemPagePartial.cshtml @@ -95,41 +95,7 @@

} - @{ - if (!string.IsNullOrEmpty(Model.PinterestUrl)) - { - if (!Model.LoggedIn) - { -
-
-

- اشعار سے متعلق تصاویر تجویز کرنے کے لیے پہلے دیوان میں داخل ہوں. -

-

- دیوان میں داخلہ -

-
-
- } - else - { -
-
- @Html.AntiForgeryToken() - - - - - -
- @if (Model.PinterestUrl == "manual") - { - فائرفاکس ایکسٹینشن سے انسٹاگرام اور پنٹرسٹ سے آسان تجویز - } -
- } - } - } + @* diwan: museum/Pinterest image suggestions removed *@
@if (Model.DiwanPage.PoetOrCat != null) @@ -219,7 +185,6 @@
- @if (Model.DiwanPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.DiwanAudio.RecitationType.Normal).Any()) { @@ -463,7 +428,6 @@
- @if (Model.DiwanPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.DiwanAudio.RecitationType.Normal).Any()) { @@ -488,90 +452,6 @@
- @* ============ MANUSCRIPTS TAB ============ *@ -
-
- - - - @if (Model.DiwanPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.DiwanAudio.RecitationType.Normal).Any()) - { - - } - @if (Model.DiwanPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.DiwanAudio.RecitationType.Commentary).Any()) - { - - } - - @if (Model.SectionsWithRelated.Count > 0) - { - - } - -
- - @* ============ RECITATIONS TAB ============ *@ @if (Model.DiwanPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.DiwanAudio.RecitationType.Normal).Any()) { @@ -579,7 +459,6 @@
- @if (Model.DiwanPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.DiwanAudio.RecitationType.Commentary).Any()) { @@ -609,7 +488,6 @@
- @if (Model.DiwanPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.DiwanAudio.RecitationType.Normal).Any()) { @@ -636,7 +514,6 @@
- @if (Model.DiwanPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.DiwanAudio.RecitationType.Normal).Any()) { @@ -686,7 +563,6 @@
- @if (Model.DiwanPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.DiwanAudio.RecitationType.Normal).Any()) { @@ -770,7 +646,6 @@
- @if (Model.DiwanPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.DiwanAudio.RecitationType.Normal).Any()) { diff --git a/DiwanRazor/Startup.cs b/DiwanRazor/Startup.cs index 0856ff39..68ddded6 100644 --- a/DiwanRazor/Startup.cs +++ b/DiwanRazor/Startup.cs @@ -85,7 +85,6 @@ namespace DiwanRazor options.Conventions.AddPageRoute("/Auth/ResetPassword", "/ResetPassword"); - options.Conventions.AddPageRoute("/ImageRecommendation/Pin", "/Pin"); options.Conventions.AddPageRoute("/Recitations/AudioClip", "/AudioClip"); options.Conventions.AddPageRoute("/Recitations/RecitationsOrder", "/RecitationsOrder");