mirror of
https://github.com/lantean-code/qbtmud.git
synced 2025-10-22 20:42:24 +00:00
79 lines
4.6 KiB
Plaintext
79 lines
4.6 KiB
Plaintext
@page "/rss"
|
|
@layout OtherLayout
|
|
|
|
<div class="content-panel">
|
|
<div class="content-panel__toolbar">
|
|
<MudToolBar Gutters="false" Dense="true">
|
|
@if (!DrawerOpen)
|
|
{
|
|
<MudIconButton Icon="@Icons.Material.Outlined.NavigateBefore" OnClick="NavigateBack" title="Back to torrent list" />
|
|
<MudDivider Vertical="true" />
|
|
}
|
|
<MudText Class="px-5 no-wrap">RSS</MudText>
|
|
<MudDivider Vertical="true" />
|
|
<MudIconButton Icon="@Icons.Material.Outlined.Subscriptions" OnClick="NewSubscription" title="New subscription" />
|
|
<MudIconButton Icon="@Icons.Material.Outlined.MarkEmailRead" OnClick="MarkAsRead" Disabled="@(SelectedFeed is null)" title="Mark items read" />
|
|
<MudIconButton Icon="@Icons.Material.Outlined.Update" OnClick="UpdateAll" title="Update all" />
|
|
<MudDivider Vertical="true" />
|
|
<MudIconButton Icon="@Icons.Material.Outlined.DownloadForOffline" OnClick="EditDownloadRules" title="Edit auto downloading rules" />
|
|
</MudToolBar>
|
|
</div>
|
|
|
|
<div class="content-panel__body">
|
|
<MudContainer MaxWidth="MaxWidth.ExtraExtraLarge" Class="content-panel__container">
|
|
<MudGrid Class="rss-contents">
|
|
<MudItem xs="4" Style="height: 100%">
|
|
<MudList T="string" SelectionMode="SelectionMode.SingleSelection" SelectedValue="SelectedFeed" SelectedValueChanged="SelectedFeedChanged" Dense>
|
|
<MudListItem Icon="@Icons.Material.Filled.MarkEmailUnread" Text="@($"Unread ({UnreadCount})")" Value="@("unread")" />
|
|
@foreach (var (key, feed) in Feeds)
|
|
{
|
|
<MudListItem Icon="@(feed.IsLoading ? Icons.Material.Filled.Sync : Icons.Material.Filled.Wifi)" Class="@(feed.IsLoading ? "spin-animation" : "")" Text="@($"{feed.Title} ({feed.UnreadCount})")" Value="@key" />
|
|
}
|
|
</MudList>
|
|
</MudItem>
|
|
<MudItem xs="4" Style="height: 100%; overflow: auto">
|
|
@if (Articles.Count > 0)
|
|
{
|
|
<MudList T="string" SelectionMode="SelectionMode.SingleSelection" SelectedValue="SelectedArticle" SelectedValueChanged="SelectedArticleChanged" Dense>
|
|
@foreach (var article in Articles)
|
|
{
|
|
<MudListItem Text="@article.Title" Value="article.Id" Icon="@Icons.Material.Filled.Check" IconColor="@(article.IsRead ? Color.Success : Color.Transparent)" />
|
|
}
|
|
</MudList>
|
|
}
|
|
else
|
|
{
|
|
<MudSkeleton SkeletonType="SkeletonType.Rectangle" Height="100%" Animation="Animation.False" Width="100%" />
|
|
}
|
|
</MudItem>
|
|
<MudItem xs="4" Style="height: 100%">
|
|
@if (Article is not null)
|
|
{
|
|
<MudCard>
|
|
<MudCardHeader>
|
|
<CardHeaderContent>
|
|
<MudText Typo="Typo.h6" Style="overflow-wrap: anywhere">@Article.Title</MudText>
|
|
</CardHeaderContent>
|
|
<CardHeaderActions>
|
|
<MudMenu Icon="@Icons.Material.Filled.MoreVert" Dense>
|
|
<MudMenuItem Icon="@Icons.Material.Filled.Download" OnClick="c => DownloadItem(Article.TorrentURL)" title="Download">Download</MudMenuItem>
|
|
<MudMenuItem Icon="@Icons.Material.Filled.Link" Href="@Article.TorrentURL" Target="@Article.TorrentURL" title="Download">Open torrent URL</MudMenuItem>
|
|
</MudMenu>
|
|
</CardHeaderActions>
|
|
</MudCardHeader>
|
|
|
|
<MudCardContent>
|
|
<MudText Typo="Typo.subtitle2">@Article.Date</MudText>
|
|
<MudText Typo="Typo.body1">@Article.Description</MudText>
|
|
</MudCardContent>
|
|
</MudCard>
|
|
}
|
|
else
|
|
{
|
|
<MudSkeleton SkeletonType="SkeletonType.Rectangle" Height="100%" Animation="Animation.False" Width="100%" />
|
|
}
|
|
</MudItem>
|
|
</MudGrid>
|
|
</MudContainer>
|
|
</div>
|
|
</div> |