Direct database link feature
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
@if (StyleType.Equals("Plain"))
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
@if (StyleType.Equals("Plain"))
|
||||
{
|
||||
<div>
|
||||
<b id="entityName">@Entity?.Info().Name</b>
|
||||
@@ -11,9 +13,9 @@
|
||||
else
|
||||
{
|
||||
<div class="entityHeader">
|
||||
<div id="entityName" class="entityHeaderText">
|
||||
<button id="entityName" class="entityHeaderText searchLink" @onclick="() => OnOpenStandalone()">
|
||||
@Entity?.Info().Name
|
||||
</div>
|
||||
</button>
|
||||
<div style="font-size:1.4rem;">
|
||||
<b>@Entity?.EntityType.Replace("_", " ")</b>
|
||||
@if (Entity?.Info().Descriptive != DescriptiveType.None)
|
||||
@@ -52,6 +54,10 @@ else
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.searchLink:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
@@media only screen and (max-width: 1025px) {
|
||||
.entityHeader {
|
||||
flex-direction: column;
|
||||
@@ -68,5 +74,24 @@ else
|
||||
|
||||
|
||||
[CascadingParameter] public string StyleType { get; set; } = "Detailed";
|
||||
|
||||
|
||||
public void NavigateTo(string url)
|
||||
{
|
||||
if (url.Contains("#"))
|
||||
{
|
||||
NavigationManager.NavigateTo(url,
|
||||
NavigationManager.Uri.Split("#").First().Contains(url.Split("#").First()));
|
||||
}
|
||||
else
|
||||
{
|
||||
NavigationManager.NavigateTo(url);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnOpenStandalone()
|
||||
{
|
||||
var url = NavigationManager.BaseUri;
|
||||
var completeUrl = $"{url}database/{Entity!.Info().Name.ToLower().Replace(" ", "%20")}";
|
||||
NavigateTo(completeUrl);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user