hour of week colors

This commit is contained in:
Tomasz Gieniusz 2012-10-21 21:33:44 +02:00
parent 33df12e025
commit 60f76d2000
3 changed files with 6 additions and 4 deletions

View File

@ -67,11 +67,13 @@
%th
- (0..23).each do |h|
%th= h
- max = author.activity.by_wday_hour.values.map {|h| h.values.max }.max
- (0..6).each do |day|
%tr
%th= Date::ABBR_DAYNAMES[day]
- (0..23).each do |hour|
%td= author.activity.by_wday_hour[day][hour]
- color = "%02x" % (255 - author.activity.by_wday_hour[day][hour] * 100 / max)
%td{style: "background-color: ##{color}#{color}#{color};"}= author.activity.by_wday_hour[day][hour]
.tab-pane{id: "month_of_year-#{author.hash}"}

View File

@ -46,7 +46,7 @@
.modal.hide{:id => "#{author.hash}-modal", :role => "dialog", :style => "width: 1140px; margin-left:-570px; top: 30%;"}
.modal-header
%h1.pagination-centered= "#{author.name} <#{author.email}>"
.modal-body{:style => "height: 650px; max-height: 800px;"}
.modal-body{:style => "height: 650px; max-height: 90%; max-width: 90%;"}
= render '_activity', author: author
.modal-footer
%a.btn{'data-dismiss' => "modal"}= :close.t

View File

@ -18,12 +18,12 @@
e.preventDefault();
$(this).tab('show');
var ev = document.createEvent('Event');
ev.initEvent('load', true, true);
ev.initEvent('resize', true, true);
window.dispatchEvent(ev);
});
$('.modal').on('shown', function (e) {
var ev = document.createEvent('Event');
ev.initEvent('load', true, true);
ev.initEvent('resize', true, true);
window.dispatchEvent(ev);
});
});