86 lines
2.4 KiB
Plaintext
86 lines
2.4 KiB
Plaintext
@using MP.AppAuth.Models
|
|
@using MP.Land.Data
|
|
@using Microsoft.Extensions.Configuration
|
|
|
|
@inject IConfiguration Configuration
|
|
|
|
@inject AppAuthService DataService
|
|
|
|
<div class="card">
|
|
<div class="card-header">
|
|
@if (authOk())
|
|
{
|
|
<a target="_blank" href="@(fullUrl(CurrItem.AppUrl))" class="text-info" title="Apri">
|
|
<h3 class="mb-0">@CurrItem.AppName <i class="fas fa-link"></i></h3>
|
|
</a>
|
|
}
|
|
else
|
|
{
|
|
<del>
|
|
<h3 class="mb-0 text-secondary">@CurrItem.AppName</h3>
|
|
</del>
|
|
}
|
|
</div>
|
|
<div class="card-body pb-0">
|
|
<div class="row">
|
|
@if (authOk())
|
|
{
|
|
<div class="col-3 text-info">
|
|
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
|
|
</div>
|
|
<div class="col-9" style="overflow-y: auto; height: 8em;">
|
|
<b>@(traduci($"{CurrItem.AppName}-TITLE"))</b>
|
|
<ul style="mb-0">
|
|
@(traduci($"{CurrItem.AppName}-LIST"))
|
|
</ul>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="col-3 text-secondary">
|
|
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
|
|
</div>
|
|
<div class="col-9 text-secondary" style="overflow-y: auto; height: 8em;">
|
|
<b>@(traduci($"{CurrItem.AppName}-TITLE"))</b>
|
|
<ul style="mb-0">
|
|
@(traduci($"{CurrItem.AppName}-LIST"))
|
|
</ul>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
<div class="card-footer text-danger py-1">
|
|
@if (authOk())
|
|
{
|
|
<span class="text-success">Programma Attivato</span>
|
|
}
|
|
else
|
|
{
|
|
<span class="text-danger">Licenza non attivata!</span>
|
|
}
|
|
</div>
|
|
</div>
|
|
@code {
|
|
|
|
[Parameter]
|
|
public UpdMan CurrItem { get; set; }
|
|
|
|
protected bool authOk()
|
|
{
|
|
bool answ = !string.IsNullOrEmpty(CurrItem.LicenseKey);
|
|
return answ;
|
|
}
|
|
|
|
protected string fullUrl(string relUrl)
|
|
{
|
|
return $"{Configuration["BaseUrl"]}{relUrl}";
|
|
}
|
|
|
|
protected MarkupString traduci(string lemma)
|
|
{
|
|
MarkupString answ;
|
|
string rawHtml = DataService.Traduci(lemma, "IT");
|
|
answ = new MarkupString(rawHtml);
|
|
return answ;
|
|
}
|
|
} |