def note_row(note): return """<tr> <td style="background: {color};"></td> <td>{post}</td> <td>{note}</td> <td>{body}</td> <td>{user}</td> <td>{date}</td> </tr>\n""".format(color = id_to_color(note['post_id']), post = link(note['post_id'], '/post/show/{0}'.format(note['post_id'])), note = link('{0}.{1}'.format(note['note_id'], note['version']), '/note/history/{0}'.format(note['note_id'])), body = he(note['body'].encode('utf-8')) + ('' if note['is_active'] else ' (deleted)'), user = link(he(user_summary(note['creator_id'])['name'].encode('utf-8')), '/user/show/{0}'.format(note['creator_id'])), date = note['updated_at'].strftime('%Y-%m-%d %H:%M') )
def html_print_users(users, criteria, ids): print frame_top print '<p><i>Searched {0} users on criteria {1}</i></p>'.format(len(ids), he(criteria)) print '<p><i>Got {0} users</i></i>'.format(len(users)) print '<p><i>Generated {0:%Y-%m-%d %H:%M}</i></p><br/>'.format(datetime.now()) total = TotalUser() for user in users: print html_format_user(user) total.update(user) if options.totalstats and users: print '<br/><br/>' print html_format_user(total, True) print html_format_user(total.average(), True) print frame_bottom