Commits

Shihab Hamid committed 2a1ae97

initial commit from wallboard we used for workbox

Comments (0)

Files changed (1)

+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
+	<style type="text/css">
+	<!--
+		body {
+			background: url(http://line25.com/wp-content/uploads/2009/letterpress/demo/bg.png);
+		}
+	
+		.column {
+			display: table-cell;
+			width: 400px;			
+		}
+		
+		.capsule {
+			text-align: center;
+			font-family: Impact;
+			box-shadow: 0px 3px 3px #666;
+		    border-radius: 30px;
+		    margin: 20px;
+		    padding: 10px;
+			text-shadow: 0px 2px 3px #555;
+			background-color: #ccc;
+			color: white;
+		}
+		
+		#issues {
+			background: -webkit-linear-gradient(top, rgba(248,80,50,1) 0%,rgba(241,111,92,1) 50%,rgba(246,41,12,1) 51%,rgba(240,47,23,1) 71%,rgba(231,56,39,1) 100%);
+		}
+		
+		#estimate {
+			background: -webkit-linear-gradient(top, rgba(191,210,85,1) 0%,rgba(142,185,42,1) 50%,rgba(114,170,0,1) 51%,rgba(158,203,45,1) 100%); /* Chrome10+,Safari5.1+ */
+		}
+		
+		#release {
+			background: -webkit-linear-gradient(top, rgba(109,179,242,1) 0%,rgba(84,163,238,1) 50%,rgba(54,144,240,1) 51%,rgba(30,105,222,1) 100%); /* Chrome10+,Safari5.1+ */
+		}
+		
+		.value {			
+			font-size: 200px;
+		}
+		
+		.description {
+			font-size: 40px;
+		}
+	-->
+	</style>
+</head>
+<body>
+	<div style="display: table; width: 1200px; margin: 0px auto; margin-top: 200px">
+		<div style="display: table-row; width: 100%; border: 10px; solid white; border-radius: 40px;">
+			<div class="column">
+				<div class="capsule" id="issues">
+					<div class="value">
+						!
+					</div>
+					<div class="description">
+						Open Issues
+					</div>
+				</div>
+			</div>
+			<div class="column">
+				<div class="capsule" id="estimate">
+					<div class="value">
+						!
+					</div>
+					<div class="description">
+						Hours of Work
+					</div>
+				</div>
+			</div>
+			<div class="column">
+				<div class="capsule" id="release">
+					<div class="value">
+						!
+					</div>
+					<div class="description">
+						Days to Ship
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+	
+	<!-- <div style="display: table; width: 1200px; margin: 0px auto; margin-top: 50px">
+		<div style="display: table-row; width: 100%; border: 10px; solid white; border-radius: 40px;">
+			<div class="column">
+				<div class="capsule" id="today-created">
+					<div class="value">
+						!
+					</div>
+					<div class="description">
+						Issues Created
+					</div>
+				</div>
+			</div>
+			<div class="column">
+				<div class="capsule" id="today-resolved">
+					<div class="value">
+						!
+					</div>
+					<div class="description">
+						Issues Resolved
+					</div>
+				</div>
+			</div>
+			<div class="column">
+				<div class="capsule" id="today-worklogged">
+					<div class="value">
+						!
+					</div>
+					<div class="description">
+						Hours Logged
+					</div>
+				</div>
+			</div>
+		</div>
+	</div> -->
+	  	
+  	<script>
+	    $(document).ready(function(){		
+			var targetDate = new Date("2012-07-29");
+			targetDate.setHours(0,0,0,0);			
+		
+			var refreshFn = function() {
+	     		$.ajax({
+			       	type: 'GET',
+			        url: "https://jdog.atlassian.net/rest/api/2/search?jql=project%20=%20wday%20and%20(fixVersion%20=%20%221.0%22%20or%20fixVersion%20is%20EMPTY)%20and%20status%20not%20%20in%20(resolved,%20closed)%20and%20resolution%20is%20empty&maxResults=1000&fields=key,timeoriginalestimate,timespent",
+			        contentType: "application/json",
+			        dataType: 'jsonp',
+					jsonp: 'jsonp-callback',
+					success: function(json) {				
+						var totalTimeRemaining = 0;
+			
+						for (var i = 0; i < json.issues.length; i++)
+						{
+							var original = json.issues[i].fields.timeoriginalestimate || 4 * 60 * 60; // 4h by default
+							var spent = json.issues[i].fields.timespent || 0;
+				
+							var left = original - spent;
+				
+							if (left < 0)
+							{
+								left = 0; // we have already spend more than we estimated
+							}
+				
+							totalTimeRemaining += left;
+						}
+			
+						totalTimeRemaining = Math.round(totalTimeRemaining/60/60); // in hours
+			
+						var timeToShip = targetDate.getTime() - (new Date()).getTime();
+						timeToShip = timeToShip / 1000 / 60 / 60 / 24; // in days
+						timeToShip = Math.floor(timeToShip);
+			
+						$("#issues .value").html(json.issues.length);
+						$("#estimate .value").html(totalTimeRemaining);
+						$("#release .value").html(timeToShip);
+				    },
+				    error: function(e) {
+				       console.log(e.message);
+				    }
+			    });
+			
+				// $.ajax({
+				// 			       	type: 'GET',
+				// 			        url: "https://jdog.atlassian.net/rest/api/2/search?jql=project%20=%20wday%20and%20created%20%3E%20-1d&maxResults=0&fields=key",
+				// 			        contentType: "application/json",
+				// 			        dataType: 'jsonp',
+				// 	jsonp: 'jsonp-callback',
+				// 	success: function(json) {													
+				// 		$("#today-created .value").html(json.total);
+				//     },
+				//     error: function(e) {
+				//        console.log(e.message);
+				//     }
+				// 			    });
+				// 			
+				// $.ajax({
+				// 			       	type: 'GET',
+				// 			        url: "https://jdog.atlassian.net/rest/api/2/search?jql=project%20=%20wday%20and%20created%20%3E%20-1d&maxResults=0&fields=key",
+				// 			        contentType: "application/json",
+				// 			        dataType: 'jsonp',
+				// 	jsonp: 'jsonp-callback',
+				// 	success: function(json) {													
+				// 		$("#today-resolved .value").html("!");
+				//     },
+				//     error: function(e) {
+				//        console.log(e.message);
+				//     }
+				// 			    });
+			};
+		
+			refreshFn();
+			setInterval(refreshFn, 1000 * 60);				
+	    });
+  	</script>
+</body>
+</html>