{% load timepiece_tags %}

{# FIXME: Some permissions don't exist #}
{% if perms.crm.view_project or perms.auth.view_user or perms.crm.view_business or perms.contracts.add_project_contract %}
    <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">CRM <b class="caret"></b></a>
        <ul class="dropdown-menu">
            {% if perms.crm.view_project %}
                <li><a href="{% url 'list_projects' %}">Projects</a></li>
            {% endif %}
            {% if perms.auth.view_user %}  {# FIXME: Permission doesn't exist #}
                <li><a href="{% url 'list_users' %}">Users</a></li>
            {% endif %}
            {% if perms.crm.view_business %}  {# FIXME: Permission doesn't exist #}
                <li><a href="{% url 'list_businesses' %}">Businesses</a></li>
            {% endif %}
            {% if perms.contracts.add_project_contract %}
                <li><a href="{% url 'list_contracts' %}">Contracts</a></li>
            {% endif %}
        </ul>
    </li>
{% endif %}
