bulletboards/ImageBoardServerApp/Pages/Basic/Index.razor

50 lines
1.7 KiB
Text
Raw Normal View History

2023-01-18 12:56:24 +00:00
@page "/"
@using ImageBoardServerApp.Data.Repository
2023-02-02 07:15:43 +00:00
@inject AuthenticationStateProvider authStateProvider
2023-01-18 12:56:24 +00:00
<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();
}
}