{% load i18n pages_tags %}

{% spaceless %}
{% if page_branch_in_menu %}
<ul class="footer-tree-menu-level-{{ branch_level }}">
	{% for page in page_branch %}

    {% if not has_home and page.is_primary and forloop.first %}
	<li class="first{% if on_home %} active{% endif %}"
        id="footer-tree-menu-home">
	    <a href="{% url "home" %}">{% trans "Home" %}</a>
	</li>
	{% endif %}

	{% if page.in_menu %}
	<li class="{% if page.is_current_or_ascendant %}active{% endif %}
        {% if not top_level and forloop.first %} first{% endif %}
        {% if forloop.last %} last{% endif %}"
        id="footer-tree-menu-{{ page.html_id }}">
        {% if page.menuplaceholder %}<a class="footertreenomenu">{{ page.title }}</a>{% else %}
        <a href="{{ page.get_absolute_url }}">{{ page.title }}</a>
        {% endif %}
		{# remove this if tag to always show all nav items #}
		{% if page.is_current_or_ascendant and page.has_children_in_menu %}
		{% page_menu page %}
		{% endif %}
	</li>
    {% endif %}

	{% endfor %}
</ul>
{% endif %}
{% endspaceless %}
