## -*- coding: utf-8 -*- <%namespace name="styles" file="../styles.block.html"/> <%namespace name="common" file="common.block.html"/> <%def name="render_reply_for(type)"> ${reply()} <%def name="reply()"> ${intro()} ${trackback()}
${post.parent_body}
<%def name="intro()">

${common.yauser(initiator, caps=True)} ${item_action_description(post.reply_type)}

% if not post.is_reply_body_empty():
${post.reply_body}
% endif <%def name="parent_comment_link()"> comment <%def name="parent_post_link()"> post <%def name="reply_link(text)"> ${text} <%def name="trackback()">

% if post.parent_id: ## Отвечаем на коммент % if initiator == post.parent_author: on own ${parent_comment_link() } % elif target == post.parent_author: on your ${parent_comment_link() } % else: on ${common.yauser(post.parent_author)} ${parent_comment_link()} ${feed_link()} % endif % else: ## Отвечаем на пост % if initiator == post.post_author: on own ${parent_post_link()} % elif target == post.post_author: on your ${parent_post_link()} % else: on ${common.yauser(post.post_author)} ${parent_post_link()} ${feed_link()} % endif % endif

<%def name="item_action_description(item_type)"> <% item_type_messages = { 'status': (capture(reply_link, capture(common.inflect, u'changed', initiator)), u'mood'), 'join': lambda: (capture(reply_link, capture(common.inflect, u'joined', initiator)), capture(common.yauser, post.friended_in_reply)), 'unjoin': lambda: (capture(reply_link, capture(common.inflect, u'left', initiator)), capture(common.yauser, post.friended_in_reply)), 'friend': lambda: (capture(reply_link, capture(common.inflect, u'friended', initiator)), capture(common.yauser, post.friended_in_reply)), 'unfriend': lambda: (capture(reply_link, capture(common.inflect, u'unfriended', initiator)), capture(common.yauser, post.friended_in_reply)), 'summon': lambda: (capture(reply_link, capture(common.inflect, u'invited', initiator)), capture(common.yauser, post.summoned), u'into comments'), 'link': (capture(reply_link, capture(common.inflect, u'shared', initiator)), u'link'), 'congratulation': lambda: (capture(reply_link, capture(common.inflect, u'congratulated', initiator)), u'friends' if post.congratulated_by_reply is None else capture(common.yauser, post.congratulated_by_reply)), 'jira': (capture(reply_link, capture(common.inflect, u'started', initiator)), u'ticket'), 'default': (capture(reply_link, capture(common.inflect, u'wrote', initiator)), u'comment') } if item_type not in item_type_messages: item_type = 'default' current_message = item_type_messages[item_type] if callable(current_message): current_message = current_message() %> ${reply_link(u' '.join(current_message))} <%def name="feed_link()"> % if post.feed == initiator: in own blog % elif post.feed == target: in your blog % elif post.parent_author == post.feed: in ${u'his' if post.parent_author.sex == 'man' else u'her'} blog % else: % if post.feed.is_club: in club ${common.yauser(post.feed)} % else: in ${common.yauser(post.feed)} blog % endif % endif