def _get_topic_html(self, data, index): return """<table width="100%%" cellspacing="0" cellpadding="0"><tr><td width="100%%">%(username)s create topic <strong>%(name)s</strong> in group <strong>%(group)s</strong> %(when)s</td></table>""" %( {'name':data.name, 'group':data.group.name, 'username':data.creator.username, 'when':friendly_time(data.date_created), })
def _get_message_html(self, data, index): return """<table width="100%%" cellspacing="0" cellpadding="0"><tr><td width="100%%">%(username)s created message <strong>%(message)s</strong> in topic <strong>%(topic)s</strong> of group <strong>%(group)s</strong> %(when)s</td></table>""" %( {'message':autolink(cgi.escape(data.message)).replace("\n", '<br>'), 'topic':data.topic.name, 'group':data.topic.group.name, 'username':data.user.username, 'when':friendly_time(data.date_created), })
def _get_html(self, data, index): message = autolink(cgi.escape(data.message)).replace("\n", '<br>') if data.unread == True: message = "<strong>" + message + "</strong>" return """<table width="100%%" cellspacing="0" cellpadding="0"><tr><td width="100%%">%(message)s</td><td nowrap="1" align="right"> <font color="#888888" size="7pt">%(username)s <br>%(date_created)s </font></td></tr></table>""" %( {'message':message, 'username':data.user.username, 'date_created':friendly_time(data.date_created), })
def _get_html(self, data, index): unread_snippet = '' if data.unread > 0: unread_snippet = '<br><font color="darkred"><b>%s unread</b></font> ' %(data.unread) return """<table width="100%%" cellspacing="0" cellpadding="0"><tr><td width="100%%">%(name)s</td><td nowrap="1" align="right"> <font color="#888888" size="7pt">%(username)s <br>%(date_latest_message)s %(unread_snippet)s</font></td></tr></table>""" %( {'name':data.name, 'username':data.creator.username, 'date_latest_message':friendly_time(data.date_latest_message), 'unread_snippet': unread_snippet, })
def _get_read_html(self, data, index): return """<table width="100%%" cellspacing="0" cellpadding="0"><tr><td width="100%%">%(username)s read <strong>%(name)s</strong> %(when)s</td></table>""" %( {'name':data.topic.name, 'username':data.user.username, 'when':friendly_time(data.when), })
def _get_login_html(self, data, index): return """<table width="100%%" cellspacing="0" cellpadding="0"><tr><td width="100%%">%(username)s logged in %(when)s</td></tr></table>""" %( {'username':data.user.username, 'when':friendly_time(data.when), })