79 lines
1.8 KiB
Plaintext
79 lines
1.8 KiB
Plaintext
@using Blog3000.Client.Shared
|
|
@inherits LayoutComponentBase
|
|
@implements IDisposable
|
|
@inject Config CurrConfig
|
|
@inject IJSRuntime JSRuntime
|
|
|
|
|
|
<div class="sidebar">
|
|
<NavMenu />
|
|
</div>
|
|
|
|
|
|
|
|
<div class="main">
|
|
<!-- div class="top-row px-4">
|
|
<a href="http://blazor.net" target="_blank" class="ml-md-auto">About</a>
|
|
</div-->
|
|
<div class="updater">
|
|
<span><Updater /></span>
|
|
</div>
|
|
|
|
<div class="content px-4">
|
|
@Body
|
|
</div>
|
|
<hr />
|
|
|
|
@if (defaultMailAddress != null)
|
|
{
|
|
<div class="blog-contact"><a href="@defaultMailAddress">@defaultMailAddressTxt</a></div>
|
|
}
|
|
<div class="blog-powered-by">Powered by blog3000 (C) M. Höß, Version 0.1 PreAlpha Build @build, powered by C#, ASP.NetCore, Blazor and Gentoo-Linux :)</div>
|
|
|
|
</div>
|
|
|
|
|
|
@code {
|
|
|
|
private string build;
|
|
private string defaultMailAddress;
|
|
private string defaultMailAddressTxt;
|
|
|
|
public void Dispose()
|
|
{
|
|
CurrConfig.ConfigChanged -= ConfigChanged;
|
|
}
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
build = Blog3000.Client.BuildVersion.BUILD_DATE;
|
|
|
|
CurrConfig.ConfigChanged += ConfigChanged;
|
|
_ = CurrConfig.FetchAsync();
|
|
Refresh();
|
|
|
|
}
|
|
|
|
private void ConfigChanged(object sender, EventArgs e)
|
|
{
|
|
Refresh();
|
|
}
|
|
|
|
private void Refresh()
|
|
{
|
|
defaultMailAddress = CurrConfig?.Main?.DefaultMailAddress != null ? $"mailto:{CurrConfig.Main.DefaultMailAddress}" : null;
|
|
defaultMailAddressTxt = CurrConfig?.Main?.DefaultMailAddress != null ? $"Send a comment to {CurrConfig.Main.DefaultMailAddress}" : null;
|
|
|
|
if (CurrConfig?.Main?.Title != null)
|
|
{
|
|
JSRuntime.InvokeVoidAsync("window.setTitle", CurrConfig.Main.Title);
|
|
}
|
|
|
|
|
|
StateHasChanged();
|
|
}
|
|
|
|
}
|
|
|
|
|