Add clickable rows in dashboard

master
Sven Slootweg 12 years ago
parent 59c1620e89
commit a74c3bff71

@ -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),

@ -34,6 +34,20 @@ pre.debug
clear: both;
}
/**************************************
* CLICKABLE *
**************************************/
.clickable
{
cursor: pointer;
}
.clickable:hover
{
background-color: #F6FFE6;
}
/**************************************
* HEADER *
**************************************/

@ -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;
}
}
});
});

@ -19,7 +19,7 @@
<th>Payment methods</th>
</tr>
{%foreach campaign in campaigns}
<tr>
<tr class="clickable" data-url="/dashboard/{%?campaign[urlname]}">
<td class="name">{%?campaign[name]}</td>
<td>
{%if campaign[one-off] == false}

@ -2,9 +2,11 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ReDonate :: {%?title}</title>
<link href='http://fonts.googleapis.com/css?family=Lato:400,700|Roboto:500' rel='stylesheet' type='text/css'>
<link href="/static/css/style.css" rel="stylesheet">
<title>ReDonate :: {%?title}</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="/static/script/script.js"></script>
</head>
<body>
<div class="wrapper">

Loading…
Cancel
Save