{% extends 'base/base.html' %}
{% load static %}
{% block title %} {{ object.title }} {% 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="col-md-12">
                        <h1 id="page-header">Contribution</h1>
                    </div>
                    <div class="col-md-10">
                        <div class="card mb-3">
                            <img class="card-img-top img-fluid" src="{% static 'achievements/image/contribution.jpeg' %}"
                                 alt="Card image cap">
                            <div class="card-block">
                                <h4 class="card-title">{{ object.title }}</h4>
                                <h5 class="card-text">
                                    <small class="text-muted">{{ object.organisation }}, bug id:
                                        <a href="{{ object.url }}">{{ object.contribution_id }}</a>
                                    </small>
                                </h5>
                                <p class="card-text">{{ object.description }}</p>
                                <p class="card-text">
                                    <small class="text-muted">
                                        {{ object.user.first_name }} {{ object.user.last_name }}, {{ object.date }}
                                    </small>
                                </p>
                                {% if edit_permission %}
                                    <a href="{% url 'contribution_update' object.id %}">
                                        <button type="submit" class="btn btn-primary add-btn">Update</button>
                                    </a>
                                    <a href="{% url 'contribution_delete' object.id %}">
                                        <button type="submit" class="btn btn-danger add-btn">Delete</button>
                                    </a>
                                {% endif %}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    {% include 'base/footer.html' %}
    <style>
        #page-header {
            margin: 30px;
            text-align: center;
        }

        @media (max-width:480px)  {
            /* smartphones, Android phones, landscape iPhone */
            .card-img-top {
                height: 7em;
            }
        }
    </style>
{% endblock %}

