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)
def get_snippet_group(activity, detail): return h.group_link(activity['data']['group'])
def get_snippet_group(activity, detail): link = h.group_link(activity['data']['group']) return literal('''<span>%s</span>''' % (link))
def get_snippet_group(activity, detail): link = h.group_link(activity['data']['group']) return literal('''<span>%s</span>''' % (link) )
def get_snippet_group(activity, detail): link = h.group_link(activity["data"]["group"]) return literal("""<span>%s</span>""" % (link))
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) )
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) )
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))
def group_with_url(group): group['url'] = h.group_link(group) return group