def msg_box(self): if "messages" in self.session: self.msg_alerts = self.msg_alerts or [] self.msg_alerts += self.session["messages"] del (session["messages"]) # session.save() s = "" + "".join(["%s <br />" % (x) for x in self.msg_alerts]) return (len(s) > 0 or "") and ("$.ds.humanMsg.displayMsg('%s');" % s) return (len(s) > 0 or "") and helpers.round_box(s)
def error_box(self): if "errors" in self.session: self.msg_errors = self.msg_errors or [] self.msg_errors += session["errors"] s = "" if (self.form_errors and len(self.form_errors) > 0) or (self.msg_errors and len(self.msg_errors) > 0): s += '<img src="/static/images/error.png" class="ib"/>' if self.form_errors and len(self.form_errors) > 0: s += "There were errors on the form highlighted below" s += "".join(["%s <br />" % (x) for x in self.msg_errors]) return (len(s) > 0 or "") and ("$.ds.humanMsg.displayMsg('%s');" % s) return (len(s) > 0 or "") and helpers.round_box(s)