{% extends "layout.html" %}
{% block content %}
<section class="hero">
    <br>
    <br>
    <section class="hero is-light">
        <div class="hero-body">
            <div class="container has-text-centered">
                <h1 class="title">All Your Tickets</h1>
                <br>
                <h2 class="subtitle">So many tickets...</h2>
            </div>
        </div>
    </section>
    <br>
    <br>
</section>

<section class="container">
    {% if ticket_lists %}
    {% for tickets in ticket_lists %}
    <div class="columns features">
        {% for ticket in tickets %}
        <div class="column is-4">
            <div class="card is-shady">
                <div class="card-image">
                    {% if ticket.transferrable == False %}
                    <figure class="watermarked image is-2by1">
                        <img src="https://unsplash.it/1200/600?<%=@product.address %>" alt="
{{ ticket.address }}"/>
                    </figure>
                    {% else %}
                    <figure class="image is-2by1">
                        <img src="https://unsplash.it/1200/600?<%=@product.address %>" alt="
{{ ticket.address }}"/>
                    </figure>
                    {% endif %}

                </div>
                <div class="card-content">
                    <div class="content">
                        <h4>{{events.get(ticket.address).event_info.title}}</h4>
                        <div class="tags are-large">
                            <span class="tag are-large is-warning">2019-02-21</span>
                        </div>
                        {% if ticket.transferrable==True %}
                        <a class="button is-info" href="/activate?address={{ticket.address}}"> Use It</a>
                        <a class="button is-info" href="/ticket_details?address={{ticket.address}}"> TX</a>
                        {% else %}
                        {% endif %}
                    </div>
                </div>
            </div>
        </div>

        {% endfor %}
    </div>
    {% endfor %}
    {% else %} <h1>There's no tickets created yet!</h1>
    {% endif %}
</section>
{% endblock %}
