web/widgets.py
branchtls-sprint
changeset 1641 2c80b09d8d86
parent 1554 3a3263df6cdd
parent 1609 79ec2b8e6466
child 1704 d6f0e04d82bd
equal deleted inserted replaced
1640:65b60f177eb1 1641:2c80b09d8d86
   142         return u''
   142         return u''
   143 
   143 
   144     def render_help(self, entity):
   144     def render_help(self, entity):
   145         """render a help message about the (edited) field"""
   145         """render a help message about the (edited) field"""
   146         req = entity.req
   146         req = entity.req
   147         help = [u'<br/>']
   147         help = [u'<div class="helper">']
   148         descr = self.description or self.rschema.rproperty(self.subjtype, self.objtype, 'description')
   148         descr = self.description or self.rschema.rproperty(self.subjtype, self.objtype, 'description')
   149         if descr:
   149         if descr:
   150             help.append(u'<span class="helper">%s</span>' % req._(descr))
   150             help.append(u'<span>%s</span>' % req._(descr))
   151         example = self.render_example(req)
   151         example = self.render_example(req)
   152         if example:
   152         if example:
   153             help.append(u'<span class="helper">(%s: %s)</span>'
   153             help.append(u'<span>(%s: %s)</span>'
   154                         % (req._('sample format'), example))
   154                         % (req._('sample format'), example))
       
   155 	help.append(u'</div>')
   155         return u'&nbsp;'.join(help)
   156         return u'&nbsp;'.join(help)
   156 
   157 
   157     def render_example(self, req):
   158     def render_example(self, req):
   158         return u''
   159         return u''
   159 
   160 
   748         return wdg+cal_button
   749         return wdg+cal_button
   749 
   750 
   750     def render_help(self, entity):
   751     def render_help(self, entity):
   751         """calendar popup widget"""
   752         """calendar popup widget"""
   752         req = entity.req
   753         req = entity.req
   753         help = [ u'<br/>' ]
   754         help = [ u'<div class="helper">' ]
   754         descr = self.rschema.rproperty(self.subjtype, self.objtype, 'description')
   755         descr = self.rschema.rproperty(self.subjtype, self.objtype, 'description')
   755         if descr:
   756         if descr:
   756             help.append('<span class="helper">%s</span>' % req._(descr))
   757             help.append('<span>%s</span>' % req._(descr))
   757         example = self.render_example(req)
   758         example = self.render_example(req)
   758         if example:
   759         if example:
   759             help.append('<span class="helper">(%s: %s)</span>'
   760             help.append('<span>(%s: %s)</span>'
   760                         % (req._('sample format'), example))
   761                         % (req._('sample format'), example))
       
   762 	help.append(u'</div>')
   761         return u'&nbsp;'.join(help)
   763         return u'&nbsp;'.join(help)
   762 
   764 
   763     def render_calendar_popup(self, entity):
   765     def render_calendar_popup(self, entity):
   764         """calendar popup widget"""
   766         """calendar popup widget"""
   765         req = entity.req
   767         req = entity.req