예제 #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:
         return format.embed_to_editor_html(attrs['url'])
     else:
         return format.embed_to_frontend_html(attrs['url'])
예제 #2
0
    def expand_db_attributes(attrs, for_editor):
        """
        Given a dict of attributes from the <embed> tag, return the real HTML
        representation.
        """
        from wagtail.wagtailembeds import format

        if for_editor:
            return format.embed_to_editor_html(attrs["url"])
        else:
            return format.embed_to_frontend_html(attrs["url"])
예제 #3
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 embeds.EmbedException:
             # Could be replaced with a nice error message
             return ''
     else:
         return format.embed_to_frontend_html(attrs['url'])
예제 #4
0
파일: blocks.py 프로젝트: iicc/wagtail
 def __str__(self):
     return embed_to_frontend_html(self.url)
예제 #5
0
def Embed(props):
    """
    Inspired by: https://github.com/wagtail/wagtail/blob/master/wagtail/wagtailembeds/rich_text.py
    """
    return DOM.parse_html(embed_to_frontend_html(props['url']))
예제 #6
0
 def render_basic(self, value):
     return embed_to_frontend_html(value)
예제 #7
0
 def render(self, props):
     return DOM.parse_html(embed_to_frontend_html(props['url']))