Page MenuHomeDevCentral

index.erb
No OneTemporary

index.erb

<!DOCTYPE html>
<html>
<head>
<meta charset="utf8" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
<meta http-equiv="refresh" content="30" />
<title>Tommy</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<% @projects.each do |project| %>
<% if project %>
<div class="project <%= css_for_project(project) %>">
<div class="heading">
<span class="name"><%= project.name %></span>
<a href="<%= project.last_build_url %>" target="_blank" class="build-number"><%= project.last_build_number %></a>
</div>
<div class="details">
<div class="health"><%= project.health_report %></div>
<div class="actions">
<a href="<%= project.last_build_url %>" target="_blank">Build</a>
<a href="<%= project.last_complete_url %>" target="_blank">Complete</a>
<a href="<%= project.last_failed_url %>" target="_blank">Failed</a>
</div>
</div>
</div>
<% else %>
<!--No project-->
<% end %>
<% end %>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
var DETAILS_CLASS = 'with-details';
var projects = $('.project');
var doc = $(document);
function toggleDetails(e) {
var target = $(this);
var hadDetails = target.hasClass(DETAILS_CLASS);
projects.removeClass(DETAILS_CLASS);
if (!hadDetails) target.addClass(DETAILS_CLASS);
}
doc.on('click', '.project', toggleDetails);
doc.on('touchstart', '.project', toggleDetails);
doc.on('keydown', function(e) {
if (e.keyCode === 27) projects.removeClass(DETAILS_CLASS);
});
// Always take up the full screen.
function adjustProjectHeights() {
var _firstTop = NaN;
for (var howManyAcross = 0; howManyAcross < projects.length; howManyAcross++) {
var offsetTop = $(projects[howManyAcross]).offset().top;
if (isNaN(_firstTop)) _firstTop = offsetTop;
if (offsetTop !== _firstTop) break;
}
projects.height(projects.parent().height() / (projects.length / howManyAcross));
}
$(window).on('resize', adjustProjectHeights);
adjustProjectHeights();
// An iPod driving an HD monitor will stretch the image.
// Compensate by shrinking it a bit.
if (~location.search.indexOf('ipad')) $('html').addClass('ipad-scale');
</script>
</body>
</html>

File Metadata

Mime Type
text/html
Expires
Tue, Jul 29, 14:18 (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2838562
Default Alt Text
index.erb (2 KB)

Event Timeline