home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2012 January / maximum-cd-2012-01.iso / DiscContents / digsby_setup.exe / lib / plugins / facebook / res / comment_link.py.xml < prev    next >
Encoding:
Text File  |  2011-02-08  |  1.1 KB  |  28 lines

  1. <?PY
  2. DISLIKE = _("Dislike! (via http://digsby.com/fb)")
  3. ?>
  4. <?py
  5. from common import pref
  6. num_comments = ('comments' in post and 'count' in post.comments and post.comments.count != '0' and post.comments.count) or 0;
  7. can_comment = 'comments' in post and 'can_post' in post.comments and post.comments.can_post;
  8. if pref('facebook.dislike_enabled', type=bool, default=True):
  9.     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;
  10. else:
  11.     num_dislikes = 0;
  12. num_non_dislike_comments = max(num_comments - num_dislikes, 0);
  13. ?>
  14. <?py if can_comment: ?>
  15.         <span class="comment_button_section link_section">
  16.             ┬╖ <!--! this line has a dot  -->
  17.             <a href="javascript:null;" class="skinlink link makecommenttxt comment_button"><?py
  18.     if num_non_dislike_comments > 0:
  19. ?>${{_('Comment')}} (${num_non_dislike_comments})<?py
  20.     else: ?>${{_('Comment')}}<?py
  21.     #endif
  22. ?></a>
  23.         </span>
  24. <?py elif num_non_dislike_comments: ?>
  25. <?py     pass ?>
  26. <?py #endif ?>
  27. <?py del num_comments, can_comment ?>
  28.