Esempio n. 1
0
 def get_thumbnail(self):
     """Returns a thumbnail of the image."""
     return mark_safe('<img src="%s" data-at2x="%s" '
                      'class="file-thumbnail" alt="%s" />'
                      % (thumbnail(self.attachment.file),
                         thumbnail(self.attachment.file, '800x200'),
                         escape(self.attachment.caption)))
Esempio n. 2
0
 def get_thumbnail(self):
     """Returns a thumbnail of the image."""
     return mark_safe('<img src="%s" data-at2x="%s" '
                      'class="file-thumbnail" alt="%s" />' %
                      (thumbnail(self.attachment.file),
                       thumbnail(self.attachment.file, '800x200'),
                       escape(self.attachment.caption)))
Esempio n. 3
0
 def get_thumbnail(self):
     """Return a thumbnail of the image."""
     return mark_safe(
         '<div class="file-thumbnail">'
         ' <img src="%s" data-at2x="%s" alt="%s" />'
         '</div>'
         % (thumbnail(self.attachment.file, (300, None)),
            thumbnail(self.attachment.file, (600, None)),
            escape(self.attachment.caption)))
Esempio n. 4
0
 def get_thumbnail(self):
     """Return a thumbnail of the image."""
     return mark_safe(
         '<div class="file-thumbnail">'
         ' <img src="%s" data-at2x="%s" alt="%s" />'
         '</div>' %
         (thumbnail(self.attachment.file, (300, None)),
          thumbnail(self.attachment.file,
                    (600, None)), escape(self.attachment.caption)))
Esempio n. 5
0
    def get_thumbnail(self):
        """Return a thumbnail of the image.

        Returns:
            django.utils.safestring.SafeText:
            The HTML for the thumbnail for the associated attachment.
        """
        return format_html(
            '<div class="file-thumbnail">'
            ' <img src="{src_1x}" srcset="{src_1x} 1x, {src_2x} 2x"'
            ' alt="{caption}" width="300" />'
            '</div>',
            src_1x=thumbnail(self.attachment.file, (300, None)),
            src_2x=thumbnail(self.attachment.file, (600, None)),
            caption=self.attachment.caption)
Esempio n. 6
0
 def thumb(self):
     """
     Creates a thumbnail of this screenshot and returns the HTML
     output embedding the thumbnail.
     """
     url = thumbnail(self.image)
     return mark_safe('<img src="%s" alt="%s" />' % (url, self.caption))
Esempio n. 7
0
 def thumb(self):
     """Creates and returns HTML for this screenshot's thumbnail."""
     url = self.get_thumbnail_url()
     return format_html(
         '<img src="{src_1x}" srcset="{src_1x} 1x, {src_2x} 2x"'
         ' alt="{caption}" width="400" />',
         src_1x=url,
         src_2x=thumbnail(self.image, '800x200'),
         caption=self.caption)
Esempio n. 8
0
 def thumb(self):
     """Creates and returns HTML for this screenshot's thumbnail."""
     url = self.get_thumbnail_url()
     return mark_safe('<img src="%s" data-at2x="%s" alt="%s" />' %
                      (url, thumbnail(self.image, '800x200'),
                       escape(self.caption)))
Esempio n. 9
0
 def get_thumbnail_url(self):
     """Returns the URL for the thumbnail, creating it if necessary."""
     return thumbnail(self.image)
Esempio n. 10
0
 def get_thumbnail(self):
     """Returns a thumbnail of the image."""
     return mark_safe('<img src="%s" class="file-thumbnail" alt="%s" />'
                      % (thumbnail(self.attachment.file),
                         self.attachment.caption))
Esempio n. 11
0
 def get_thumbnail(self):
     """Returns a thumbnail of the image."""
     return mark_safe(
         '<img src="%s" class="file-thumbnail" alt="%s" />' %
         (thumbnail(self.attachment.file), self.attachment.caption))