Exemplo n.º 1
0
 def code(self):
     """Return the code to embed this banner.."""
     return jingo.env.from_string(BANNER_TEMPLATE).render({
         'url': self.affiliate_link(),
         'img': absolutify(self.image.image.url),
         'alt_text': _locale(self.badge.name, self.image.locale)
     })
Exemplo n.º 2
0
 def test_basic(self):
     """
     Test that translating a string works and doesn't change the current
     locale.
     """
     activate('fr')
     eq_(_locale('message', 'xxx'), 'translated')
     eq_(get_language(), 'fr')
Exemplo n.º 3
0
 def preview(self):
     """Return the HTML to preview this banner."""
     return Markup('<img src="%s?from_affiliates" alt="%s">' %
                   (absolutify(self.image.image.url),
                    _locale(self.badge.name, self.image.locale)))
Exemplo n.º 4
0
 def preview(self):
     """Return the HTML to preview this banner."""
     return Markup('<img src="%s?from_affiliates" alt="%s">' %
                   (absolutify(self.image.image.url),
                    _locale(self.badge.name, self.image.locale)))