{% 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">Your Account Information</h1>
                    <br>
                    <h2 class="subtitle">More about yourself...</h2>
                </div>
            </div>
        </section>
        <br>
        <br>
        <section class="section">
            <section class="container">
                <h2 class="title"> Summary</h2>
                <hr>
                <br>
                <div class="media">
                    <div class="media-left">
                        <figure class="image" style="height: 70px; width: 70px;"><img
                                src="https://source.unsplash.com/random/96x96" alt="Image"></figure>
                    </div>
                    <div class="media-content">
                        <p class="title is-4">{{ user.moniker }}</p>
                        <p class='text-center'><strong>Address:</strong> <i>{{ user.address }}</i></p>
                    </div>
                </div>
                <div class="contents">
                    <br>
                    <br>
                    <br>
                    <h3 class='title is-5'><strong>Balance: </strong> <i>{{ user.display_balance }}</i> ABT</h3>
                </div>
            </section>
        </section>

        <section class="section">
            <section class="container">
                <h2 class="title"> Your Tickets</h2>
                <hr>
                {% if ticket_lists %}
                    {% for tickets in ticket_lists %}
                        <section class="section">
                            <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?{{ ticket.address }}"
                                                             alt="pic"/>
                                                    </figure>
                                                {% else %}
                                                    <figure class="image is-2by1">
                                                        <img src="https://unsplash.it/1200/600?{{ ticket.address }}"
                                                             alt="pic"/>
                                                    </figure>
                                                {% endif %}

                                            </div>
                                            <div class="card-content">
                                                <div class="content">
                                                    <h4>Event: {{ 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="/ticket-detail?address={{ ticket.address }}">
                                                            Click to Use</a>
                                                    {% else %}
                                                        <a class="button is-info"
                                                           href="/ticket-detail?address={{ ticket.address }}">
                                                            Click to View</a>
                                                    {% endif %}
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                {% endfor %}
                            </div>
                        </section>
                    {% endfor %}
                {% else %} <h1>There's no tickets created yet!</h1>
                {% endif %}
            </section>
        </section>
    </section>

{% endblock %}
