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>
|
<div>
|
||||||
<b id="entityName">@Entity?.Info().Name</b>
|
<b id="entityName">@Entity?.Info().Name</b>
|
||||||
@@ -11,9 +13,9 @@
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
<div class="entityHeader">
|
<div class="entityHeader">
|
||||||
<div id="entityName" class="entityHeaderText">
|
<button id="entityName" class="entityHeaderText searchLink" @onclick="() => OnOpenStandalone()">
|
||||||
@Entity?.Info().Name
|
@Entity?.Info().Name
|
||||||
</div>
|
</button>
|
||||||
<div style="font-size:1.4rem;">
|
<div style="font-size:1.4rem;">
|
||||||
<b>@Entity?.EntityType.Replace("_", " ")</b>
|
<b>@Entity?.EntityType.Replace("_", " ")</b>
|
||||||
@if (Entity?.Info().Descriptive != DescriptiveType.None)
|
@if (Entity?.Info().Descriptive != DescriptiveType.None)
|
||||||
@@ -52,6 +54,10 @@ else
|
|||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.searchLink:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
@@media only screen and (max-width: 1025px) {
|
@@media only screen and (max-width: 1025px) {
|
||||||
.entityHeader {
|
.entityHeader {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -68,5 +74,24 @@ else
|
|||||||
|
|
||||||
|
|
||||||
[CascadingParameter] public string StyleType { get; set; } = "Detailed";
|
[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