Example #1
0
 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),
          })
Example #2
0
 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),
          })
Example #3
0
    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&nbsp;<br>%(date_created)s&nbsp;</font></td></tr></table>""" %(
            {'message':message,
             'username':data.user.username,
             'date_created':friendly_time(data.date_created),
             })
Example #4
0
 def _get_html(self, data, index):
     unread_snippet = ''
     if data.unread > 0:
         unread_snippet = '<br><font color="darkred"><b>%s unread</b></font>&nbsp;' %(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&nbsp;<br>%(date_latest_message)s&nbsp;%(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,
          })
Example #5
0
 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),
          })
Example #6
0
 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),
          })