From a74c3bff71ff729d5530c5fdfac33cb77b287de1 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Mon, 25 Feb 2013 05:04:27 +0100 Subject: [PATCH] Add clickable rows in dashboard --- public_html/modules/dashboard.php | 1 + public_html/static/css/style.css | 14 ++++++++++++++ public_html/static/script/script.js | 30 +++++++++++++++++++++++++++++ public_html/templates/dashboard.tpl | 2 +- public_html/templates/layout.tpl | 4 +++- 5 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 public_html/static/script/script.js diff --git a/public_html/modules/dashboard.php b/public_html/modules/dashboard.php index ae36d42..cce9c26 100644 --- a/public_html/modules/dashboard.php +++ b/public_html/modules/dashboard.php @@ -51,6 +51,7 @@ try $sCampaigns[] = array( "name" => $sCampaign->sName, + "urlname" => $sCampaign->sUrlName, "subscribers" => number_format($sCampaign->sSubscriberCount, 0), "rate" => number_format($sCampaign->sDonationRate, 2), "total" => Currency::Format("usd", $sCampaign->sMonthlyTotal), diff --git a/public_html/static/css/style.css b/public_html/static/css/style.css index 4599fa5..d2daba4 100644 --- a/public_html/static/css/style.css +++ b/public_html/static/css/style.css @@ -34,6 +34,20 @@ pre.debug clear: both; } +/************************************** + * CLICKABLE * + **************************************/ + +.clickable +{ + cursor: pointer; +} + +.clickable:hover +{ + background-color: #F6FFE6; +} + /************************************** * HEADER * **************************************/ diff --git a/public_html/static/script/script.js b/public_html/static/script/script.js new file mode 100644 index 0000000..28d7207 --- /dev/null +++ b/public_html/static/script/script.js @@ -0,0 +1,30 @@ +$(function(){ + $('.clickable').click(function(event) + { + if($(this).data('url')) + { + url = $(this).data('url'); + + if(event.which == 1) + { + if($(this).hasClass('external')) + { + window.open(url); + } + else + { + window.location = url; + } + + event.stopPropagation(); + return false; + } + else if(event.which == 2) + { + window.open(url); + event.stopPropagation(); + return false; + } + } + }); +}); diff --git a/public_html/templates/dashboard.tpl b/public_html/templates/dashboard.tpl index acc6be8..c30688f 100644 --- a/public_html/templates/dashboard.tpl +++ b/public_html/templates/dashboard.tpl @@ -19,7 +19,7 @@ Payment methods {%foreach campaign in campaigns} - + {%?campaign[name]} {%if campaign[one-off] == false} diff --git a/public_html/templates/layout.tpl b/public_html/templates/layout.tpl index 6c1123f..2b2a864 100644 --- a/public_html/templates/layout.tpl +++ b/public_html/templates/layout.tpl @@ -2,9 +2,11 @@ + ReDonate :: {%?title} - ReDonate :: {%?title} + +