{% load dump_die %}


{# for each object to output #}
{% for filename, linenumber, obj_name, obj, function_doc, root_index_start, root_index_end, original_obj in objects %}

{# If it is not the first object, add a horizontal line to separate #}
{% if not forloop.first %}<hr>{% endif %}

<div class="dump-wrapper">
  {% if filename and linenumber %}
    <span title="Dumped From Location" class="location">File: {{ filename }}, Line: {{ linenumber }}</span><br>
  {% endif %}

  {# If dumped object has function_docs, assume function. Otherwise object. #}
  {% if function_doc %}

    {# Display the name of the dumped object so long as not None #}
    {% if obj_name is not None %}
      <span class="dumped_function" title="Dumped Function">
        {% for entry in obj_name %}<span class="{{ entry.css_class }}">{{ entry.value }}</span>{% endfor %}
      </span>:
    {% else %}
      <span class="empty" title="Dumped Function">Unknown Function</span>:
    {% endif %}

    {# Handle function doc output. #}
    {% if multiline_function_docs %}
      <span class="docs indent-docs">{{ function_doc|linebreaks }}</span>
    {% else  %}
      <span class="docs">{{ function_doc }}</span>
    {% endif %}

  {% else %}

    {# Display the name of the dumped object so long as not None #}
    {% if obj_name is not None %}
      <span class="dumped_object" title="Dumped Object">
        {% for entry in obj_name %}<span class="{{ entry.css_class }}">{{ entry.value }}</span>{% endfor %}
      </span>:
    {% else %}
      <span class="empty" title="Dumped Object">Unknown Object</span>:
    {% endif %}
    {# Use dump_object template tag to dump object #}
    {% dump_object obj obj None 0 0 root_index_start root_index_end original_obj %}

  {% endif %}
</div>
{% endfor %}
