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)))
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)))
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)
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))
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)
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)))
def get_thumbnail_url(self): """Returns the URL for the thumbnail, creating it if necessary.""" return thumbnail(self.image)
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))
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))