The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
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.
 
 
 
 
 

85 lines
3.5 KiB

@model Teknik.Areas.Users.ViewModels.BillingSettingsViewModel
@using Teknik.BillingCore.Models
@{
Layout = "~/Areas/User/Views/User/Settings/Settings.cshtml";
}
<script>
var cancelSubscriptionURL = '@Url.SubRouteUrl("account", "User.Action", new { action = "CancelSubscription" })';
var renewSubscriptionURL = '@Url.SubRouteUrl("account", "User.Action", new { action = "RenewSubscription" })';
</script>
@if (Config.BillingConfig.Enabled)
{
if (!string.IsNullOrEmpty(Model.PortalUrl))
{
<div class="row">
<div class="col-sm-12">
<h2>Billing Information</h2>
<hr />
</div>
</div>
<div class="row">
<div class="form-group col-sm-12">
<a href="@Model.PortalUrl">Click here</a> to view/modify your billing information and invoices.
</div>
</div>
}
<div class="row">
<div class="col-sm-12">
<h2>Current Subscriptions</h2>
<hr />
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div id="activeSubscriptions" style="overflow-y: auto; max-height: 400px;">
<ul class="list-group" id="activeSubscriptionList">
@if (Model.Subscriptions.Any())
{
foreach (var subscription in Model.Subscriptions)
{
<li class="list-group-item" id="@subscription.SubscriptionId">
<div class="pull-left">
<h4 class="list-group-item-heading pull-left">@subscription.ProductName: <strong>@(StringHelper.GetBytesReadable(subscription.Storage))</strong> for <strong>@($"${subscription.Price:0.00} / {subscription.Interval}")</strong></h4>
<p>
@if (subscription.Canceled)
{
@:<strong>Canceled</strong> -
}
Billing period ends @(subscription.BillingPeriodEnd.ToShortDateString()).
</p>
</div>
@if (subscription.Canceled)
{
<button role="button" class="btn btn-primary renew-subscription-button pull-right" data-subscription-id="@subscription.SubscriptionId">Renew Subscription</button>
}
else
{
<button role="button" class="btn btn-danger cancel-subscription-button pull-right" data-subscription-id="@subscription.SubscriptionId">Cancel Subscription</button>
}
<div class="clearfix"></div>
</li>
}
}
else
{
<li class="list-group-item text-center">No Active Subscriptions</li>
}
</ul>
</div>
</div>
</div>
}
else
{
<div class="row">
<div class="form-group col-sm-12">
<p>Billing System Disabled</p>
</div>
</div>
}
<bundle src="js/user.settings.billing.min.js" append-version="true"></bundle>