accessible_panels template variable in openstack horizon juno

asked 2015-11-02 17:42:12 -0500

navanitachora gravatar image

am in the process of customizing the Horizon Juno interface and wanted to know about a particular template variable called "accessible_panels".

This variable is in the horizon/templates/horizon/_subnav_list.html template.

I cannot find accessible_panels to be defined anywhere in the codebase and I was wondering what this variable is used for.

Currently it comes up empty for me and as a result some of the panels I want to show do not show up. If I comment it out everything works.

The code for the template is below (Note: I have commented out accessible_panels to show the working template):

{% load horizon %}

{% for heading, panels in components.iteritems %}
  {% with panels|has_permissions_on_list:user as filtered_panels %}
    {% if filtered_panels %}
{#      {% if accessible_panels %}#}
        {% if heading %}<h4>{{ heading }}</h4>{% endif %}
{#      {% endif %}#}
      <ul class="main_nav">
        {% for panel in filtered_panels %}
{#          {% if panel in accessible_panels or current == panel.slug %}#}
              <a href="{{ panel.get_absolute_url }}" {% if current == panel.slug %}class="active"{% endif %} tabindex='1'>{{ }}</a>
{#          {% endif %}#}
        {% endfor %}
    {% endif %}
  {% endwith %}
{% endfor %}

My understanding of django templates tells me that this variable has to be defined somewhere but I cannot find it.

I asked this question in StackOverflow but got no replies. I am hoping someone here can help me out.

Cheers, nav

edit retag flag offensive close merge delete