feature(BuildCalc) Added reset button, can change micro delay, and can alter timing interval again
This commit is contained in:
@@ -7,15 +7,15 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<DefineConstants>TRACE;NO_SQL</DefineConstants>
|
||||
<DefineConstants>TRACE;NO_SQL</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<DefineConstants>TRACE;NO_SQL</DefineConstants>
|
||||
<DefineConstants>TRACE;NO_SQL</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<SupportedPlatform Include="browser" />
|
||||
<SupportedPlatform Include="browser"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -25,14 +25,14 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Inputs\" />
|
||||
<Folder Include="Inputs\"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Model\Model.csproj" />
|
||||
<ProjectReference Include="..\Services\Services.csproj" />
|
||||
<ProjectReference Include="..\Model\Model.csproj"/>
|
||||
<ProjectReference Include="..\Services\Services.csproj"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Inputs\" />
|
||||
<None Remove="Inputs\"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@if (isOnDev) {
|
||||
@if (isOnDev)
|
||||
{
|
||||
<div class="devOnlyContainer">
|
||||
<div class="devOnlyTitleContainer">
|
||||
<div class="devOnlyTitle">
|
||||
@@ -65,7 +66,8 @@
|
||||
|
||||
bool isOnDev;
|
||||
|
||||
protected override void OnInitialized() {
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
isOnDev = NavigationManager.BaseUri.Contains("https://localhost");
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<div class="panelDisplay">
|
||||
@ChildContent
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.panelDisplay {
|
||||
border: 2px solid var(--paper-border);
|
||||
padding: 20px;
|
||||
background-color: var(--paper);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-grow: 1;
|
||||
}
|
||||
</style>
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public RenderFragment ChildContent { get; set; } = default!;
|
||||
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
@using Model.Feedback
|
||||
<div class="alertContainer @Type.ToLower()">
|
||||
@if (Title != null) {
|
||||
<div class="alertContainer @Type.ToLower()">
|
||||
@if (Title != null)
|
||||
{
|
||||
<div class="alertTitle">
|
||||
@Title
|
||||
</div>
|
||||
}
|
||||
@if (Message != null) {
|
||||
@if (Message != null)
|
||||
{
|
||||
<div>
|
||||
@Message
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
checked="@Value
|
||||
"@onchange="OnChange"/>
|
||||
</div>
|
||||
@if (Info != "") {
|
||||
@if (Info != "")
|
||||
{
|
||||
<div class="formInfo">
|
||||
@Info
|
||||
</div>
|
||||
@@ -66,7 +67,8 @@
|
||||
|
||||
private string labelId = "";
|
||||
|
||||
protected override void OnInitialized() {
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
labelId = Label.ToLower().Replace(" ", "_");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<div class="displayContainer">
|
||||
@if (Label != "") {
|
||||
@if (Label != "")
|
||||
{
|
||||
<div class="formLabel">
|
||||
@Label
|
||||
</div>
|
||||
@@ -7,7 +8,8 @@
|
||||
<div class="displayContent">
|
||||
@Display
|
||||
</div>
|
||||
@if (Info != "") {
|
||||
@if (Info != "")
|
||||
{
|
||||
<div class="formInfo">
|
||||
@Info
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
@code {
|
||||
string Output = "";
|
||||
|
||||
public void OnChange(ChangeEventArgs changeEventArgs) {
|
||||
public void OnChange(ChangeEventArgs changeEventArgs)
|
||||
{
|
||||
var encoded = HttpUtility.HtmlEncode(changeEventArgs.Value!.ToString());
|
||||
Output = encoded?.Replace("@", "@@")!;
|
||||
Output = Output.Replace("\n", "<br />");
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
@using Services
|
||||
@using Model.MemoryTester
|
||||
@using Services.Immortal
|
||||
@using Model.MemoryTester
|
||||
@implements IDisposable
|
||||
|
||||
@inject IMemoryTesterService MemoryTesterService
|
||||
|
||||
<div class="formGuessContainer">
|
||||
@if (MemoryQuestion.Name != "") {
|
||||
@if (MemoryQuestion.Name != "")
|
||||
{
|
||||
<div class="formLabel">
|
||||
@MemoryQuestion.Name
|
||||
</div>
|
||||
@@ -94,46 +94,57 @@
|
||||
|
||||
private string labelId = "";
|
||||
|
||||
protected override void OnInitialized() {
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
labelId = Label.ToLower().Replace(" ", "_") + MemoryQuestion.Id;
|
||||
|
||||
MemoryTesterService.Subscribe(OnMemoryEvent);
|
||||
|
||||
if (MemoryQuestion.IsRevealed) {
|
||||
if (MemoryQuestion.IsRevealed)
|
||||
{
|
||||
guess = MemoryQuestion.Answer.ToString();
|
||||
}
|
||||
|
||||
OnRefresh();
|
||||
}
|
||||
|
||||
void IDisposable.Dispose() {
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
MemoryTesterService.Unsubscribe(OnMemoryEvent);
|
||||
}
|
||||
|
||||
void OnMemoryEvent(MemoryTesterEvent memoryTesterEvent) {
|
||||
if (memoryTesterEvent == MemoryTesterEvent.OnVerify) {
|
||||
void OnMemoryEvent(MemoryTesterEvent memoryTesterEvent)
|
||||
{
|
||||
if (memoryTesterEvent == MemoryTesterEvent.OnVerify)
|
||||
{
|
||||
OnVerify();
|
||||
}
|
||||
|
||||
if (memoryTesterEvent == MemoryTesterEvent.OnRefresh) {
|
||||
if (memoryTesterEvent == MemoryTesterEvent.OnRefresh)
|
||||
{
|
||||
OnRefresh();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnAfterRender(bool firstRender) {
|
||||
if (MemoryQuestion.IsRevealed) {
|
||||
protected override void OnAfterRender(bool firstRender)
|
||||
{
|
||||
if (MemoryQuestion.IsRevealed)
|
||||
{
|
||||
guess = MemoryQuestion.Answer.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
void OnVerify() {
|
||||
void OnVerify()
|
||||
{
|
||||
IsSubmitted = true;
|
||||
}
|
||||
|
||||
void OnRefresh() {
|
||||
void OnRefresh()
|
||||
{
|
||||
guess = "";
|
||||
|
||||
if (MemoryQuestion.IsRevealed) {
|
||||
if (MemoryQuestion.IsRevealed)
|
||||
{
|
||||
guess = MemoryQuestion.Answer.ToString();
|
||||
}
|
||||
|
||||
@@ -141,10 +152,12 @@
|
||||
IsSubmitted = false;
|
||||
}
|
||||
|
||||
void OnGuessChanged(ChangeEventArgs changeEventArgs) {
|
||||
void OnGuessChanged(ChangeEventArgs changeEventArgs)
|
||||
{
|
||||
guess = changeEventArgs.Value!.ToString()!;
|
||||
|
||||
OnChange.InvokeAsync(new AnswerEventArgs {
|
||||
OnChange.InvokeAsync(new AnswerEventArgs
|
||||
{
|
||||
Name = MemoryQuestion.Name,
|
||||
IsCorrect = int.Parse(guess) == MemoryQuestion.Answer,
|
||||
Guess = int.Parse(guess)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<div class="formNumberContainer">
|
||||
@if (FormLabelComponent != null) {
|
||||
@if (FormLabelComponent != null)
|
||||
{
|
||||
<FormLabelComponent>@FormLabelComponent</FormLabelComponent>
|
||||
}
|
||||
<div>
|
||||
@@ -11,7 +12,8 @@
|
||||
value="@Value"
|
||||
@onchange="OnChange"/>
|
||||
</div>
|
||||
@if (FormInfoComponent != null) {
|
||||
@if (FormInfoComponent != null)
|
||||
{
|
||||
<FormInfoComponent>@FormInfoComponent</FormInfoComponent>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<div style="display: flex; width: 100%; flex-direction: column; gap:6px;">
|
||||
@if (FormLabelComponent != null) {
|
||||
@if (FormLabelComponent != null)
|
||||
{
|
||||
<FormLabelComponent>@FormLabelComponent</FormLabelComponent>
|
||||
}
|
||||
<select style="background-color: #2C2E33; width: 100%; border:3px solid #A8ADB9; border-radius:1px; padding: 8px;"
|
||||
@@ -7,7 +8,8 @@
|
||||
@ChildContent
|
||||
</select>
|
||||
|
||||
@if (FormInfoComponent != null) {
|
||||
@if (FormInfoComponent != null)
|
||||
{
|
||||
<FormInfoComponent>@FormInfoComponent</FormInfoComponent>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<div class="form-text-container">
|
||||
@if (Label != "") {
|
||||
@if (Label != "")
|
||||
{
|
||||
<div class="form-label">
|
||||
@Label
|
||||
</div>
|
||||
@@ -12,7 +13,8 @@
|
||||
value="@Value"
|
||||
@onchange="OnChange" />
|
||||
</div>
|
||||
@if (Info != "") {
|
||||
@if (Info != "")
|
||||
{
|
||||
<div class="form-info">
|
||||
@Info
|
||||
</div>
|
||||
@@ -83,7 +85,8 @@
|
||||
|
||||
private string labelId = "";
|
||||
|
||||
protected override void OnInitialized() {
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
labelId = Label.ToLower().Replace(" ", "_");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<div class="formContainer">
|
||||
@if (Label != "") {
|
||||
@if (Label != "")
|
||||
{
|
||||
<div class="formLabel">
|
||||
@Label
|
||||
</div>
|
||||
@@ -13,7 +14,8 @@
|
||||
id="@labelId"
|
||||
@onchange="OnChange"/>
|
||||
</div>
|
||||
@if (Info != "") {
|
||||
@if (Info != "")
|
||||
{
|
||||
<div class="formInfo">
|
||||
@Info
|
||||
</div>
|
||||
@@ -68,7 +70,8 @@
|
||||
|
||||
private string labelId = "";
|
||||
|
||||
protected override void OnInitialized() {
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
labelId = Label.ToLower().Replace(" ", "_");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<div class="infoContainer">
|
||||
@if (InfoQuestionComponent != null) {
|
||||
@if (InfoQuestionComponent != null)
|
||||
{
|
||||
<div class="infoTitle">@InfoQuestionComponent</div>
|
||||
}
|
||||
@if (InfoAnswerComponent != null) {
|
||||
@if (InfoAnswerComponent != null)
|
||||
{
|
||||
<div>@InfoAnswerComponent</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -45,7 +45,8 @@
|
||||
[Parameter]
|
||||
public ButtonType ButtonType { get; set; } = default!;
|
||||
|
||||
private void ButtonClicked(EventArgs eventArgs) {
|
||||
private void ButtonClicked(EventArgs eventArgs)
|
||||
{
|
||||
OnClick.InvokeAsync(eventArgs);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
<div class="groupButtonContainerContainer">
|
||||
<div class="groupButtonContainer">
|
||||
@foreach (var choice in Choices) {
|
||||
var styleClass = "";
|
||||
if (choice.Equals(Choice)) {
|
||||
styleClass = "selected";
|
||||
<div class="groupButtonContainer">
|
||||
@foreach (var choice in Choices)
|
||||
{
|
||||
var styleClass = "";
|
||||
if (choice.Equals(Choice))
|
||||
{
|
||||
styleClass = "selected";
|
||||
}
|
||||
<button @onclick="@(e => OnChangeChoice(choice))" class="groupChoiceButton @styleClass">@choice</button>
|
||||
}
|
||||
<button @onclick="@(e => OnChangeChoice(choice))" class="groupChoiceButton @styleClass">@choice</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
|
||||
@@ -76,12 +78,15 @@
|
||||
[Parameter]
|
||||
public EventCallback<string> OnClick { get; set; }
|
||||
|
||||
|
||||
protected override void OnInitialized() { }
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
}
|
||||
|
||||
void OnChangeChoice(string choice)
|
||||
{
|
||||
Choice = choice;
|
||||
OnClick.InvokeAsync(choice);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
namespace Components.Inputs;
|
||||
|
||||
public enum ButtonType {
|
||||
public enum ButtonType
|
||||
{
|
||||
Primary, // Positive Actions
|
||||
Secondary // Destruction Action
|
||||
}
|
||||
@@ -25,4 +25,5 @@
|
||||
|
||||
[Parameter]
|
||||
public string Href { get; set; } = "";
|
||||
|
||||
}
|
||||
@@ -25,4 +25,5 @@
|
||||
|
||||
[Parameter]
|
||||
public string Href { get; set; } = "";
|
||||
|
||||
}
|
||||
@@ -1,10 +1,6 @@
|
||||
@using Model.Entity
|
||||
@using Services.Website
|
||||
@using System.ComponentModel.DataAnnotations
|
||||
@using Model.Entity.Data
|
||||
@using Services
|
||||
|
||||
@inject IEntityDialogService entityDialogService
|
||||
@inject IEntityDialogService entityDialogService
|
||||
|
||||
|
||||
@if (EntityId == null)
|
||||
@@ -17,8 +13,9 @@ else
|
||||
}
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter] public string EntityId { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public string EntityId { get; set; } = default!;
|
||||
|
||||
private EntityModel Entity => DATA.Get()[EntityId];
|
||||
|
||||
@@ -26,4 +23,5 @@ else
|
||||
{
|
||||
entityDialogService.AddDialog(EntityId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
.entityLabel {
|
||||
font-weight: bolder;
|
||||
box-shadow: 1px 1px 0 0 rgba(0,0,0,0.2);
|
||||
box-shadow: 1px 1px 0 0 rgba(0, 0, 0, 0.2);
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
<div class="layoutWithSidebar">
|
||||
<div class="layoutWithSidebar">
|
||||
<div class="layoutSidebar">
|
||||
@Sidebar
|
||||
</div>
|
||||
@@ -49,10 +48,12 @@
|
||||
|
||||
</style>
|
||||
|
||||
@code {
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public RenderFragment Sidebar { get; set; } = default!;
|
||||
|
||||
|
||||
[Parameter]
|
||||
public RenderFragment Content { get; set; } = default!;
|
||||
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
@((MarkupString)MarkdownText)
|
||||
@using Markdig
|
||||
@((MarkupString)MarkdownText)
|
||||
|
||||
@code {
|
||||
|
||||
[Inject]
|
||||
protected HttpClient Http { get; set; } = default!;
|
||||
|
||||
@@ -9,7 +11,9 @@
|
||||
|
||||
private string MarkdownText { get; set; } = "";
|
||||
|
||||
protected override async Task OnInitializedAsync() {
|
||||
MarkdownText = Markdig.Markdown.ToHtml(await Http.GetStringAsync($"markdown/{MarkdownFileName}.md"));
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
MarkdownText = Markdown.ToHtml(await Http.GetStringAsync($"markdown/{MarkdownFileName}.md"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +1,16 @@
|
||||
@inject INavigationService navigationService;
|
||||
@inject NavigationManager navigationManager;
|
||||
|
||||
@if (isOnPage) {
|
||||
@if (isOnPage)
|
||||
{
|
||||
<NavLink href="@Page.Href" class="desktopNavLink navSelected">
|
||||
<div class="navName">
|
||||
@Page.Name
|
||||
</div>
|
||||
</NavLink>
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
<NavLink @onclick="() => navigationService.ChangeNavigationState(NavigationStateType.Default)" href="@Page.Href" class="desktopNavLink">
|
||||
<div class="navName">
|
||||
@Page.Name
|
||||
@@ -67,7 +69,8 @@ else {
|
||||
|
||||
bool isOnPage = false;
|
||||
|
||||
protected override Task OnParametersSetAsync() {
|
||||
protected override Task OnParametersSetAsync()
|
||||
{
|
||||
var uri = navigationManager.Uri.Remove(0, navigationManager.BaseUri.Count()).ToLower();
|
||||
|
||||
isOnPage = Page.Href.ToLower().Equals(uri);
|
||||
@@ -75,11 +78,13 @@ else {
|
||||
}
|
||||
|
||||
|
||||
void OnNavigationChanged() {
|
||||
void OnNavigationChanged()
|
||||
{
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
void OnBack() {
|
||||
void OnBack()
|
||||
{
|
||||
navigationService.Back();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@using Model.Website
|
||||
|
||||
<div class="sectionContainer">
|
||||
@foreach (var childPage in Section.WebPageModels) {
|
||||
if (childPage.IsPrivate.Equals("True")) {
|
||||
<div class="sectionContainer">
|
||||
@foreach (var childPage in Section.WebPageModels)
|
||||
{
|
||||
if (childPage.IsPrivate.Equals("True"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
<DesktopNavLinkComponent Page=childPage></DesktopNavLinkComponent>
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
@using Model.Website
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
|
||||
<div class="mobileFooter">
|
||||
<div class="mobileFooter">
|
||||
<div class="mobileNavSectionsContainer">
|
||||
@foreach (var webSection in WebSections) {
|
||||
@foreach (var webSection in WebSections)
|
||||
{
|
||||
<div class="mobileNavSectionButton" @onclick="() => OnSectionClicked(webSection)" @onclick:preventDefault="true" @onclick:stopPropagation="true">
|
||||
<div class="mobileNavSectionButtonText">
|
||||
@webSection?.Name
|
||||
@@ -15,14 +13,17 @@
|
||||
<div class="fullPageButton @(selectedSection != null)" @onclick="OnPageClicked" @onclick:stopPropagation="false" @onclick:preventDefault="false">
|
||||
</div>
|
||||
|
||||
@if (selectedSection != null) {
|
||||
@if (selectedSection != null)
|
||||
{
|
||||
List<WebPageModel?> webPages = (from page in WebPages
|
||||
where page.WebSectionModelId == selectedSection.Id
|
||||
select page).ToList()!;
|
||||
|
||||
<div class="mobileNavPagesContainer">
|
||||
@foreach (var webPage in webPages) {
|
||||
if (webPage!.IsPrivate.Equals("True")) {
|
||||
@foreach (var webPage in webPages)
|
||||
{
|
||||
if (webPage!.IsPrivate.Equals("True"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
<div class="mobileNavPageButton" @onclick="() => OnPageLinkClicked(webPage)" @onclick:preventDefault="true" @onclick:stopPropagation="true">
|
||||
@@ -143,7 +144,7 @@
|
||||
|
||||
[Parameter]
|
||||
public List<WebPageModel> WebPages { get; set; } = default!;
|
||||
|
||||
|
||||
#else
|
||||
[Parameter]
|
||||
public DbSet<WebSectionModel> WebSections { get; set; }
|
||||
@@ -151,27 +152,30 @@
|
||||
[Parameter]
|
||||
public DbSet<WebPageModel> WebPages { get; set; }
|
||||
#endif
|
||||
|
||||
|
||||
[Inject]
|
||||
public NavigationManager NavigationManager { get; set; } = default!;
|
||||
|
||||
|
||||
private WebSectionModel? selectedSection;
|
||||
private WebPageModel? selectedPage;
|
||||
private WebPageModel? selectedPage;
|
||||
|
||||
|
||||
void OnSectionClicked(WebSectionModel? webSection) {
|
||||
void OnSectionClicked(WebSectionModel? webSection)
|
||||
{
|
||||
selectedSection = webSection;
|
||||
}
|
||||
|
||||
void OnPageLinkClicked(WebPageModel? webPage) {
|
||||
void OnPageLinkClicked(WebPageModel? webPage)
|
||||
{
|
||||
selectedPage = webPage;
|
||||
selectedSection = null;
|
||||
|
||||
NavigationManager.NavigateTo(webPage?.Href!);
|
||||
}
|
||||
|
||||
void OnPageClicked(EventArgs eventArgs) {
|
||||
void OnPageClicked(EventArgs eventArgs)
|
||||
{
|
||||
selectedPage = null;
|
||||
selectedSection = null;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
|
||||
|
||||
<div class="tabletNav @navOpen">
|
||||
@foreach (var webSection in WebSections) {
|
||||
@foreach (var webSection in WebSections)
|
||||
{
|
||||
var pages = (from page in WebPages
|
||||
where page.WebSectionModelId == webSection.Id
|
||||
select page).ToList();
|
||||
@@ -30,8 +31,10 @@
|
||||
</div>
|
||||
|
||||
<div class="tabletNavItems">
|
||||
@foreach (var webPage in pages) {
|
||||
if (webPage.IsPrivate.Equals("True")) {
|
||||
@foreach (var webPage in pages)
|
||||
{
|
||||
if (webPage.IsPrivate.Equals("True"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
<NavLink href="@webPage.Href" class="tabletNavItem" @onclick="OnPageClicked">
|
||||
@@ -139,7 +142,7 @@
|
||||
</style>
|
||||
|
||||
@code {
|
||||
|
||||
|
||||
#if NO_SQL
|
||||
[Parameter]
|
||||
public List<WebSectionModel> WebSections { get; set; } = default!;
|
||||
@@ -156,15 +159,16 @@
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
bool navOpen = true;
|
||||
|
||||
void OnNavClicked(EventArgs eventArgs) {
|
||||
void OnNavClicked(EventArgs eventArgs)
|
||||
{
|
||||
navOpen = !navOpen;
|
||||
}
|
||||
|
||||
|
||||
void OnPageClicked(EventArgs eventArgs) {
|
||||
void OnPageClicked(EventArgs eventArgs)
|
||||
{
|
||||
navOpen = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@using Model.Website.Enums
|
||||
@using Model.Website
|
||||
@if (isDisplayable) {
|
||||
@if (isDisplayable)
|
||||
{
|
||||
@ChildContent
|
||||
}
|
||||
|
||||
@@ -10,14 +9,15 @@
|
||||
public RenderFragment ChildContent { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public WebDeploymentType DeploymentType { get; set; } = default!;
|
||||
public WebDeploymentType DeploymentType { get; set; }
|
||||
|
||||
[Inject]
|
||||
public NavigationManager MyNavigationManager { get; set; } = default!;
|
||||
|
||||
bool isDisplayable;
|
||||
|
||||
protected override void OnInitialized() {
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
isDisplayable = DeploymentType == WebDeploymentModel.DeploymentType;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
@using Model.Website
|
||||
@if (isDisplayable) {
|
||||
@if (isDisplayable)
|
||||
{
|
||||
@ChildContent
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
<LayoutView Layout="@typeof(MainLayout)">
|
||||
<p>Sorry, there's nothing at this address.</p>
|
||||
</LayoutView>
|
||||
@@ -18,7 +19,8 @@ else {
|
||||
|
||||
bool isDisplayable;
|
||||
|
||||
protected override void OnInitialized() {
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
var page = MyNavigationManager.Uri.Remove(0, MyNavigationManager.BaseUri.Length);
|
||||
isDisplayable = WebDeploymentModel.Get().Contains(page);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user