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