You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
2.4 KiB
97 lines
2.4 KiB
@inject NavigationManager NavigationManager |
|
|
|
@if (StyleType.Equals("Plain")) |
|
{ |
|
<div> |
|
<b id="entityName">@Entity?.Info().Name</b> |
|
@if (Entity?.Info().Descriptive != DescriptiveType.None) |
|
{ |
|
<span>, @Entity?.Info().Descriptive.Replace("_", " ")</span> |
|
} |
|
</div> |
|
} |
|
else |
|
{ |
|
<div class="entityHeader"> |
|
<button id="entityName" class="entityHeaderText searchLink" @onclick="() => OnOpenStandalone()"> |
|
@Entity?.Info().Name |
|
</button> |
|
<div style="font-size:1.4rem;"> |
|
<b>@Entity?.EntityType.Replace("_", " ")</b> |
|
@if (Entity?.Info().Descriptive != DescriptiveType.None) |
|
{ |
|
<span> |
|
<b>:</b> @Entity!.Info().Descriptive.Replace("_", " ") |
|
</span> |
|
} |
|
</div> |
|
|
|
|
|
<div> |
|
@if (Entity.Info().FlavorText != "") |
|
{ |
|
<div> |
|
<i> @((MarkupString)Entity.Info().FlavorText)</i> |
|
</div> |
|
} |
|
|
|
</div> |
|
</div> |
|
|
|
<style> |
|
.entityHeader { |
|
display: flex; |
|
flex-direction: row; |
|
gap: 4px; |
|
justify-content: space-between; |
|
margin-bottom: 22px; |
|
width: 100%; |
|
margin-left: -6px; |
|
} |
|
|
|
.entityHeaderText { |
|
font-size: 2rem; |
|
font-weight: 900; |
|
} |
|
|
|
.searchLink:hover { |
|
text-decoration: underline; |
|
} |
|
|
|
@@media only screen and (max-width: 1025px) { |
|
.entityHeader { |
|
flex-direction: column; |
|
justify-content: normal; |
|
margin-left: 4px; |
|
} |
|
} |
|
</style> |
|
} |
|
|
|
@code { |
|
|
|
[CascadingParameter] public EntityModel? Entity { get; set; } |
|
|
|
|
|
[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); |
|
} |
|
} |