home *** CD-ROM | disk | FTP | other *** search
- <?PY
- DISLIKE = _("Dislike! (via http://digsby.com/fb)")
- ?>
- <?py
- from common import pref
- num_comments = ('comments' in post and 'count' in post.comments and post.comments.count != '0' and post.comments.count) or 0;
- can_comment = 'comments' in post and 'can_post' in post.comments and post.comments.can_post;
- if pref('facebook.dislike_enabled', type=bool, default=True):
- num_dislikes = (post.post_id in feed.comments and len([c for c in feed.comments[post.post_id] if c.text == #{{repr(DISLIKE)}}])) or 0;
- else:
- num_dislikes = 0;
- num_non_dislike_comments = max(num_comments - num_dislikes, 0);
- ?>
- <?py if can_comment: ?>
- <span class="comment_button_section link_section">
- ┬╖ <!--! this line has a dot -->
- <a href="javascript:null;" class="skinlink link makecommenttxt comment_button"><?py
- if num_non_dislike_comments > 0:
- ?>${{_('Comment')}} (${num_non_dislike_comments})<?py
- else: ?>${{_('Comment')}}<?py
- #endif
- ?></a>
- </span>
- <?py elif num_non_dislike_comments: ?>
- <?py pass ?>
- <?py #endif ?>
- <?py del num_comments, can_comment ?>
-