Show placeholder when no statistics are available for a campaign yet

master
Sven Slootweg 11 years ago
parent 1ab7613b0e
commit 787843fee1

@ -54,6 +54,7 @@ if($sEventTotal !== 0)
$sUnsubscriptionPercentage = ($sCampaign->sPastMonthUnsubscriptions / $sEventTotal) * 100;
$sDonationPercentage = ($sCampaign->sPastMonthDonations / $sEventTotal) * 100;
$sNonDonationPercentage = ($sCampaign->sPastMonthNonDonations / $sEventTotal) * 100;
$sStatisticsAvailable = true;
}
else
{
@ -62,6 +63,7 @@ else
$sUnsubscriptionPercentage = 0;
$sDonationPercentage = 0;
$sNonDonationPercentage = 0;
$sStatisticsAvailable = false;
}
$sPageTitle = "Dashboard for {$sCampaign->sName}";
@ -76,6 +78,7 @@ $sPageContents = NewTemplater::Render("campaign/dashboard", $locale->strings, ar
"donations-amount" => $sCampaign->sPastMonthDonations,
"donations-percentage" => $sDonationPercentage,
"nondonations-amount" => $sCampaign->sPastMonthNonDonations,
"nondonations-percentage" => $sNonDonationPercentage
"nondonations-percentage" => $sNonDonationPercentage,
"statistics-available" => $sStatisticsAvailable
));

@ -515,6 +515,12 @@ table.payment-methods td.remove button
font-size: 15px;
}
.no-stats
{
padding: 9px 12px;
color: gray;
}
/**************************************
* BAR GRAPH *
**************************************/

@ -21,6 +21,9 @@
<div class="area not-donated" style="width: {%?nondonations-percentage}%;"></div>
<div class="area donated" style="width: {%?donations-percentage}%;"></div>
<div class="area subscribed" style="width: {%?subscriptions-percentage}%;"></div>
{%if statistics-available == false}
<div class="no-stats">No statistics available yet.</div>
{%/if}
</div>
<div class="graph-legend">

Loading…
Cancel
Save