Ejemplo n.º 1
0
 def render(self, what, row, tags, custom_vars):
     comments = row[what + "_comments_with_extra_info"]
     if len(comments) > 0:
         text = ""
         for c in sorted(comments, key=lambda x: x[4]):
             _id, author, comment, _ty, timestamp = c
             comment = comment.replace("\n", "<br>")
             text += '%s %s: "%s" \n' % (
                 paint_age(timestamp, True, 0, "abs")[1],
                 author,
                 comment,
             )
         return (
             "comment",
             text,
             url_to_visual(row,
                           VisualLinkSpec("views", "comments_of_" + what)),
         )
Ejemplo n.º 2
0
 def render(self, row, cell):
     return paint_age(row["crash_time"], has_been_checked=True, bold_if_younger_than=3600)