## -*- 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()"> комментарий <%def name="parent_post_link()"> запись <%def name="reply_link(text)"> ${text} <%def name="trackback()">

% if post.parent_id: ## Отвечаем на коммент % if initiator == post.parent_author: в ответ на свой ${parent_comment_link() } % elif target == post.parent_author: в ответ на ваш ${parent_comment_link()} % else: в ответ на ${parent_comment_link()} ${common.yauser(post.parent_author, 'rod')} ${feed_link()} % endif % else: ## Отвечаем на пост % if initiator == post.post_author: в ответ на свою ${parent_post_link()} % elif target == post.post_author: в ответ на вашу ${parent_post_link()} % else: в ответ на ${parent_post_link()} ${common.yauser(post.post_author, 'rod')} ${feed_link()} % endif % endif

<%def name="item_action_description(item_type)"> <% item_type_messages = { 'status': (capture(reply_link, capture(common.inflect, u'сменил', initiator, initiator==target)), u'настроение'), 'join': lambda: (capture(reply_link, capture(common.inflect, u'вступил', initiator, initiator==target)), u'в клуб', capture(common.yauser, post.friended_in_reply)), 'unjoin': lambda: (capture(reply_link, capture(common.inflect, u'покинул', initiator, initiator==target)), u'клуб', capture(common.yauser, post.friended_in_reply)), 'friend': lambda: (capture(reply_link, capture(common.inflect, u'подружился', initiator, initiator==target)), u'c', capture(common.yauser, post.friended_in_reply, 'tvor')), 'unfriend': lambda: (capture(reply_link, capture(common.inflect, u'поссорился', initiator, initiator==target)), u'с', capture(common.yauser, post.friended_in_reply, 'tvor')), 'summon': lambda: (capture(reply_link, capture(common.inflect, u'призвал', initiator, initiator==target)), capture(common.yauser, post.summoned, 'vin')), 'link': (capture(reply_link, capture(common.inflect, u'поделился', initiator, initiator==target)), u'ссылкой'), 'congratulation': lambda: (capture(reply_link, capture(common.inflect, u'поздравил', initiator, initiator==target)), u'друзей' if post.congratulated_by_reply is None else capture(common.yauser, post.congratulated_by_reply, 'vin')), 'jira': (capture(reply_link, capture(common.inflect, u'создал', initiator, initiator==target)), u'тикет'), 'default': (capture(reply_link, capture(common.inflect, u'написал', initiator, initiator==target)), u'комментарий') } 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() %> ${u' '.join(current_message)} <%def name="feed_link()"> % if post.feed == initiator: в своём дневнике % elif post.feed == target: в вашем дневнике % elif post.parent_author == post.feed: в ${u'его' if post.parent_author.sex == 'man' else u'её'} дневнике % else: % if post.feed.is_club: в клубе ${common.yauser(post.feed)} % else: в дневнике ${common.yauser(post.feed, 'rod')} % endif % endif