示例#1
0
 def expand_db_attributes(attrs, for_editor):
     """
     Given a dict of attributes from the <embed> tag, return the real HTML
     representation.
     """
     if for_editor:
         try:
             return format.embed_to_editor_html(attrs['url'])
         except EmbedException:
             # Could be replaced with a nice error message
             return ''
     else:
         return format.embed_to_frontend_html(attrs['url'])
示例#2
0
 def html(self):
     return embed_to_frontend_html(self.url)
示例#3
0
 def __str__(self):
     return embed_to_frontend_html(self.url)
    def get_context(self, parent_context=None):
        video_url = self.obj['settings'].get('video_url', '')
        self.obj['settings']['player_html'] = embed_to_frontend_html(video_url)
        context = super().get_context(parent_context=parent_context)

        return context
示例#5
0
 def expand_db_attributes(attrs):
     """
     Given a dict of attributes from the <embed> tag, return the real HTML
     representation for use on the front-end.
     """
     return format.embed_to_frontend_html(attrs['url'])
示例#6
0
文件: blocks.py 项目: jams2/wagtail
 def html(self):
     return embed_to_frontend_html(self.url, self.max_width,
                                   self.max_height)
示例#7
0
 def html(self):
     return embed_to_frontend_html(self.url)
示例#8
0
def media_embedtype_handler(attrs):
    """
    Given a dict of attributes from the <embed> tag, return the real HTML
    representation for use on the front-end.
    """
    return format.embed_to_frontend_html(attrs['url'])
示例#9
0
def media_embedtype_handler(attrs):
    """
    Given a dict of attributes from the <embed> tag, return the real HTML
    representation for use on the front-end.
    """
    return format.embed_to_frontend_html(attrs['url'])