2012-03-30 15:54:30 +01:00
|
|
|
-set_meta_tags :title => t('.title')
|
2012-08-09 17:39:01 +01:00
|
|
|
|
|
|
|
%div.reloader
|
|
|
|
= label_tag :autoreload do
|
|
|
|
= check_box_tag :autoreload, true, true
|
|
|
|
= t("layout.autoreload_page")
|
|
|
|
.both
|
|
|
|
|
2012-02-29 14:04:04 +00:00
|
|
|
%table.tablesorter{:cellpadding => "0", :cellspacing => "0"}
|
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th.lpadding16= t("activerecord.attributes.build_list.bs_id")
|
|
|
|
%th.lpadding16= t("activerecord.attributes.build_list.status")
|
|
|
|
%th.lpadding16= t("activerecord.attributes.build_list.project")
|
2012-03-01 17:37:24 +00:00
|
|
|
%th.lpadding16= t("activerecord.attributes.build_list.project_version")
|
2012-08-06 13:31:44 +01:00
|
|
|
%th.lpadding16= t("activerecord.attributes.build_list.save_to_repository")
|
2012-07-09 22:49:19 +01:00
|
|
|
%th.lpadding16= t("activerecord.attributes.build_list.arch")
|
2012-02-29 14:04:04 +00:00
|
|
|
%th.lpadding16= t("activerecord.attributes.build_list.user")
|
2012-05-02 10:18:07 +01:00
|
|
|
%tbody= render :partial => 'projects/build_lists/build_list', :collection => @build_lists
|
2012-02-29 14:04:04 +00:00
|
|
|
.both
|
2011-04-07 14:20:21 +01:00
|
|
|
|
2012-08-08 22:10:39 +01:00
|
|
|
:javascript
|
|
|
|
$(function(){
|
|
|
|
// from jQuery.timeago
|
|
|
|
var parseIso8601 = function(iso8601) {
|
|
|
|
var s = $.trim(iso8601);
|
|
|
|
s = s.replace(/\.\d+/,""); // remove milliseconds
|
|
|
|
s = s.replace(/-/,"/").replace(/-/,"/");
|
|
|
|
s = s.replace(/T/," ").replace(/Z/," UTC");
|
|
|
|
s = s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400
|
|
|
|
return new Date(s);
|
|
|
|
}
|
2012-08-09 17:39:01 +01:00
|
|
|
var strTimeBetween = function(dt, dt1) {
|
|
|
|
|
|
|
|
var formatNumber = function(num) {
|
|
|
|
return (num < 10) ? "0%d".replace("%d", num) : num
|
|
|
|
}
|
|
|
|
|
|
|
|
var seconds = Math.abs(dt1 - dt) / 1000;
|
|
|
|
var minutes = seconds / 60;
|
|
|
|
var hours = minutes / 60;
|
|
|
|
minutes = Math.round(minutes % 60);
|
|
|
|
hours = Math.round(hours);
|
|
|
|
|
|
|
|
return "%d:%d".replace("%d", formatNumber(hours))
|
|
|
|
.replace("%d", formatNumber(minutes));
|
|
|
|
}
|
2012-08-08 22:10:39 +01:00
|
|
|
// TODO Very, very ugly method.
|
2012-08-09 17:39:01 +01:00
|
|
|
var now = (new Date).getTime();
|
2012-08-08 22:10:39 +01:00
|
|
|
$("time.js-relative-date").each(function() {
|
2012-08-09 17:39:01 +01:00
|
|
|
var time = parseIso8601($(this).attr('datetime')).getTime();
|
|
|
|
$(this).text(strTimeBetween(time, now));
|
2012-08-08 22:10:39 +01:00
|
|
|
});
|
|
|
|
|
2012-08-09 17:39:01 +01:00
|
|
|
var t = null;
|
|
|
|
|
|
|
|
var reloadChange = function() {
|
|
|
|
if ($(this).is(':checked')) {
|
|
|
|
//reload page every 1 minute
|
|
|
|
t = setTimeout(function() {
|
|
|
|
window.location.reload();
|
|
|
|
}, 60000);
|
|
|
|
} else {
|
|
|
|
clearTimeout(t);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$('#autoreload').on('change', reloadChange)
|
|
|
|
.trigger('change');
|
|
|
|
|
2012-08-08 22:10:39 +01:00
|
|
|
});
|
|
|
|
|
2012-02-29 14:04:04 +00:00
|
|
|
= will_paginate @build_lists
|
2011-04-07 14:20:21 +01:00
|
|
|
|
2012-05-02 10:18:07 +01:00
|
|
|
= render 'filter'
|
|
|
|
= render @project ? 'projects/base/submenu' : 'projects/build_lists/submenu'
|