Beispiel #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)
     })
Beispiel #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')
Beispiel #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)))
Beispiel #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)))