Related Work Items: #4
This commit is contained in:
Hamid Reza Mohammadi 2024-04-04 15:17:33 +03:30
parent 3a1ba89e5f
commit 913b29f36d
3 changed files with 20 additions and 1 deletions

View File

@ -338,6 +338,15 @@
<input type="checkbox" id="select-@poem.Id" data-value="@poem.Id" class="poemSelect" />
</td>
</tr>
@if(Model.PoemRelatedImages.Any(r => r.PoemId == poem.Id))
{
<tr>
<td colspan="5">
<img src="@Model.PoemRelatedImages.Where(r => r.PoemId == poem.Id).First().ThumbnailImageUrl" />
</td>
</tr>
}
}
<tr>

View File

@ -78,6 +78,8 @@ namespace GanjooRazor.Areas.Admin.Pages
[BindProperty]
public GanjoorCatViewModel CatMeta { get; set; }
public PoemRelatedImageEx[] PoemRelatedImages { get; set; }
private async Task ReadLanguagesAsync()
{
HttpResponseMessage response = await _httpClient.GetAsync($"{APIRoot.Url}/api/translations/languages");
@ -139,6 +141,14 @@ namespace GanjooRazor.Areas.Admin.Pages
}
Numberings = JsonConvert.DeserializeObject<GanjoorNumbering[]>(await numberings.Content.ReadAsStringAsync());
var images = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/cat/{Cat.Cat.Id}/images");
if (!images.IsSuccessStatusCode)
{
LastMessage = JsonConvert.DeserializeObject<string>(await images.Content.ReadAsStringAsync());
return false;
}
PoemRelatedImages = JsonConvert.DeserializeObject<PoemRelatedImageEx[]>(await images.Content.ReadAsStringAsync());
await ReadLanguagesAsync();
return true;
}

View File

@ -3879,7 +3879,7 @@ namespace RMuseum.Services.Implementation
where
link.ReviewResult == ReviewResult.Approved
&&
poem.Id == catId
poem.CatId == catId
orderby poem.Id
select new PoemRelatedImageEx()
{