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

  1.     <?py img = skin.get('facebookicons.like') ?>
  2. <div class="likes minor">
  3.     <?py user_likes = 'likes' in post and 'user_likes' in post.likes and post.likes.user_likes; ?>
  4.     <?py uids = (('sample' in post.likes and post.likes.sample or []) + ('friends' in post.likes and post.likes.friends or [])) ?>
  5.     <?py if ('count' in post.likes and post.likes.count): ?>
  6.         <?py link = post.likes.get('href') or False ?>
  7.         <?py if user_likes: ?>
  8.     <div>
  9.             <img src="${img.path.url()}"
  10.                 width="${img.Width}"
  11.                 height="${img.Height}"
  12.             />
  13.             <?py if post.likes.count == 1: ?>
  14.                 <?py likes_msg = _('You liked this') ?>
  15.             <?py elif post.likes.count > 1: ?>
  16.                 <?py likes_fmt = ngettext("You and {startlink_other}one other{endlink_other} liked this",
  17.                                           "You and {startlink_other}{num_others} others{endlink_other} liked this",
  18.                                           post.likes.count - 1) ?>
  19.                 <?py if link: ?>
  20.                     <?py likes_msg = likes_fmt.format(num_others = post.likes.count - 1,
  21.                                                       startlink_other='<a class="no_ondown_link" href="' + link + '">',
  22.                                                       endlink_other='</a>') ?>
  23.                 <?py else: ?>
  24.                     <?py likes_msg = likes_fmt.format(num_others = post.likes.count - 1,
  25.                                                       startlink_other='',
  26.                                                       endlink_other='') ?>
  27.                 <?py #endif ?>
  28.             <?py #endif ?>
  29.             #{likes_msg}
  30.             </div>
  31.         <?py elif uids: ?>
  32.             <?py for uid in uids: ?>
  33.                 <?py if uid in feed.profiles and feed.profiles[uid].name: ?>
  34.                     <div>
  35.                         <img src="${img.path.url()}"
  36.                             width="${img.Width}"
  37.                             height="${img.Height}"
  38.                         />
  39.                     <?py if post.likes.count == 1: ?>
  40.                         <?py likes_fmt = _("{startlink_name}{name}{endlink_name} liked this") ?>
  41.                         <?py if feed.profiles[uid].url: ?>
  42.                             <?py likes_msg = likes_fmt.format(name = feed.profiles[uid].name or _("Facebook User"),
  43.                                                               startlink_name='<a class="link no_ondown_link" href="' + escape(feed.profiles[uid].url) + '">',
  44.                                                               endlink_name='</a>') ?>
  45.                         <?py else: ?>
  46.                             <?py likes_msg = likes_fmt.format(name = feed.profiles[uid].name or _("Facebook User"),
  47.                                                               startlink_name='',
  48.                                                               endlink_name='') ?>
  49.                         <?py #endif ?>
  50.                     <?py if post.likes.count > 1: ?>
  51.                         <?py likes_fmt = ngettext("{startlink_name}{name}{endlink_name} and {startlink_other}one other{endlink_other} liked this",
  52.                                                   "{startlink_name}{name}{endlink_name} and {startlink_other}{num_others} others{endlink_other} liked this",
  53.                                                   post.likes.count - 1) ?>
  54.                         <?py if link: ?>
  55.                             <?py likes_msg = likes_fmt.format(name = feed.profiles[uid].name or _('Facebook User'),
  56.                                                               num_others = post.likes.count - 1,
  57.                                                               startlink_name='<a class="link no_ondown_link" href="' + escape(feed.profiles[uid].url) + '">',
  58.                                                               startlink_other='<a class="no_ondown_link" href="' + link + '">',
  59.                                                               endlink_name='</a>',
  60.                                                               endlink_other='</a>') ?>
  61.                         <?py else: ?>
  62.                             <?py likes_msg = likes_fmt.format(name = feed.profiles[uid].name or _("Facebook User"),
  63.                                                               num_others = post.likes.count - 1,
  64.                                                               startlink_name='',
  65.                                                               startlink_other='',
  66.                                                               endlink_name='',
  67.                                                               endlink_other='') ?>
  68.                         <?py #endif ?>
  69.                     <?py #endif ?>
  70.                     #{likes_msg}
  71.                     <br/>
  72.                     </div>
  73.                     <?py break ?>
  74.                 <?py #endif ?>
  75.             <?py else: ?>
  76.                 <?py likes_fmt = ngettext("{startlink_other}one user{endlink_other} liked this",
  77.                                           "{startlink_other}{num_users} users{endlink_other} liked this",
  78.                                           post.likes.count) ?>
  79.                 <?py if link: ?>
  80.                     <?py likes_msg = likes_fmt.format(name = feed.profiles[uid].name or _("Facebook User"),
  81.                                                       num_users = post.likes.count,
  82.                                                       startlink_other='<a class="no_ondown_link" href="' + link + '">',
  83.                                                       endlink_other='</a>') ?>
  84.                 <?py else: ?>
  85.                     <?py likes_msg = likes_fmt.format(name = feed.profiles[uid].name or _("Facebook User"),
  86.                                                       num_users = post.likes.count,
  87.                                                       startlink_other='',
  88.                                                       endlink_other='') ?>
  89.                 <?py #endif ?>
  90.                 #{likes_msg}
  91.             <?py #endfor ?>
  92.         <?py del link ?>
  93.         <?py #endif ?>
  94.     <?py #endif ?>
  95.     <?py del user_likes ?>
  96. </div>
  97.