121 lines
2.4 KiB
Plaintext
121 lines
2.4 KiB
Plaintext
@layout PageLayout
|
|
|
|
@inherits BasePage
|
|
|
|
@inject INoteService NoteService
|
|
@implements IDisposable
|
|
|
|
@inject IDataCollectionService DataCollectionService
|
|
|
|
@page "/notes/{href1}/{href2?}/{href3?}/{href4?}/{href5?}"
|
|
|
|
|
|
@if (!NoteService.IsLoaded())
|
|
{
|
|
<LoadingComponent/>
|
|
}
|
|
else
|
|
{
|
|
<LayoutWithSidebarComponent>
|
|
<Sidebar>
|
|
<NoteNavComponent
|
|
Connections="NoteService.NoteConnectionModels"
|
|
Notes="NoteService.NoteContentModels"/>
|
|
</Sidebar>
|
|
<Content>
|
|
<PaperComponent>
|
|
@foreach (var note in NoteService.NoteContentModels)
|
|
{
|
|
if (!note.Href.Equals(Href))
|
|
{
|
|
continue;
|
|
}
|
|
|
|
<NoteComponent NoteContentModel="note"/>
|
|
}
|
|
</PaperComponent>
|
|
</Content>
|
|
</LayoutWithSidebarComponent>
|
|
}
|
|
|
|
<style>
|
|
pre code {
|
|
color: white;
|
|
}
|
|
|
|
h1 {
|
|
display: block;
|
|
font-size: 2em;
|
|
margin-top: 0.67em;
|
|
margin-bottom: 0.67em;
|
|
margin-left: 0;
|
|
margin-right: 0;
|
|
font-weight: bold;
|
|
}
|
|
|
|
h2 {
|
|
display: block;
|
|
font-size: 1.5em;
|
|
margin-top: 0.83em;
|
|
margin-bottom: 0.83em;
|
|
margin-left: 0;
|
|
margin-right: 0;
|
|
font-weight: bold;
|
|
}
|
|
|
|
li {
|
|
display: list-item;
|
|
}
|
|
|
|
p {
|
|
display: block;
|
|
margin-top: 1em;
|
|
margin-bottom: 1em;
|
|
margin-left: 0;
|
|
margin-right: 0;
|
|
}
|
|
|
|
ul {
|
|
display: block;
|
|
list-style-type: disc;
|
|
margin-top: 1em;
|
|
margin-bottom: 1em;
|
|
margin-left: 0;
|
|
margin-right: 0;
|
|
padding-left: 40px;
|
|
}
|
|
|
|
pre {
|
|
background: black;
|
|
padding: 2px;
|
|
}
|
|
</style>
|
|
|
|
@code {
|
|
|
|
[Parameter] public string? Href1 { get; set; }
|
|
|
|
[Parameter] public string? Href2 { get; set; }
|
|
|
|
[Parameter] public string? Href3 { get; set; }
|
|
|
|
[Parameter] public string? Href4 { get; set; }
|
|
|
|
[Parameter] public string? Href5 { get; set; }
|
|
|
|
private string Href => Href5 ?? Href4 ?? Href3 ?? Href2 ?? Href1 ?? "";
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
base.OnInitialized();
|
|
NoteService.Subscribe(StateHasChanged);
|
|
|
|
NoteService.Load();
|
|
}
|
|
|
|
void IDisposable.Dispose()
|
|
{
|
|
NoteService.Unsubscribe(StateHasChanged);
|
|
}
|
|
|
|
} |