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

  1. <?PY
  2. DISLIKE = _("Dislike! (via http://digsby.com/fb)")
  3. ?>
  4.  
  5. <?py
  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. dislikes = (post.post_id in feed.comments and [c for c in feed.comments[post.post_id] if c.text == #{{repr(DISLIKE)}}]) or [];
  9. num_dislikes = len(dislikes);
  10. num_non_dislike_comments = max(num_comments - num_dislikes, 0);
  11. user_dislikes = [c for c in dislikes if int(c.fromid) == int(post.viewer_id)]
  12. ?>
  13.     <span class="dislike_link_block">
  14. <?py if can_comment: ?>
  15.         <?py if not user_dislikes: ?>
  16.             <span class="dislike_button_section link_section">
  17.                 ┬╖ <!--! this line has a dot  -->
  18.                 <a href="javascript:null;" class="link dislike_button">${{_('Dislike')}}</a>
  19.             </span>
  20.         <?py else: ?>
  21.             <span class="dislike_button_section link_section">
  22.                 ┬╖ <!--! this line has a dot  -->
  23.                 <a href="javascript:null;" class="link undislike_button">${{_('Undislike')}}</a>
  24.             </span>
  25.         <?py #endif ?>
  26.         <?py if num_dislikes > 0: ?>
  27.             <a class="link link_section num_dislikes comment_button_section comment_button" href="javascript:null;">(${num_dislikes})</a>
  28.         <?py #endif ?>
  29. <?py else: ?>
  30.     <?py if num_dislikes > 0: ?>
  31.         ┬╖ <!--! this line has a dot  -->
  32.         <a class="link link_section num_dislikes comment_button_section comment_button" href="javascript:null;">${{_('Dislikes')}} (${num_dislikes})</a> <!--! <--needs link2 -->
  33.     <?py #endif ?>
  34. <?py #endif ?>
  35.     </span>
  36.