2012-03-30 15:54:30 +01:00
|
|
|
-set_meta_tags :title => t('.title')
|
2012-08-09 17:39:01 +01:00
|
|
|
|
2013-02-20 15:07:11 +00:00
|
|
|
= render 'filter'
|
2012-08-09 17:39:01 +01:00
|
|
|
|
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-12-04 10:24:28 +00:00
|
|
|
%th.lpadding16= t("diff")
|
2013-02-14 16:59:52 +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")
|
2013-02-14 16:59:52 +00:00
|
|
|
%th.lpadding6= t("activerecord.attributes.build_list.arch_short")
|
2012-02-29 14:04:04 +00:00
|
|
|
%th.lpadding16= t("activerecord.attributes.build_list.user")
|
2013-02-21 15:57:51 +00:00
|
|
|
%th.lpadding6= t("activerecord.attributes.build_list.updated_at")
|
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);
|
2012-08-11 19:15:11 +01:00
|
|
|
hours = Math.floor(hours);
|
2012-08-09 17:39:01 +01:00
|
|
|
|
|
|
|
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-12-28 16:34:10 +00:00
|
|
|
var now = $('#servertime').val() * 1000;
|
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-08-10 15:09:44 +01:00
|
|
|
= will_paginate @bls
|
2011-04-07 14:20:21 +01:00
|
|
|
|
2012-05-02 10:18:07 +01:00
|
|
|
= render @project ? 'projects/base/submenu' : 'projects/build_lists/submenu'
|