rosa-build/app/views/projects/build_lists/index.html.haml

74 lines
2.4 KiB
Plaintext
Raw Normal View History

2012-03-30 15:54:30 +01:00
-set_meta_tags :title => t('.title')
= render 'filter'
%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")
%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")
%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")
%tbody= render :partial => 'projects/build_lists/build_list', :collection => @build_lists
.both
2011-04-07 14:20:21 +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);
}
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.floor(hours);
return "%d:%d".replace("%d", formatNumber(hours))
.replace("%d", formatNumber(minutes));
}
// TODO Very, very ugly method.
var now = $('#servertime').val() * 1000;
$("time.js-relative-date").each(function() {
var time = parseIso8601($(this).attr('datetime')).getTime();
$(this).text(strTimeBetween(time, now));
});
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');
});
= will_paginate @bls
2011-04-07 14:20:21 +01:00
= render @project ? 'projects/base/submenu' : 'projects/build_lists/submenu'