def writeLeftMargin(self): wr = self.write #row = self.target sess = self.getSession() frm = sess.forms.get('login',None) if frm is None: usr = sess.getUser() if usr is None: wr( "wie kann das?") else: wr("""Logged in as %s. <a href="logout">(log out)</a>""" % usr.getLabel()) else: self.renderForm(frm) wr("""<br><a href="%s">register</a>""" % \ self.contextURI("register")) msgs = sess.popMessages() if len(msgs) > 0: wr("""<p style="padding:5px;border:1px solid black; background-colr:gold;">""") for msg in msgs: wr("""<br><font color="red">%s</font>""" % txt2html(msg)) wr('</p>') ContextedResponse.writeLeftMargin(self) #self.write('<p><a href="add">add row</a>') #self.write('<br><a href="delete">delete row</a></p>') self.writeContextMenu()
def htmltext(s): s = escape(s) # s = s.replace('<','<') # s = s.replace('>','>') # s = s.replace('&','&') return txt2html(s)