{% extends 'base/base.html' %}
{% load static %}
{% block title %} Teams {% endblock %}

{% block body %}
    {% include 'base/nav-bar.html' %}
    <div id="wrap">
        <div id="main">
            <!-- content goes here -->
            <div class="container">
                <div class="row">
                    <div class="card col-md-12">
                        <div class="card-block">
                            <h1 class="card-title">Teams</h1>
                            <p class="card-text">
                                <small class="text-muted">A list of all the Teams, FOSS@Amrita.</small>
                            </p>
                            <hr>
                            <div class="row">
                                {% for object in object_list %}
                                    <div class="col-md-6">
                                        <div class="card">
                                            <img class="card-img-top img-fluid" height="250px" src="/static/media/{{ object.image }}" alt="Card image cap">
                                            <div class="card-block">
                                                <h3 class="card-title">{{ object.name }}</h3>
                                                <p class="card-text">{{ object.description }}</p>
                                                <a href="{% url 'team_detail' object.id %}"
                                                   class="btn btn-primary">More info
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                {% endfor %}
                                {% if request.user.is_authenticated %}
                                <div class="col-md-12">
                                    <div class="container">
                                        <a href="{% url 'team_create' %}">
                                            <button class="btn btn-secondary">Add new</button>
                                        </a>
                                    </div>
                                </div>
                                {% endif %}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    {% include 'base/footer.html' %}

    <style>
        .card {
            margin: 10px;
        }
        .container {
            margin-top: 50px;
        }
    </style>
{% endblock %}
