Example #1
0
 def _specific_link(user, instance, size, scope, other):
     from adhocracy.lib import tiles
     from adhocracy.lib.helpers import entity_url
     url = _generic_link(user, instance, size, scope)
     if user.badges:
         url += u"<span class='user_link_badges'>" + \
             unicode(tiles.badge.badges(user.badges)) + "</span>"
     if other and scope:
         dnode = democracy.DelegationNode(other, scope)
         for delegation in dnode.outbound():
             if delegation.agent == user:
                 icon = (u'<img class="user_icon" width="16" height="16" '
                         'src="/img/icons/delegate_16.png" />')
                 url += u'<a href="%s">%s</a>' % (entity_url(delegation),
                                                  icon)
     return url
Example #2
0
 def _dnode(self):
     if not self.__dnode:
         self.__dnode = democracy.DelegationNode(c.user, self.poll.scope)
     return self.__dnode
Example #3
0
 def _dnode(self):
     if not self.__dnode:
         self.__dnode = democracy.DelegationNode(c.user, self.delegateable)
     return self.__dnode