init
This commit is contained in:
@@ -1,55 +1,55 @@
|
||||
@using Microsoft.Extensions.Options
|
||||
@using OpenArchival.Blazor.Config
|
||||
@using OpenArchival.Blazor.Theme
|
||||
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
|
||||
@*
|
||||
For the login/logout
|
||||
<AuthorizeView>
|
||||
<Authorized>
|
||||
<MudNavLink Href="Account/Manage" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Person">@context.User.Identity?.Name</MudNavLink>
|
||||
<form action="Account/Logout" method="post">
|
||||
<AntiforgeryToken />
|
||||
<input type="hidden" name="ReturnUrl" value="@currentUrl" />
|
||||
<button type="submit" class="mud-nav-link mud-ripple">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Logout" Color="Color.Info" Class="mr-3"></MudIcon> Logout
|
||||
</button>
|
||||
</form>
|
||||
</Authorized>
|
||||
<NotAuthorized>
|
||||
<MudNavLink Href="Account/Register" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Person">Register</MudNavLink>
|
||||
<MudNavLink Href="Account/Login" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Password">Login</MudNavLink>
|
||||
</NotAuthorized>
|
||||
</AuthorizeView>
|
||||
*@
|
||||
|
||||
@inject IOptions<ApplicationOptions> Options;
|
||||
@inject NavigationManager NavigationManager;
|
||||
|
||||
<MudThemeProvider />
|
||||
<MudThemeProvider Theme="AppThemeFactory.GetTheme()"/>
|
||||
<MudPopoverProvider />
|
||||
<MudDialogProvider />
|
||||
<MudSnackbarProvider />
|
||||
|
||||
<MudLayout>
|
||||
<MudLayout Style="min-height: 100vh; display: flex; flex-direction: column;">
|
||||
<MudAppBar Elevation="1" >
|
||||
@if (!string.IsNullOrEmpty(Options.Value.NavBarTitle)) {
|
||||
<MudNavLink Href="/" Style="max-width:200px;">
|
||||
<MudNavLink Href="/" Style="max-width:400px;">
|
||||
<MudText Typo="Typo.h6" Class="ml-3">@Options.Value.NavBarTitle</MudText>
|
||||
</MudNavLink>
|
||||
}
|
||||
|
||||
<div class="d-flex justify-center align-center">
|
||||
<MudSpacer/>
|
||||
<div class="d-flex d-md-none">
|
||||
<MudMenu Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" AnchorOrigin="Origin.BottomRight" TransformOrigin="Origin.TopRight">
|
||||
<MudMenuItem Icon="@Icons.Material.Filled.Home" IconColor=Color.Secondary Href="/">Home</MudMenuItem>
|
||||
<MudMenuItem Icon="@Icons.Material.Filled.Star" IconColor=Color.Secondary Href="/featured">Featured</MudMenuItem>
|
||||
<MudMenuItem Icon="@Icons.Material.Filled.Search" IconColor=Color.Secondary Href="/search">Artifacts</MudMenuItem>
|
||||
<MudMenuItem Icon=@Icons.Material.Filled.Book Href="/articles/search" IconColor=Color.Secondary>Articles</MudMenuItem>
|
||||
<MudMenuItem Href="/about" Icon=@Icons.Material.Filled.QuestionMark IconColor="Color.Secondary">About</MudMenuItem>
|
||||
</MudMenu>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="justify-center align-center d-none d-md-flex gap-4">
|
||||
<MudNavLink
|
||||
Icon="@Icons.Material.Filled.Home"
|
||||
Icon="@Icons.Material.Filled.Star"
|
||||
IconColor=Color.Secondary
|
||||
Ripple=true
|
||||
Style="max-width:200px;"
|
||||
Href="/featured">
|
||||
Featured
|
||||
</MudNavLink>
|
||||
|
||||
<MudNavLink
|
||||
Icon="@Icons.Material.Filled.Search"
|
||||
IconColor=Color.Secondary
|
||||
Ripple=true
|
||||
Style="max-width:200px;"
|
||||
Href="/search">
|
||||
Artifacts
|
||||
</MudNavLink>
|
||||
|
||||
|
||||
<MudNavLink Href="/articles/search" Icon=@Icons.Material.Filled.Book IconColor=Color.Secondary Ripple=true Style="max-width: 200px">
|
||||
Articles
|
||||
</MudNavLink>
|
||||
@@ -57,34 +57,44 @@ For the login/logout
|
||||
<MudNavLink Href="/about" Icon=@Icons.Material.Filled.QuestionMark IconColor="Color.Secondary" Ripple=true Style="max-width:200px;">
|
||||
About
|
||||
</MudNavLink>
|
||||
|
||||
<MudSpacer></MudSpacer>
|
||||
<div style="background-color: white; border-radius:10px;" class="pa-2">
|
||||
<MudAutocomplete
|
||||
Placeholder="Search Archive"
|
||||
T="string"
|
||||
Variant="Variant.Filled | Variant.Outlined"
|
||||
AdornmentIcon="@Icons.Material.Filled.Search"
|
||||
Dense=true
|
||||
Underline=false
|
||||
Style="width:200px; --mud-input-text: white; --mud-input-label-text: white;"
|
||||
OnKeyDown="OnSearchBarKeyDown"
|
||||
SearchFunc="Search"
|
||||
@bind-Text=_searchBarText/>
|
||||
</div>
|
||||
</div>
|
||||
<MudSpacer></MudSpacer>
|
||||
<div style="background-color: white; border-radius:10px;" class="pa-2">
|
||||
<MudAutocomplete
|
||||
Placeholder="Search Archive"
|
||||
T="string"
|
||||
Variant="Variant.Filled | Variant.Outlined"
|
||||
AdornmentIcon="@Icons.Material.Filled.Search"
|
||||
Dense=true
|
||||
Underline=false
|
||||
Style="width:200px; --mud-input-text: white; --mud-input-label-text: white;"
|
||||
OnKeyDown="OnSearchBarKeyDown"
|
||||
@bind-Text=_searchBarText/>
|
||||
</div>
|
||||
|
||||
@*
|
||||
<MudTextField
|
||||
Placeholder="Search"
|
||||
Variant="Variant.Filled"
|
||||
Adornment="Adornment.Start"
|
||||
AdornmentIcon="@Icons.Material.Filled.Search"
|
||||
IconSize="Size.Medium"
|
||||
T="string">
|
||||
</MudTextField>*@
|
||||
</MudAppBar>
|
||||
|
||||
</MudAppBar>
|
||||
<MudMainContent Class="pt-16 pa-4">
|
||||
@Body
|
||||
</MudMainContent>
|
||||
|
||||
<MudPaper Elevation="0" Class="pa-8 mt-auto" Style="background-color: var(--mud-palette-appbar-background); color: var(--mud-palette-appbar-text); border-radius: 0;">
|
||||
<MudContainer MaxWidth="MaxWidth.Large">
|
||||
<MudGrid Justify="Justify.Center">
|
||||
<MudItem xs="12" sm="8" Class="d-flex flex-wrap gap-4 justify-center justify-sm-start align-center">
|
||||
<MudLink Href="/" Color="Color.Inherit">Home</MudLink>
|
||||
<MudLink Href="/featured" Color="Color.Inherit">Featured</MudLink>
|
||||
<MudLink Href="/search" Color="Color.Inherit">Artifacts</MudLink>
|
||||
<MudLink Href="/articles/search" Color="Color.Inherit">Articles</MudLink>
|
||||
<MudLink Href="/about" Color="Color.Inherit">About</MudLink>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="4" Class="d-flex justify-center justify-sm-end align-center">
|
||||
<a href="https://www.linkedin.com/in/vincenttallen/">Development by Vincent Allen</a>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudContainer>
|
||||
</MudPaper>
|
||||
</MudLayout>
|
||||
|
||||
|
||||
@@ -106,6 +116,11 @@ For the login/logout
|
||||
_searchBarText = "";
|
||||
}
|
||||
}
|
||||
|
||||
private Task<IEnumerable<string>> Search(string value, CancellationToken token)
|
||||
{
|
||||
return Task.FromResult<IEnumerable<string>>([]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user