示例#1
0
def render_new_group(template, activity):
    """Return the HTML snippet describing a user creating a new group"""

    # Provide a html link to the user's page
    actor = link_to_user(activity['user_id'])
    actor = '%s' % actor

    # Provide a html link to the new group
    object = h.group_link(activity['data']['group'])
    if object:
        object = '%s' % object

    # Build the entire message and return the html.
    date = '%s' % h.render_datetime(activity['timestamp'])
    template = template.format(actor=actor, date=date, object=object)
    template = '%s %s' % (template, date)

    # It is important to return it as a literal or it will be converted to text
    return html.literal(template)
示例#2
0
def render_new_group(template, activity):
    """Return the HTML snippet describing a user creating a new group"""
    
    # Provide a html link to the user's page
    actor = link_to_user(activity['user_id'])
    actor = '%s' % actor
    
    # Provide a html link to the new group
    object = h.group_link(activity['data']['group'])
    if object:
        object = '%s' % object
    
    # Build the entire message and return the html. 
    date = '%s' % h.render_datetime(activity['timestamp'])
    template = template.format(actor=actor, date=date, object=object)
    template = '%s %s' % (template, date)
    
    # It is important to return it as a literal or it will be converted to text
    return html.literal(template)

                      
示例#3
0
def get_snippet_group(activity, detail):
    return h.group_link(activity['data']['group'])
示例#4
0
def get_snippet_group(activity, detail):
    link = h.group_link(activity['data']['group'])
    return literal('''<span>%s</span>''' % (link))
示例#5
0
def get_snippet_group(activity, detail):
    link = h.group_link(activity['data']['group'])
    return literal('''<span>%s</span>'''
        % (link)
        )
示例#6
0
def get_snippet_group(activity, detail):
    link = h.group_link(activity["data"]["group"])
    return literal("""<span>%s</span>""" % (link))
示例#7
0
def get_snippet_group(activity, detail):
    link = h.group_link(activity['data']['group'])
    return literal('''<span data-module="popover-context" data-module-type="group" data-module-id="%s">%s</span>'''
        % (activity['object_id'], link)
        )
示例#8
0
def get_snippet_group(activity, detail):
    link = h.group_link(activity["data"]["group"])
    return literal(
        """<span data-module="popover-context" data-module-type="group" data-module-id="%s">%s</span>"""
        % (activity["object_id"], link)
    )
示例#9
0
def get_snippet_group(activity, detail):
    return h.group_link(activity['data']['group'])
示例#10
0
def get_snippet_group(activity, detail):
    link = h.group_link(activity['data']['group'])
    return literal(
        '''<span data-module="popover-context" data-module-type="group" data-module-id="%s">%s</span>'''
        % (activity['object_id'], link))
示例#11
0
def group_with_url(group):
    group['url'] = h.group_link(group)
    return group