add support for trial periods
This commit is contained in:
@ -29,17 +29,21 @@ else
|
||||
<td><ActionLink Action="View" Parameters="@($"name=" + WebUtility.UrlEncode(context.ThemeName))" ResourceKey="ViewTheme" /></td>
|
||||
<td>
|
||||
@if (context.AssemblyName != "Oqtane.Client")
|
||||
{
|
||||
{
|
||||
<ActionDialog Header="Delete Theme" Message="@string.Format(Localizer["Confirm.Theme.Delete"], context.Name)" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteTheme(context))" ResourceKey="DeleteTheme" />
|
||||
}
|
||||
}
|
||||
</td>
|
||||
<td>@context.Name</td>
|
||||
<td>@context.Version</td>
|
||||
<td>
|
||||
@if (UpgradeAvailable(context.PackageName, context.Version))
|
||||
{
|
||||
{
|
||||
<button type="button" class="btn btn-success" @onclick=@(async () => await DownloadTheme(context.PackageName, context.Version))>@SharedLocalizer["Upgrade"]</button>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@((MarkupString)PurchaseLink(context.PackageName))
|
||||
}
|
||||
</td>
|
||||
<td></td>
|
||||
</Row>
|
||||
@ -99,6 +103,23 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
private string PurchaseLink(string packagename)
|
||||
{
|
||||
string link = "";
|
||||
if (!string.IsNullOrEmpty(packagename) && _packages != null)
|
||||
{
|
||||
var package = _packages.Where(item => item.PackageId == packagename).FirstOrDefault();
|
||||
if (package != null)
|
||||
{
|
||||
if (package.Price > 0 && !string.IsNullOrEmpty(package.PaymentUrl))
|
||||
{
|
||||
link = "<a class=\"btn btn-primary\" style=\"text-decoration: none !important\" href=\"" + package.PaymentUrl + "\" target=\"_new\">" + package.Price.ToString("$#,##0.00") + "</a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
return link;
|
||||
}
|
||||
|
||||
private async Task DeleteTheme(Theme Theme)
|
||||
{
|
||||
try
|
||||
|
Reference in New Issue
Block a user