<s> from django import template <EOL> from django . conf import settings <EOL> from django . core . urlresolvers import reverse <EOL> register = template . Library ( ) <EOL> @ register . inclusion_tag ( "<STR_LIT>" , takes_context = True ) <EOL> def show_update ( context , update ) : <EOL> feed_object = update . feed . feed_object <EOL> update_object = update . content_object <EOL> icon = object_content = None <EOL> feed_object_link = '<STR_LIT>' % ( feed_object . get_absolute_url ( ) , feed_object ) <EOL> update_object_link = None <EOL> if update . action_description . startswith ( '<STR_LIT>' ) : <EOL> icon = '<STR_LIT>' <EOL> update_line = update . action_description % feed_object_link <EOL> elif update . action_description . startswith ( '<STR_LIT>' ) : <EOL> icon = '<STR_LIT>' <EOL> update_line = update . action_description % feed_object_link <EOL> elif update . action_description . startswith ( '<STR_LIT>' ) : <EOL> icon = '<STR_LIT>' <EOL> update_line = update . action_description % feed_object_link <EOL> elif update . action_description . startswith ( '<STR_LIT>' ) : <EOL> icon = '<STR_LIT>' <EOL> update_object_link = '<STR_LIT>' % ( update_object . get_absolute_url ( ) , update_object ) <EOL> update_line = update . action_description % ( update_object_link , feed_object_link ) <EOL> elif update . action_description . startswith ( '<STR_LIT>' ) : <EOL> icon = '<STR_LIT>' <EOL> update_line = update . action_description % feed_object_link <EOL> elif update . action_description . startswith ( '<STR_LIT>' ) : <EOL> icon = '<STR_LIT>' <EOL> update_line = update . action_description % feed_object_link <EOL> else : <EOL> icon = '<STR_LIT>' <EOL> update_line = update . action_description % feed_object_link <EOL> return { '<STR_LIT>' : update , '<STR_LIT>' : update . user , '<STR_LIT>' : icon , <EOL> '<STR_LIT>' : feed_object , '<STR_LIT>' : update_object , '<STR_LIT>' : update_line , <EOL> '<STR_LIT>' : update . update_content , '<STR_LIT>' : settings . STATIC_URL } <EOL> @ register . inclusion_tag ( "<STR_LIT>" , takes_context = True ) <EOL> def follow_button ( context , content_object , extra_text = None ) : <EOL> user = context [ '<STR_LIT>' ] . user <EOL> feed = content_object . feed <EOL> subscription_url = reverse ( '<STR_LIT>' , kwargs = { '<STR_LIT>' : feed . id } ) <EOL> if user . is_authenticated ( ) : <EOL> subscription = feed . is_user_following ( user ) <EOL> else : <EOL> subscription = None <EOL> return { '<STR_LIT>' : subscription_url , '<STR_LIT>' : subscription , <EOL> '<STR_LIT>' : extra_text , '<STR_LIT>' : feed , <EOL> '<STR_LIT>' : settings . STATIC_URL } </s>
