bulletboards/ImageBoardServerApp/Pages/Basic/Index.razor
limited_dev 2a73df7f58 feat: improved index
Signed-off-by: limited_dev <loginakkisativ@gmail.com>
2023-06-13 19:59:33 +02:00

50 lines
No EOL
1.7 KiB
Text

@page "/"
@using ImageBoardServerApp.Data.Repository
@inject AuthenticationStateProvider authStateProvider
<h1>BulletBoard</h1>
<p>
This is a simple <a href="https://en.wiktionary.org/wiki/imageboard">imageboard</a> made in <a href="https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blazor">Razor Server</a>.
<br/>
This project was made by Pierre, Jennifer and Eric.
<br/>
This project is licensed under the <a href="https://www.gnu.org/licenses/gpl-3.0.en.html#license-text">GPL-3.0</a>.
<br/>
Click <a href="https://www.gnu.org/philosophy/free-sw.en.html">here</a> to learn more about free software.
<br/>
<br>
We're currently @amountOfUsers User(s), viewing @amountOfPosts Post(s) with @amountOfComments Comment(s).
<br/>
Click here to:
<AuthorizeView>
<Authorized>
<a href="/sys/you">Edit your account information</a>
</Authorized>
<NotAuthorized>
<a href="/sys/register">Create an account to start posting</a>
<a>&emsp;</a>
or
<a>&emsp;</a>
<a href="/sys/login">Log into your account</a>
</NotAuthorized>
</AuthorizeView>
</p>
@code{
private int amountOfPosts = -1;
private int amountOfComments = -1;
private int amountOfUsers = -1;
protected override async Task OnParametersSetAsync()
{
var posts = await PostsRepository.getPostsAsync();
amountOfPosts = posts.Count;
var comments = await CommentsRepository.getCommentsAsync();
amountOfComments = comments.Count;
var users = await UsersRepository.getUsersAsync();
amountOfUsers = users.Count;
await base.OnParametersSetAsync();
}
}