{{!--
/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */
--}}
{{#each meta.panels}}
    <table class="table dataTable table-striped">
        <thead>
        <tr>
            {{#each ../leftColumns}}
                <th{{#if name}} data-fieldname="{{name}}"{{/if}}>
                    <span>
                        {{field ../../this template="list-header"}}
                    </span>
                </th>
            {{/each}}
            {{#each fields}}
                <th class="{{#isSortable ../../module this}}sorting{{#eq ../../../orderBy.field name}}_{{{../../../../orderBy.direction}}}{{/eq}} orderBy{{name}}{{/isSortable}}{{#if widthClass}} {{widthClass}}{{/if}}"
                    {{#if styles}} style="{{styles}}"{{/if}}
                    {{#if name}} data-fieldname="{{name}}"{{/if}} data-orderby="{{orderBy}}">
                    <span>
                        {{str label}}
                    </span>
                </th>
            {{/each}}
        </tr>
        </thead>
        <tbody>
            {{#if ../filteredCollection.length}}
                {{#each ../../filteredCollection}}
                    <tr name="{{module}}_{{attributes.id}}" data-fieldname="{{attributes.field_name}}" class="single">
                        {{#each ../../../leftColumns}}
                            <td>
                                {{field ../../../../this model=../this template=../../../../this.action}}
                            </td>
                        {{/each}}
                        {{#each fields}}
                            <td{{#if align}} class="{{align}}"{{/if}} data-column="{{name}}">
                                {{field ../../../../this model=../this template=../../../../this.action}}
                            </td>
                        {{/each}}
                    </tr>
                {{/each}}
            {{/if}}
        </tbody>
    </table>
{{/each}}
