From 01b36817127324f3d5767d8d042c23823548233d Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Wed, 25 Mar 2015 11:56:01 +0100 Subject: [PATCH] [gen] Calendar field: layers: bugfix. --- fields/calendar.py | 13 +++++++++---- gen/ui/appy.css | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/fields/calendar.py b/fields/calendar.py index 4289f1c..ae06178 100644 --- a/fields/calendar.py +++ b/fields/calendar.py @@ -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 '%s' % 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 '%s' % (style, title, content) # Define the cell's style style = self.getCellStyle(obj, date, render, events) or '' if style: style = ' style="%s"' % style diff --git a/gen/ui/appy.css b/gen/ui/appy.css index 21e63d9..ea93598 100644 --- a/gen/ui/appy.css +++ b/gen/ui/appy.css @@ -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 }