docs: def hierarchy_nav(self, obj):
          """Renders hierarchy navigation elements (folders)."""
  
          result_repr = ''  # For items without children.
          ch_count = getattr(obj, Hierarchy.CHILD_COUNT_MODEL_ATTR, 0)
  
          is_parent_link = getattr(obj, Hierarchy.UPPER_LEVEL_MODEL_ATTR, False)
  
          if is_parent_link or ch_count:  # For items with children and parent links.
              icon = 'icon icon-folder'
              title = _('Objects inside: %s') % ch_count
  
              if is_parent_link:
                  icon = 'icon icon-folder-up'
                  title = _('Upper level')
  
              url = './'
  
              if obj.pk:
                  url = '?%s=%s' % (Hierarchy.PARENT_ID_QS_PARAM, obj.pk)
  
              if self._current_changelist.is_popup:
  
                  qs_get = copy(self._current_changelist._request.GET)
  
                  try:
                      del qs_get[Hierarchy.PARENT_ID_QS_PARAM]
  
                  except KeyError:
                      pass
  
                  qs_get = qs_get.urlencode()
                  url = ('%s&%s' if '?' in url else '%s?%s') % (url, qs_get)
  
              result_repr = format_html('<a href="{0}" class="{1}" title="{2}"></a>', url, icon, force_text(title))
  
          return result_repr