{% extends 'base.html' %}

{% block title %} | Web Resources{% endblock %}

{% block main %}
{% include 'snippets/wr_header.html' %}

<div class="container">
    <div class="row">
        <div class="col-md-12">
            <h3 class="header">Manage web resources</h3>

            <ul class="list-unstyled overview-list">
                {% for project in projects %}
                    <li>
                        <h3>
                            {% if project.islocked %}<span class="glyphicon glyphicon-lock text-warning" aria-hidden="true"></span>{% endif %}
                            <a href="{% url 'geokey_webresources:all_webresources' project.id %}">{{ project.name }}</a>
                        </h3>

                        <p>
                            {% if project.status == 'inactive' %}<label class="label label-warning">Archived</label>{% endif %}
                            {% with webresources=project.webresources.count %}<label class="label label-primary">{{ webresources }} web resource{{ webresources|pluralize }}</label>{% endwith %}
                        </p>

                        <p class="meta">Created by {{ project.creator }} {{ project.created_at|timesince }} ago</p>
                    </li>
                {% empty %}
                    <li>
                        <div class="well empty-list">
                            <p class="lead">We couldn't find any projects you are eligible to manage.</p>
                            <p>You can create a new project if you want add web resources to it.</p>
                            <a href="{% url 'admin:project_create' %}" class="btn btn-lg btn-success">Create a new project</a>
                        </div>
                    </li>
                {% endfor %}
            </ul>
        </div>
    </div>
</div>
{% endblock %}
