This commit is contained in:
parent
ac5efe3113
commit
4fd51e24d0
@ -1,4 +1,4 @@
|
||||
@page "/sources/list"
|
||||
@page "/sources"
|
||||
@using Newsbot.Collector.Client
|
||||
@using Newsbot.Collector.Client.Domain.Dto
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
<tr>
|
||||
<td>Title</td>
|
||||
<td>Publish Date</td>
|
||||
<td>Tags</td>
|
||||
</tr>
|
||||
@foreach (var item in Data ??= new List<SourcesDto>())
|
||||
{
|
||||
@ -21,12 +22,34 @@
|
||||
<a href="@item.Url" target="_blank">@item.Name</a><br/>
|
||||
</td>
|
||||
<td>@item.Source</td>
|
||||
<td>@FlattenTags(@item.Tags ??= new List<string>())</td>
|
||||
<td>
|
||||
<a href="/articles/sources/@item.Id">View News</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
|
||||
@code {
|
||||
private List<SourcesDto> Data { get; set; }
|
||||
private List<SourcesDto>? Data { get; set; }
|
||||
|
||||
private string FlattenTags(List<string> tags)
|
||||
{
|
||||
|
||||
string res = "";
|
||||
foreach (var tag in tags)
|
||||
{
|
||||
if (res == "")
|
||||
{
|
||||
res = tag;
|
||||
}
|
||||
else
|
||||
{
|
||||
res += $", {tag}";
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user