diff --git a/GanjooRazor/Pages/GanjoorPage.cshtml.cs b/GanjooRazor/Pages/GanjoorPage.cshtml.cs index 385294be..018cfbb7 100644 --- a/GanjooRazor/Pages/GanjoorPage.cshtml.cs +++ b/GanjooRazor/Pages/GanjoorPage.cshtml.cs @@ -213,6 +213,23 @@ namespace GanjooRazor.Pages }); } + /// + /// like / dislike / clear rating for a comment (AJAX, called from rateComment() in bk.js) + /// + public Task OnPostRateCommentAsync(int id, short value) + { + return WithSecureClientAsync(async secureClient => + { + var response = await secureClient.PostAsync($"{APIRoot.Url}/api/ganjoor/poem/comment/{id}/rate?value={value}", null); + if (!response.IsSuccessStatusCode) + { + return new BadRequestObjectResult(await ReadErrorMessageAsync(response)); + } + var result = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); + return new JsonResult(result); + }); + } + /// /// Poets (for this page's own #hdr2 author dropdown - same pattern as Search/Simi/etc.) /// diff --git a/GanjooRazor/Pages/Map.cshtml b/GanjooRazor/Pages/Map.cshtml index bf4227ef..66dd1fc5 100644 --- a/GanjooRazor/Pages/Map.cshtml +++ b/GanjooRazor/Pages/Map.cshtml @@ -23,7 +23,7 @@ font-family: 'Vazirmatn' } - + diff --git a/GanjooRazor/Pages/Misc/Photos.cshtml b/GanjooRazor/Pages/Misc/Photos.cshtml index 7598abd9..56c69f1e 100644 --- a/GanjooRazor/Pages/Misc/Photos.cshtml +++ b/GanjooRazor/Pages/Misc/Photos.cshtml @@ -15,7 +15,7 @@ - + - + diff --git a/GanjooRazor/Pages/Recitations/ReportRecitation.cshtml b/GanjooRazor/Pages/Recitations/ReportRecitation.cshtml index fbb9143d..3fc51aca 100644 --- a/GanjooRazor/Pages/Recitations/ReportRecitation.cshtml +++ b/GanjooRazor/Pages/Recitations/ReportRecitation.cshtml @@ -238,7 +238,7 @@ - + diff --git a/GanjooRazor/Pages/Shared/_AdminLayout.cshtml b/GanjooRazor/Pages/Shared/_AdminLayout.cshtml index 63f751c3..c3c01f62 100644 --- a/GanjooRazor/Pages/Shared/_AdminLayout.cshtml +++ b/GanjooRazor/Pages/Shared/_AdminLayout.cshtml @@ -35,7 +35,7 @@ }); - + - + - +