Skip to content

Commit

Permalink
No data message if a given account type doesn't have any accounts yet
Browse files Browse the repository at this point in the history
  • Loading branch information
groberts314 committed Dec 14, 2018
1 parent 3ec4e59 commit 7efcb49
Showing 1 changed file with 60 additions and 53 deletions.
113 changes: 60 additions & 53 deletions src/DashAccountingSystem/Views/LedgerAccounts/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -32,73 +32,80 @@
<div class="panel-collapse collapse@(categoryIndex == 0 ? " in" : null)" id="collapse-@categoryKey">
<div class="panel-body">
<div class="panel-group acct-sub-category" id="acct-@categoryKey-accordion">
@{
foreach (var accountSubCategoryEntry in accountCategoryEntry.Value)
{
subCategoryKey = accountSubCategoryEntry.Key.ToString().ToLower();
@{
foreach (var accountSubCategoryEntry in accountCategoryEntry.Value)
{
subCategoryKey = accountSubCategoryEntry.Key.ToString().ToLower();

<div class="panel panel-info">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#acct-@categoryKey-accordion" href="#collapse-@subCategoryKey">
<span class="child glyphicon glyphicon-plus"></span>
@accountSubCategoryEntry.Key.GetDisplayName()
</a>
</h4>
</div>
<div class="panel-collapse collapse@(subCategoryIndex == 0 ? " in" : null)" id="collapse-@subCategoryKey">
<div class="panel-body">
@{
foreach (var account in accountSubCategoryEntry.Value)
{
<div class="panel panel-info">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#acct-@categoryKey-accordion" href="#collapse-@subCategoryKey">
<span class="child glyphicon glyphicon-plus"></span>
@accountSubCategoryEntry.Key.GetDisplayName()
</a>
</h4>
</div>
<div class="panel-collapse collapse@(subCategoryIndex == 0 ? " in" : null)" id="collapse-@subCategoryKey">
<div class="panel-body">
@{
if (!accountSubCategoryEntry.Value.Any())
{
<p>No @accountSubCategoryEntry.Key.GetDisplayName() accounts have been created yet.</p>
}
else
{
foreach (var account in accountSubCategoryEntry.Value)
{

var accountBalanceUpdated = LocalDateTime
.FromDateTime(account.BalanceUpdated)
.InZoneStrictly(DateTimeZone.Utc)
.WithZone(timeZone)
.ToDateTimeUnspecified();
var accountBalanceUpdated = LocalDateTime
.FromDateTime(account.BalanceUpdated)
.InZoneStrictly(DateTimeZone.Utc)
.WithZone(timeZone)
.ToDateTimeUnspecified();

<div class="panel panel-default">
<div class="panel-heading acct-heading">
<div class="row">
<div class="col-md-6">
<h5 class="panel-title">
<a asp-route="accountDetails"
asp-route-tenantid="@Model.Tenant.Id"
asp-route-accountid="@account.Id">
@account.DisplayName
</a>
</h5>
</div>
<div class="col-md-6 acct-heading-balance">
<div class="acct-balance pull-right">
<div class="acct-balance-asset text-muted small">
@account.AssetType
</div>
<div class="acct-balance-value">
@string.Format("{0:N2}", Math.Abs(account.CurrentBalance))
</div>
<div class="panel panel-default">
<div class="panel-heading acct-heading">
<div class="row">
<div class="col-md-6">
<h5 class="panel-title">
<a asp-route="accountDetails"
asp-route-tenantid="@Model.Tenant.Id"
asp-route-accountid="@account.Id">
@account.DisplayName
</a>
</h5>
</div>
<div class="col-md-6 acct-heading-balance">
<div class="acct-balance pull-right">
<div class="acct-balance-asset text-muted small">
@account.AssetType
</div>
<div class="acct-balance-value">
@string.Format("{0:N2}", Math.Abs(account.CurrentBalance))
</div>
</div>
</div>

</div>
<div class="panel-body">
<div class="small text-muted">Balance updated:</div>
<div class="acct-info">
@accountBalanceUpdated.ToString("G")
</div>

</div>
<div class="panel-body">
<div class="small text-muted">Balance updated:</div>
<div class="acct-info">
@accountBalanceUpdated.ToString("G")
</div>
</div>
}
</div>
}
</div>
}
}
</div>
</div>
</div>

++subCategoryIndex;
}
++subCategoryIndex;
}
}
</div>
</div>
</div>
Expand Down

0 comments on commit 7efcb49

Please sign in to comment.