
from __future__ import unicode_literals

from django import template

from coop_cms.templatetags.coop_utils import is_checkbox as _is_checkbox
from coop_cms.templatetags.coop_navigation import NavigationAsNestedUlNode

register = template.Library()

# Just for compatibility

@register.filter(name='is_checkbox')
def is_checkbox(field):
    """returns true if field is a checkbox"""
    return _is_checkbox(field)

@register.tag
def navigation_bootstrap(parser, token):
    """returns the bootstrap-friendly navigation"""
    return NavigationAsNestedUlNode(li_node="coop_bootstrap/li_node.html")


from __future__ import unicode_literals

from django import template

from coop_cms.templatetags.coop_utils import is_checkbox as _is_checkbox
from coop_cms.templatetags.coop_navigation import NavigationAsNestedUlNode, extract_kwargs

register = template.Library()

# Just for compatibility

@register.filter(name='is_checkbox')
def is_checkbox(field):
    """returns true if field is a checkbox"""
    return _is_checkbox(field)


@register.tag
def navigation_bootstrap(parser, token):
    """returns the bootstrap-friendly navigation"""
    kwargs = dict(li_node="coop_bootstrap/li_node.html")
    args = token.contents.split()
    kwargs.update(extract_kwargs(args))
    return NavigationAsNestedUlNode(**kwargs)

Fix "navigation_bootstrap" templatetag : arguments were ignored
Fix "navigation_bootstrap" templatetag : arguments were ignored

  
  from __future__ import unicode_literals
  
  from django import template
  
  from coop_cms.templatetags.coop_utils import is_checkbox as _is_checkbox
- from coop_cms.templatetags.coop_navigation import NavigationAsNestedUlNode
+ from coop_cms.templatetags.coop_navigation import NavigationAsNestedUlNode, extract_kwargs
  
  register = template.Library()
  
  # Just for compatibility
  
  @register.filter(name='is_checkbox')
  def is_checkbox(field):
      """returns true if field is a checkbox"""
      return _is_checkbox(field)
  
+ 
  @register.tag
  def navigation_bootstrap(parser, token):
      """returns the bootstrap-friendly navigation"""
-     return NavigationAsNestedUlNode(li_node="coop_bootstrap/li_node.html")
+     kwargs = dict(li_node="coop_bootstrap/li_node.html")
+     args = token.contents.split()
+     kwargs.update(extract_kwargs(args))
+     return NavigationAsNestedUlNode(**kwargs)
  
Fix "navigation_bootstrap" templatetag : arguments were ignored
## Code Before:

from __future__ import unicode_literals

from django import template

from coop_cms.templatetags.coop_utils import is_checkbox as _is_checkbox
from coop_cms.templatetags.coop_navigation import NavigationAsNestedUlNode

register = template.Library()

# Just for compatibility

@register.filter(name='is_checkbox')
def is_checkbox(field):
    """returns true if field is a checkbox"""
    return _is_checkbox(field)

@register.tag
def navigation_bootstrap(parser, token):
    """returns the bootstrap-friendly navigation"""
    return NavigationAsNestedUlNode(li_node="coop_bootstrap/li_node.html")

## Instruction:
Fix "navigation_bootstrap" templatetag : arguments were ignored
## Code After:

from __future__ import unicode_literals

from django import template

from coop_cms.templatetags.coop_utils import is_checkbox as _is_checkbox
from coop_cms.templatetags.coop_navigation import NavigationAsNestedUlNode, extract_kwargs

register = template.Library()

# Just for compatibility

@register.filter(name='is_checkbox')
def is_checkbox(field):
    """returns true if field is a checkbox"""
    return _is_checkbox(field)


@register.tag
def navigation_bootstrap(parser, token):
    """returns the bootstrap-friendly navigation"""
    kwargs = dict(li_node="coop_bootstrap/li_node.html")
    args = token.contents.split()
    kwargs.update(extract_kwargs(args))
    return NavigationAsNestedUlNode(**kwargs)
