Minor UI updates (#4530)

* Minor UI updates

* Lockout page fixes

Fix duplicate headline and model null-check
This commit is contained in:
d11n
2023-01-19 10:08:34 +01:00
committed by GitHub
parent a9ad0fde9e
commit b577c0adb7
3 changed files with 44 additions and 45 deletions

View File

@@ -15,7 +15,8 @@
@if (Env.NetworkType != NBitcoin.ChainName.Mainnet) @if (Env.NetworkType != NBitcoin.ChainName.Mainnet)
{ {
var type = Env.NetworkType.ToString(); var type = Env.NetworkType.ToString();
<small class="badge bg-warning rounded-pill ms-1 ms-sm-0" title="@type">@type.Replace("Testnet", "TN").Replace("Regtest", "RT")</small> var displayType = type.Replace("Testnet", "TN").Replace("Regtest", "RT").Replace("Signet", "SN");
<small class="badge bg-warning rounded-pill ms-1 ms-sm-0" title="@type">@displayType</small>
} }
} }
private static string StoreName(string title) private static string StoreName(string title)
@@ -38,7 +39,7 @@ else
} }
<div id="StoreSelector"> <div id="StoreSelector">
@if (Model.Options.Count > 0) @if (Model.Options.Any())
{ {
<div id="StoreSelectorDropdown" class="dropdown only-for-js"> <div id="StoreSelectorDropdown" class="dropdown only-for-js">
<button id="StoreSelectorToggle" class="btn btn-secondary dropdown-toggle rounded-pill px-3 @(Model.CurrentStoreId == null ? "empty-state" : "")" type="button" data-bs-toggle="dropdown" aria-expanded="false"> <button id="StoreSelectorToggle" class="btn btn-secondary dropdown-toggle rounded-pill px-3 @(Model.CurrentStoreId == null ? "empty-state" : "")" type="button" data-bs-toggle="dropdown" aria-expanded="false">
@@ -74,6 +75,6 @@ else
} }
else if (SignInManager.IsSignedIn(User)) else if (SignInManager.IsSignedIn(User))
{ {
<a asp-controller="UIUserStores" asp-action="CreateStore" class="btn btn-primary w-100 rounded-pill" id="StoreSelectorCreate">Create Store</a> <a asp-controller="UIUserStores" asp-action="CreateStore" class="btn btn-primary w-100 rounded-pill text-nowrap" id="StoreSelectorCreate">Create Store</a>
} }
</div> </div>

View File

@@ -5,23 +5,15 @@
Layout = "_LayoutSignedOut"; Layout = "_LayoutSignedOut";
} }
<div class="row"> @if (Model is null)
<div class="col-lg-12 section-heading"> {
<h2>@ViewData["Title"]</h2> <p class="mb-0">This account has been locked out because of multiple invalid login attempts. Please try again later.</p>
<hr class="primary"> }
</div> else if (DateTimeOffset.MaxValue - Model.Value < TimeSpan.FromSeconds(1))
<div class="col-lg-12 lead"> {
@if (DateTimeOffset.MaxValue - Model.Value < TimeSpan.FromSeconds(1)) <p class="mb-0">Your account has been disabled. Please contact server administrator.</p>
{ }
<p>Your account has been disabled. Please contact server administrator.</p> else
} {
else if(Model is null) <p class="mb-0">This account has been locked out. Please try again @Model.Value.ToBrowserDate(ViewsRazor.DateDisplayFormat.Relative).</p>
{ }
<p>This account has been locked out because of multiple invalid login attempts. Please try again later.</p>
}
else
{
<p>This account has been locked out. Please try again <span data-timeago-unixms="@Model.Value.ToUnixTimeMilliseconds()">@Model.Value.ToTimeAgo()</span>.</p>
}
</div>
</div>

View File

@@ -147,19 +147,19 @@
<div class="col col-12 col-md-6 col-lg-12 col-xl-6 col-xxl-4 mb-4"> <div class="col col-12 col-md-6 col-lg-12 col-xl-6 col-xxl-4 mb-4">
<div class="card h-100" id="@plugin.Identifier"> <div class="card h-100" id="@plugin.Identifier">
<div class="card-body"> <div class="card-body">
<div class="d-flex align-items-baseline justify-content-between gap-2"> <div class="d-flex flex-wrap align-items-baseline justify-content-between gap-2 mb-3">
<h4 class="card-title" data-bs-toggle="tooltip" title="@plugin.Identifier">@plugin.Name</h4> <h4 class="card-title mb-0" data-bs-toggle="tooltip" title="@plugin.Identifier">@plugin.Name</h4>
@if (!string.IsNullOrEmpty(downloadInfo?.Author)) @if (!string.IsNullOrEmpty(downloadInfo?.Author))
{ {
<span class="text-muted"> <span class="text-muted text-nowrap">
by by
<a href="@downloadInfo.AuthorLink" rel="noreferrer noopener" target="_blank"> <a href="@downloadInfo.AuthorLink" rel="noreferrer noopener" target="_blank">
<span>@downloadInfo.Author</span> @downloadInfo.Author
</a> </a>
</span> </span>
} }
</div> </div>
<div class="d-flex flex-wrap align-items-center mb-2"> <div class="d-flex flex-wrap align-items-center mb-2 gap-3">
<h5 class="text-muted d-flex align-items-center mt-1 gap-3"> <h5 class="text-muted d-flex align-items-center mt-1 gap-3">
@plugin.Version @plugin.Version
@if (updateAvailable && x != null) @if (updateAvailable && x != null)
@@ -172,8 +172,8 @@
@if (updateAvailable) @if (updateAvailable)
{ {
<span class="nav version-switch mt-n1" role="tablist"> <span class="nav version-switch mt-n1" role="tablist">
<a data-bs-toggle="tab" href="#@tabId-current" class="nav-link px-3 small text-info show active">Show current version</a> <a data-bs-toggle="tab" href="#@tabId-current" class="nav-link text-info p-0 show active">Show current info</a>
<a data-bs-toggle="tab" href="#@tabId-update" class="nav-link px-3 small text-info">Show update information</a> <a data-bs-toggle="tab" href="#@tabId-update" class="nav-link text-info p-0">Show update info</a>
</span> </span>
} }
</div> </div>
@@ -183,15 +183,17 @@
<p class="card-text">@plugin.Description</p> <p class="card-text">@plugin.Description</p>
@if (plugin.Dependencies.Any()) @if (plugin.Dependencies.Any())
{ {
<h5 class="text-muted">Dependencies</h5> <h6 class="text-muted fw-semibold">Dependencies</h6>
<ul class="list-group list-group-flush"> <ul class="list-group list-group-flush">
@foreach (var dependency in plugin.Dependencies) @foreach (var dependency in plugin.Dependencies)
{ {
<li class="list-group-item p-2"> <li class="list-group-item p-2 d-inline-flex align-items-center gap-2">
@dependency @dependency
@if (!DependencyMet(dependency)) @if (!DependencyMet(dependency))
{ {
<span title="Dependency not met." data-bs-toggle="tooltip" class="fa fa-warning text-danger"></span> <span title="Dependency not met." data-bs-toggle="tooltip" class="text-danger">
<vc:icon symbol="warning" />
</span>
} }
</li> </li>
} }
@@ -205,15 +207,17 @@
<p class="card-text">@x.Description</p> <p class="card-text">@x.Description</p>
@if (x.Dependencies.Any()) @if (x.Dependencies.Any())
{ {
<h5 class="text-muted">Dependencies</h5> <h6 class="text-muted fw-semibold">Dependencies</h6>
<ul class="list-group list-group-flush"> <ul class="list-group list-group-flush">
@foreach (var dependency in x.Dependencies) @foreach (var dependency in x.Dependencies)
{ {
<li class="list-group-item p-2"> <li class="list-group-item p-2 d-inline-flex align-items-center gap-2">
@dependency @dependency
@if (!DependencyMet(dependency)) @if (!DependencyMet(dependency))
{ {
<span title="Dependency not met." data-bs-toggle="tooltip" class="fa fa-warning text-danger"></span> <span title="Dependency not met." data-bs-toggle="tooltip" class="text-danger">
<vc:icon symbol="warning" />
</span>
} }
</li> </li>
} }
@@ -224,7 +228,7 @@
@if (plugin != null) @if (plugin != null)
{ {
<h5 class="text-muted mt-4">Resources</h5> <h6 class="text-muted fw-semibold mt-4">Resources</h6>
<ul class="list-group list-group-flush list-unstyled"> <ul class="list-group list-group-flush list-unstyled">
@if (downloadInfo?.Source is not null) @if (downloadInfo?.Source is not null)
{ {
@@ -308,14 +312,14 @@
<div class="col col-12 col-md-6 col-lg-12 col-xl-6 col-xxl-4 mb-4"> <div class="col col-12 col-md-6 col-lg-12 col-xl-6 col-xxl-4 mb-4">
<div class="card h-100" id="@plugin.Identifier"> <div class="card h-100" id="@plugin.Identifier">
<div class="card-body"> <div class="card-body">
<div class="d-flex align-items-baseline justify-content-between gap-2"> <div class="d-flex flex-wrap align-items-baseline justify-content-between gap-2 mb-3">
<h4 class="card-title" data-bs-toggle="tooltip" title="@plugin.Identifier">@plugin.Name</h4> <h4 class="card-title mb-0" data-bs-toggle="tooltip" title="@plugin.Identifier">@plugin.Name</h4>
@if (!string.IsNullOrEmpty(plugin.Author)) @if (!string.IsNullOrEmpty(plugin.Author))
{ {
<span class="text-muted"> <span class="text-muted text-nowrap">
by by
<a href="@plugin.AuthorLink" rel="noreferrer noopener" target="_blank"> <a href="@plugin.AuthorLink" rel="noreferrer noopener" target="_blank">
<span>@plugin.Author</span> @plugin.Author
</a> </a>
</span> </span>
} }
@@ -334,15 +338,17 @@
<p class="card-text">@plugin.Description</p> <p class="card-text">@plugin.Description</p>
@if (plugin.Dependencies?.Any() is true) @if (plugin.Dependencies?.Any() is true)
{ {
<h5 class="text-muted">Dependencies</h5> <h6 class="text-muted fw-semibold">Dependencies</h6>
<ul class="list-group list-group-flush"> <ul class="list-group list-group-flush">
@foreach (var dependency in plugin.Dependencies) @foreach (var dependency in plugin.Dependencies)
{ {
<li class="list-group-item p-2"> <li class="list-group-item p-2 d-inline-flex align-items-center gap-2">
@dependency @dependency
@if (!DependencyMet(dependency)) @if (!DependencyMet(dependency))
{ {
<span title="Dependency not met." data-bs-toggle="tooltip" class="fa fa-warning text-danger"></span> <span title="Dependency not met." data-bs-toggle="tooltip" class="text-danger">
<vc:icon symbol="warning" />
</span>
} }
</li> </li>
} }
@@ -351,7 +357,7 @@
@if (plugin != null) @if (plugin != null)
{ {
<h5 class="text-muted mt-4">Resources</h5> <h6 class="text-muted fw-semibold mt-4">Resources</h6>
<ul class="list-group list-group-flush list-unstyled"> <ul class="list-group list-group-flush list-unstyled">
@if (plugin.Source is not null) @if (plugin.Source is not null)
{ {