コード例 #1
0
ファイル: display.py プロジェクト: pombredanne/editorsnotes
def display_edit_history(obj):
    return mark_safe(
        '''<div class="edit-history">
Created by %s %s.<br/>
Last edited by %s %s.</div>''' % (
            as_link(UserProfile.get_for(obj.creator)), timeago(obj.created),
            as_link(UserProfile.get_for(obj.last_updater)), timeago(obj.last_updated)))
コード例 #2
0
ファイル: display.py プロジェクト: pombredanne/editorsnotes
def display_last_updated(obj):
    if 'last_updated' in obj._meta.get_all_field_names():
        return mark_safe(
            '''<div class="last-updated">Last edited by %s %s.</div>''' % (
                as_link(UserProfile.get_for(obj.last_updater)), timeago(obj.last_updated)))
    else:
        return mark_safe(
            '''<div class="last-updated">Last edited by %s %s.</div>''' % (
                as_link(UserProfile.get_for(obj.creator)), timeago(obj.created)))
コード例 #3
0
ファイル: display.py プロジェクト: pombredanne/editorsnotes
def login_information(name):
    affiliation = UserProfile.get_for(name).affiliation
    if affiliation is not None:
        return mark_safe(
            'Logged in as %s (%s)' % (
            as_link(UserProfile.get_for(name)), as_link(affiliation)))
    else:
        return mark_safe(
            'Logged in as %s' % (
            as_link(UserProfile.get_for(name))))