{% extends "base.html" %}

{% block page_title %}All Spaces{% endblock %}

{% block content %}

{% include 'snippets/space_description.html' %}

<p><a href="{% url 'space_create' %}">Create new space</a></p>

{% for s in spaces %}
    <div class='space'>
        <dl>
            <dt>Access Protocol</dt> <dd>{{ s.get_access_protocol_display }}</dd>
            <dt>Path</dt> <dd>{{ s.path|default:"&lt;None&gt;" }}</dd>
            <dt>Last Verified</dt> <dd>{{ s.last_verified }}</dd>
            {% for k, v in s.child.items %}
                <dt>{{ k|capfirst }}</dt> <dd>{{ v }}</dd>
            {% endfor %}
            <dt>Actions</dt>
              <dd>
                <ul>
                  <li><a href="{% url 'space_detail' s.uuid %}">View Details and Locations</a></li>
                  <li><a href="{% url 'space_edit' s.uuid %}">Edit Space</a></li>
                  <li><a href="{% url 'location_create' s.uuid %}">Create Location here</a></li>
                  <li><a href="{% url 'space_delete' s.uuid %}?next={{ request.path }}">Delete Space</a></li>
                </ul>
              </dd>
        </dl>
    </div>
{% empty %}
    <p>No spaces currently exist.</p>
{% endfor %}

{% endblock %}
