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

  1. <?PY
  2. DISLIKE = _("Dislike! (via http://digsby.com/fb)")
  3. ?>
  4. <?py
  5. from util.primitives.structures import oset
  6.  
  7. num_comments = ('comments' in post and 'count' in post.comments and post.comments.count != '0' and post.comments.count) or 0;
  8. can_comment = 'comments' in post and 'can_post' in post.comments and post.comments.can_post;
  9. dislikes = (post.post_id in feed.comments and [c for c in feed.comments[post.post_id] if c.text == #{{repr(DISLIKE)}}]) or [];
  10. num_dislikes = len(dislikes);
  11. num_non_dislike_comments = max(num_comments - num_dislikes, 0);
  12. user_dislikes = [c for c in dislikes if int(c.fromid) == int(post.viewer_id)];
  13. uids = oset([int(c.fromid) for c in dislikes if int(c.fromid) != int(post.viewer_id)]);
  14. ?>
  15. <?py img = skin.get('facebookicons.dislike') ?>
  16. <div class="dislikes minor">
  17. <?py if num_dislikes: ?>
  18.     <?py if user_dislikes: ?>
  19.         <div>
  20.         <img src="${img.path.url()}"
  21.             width="${img.Width}"
  22.             height="${img.Height}"
  23.         />
  24.         <?py if len(uids) >= 2: ?>
  25.             You,
  26.             <?py for uid in uids[:-1]: ?>
  27.                 <?py if feed.profiles[uid].url: ?>
  28. <a class="link no_ondown_link" href="${feed.profiles[uid].url}">${feed.profiles[uid].name or _("Facebook User")}</a>,
  29.                 <?py else: ?>
  30.                     ${feed.profiles[uid].name or _("Facebook User")}
  31.                 <?py #endif ?>
  32.         <?py else: ?>
  33.                 You
  34.         <?py #endif ?>
  35.         <?py if len(uids) >= 1: ?>
  36.             and
  37.             <?py uid = uids[-1] ?>
  38.             <?py if feed.profiles[uid].url: ?>
  39. <a class="link no_ondown_link" href="${feed.profiles[uid].url}">${feed.profiles[uid].name or _("Facebook User")}</a>
  40.             <?py else: ?>
  41.                 ${feed.profiles[uid].name or _("Facebook User")}
  42.             <?py #endif ?>
  43.         <?py #endif ?>
  44.         disliked this
  45.         </div>
  46.     <?py elif uids: ?>
  47.         <div>
  48.         <img src="${img.path.url()}"
  49.             width="${img.Width}"
  50.             height="${img.Height}"
  51.         />
  52.         <?py if len(uids) >= 3: ?>
  53.             <?py for uid in uids[:-2]: ?>
  54.                 <?py if feed.profiles[uid].url: ?>
  55. <a class="link no_ondown_link" href="${feed.profiles[uid].url}">${feed.profiles[uid].name or _("Facebook User")}</a>,
  56.                 <?py else: ?>
  57.                     ${feed.profiles[uid].name or _("Facebook User")}
  58.                 <?py #endif ?>
  59.         <?py #endif ?>
  60.         <?py if len(uids) >= 2: ?>
  61.             <?py uid = uids[-2] ?>
  62.             <?py if feed.profiles[uid].url: ?>
  63. <a class="link no_ondown_link" href="${feed.profiles[uid].url}">${feed.profiles[uid].name or _("Facebook User")}</a>
  64.             <?py else: ?>
  65.                 ${feed.profiles[uid].name or _("Facebook User")}
  66.             <?py #endif ?>
  67.             and
  68.         <?py #endif ?>
  69.         <?py uid = uids[-1] ?>
  70.         <?py if feed.profiles[uid].url: ?>
  71. <a class="link no_ondown_link" href="${feed.profiles[uid].url}">${feed.profiles[uid].name or _("Facebook User")}</a>
  72.         <?py else: ?>
  73.             ${feed.profiles[uid].name or _("Facebook User")}
  74.         <?py #endif ?>
  75.         disliked this
  76.         </div>
  77.     <?py #endif ?>
  78. <?py #endif ?>
  79. </div>
  80.