Пример #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