Esempio n. 1
0
 def google_map_media(parser, token):
     if len(token.split_contents()) == 1:  # No parameters
         args = tuple()
         kwargs = dict()
     else:
         args, kwargs, as_var = parse_args_kwargs_and_as_var(parser, token)
     return GoogleMapsMediaNode(args, kwargs, 'base/google_map_media.html')
Esempio n. 2
0
def get_actions(parser, token):
    args, kwargs, as_var = parse_args_kwargs_and_as_var(parser, token)
    args_len = len(args)
    if args_len > 0:
        kwargs['scope'] = args[0]
    if args_len == 3:
        kwargs['for'] = args[2]
    args = []
    return GetActionsNode(args, kwargs, as_var)
Esempio n. 3
0
def urlize(parser, token):
    """
    Fix http prefix on url, take the value as default url tag content. You can 
      add "a" tag properties the first arg is take as length to crop the tag 
      content (visible value).
    For truncate long urls, you can specific the max leng visible chars

    Usage:

      {% load html_tags %}
      {% urlize content.url 50 target="_blank",rel="nofollow" %}

    """
    args, kwargs, as_var = parse_args_kwargs_and_as_var(parser, token)
    return Urlize(args, kwargs, 'cmsutils/urlize.html')
Esempio n. 4
0
def static_map(parser, token):
    args, kwargs, as_var = parse_args_kwargs_and_as_var(parser, token)
    return StaticMapNode(args, kwargs, "base/google_static_map.html")
Esempio n. 5
0
 def google_map(parser, token):
     args, kwargs, as_var = parse_args_kwargs_and_as_var(parser, token)
     return GoogleMapsNode(args, kwargs, 'base/google_map.html')