{% extends "index.html" %}
{% block body %}

<section id="section2">
    
    <button onclick="location.href = '{{ url_for('new_expense') }}';" type="submit"  class="float-right btn btn-info">+ Add New Expense</button>
    
</section>
    {% for expense in expenses %}
            <article class="media content-section">
                    <img class="rounded-circle article-img" src="{{ url_for('static', filename='profile_pic/' + expense.author.profile_image)}}">
                    <div class="media-body">
                        <div class="article-metadata">
                            <a class="mr-2" href="{{ url_for('expensesprofile', expense_id=expense.expense_id) }}">Client name: {{ expense.client_name }}</a>
                        </div>
                        <div class="article-metadata">
                            <small class="text-muted"> Client project: {{ expense.client_project }}</small>
                        </div>
                        <div class="article-metadata">
                            <small class="text-muted">{{ expense.author.role }}: {{ expense.author.name }} {{ expense.author.surname }}</small>
                        </div>
                        <div class="article-metadata">
                            <small class="text-muted"> Expense category: {{ expense.expense_category }}</small>
                        </div>
                        <div class="article-metadata">
                            <small class="text-muted"> Expense Date: {{ expense.expenses_date.strftime('%d-%m-%Y') }}</small>
                            {% if expense.EUR=='0.0' %}
                                {% if expense.USD=='0.0' %}
                                    <small class="text-muted"> Cost: {{ expense.GBP }}£</small>
                                {% endif %}
                            {% endif %}
                            {% if expense.GBP=='0.0' %}
                                {% if expense.EUR=='0.0' %}
                                    <small class="text-muted"> Cost: {{ expense.USD }}$</small>
                                {% endif %}
                            {% endif %}
                            {% if expense.GBP=='0.0' %}
                                {% if expense.USD=='0.0' %}
                                    <small class="text-muted"> Cost: {{ expense.EUR }}€</small>
                                {% endif %}
                            {% endif %}
                        </div>
                        <div class="article-metadata">
                            <small class="text-muted"> Status: {{ expense.verify_or_decline }} </small>
                        </div>
                       
                    </div>
            </article>
            
    {% endfor %}

{% endblock %}