{% set location = locations_map[location_id] %}
{% set locations_tree = locations_tree[location_id] %}
{% set location_permissions = permissions_by_id[location_id] %}
{% if current_user.is_admin or not location.is_hidden or not is_full_location_tree_hidden(locations_map, locations_tree) %}
<li {% if not (Permissions.READ in location_permissions and (not locations_filter or locations_filter(location))) %}class="location-muted"{% endif %}>
{% if Permissions.READ in location_permissions %}
<a href="{{ url_for('.location', location_id=location.id) }}">{{ location | get_location_name(False) }}</a>
{{ import_information_symbol(location) }}
  {% if location.is_hidden %}
    <p class="text-muted">
    {% if locations_tree and not is_full_location_tree_hidden(locations_map, locations_tree) %}
      <i class="fa fa-eye fa-fw" aria-hidden="true"></i>
      {{_("This location has been hidden from location lists, but will be shown because it contains other locations that have not been hidden.") }}
    {% else %}
      <i class="fa fa-eye-slash fa-fw" aria-hidden="true"></i>
      {{_("This location has been hidden from location lists.") }}
    {% endif %}
    </p>
  {% endif %}
  {% if not config['DISABLE_TOPICS'] and location.topics %}
    <p>
      {{ _('Topics') }}:
      {% for topic in location.topics %}
        <a class="badge badge-secondary" href="{{ url_for('.topic', topic_id=topic.id) }}">{{ topic.name | get_translated_text }}</a>
      {% endfor %}
    </p>
  {% endif %}
{% include "locations/responsible_users.html" %}
{% if location.description %}
  <pre style="font-family: sans-serif; background-color: transparent; border: 0; padding: 0;">{{ location.description | get_translated_text }}</pre>
{% endif %}
{% else %}
  {{ _('Location') }} #{{ location_id }}
{% endif %}
{% if locations_tree %}
  <ul>
  {% set location_ids_sorted_by_name = sort_location_ids_by_name(locations_tree.keys(), locations_map) %}
  {% for location_id in location_ids_sorted_by_name %}
    {% include "locations/locations_tree.html" %}
  {% endfor %}
  </ul>
{% endif %}
</li>
{% endif %}
