From 787843fee12d3ea45d45374f5c9950c88bf7e03e Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Thu, 28 Feb 2013 09:13:05 +0100 Subject: [PATCH] Show placeholder when no statistics are available for a campaign yet --- public_html/modules/campaign/dashboard.php | 5 ++++- public_html/static/css/style.css | 6 ++++++ public_html/templates/campaign/dashboard.tpl | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/public_html/modules/campaign/dashboard.php b/public_html/modules/campaign/dashboard.php index 13026b6..c656acc 100644 --- a/public_html/modules/campaign/dashboard.php +++ b/public_html/modules/campaign/dashboard.php @@ -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 )); diff --git a/public_html/static/css/style.css b/public_html/static/css/style.css index 987c493..6edc403 100644 --- a/public_html/static/css/style.css +++ b/public_html/static/css/style.css @@ -515,6 +515,12 @@ table.payment-methods td.remove button font-size: 15px; } +.no-stats +{ + padding: 9px 12px; + color: gray; +} + /************************************** * BAR GRAPH * **************************************/ diff --git a/public_html/templates/campaign/dashboard.tpl b/public_html/templates/campaign/dashboard.tpl index b2eec0e..20c8dfc 100644 --- a/public_html/templates/campaign/dashboard.tpl +++ b/public_html/templates/campaign/dashboard.tpl @@ -21,6 +21,9 @@
+ {%if statistics-available == false} +
No statistics available yet.
+ {%/if}