feat: add login/dashboard link to footer
This commit is contained in:
parent
eb4777e330
commit
c1e5227289
@ -1,6 +1,10 @@
|
|||||||
@using OliverBooth.Data.Blog
|
@using OliverBooth.Data.Blog
|
||||||
|
@using OliverBooth.Data.Web
|
||||||
@using OliverBooth.Services
|
@using OliverBooth.Services
|
||||||
@inject IBlogPostService BlogPostService
|
@inject IBlogPostService BlogPostService
|
||||||
|
@inject IUserService UserService
|
||||||
|
@inject ISessionService SessionService
|
||||||
|
|
||||||
@{
|
@{
|
||||||
HttpRequest request = Context.Request;
|
HttpRequest request = Context.Request;
|
||||||
var url = new Uri($"{request.Scheme}://{request.Host}{request.Path}{request.QueryString}");
|
var url = new Uri($"{request.Scheme}://{request.Host}{request.Path}{request.QueryString}");
|
||||||
@ -129,6 +133,15 @@
|
|||||||
<ul class="footer-nav" style="margin-top: 20px;">
|
<ul class="footer-nav" style="margin-top: 20px;">
|
||||||
<li>© @DateTime.UtcNow.Year</li>
|
<li>© @DateTime.UtcNow.Year</li>
|
||||||
<li><a asp-page="/privacy/index">Privacy</a></li>
|
<li><a asp-page="/privacy/index">Privacy</a></li>
|
||||||
|
@if (SessionService.TryGetSession(Context.Request, out ISession? session) &&
|
||||||
|
UserService.TryGetUser(session.UserId, out _))
|
||||||
|
{
|
||||||
|
<li><a asp-page="/admin/index">Dashboard</a></li>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<li><a asp-page="/admin/login">Login</a></li>
|
||||||
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
Loading…
Reference in New Issue
Block a user