<script type="text/x-handlebars-template" data-name="main">
    <table class="table mapsvg-data-list-table" id="mapsvg-layers-list-table">
        <thead>
        <tr>
            {{#each fields}}
                <th>{{name}}</th>
            {{/each}}
            <th style="width: 10px;"></th>
        </tr>
        </thead>
        <tbody>
        {{#each data}}
            {{>layersListItemPartial fields=../fields params=this}}
        {{/each}}
        </tbody>
    </table>

    <div class="mapsvg-pagination-container">
    </div>

    <div class="mapsvg-view-padding" id="mapsvg-setup-layers-msg" style="display: none;">
        <div class="well">
            <p class="help-block">Create layers with objects or POIs (Points Of Interest) and let a user show/hide them.</p>
        </div>
    </div>
</script>

<script type="text/x-handlebars-template" data-name="item" data-partial="true">
    <tr id="mapsvg-layer-row-{{params.id}}" data-id="{{params.id}}" class="mapsvg-data-row">
        {{#each fields}}
            {{#ifeq type 'image'}}
                <td>{{getThumbs ../params name}}</td>
            {{/ifeq}}
            {{#ifeq type 'marker'}}
                <td>{{getMarkerImage ../params name}}</td>
            {{/ifeq}}
            {{#ifnoteq type 'image'}}
                {{#ifnoteq type 'marker'}}
                    {{#if options}}
                        {{#ifeq name 'id'}}
                            <td>{{lookup ../params name}}</td>
                        {{/ifeq}}
                        {{#ifnoteq name 'id'}}
                            {{#ifeq type 'region'}}
                                <td>{{getRegions ../params name}}</td>
                            {{/ifeq}}
                            {{#ifnoteq type 'region'}}
                                {{#ifjson ../params name}}
                                    <td>{{getSelectedOptions ../params name}}</td>
                                {{/ifjson}}
                                {{#ifnotjson ../params name}}
                                    <td>{{getLabel optionsDict ../params name}}</td>
                                {{/ifnotjson}}
                            {{/ifnoteq}}
                        {{/ifnoteq}}
                    {{/if}}
                    {{#unless options}}
                        <td>{{lookup ../params name}}</td>
                    {{/unless}}
                {{/ifnoteq}}
            {{/ifnoteq}}
        {{/each}}
        <td>
            {{#with params}}
                <button class="btn btn-sm btn-default mapsvg-layer-view-toggle {{#unless visible}}active{{/unless}}">
                    {{#if visible}}
                        <i class="fa fa-eye"></i>
                    {{/if}}
                    {{#unless visible}}
                        <i class="fa fa-eye-slash"></i>
                    {{/unless}}
                </button>
            {{/with}}
            <button class="btn btn-sm btn-default mapsvg-layer-delete">
                <i class="fa fa-trash"></i>
            </button>
        </td>
    </tr>
</script>