105 lines
5.9 KiB
Plaintext
105 lines
5.9 KiB
Plaintext
@using System.Net
|
|
@using WatchIt.Common.Model.Photos
|
|
@using WatchIt.Website.Services.Client.Photos
|
|
|
|
@inherits LayoutComponentBase
|
|
|
|
|
|
|
|
<CascadingValue Value="this">
|
|
@if (_loaded)
|
|
{
|
|
<div class="container-xl">
|
|
<div class="row sticky-top top-3 mb-2rem">
|
|
<div class="col">
|
|
<div class="panel panel-header">
|
|
<div class="container-grid">
|
|
<div class="row align-items-center">
|
|
<div class="col">
|
|
<a id="logo" class="logo" href="/">
|
|
WatchIt
|
|
</a>
|
|
</div>
|
|
<div class="col-auto">
|
|
<div class="d-flex gap-2 align-items-center">
|
|
@if (_searchbarVisible)
|
|
{
|
|
<div class="input-group input-group-sm">
|
|
<InputText class="form-control" placeholder="Search with regex" @bind-Value="@(_searchbarText)"/>
|
|
</div>
|
|
<button type="button" class="btn btn-sm btn-outline-secondary" @onclick="@(SearchStart)">⌕</button>
|
|
<button type="button" class="btn btn-sm" @onclick="@(() => _searchbarVisible = false)">❌︎</button>
|
|
}
|
|
else
|
|
{
|
|
<Dropdown>
|
|
<DropdownToggle Color="Color.Default" Size="Size.Small" ToggleIconVisible="false">Database</DropdownToggle>
|
|
<DropdownMenu>
|
|
<DropdownItem Clicked="@(() => NavigationManager.NavigateTo("/database/movies"))">Movies</DropdownItem>
|
|
<DropdownItem Clicked="@(() => NavigationManager.NavigateTo("/database/series"))">TV Series</DropdownItem>
|
|
<DropdownItem Clicked="@(() => NavigationManager.NavigateTo("/database/people"))">People</DropdownItem>
|
|
</DropdownMenu>
|
|
</Dropdown>
|
|
<button type="button" class="btn btn-sm" @onclick="@(() => _searchbarVisible = true)">⌕</button>
|
|
}
|
|
</div>
|
|
</div>
|
|
<div class="col">
|
|
<div class="float-end">
|
|
@if (_user is null)
|
|
{
|
|
<a id="signInButton" class="main-button" href="/auth?redirect_to=@(WebUtility.UrlEncode(NavigationManager.Uri))">Sign in</a>
|
|
}
|
|
else
|
|
{
|
|
<Dropdown RightAligned>
|
|
<Button Color="Color.Default" Clicked="@(() => NavigationManager.NavigateTo("/user"))">
|
|
<div class="d-flex gap-2 align-items-center">
|
|
<AccountPictureComponent Id="@(_user.Id)" Size="30"/>
|
|
<span>@(_user.Username)</span>
|
|
</div>
|
|
</Button>
|
|
<DropdownToggle Color="Color.Default" Split />
|
|
<DropdownMenu>
|
|
<DropdownItem Clicked="@(() => NavigationManager.NavigateTo("/user"))">Your profile</DropdownItem>
|
|
@if (_user.IsAdmin)
|
|
{
|
|
<DropdownDivider/>
|
|
<DropdownItem Clicked="@(() => NavigationManager.NavigateTo("/admin"))">Administrator panel</DropdownItem>
|
|
}
|
|
<DropdownDivider/>
|
|
<DropdownItem Clicked="UserMenuLogOut"><span class="text-danger">Log out</span></DropdownItem>
|
|
</DropdownMenu>
|
|
</Dropdown>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row pb-3">
|
|
<div class="col">
|
|
@Body
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
|
/* TAGS */
|
|
body {
|
|
background-image: url('@(GetBackgroundPhoto() is null ? "assets/background_temp.jpg": GetBackgroundPhoto().ToString())');
|
|
}
|
|
|
|
|
|
/* IDS */
|
|
|
|
#logo, #signInButton {
|
|
background-image: linear-gradient(45deg, @(GetBackgroundPhoto() is null ? "#c6721c, #85200c" : $"#{Convert.ToHexString(GetBackgroundPhoto().Background.FirstGradientColor)}, #{Convert.ToHexString(GetBackgroundPhoto().Background.SecondGradientColor)}"));
|
|
}
|
|
</style>
|
|
}
|
|
</CascadingValue> |