{% extends "base.html" %}
{% set active_page = 'projects' %}

{% block title %}Home{% endblock %}

{% block content %}

    <div class="container">
        <h1>Projects</h1>

        {% if projects %}
            <p class="important">
                Click on a project to access the resources
            </p>

            <div class="divider"></div>

            <ul id="projects" class="collection">
                {% for project in projects %}
                    <a href="{{ url_for('show_project', project_name=project.normalized_name()) }}"
                       class="collection-item avatar project">
                        <i class="material-icons medium circle">inbox</i>
                        <span class="title">{{ project.name }}</span>
                        <p>
                            {{ project.latest_version.summary|sn }}
                        </p>
                    </a>
                {% endfor %}
            </ul>
        {% else %}
            <div class="">
                <div class="card-panel grey lighten-3">
                    <h6 class="">No projects visible for you, <a href="{{ url_for('create_project') }}">create</a> your
                        own ones.</h6>
                </div>
            </div>
        {% endif %}


        {% if show_create %}
            <div class="fixed-action-btn">
                <a
                        id="create-project-btn"
                        class="btn-floating btn-large waves-effect waves-light red"
                        href="{{ url_for('create_project') }}"
                ><i class="material-icons">add</i></a>
            </div>
        {% endif %}

    </div>







{% endblock %}