~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/model/pillaraffiliation.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-08-04 20:34:35 UTC
  • mfrom: (13608.1.4 person-picker-expand-1)
  • Revision ID: launchpad@pqm.canonical.com-20110804203435-o5cob6ra9jw8hev1
[r=jcsackett][bug=800361,
        798759] Restore picker expander and place it behind its own flag.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
from canonical.launchpad.interfaces.launchpad import IHasIcon
32
32
from lp.bugs.interfaces.bugtask import IBugTask
 
33
from lp.registry.interfaces.distribution import IDistribution
33
34
 
34
35
 
35
36
class IHasAffiliation(Interface):
80
81
                icon_url = context.icon.getURL()
81
82
                return icon_url
82
83
            return default_url
83
 
        
84
 
        if self.context.distribution or self.context.distroseries:
85
 
            icon_url = getIconUrl(
86
 
                self.context.distribution or self.context.distroseries.distribution,
87
 
                "/@@/distribution-badge")
88
 
            return BadgeDetails(icon_url, "Affiliated with Ubuntu")
89
 
        if self.context.product or self.context.productseries:
90
 
            icon_url = getIconUrl(
91
 
                self.context.product or self.context.productseries.product,
92
 
                "/@@/product-badge")
93
 
            return BadgeDetails(icon_url, "Affiliated with Launchpad itself")
 
84
 
 
85
        alt_text = "Affiliated with %s" % pillar.displayname
 
86
        if IDistribution.providedBy(pillar):
 
87
            icon_url = getIconUrl(pillar, "/@@/distribution-badge")
 
88
        else:
 
89
            icon_url = getIconUrl(pillar, "/@@/product-badge")
 
90
        return BadgeDetails(icon_url, alt_text)