<!-- Created by Navaneeth S, navisk13@gmail.com -->
{% extends 'base/base.html' %}
{% load static %}
{% block title %} Resources {% 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">Resources</h1>
                            <hr>
                            <div class="row">
                                {% for object in object_list %}
                                    <div class="col-md-6">
                                        <div class="card">
                                            {% if object.image %}
                                                <img class="card-img-top img-fluid"
                                                     src="/static/media/{{ object.image }}">
                                            {% else %}
                                                <img class="card-img-top img-fluid"
                                                     src="{% static 'technical_resource/images/default.png' %}">
                                            {% endif %}
                                            <div class="card-block">
                                                <h3 class="card-title">{{ object.name }}</h3>
                                                <p class="card-text">{{ object.description }}</p>
                                                <a href="{% url 'category_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 'project_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 %}
