{extends file="admin-layout.tpl"}

{block name="main-content"}
<div class="clearfix">
    <ul class="breadcrumb pull-left">
        <li>
            <a href="{url path='/admin/home'}">{intl l="Home"}</a>
        </li>
        <li>
            <a href="{url path='/admin/modules'}">{intl l="Modules"}</a>
        </li>
        <li>
            <a href="{url path='/admin/module/PayPal'}">{intl l="PayPal"}</a>
        </li>
        <li>
            <a href="{url path='/admin/module/paypal/configure/log'}">{intl l="Automatic PayPal logs" d="paypal.bo.default"}</a>
        </li>
    </ul>
</div>
<div class="row">
    <div class="col-md-12">
        <div class="general-block-decorator">

            {include file="paypal/menu/menu.html" selectedMenu="log"}

            <div class="tab-content">
                <!-- Countries managing tab -->
                <div class="tab-pane active form-container">
                    <div class="row">
                        <div class="col-md-12 general-block-decorator">

                            <h3>
                                <span class="label label-primary">1</span>
                                {intl l="Automatic PayPal logs" d="paypal.bo.default"}
                            </h3>

                            <div class="col-md-12 alert alert-info">
                                <div class="col-md-8">
                                    <h4 class="text-uppercase">
                                        <span class="glyphicon glyphicon-info-sign"></span>&nbsp;{intl l="Help" d="paypal.bo.default"}&nbsp;:
                                    </h4>
                                    <div class="tips">
                                        {intl l="This is where we log all the transactions made with PayPal. PayPal webhooks also automatically feed these logs." d="paypal.bo.default"}
                                        <br />{intl l="This informations can be found directly in concerned order details." d="paypal.bo.default"}
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <div class="tips__img">
                                        <img src="{image file='assets/paypal_webhook.png' source="PayPal"}" alt="Payment configuration" class="img-responsive" />
                                    </div>
                                </div>
                            </div>


                            {$page = $smarty.get.page|default:1}
                            {$limit = $smarty.get.limit|default:100}

                            <div class="form-container">
                                <div class="row">
                                    <div class="col-md-12">
                                        <table class="table table-striped table-condensed">
                                            <thead>
                                            <tr>
                                                <th>{intl l='Date' d="paypal.bo.default"}</th>
                                                <th>{intl l='Details' d="paypal.bo.default"}</th>
                                                <th>{intl l="Customer ID" d="paypal.bo.default"}</th>
                                                <th>{intl l="Order ID" d="paypal.bo.default"}</th>
                                                <th>{intl l="Webhook" d="paypal.bo.default"}</th>
                                                <th>{intl l="Level" d="paypal.bo.default"}</th>
                                            </tr>
                                            </thead>

                                            <tbody>
                                            {loop name="paypal_log" type="paypal_log" backend_context=true order="date-reverse" page=$page limit=$limit}
                                                {include file = "paypal/includes/paypal-log-row.html"}
                                            {/loop}
                                            </tbody>
                                            <tfoot>
                                            <tr>
                                                <td colspan="100">
                                                    {include
                                                        file = "includes/pagination.html"
                                                        loop_ref       = "paypal_log"
                                                        max_page_count = $limit
                                                        page_url       = {url path="/admin/module/paypal/configure/log"}
                                                    }
                                                </td>
                                            </tr>
                                            </tfoot>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="javascript-initialization"}
    {include file = "paypal/includes/paypal-log-row-js.html"}
{/block}