[gen] Calendar field: layers: bugfix.

This commit is contained in:
Gaetan Delannay 2015-03-25 11:56:01 +01:00
parent def1b6ab70
commit 01b3681712
2 changed files with 11 additions and 6 deletions

View file

@ -161,9 +161,9 @@ class Layer:
# * date - the currently walked day (a DateTime instance);
# * other - the Other instance representing the currently walked
# calendar;
# * events - the list of events (as Event instances) defined at
# that day in this calendar. Be careful: this can be
# None.
# * events - the list of events (as a list of custom Object
# instances whose attribute "event" points to an Event
# instance) defined at that day in this calendar.
# * preComputed - the result of Calendar.preCompute (see below)
self.onCell = onCell
# Is this layer activated by default ?
@ -939,7 +939,12 @@ class Calendar(Field):
layer = self.layers[-1]
info = layer.getCellInfo(obj, activeLayers, date, other, events,
c['preComputed'])
if info: return '<td%s%s>%s</td>' % info
if info:
style, title, content = info
style = style and (' style="%s"' % style) or ''
title = title and (' title="%s"' % title) or ''
content = content or ''
return '<td%s%s>%s</td>' % (style, title, content)
# Define the cell's style
style = self.getCellStyle(obj, date, render, events) or ''
if style: style = ' style="%s"' % style

View file

@ -143,7 +143,7 @@ td.search { padding-top: 8px }
border: 0 !important; padding: 0 !important; margin: 0 !important;
background-color: transparent !important }
.hidden { visibility: hidden }
.simpleLabel { text-transform: none }
.simpleLabel { text-transform: none; padding-right: 3px }
.translationLabel { background-color: #EAEAEA; border-bottom: 1px dashed grey;
margin-top: 0.5em; margin-bottom: 0.5em }
.section1 { font-size: 120%; margin: 0.45em 0em 0.1em 0;
@ -200,4 +200,4 @@ td.search { padding-top: 8px }
.highlight { background-color: yellow }
.globalActions { margin-bottom: 4px }
.objectActions { margin: 2px 0 }
.smallbox { margin: 0 0 0 3px; vertical-align: middle }
.smallbox { margin: 0; vertical-align: middle }