diff --git a/GanjooRazor/Pages/Index.cshtml.cs b/GanjooRazor/Pages/Index.cshtml.cs
index aca6a538..121cc72c 100644
--- a/GanjooRazor/Pages/Index.cshtml.cs
+++ b/GanjooRazor/Pages/Index.cshtml.cs
@@ -1170,5 +1170,29 @@ namespace GanjooRazor.Pages
}
};
}
+
+ public async Task OnGetMoreQuotedPoemsPartialAsync(int poemId, int skip, string poetImageUrl, string poetNickName)
+ {
+ string url = $"{APIRoot.Url}/api/ganjoor/poem/{poemId}/quoteds?skip={skip}&itemsCount=1000";
+ var response = await _httpClient.GetAsync(url);
+ if (!response.IsSuccessStatusCode)
+ return new BadRequestObjectResult(JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()));
+
+ var quoteds = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject>();
+
+ return new PartialViewResult()
+ {
+ ViewName = "MultipleQuotedPoemsPartial",
+ ViewData = new ViewDataDictionary(new EmptyModelMetadataProvider(), new ModelStateDictionary())
+ {
+ Model = new MultipleQuotedPoemsPartialModel()
+ {
+ GanjoorQuotedPoems = quoteds.ToArray(),
+ PoetImageUrl = poetImageUrl,
+ PoetNickName = poetNickName
+ }
+ }
+ };
+ }
}
}
\ No newline at end of file
diff --git a/GanjooRazor/Pages/_GanjoorPagePartial.cshtml b/GanjooRazor/Pages/_GanjoorPagePartial.cshtml
index 0493018c..4771f011 100644
--- a/GanjooRazor/Pages/_GanjoorPagePartial.cshtml
+++ b/GanjooRazor/Pages/_GanjoorPagePartial.cshtml
@@ -632,7 +632,7 @@
{
}
diff --git a/GanjooRazor/wwwroot/js/bk.js b/GanjooRazor/wwwroot/js/bk.js
index 3eb21529..651a0d80 100644
--- a/GanjooRazor/wwwroot/js/bk.js
+++ b/GanjooRazor/wwwroot/js/bk.js
@@ -1445,3 +1445,31 @@ function loadMoreQuotedForRelatedPoem(quoteRecordId, poemId, relatedPoemId, poet
});
}
+
+function loadMoreQuotedPoems(poemId, skip, poetImageUrl, poetNickName) {
+ var loadButton = document.getElementById('load-more-quoted');
+ if (loadButton != null) {
+ loadButton.remove();
+ }
+ var divParent = document.getElementById('more-quoted-placeholder');
+ var imgeId = 'load-more-quoted-loadingimg';
+ divParent.innerHTML = divParent.innerHTML + '
';
+
+ $.ajax({
+ type: "GET",
+ url: '?Handler=MoreQuotedPoemsPartial',
+ data: {
+ poemId: poemId,
+ skip: skip,
+ poetImageUrl: poetImageUrl,
+ poetNickName: poetNickName
+ },
+ success: function (data) {
+
+ var imgElement = document.getElementById(imgeId);
+ imgElement.remove();
+
+ $(data).appendTo(document.getElementById('more-quoted-placeholder'));
+ },
+ });
+}