<table class="DescartesTable table table-striped table-bordered table-hover" id="<%=id%>">
    <thead>
        <tr>
            <th>
                <label class="checkbox-inline">
                    <input id="selectAll" type="checkbox" value="true">&nbsp;
                </label>
            </th>
            <% _.forEach(columns,function(column){ %>
            <th><span class="DescartesUIText"><%=column.title%></span></th>
                <% }); %>
        </tr>
    </thead>
    <tbody id="<%=id%>_body">
        <% _.forEach(data,function(layer,index){
            var readableMinScale = '-';
            if(layer.minScale !== 0) {
                readableMinScale = Descartes.Utils.readableScale(layer.minScale);
            }
            var readableMaxScale = '-';
            if(layer.maxScale !== 0) {
                readableMaxScale = Descartes.Utils.readableScale(layer.maxScale);
            }
        %>
        <tr>
            <td>
                <label class="checkbox-inline">
                    <input type="hidden" name="selected_<%=index%>" value="false"/>
                    <input type="checkbox" name="selected_<%=index%>" value="true">&nbsp;
                </label>
            </td>
            <td><span class="DescartesUIText"><%=layer.title%></span></td>
            <td>
                <select class="DescartesUISelect form-control" name="format_<%=index%>">
                    <% _.forEach(layer.formats,function(format){ %>
                    <option><%=format%></option>
                    <% }); %>
                </select>
            </td>
            <td><span class="DescartesUIText"><%=readableMinScale%></span></td>
            <td><span class="DescartesUIText"><%=readableMaxScale%></span></td>
            <td><span class="DescartesUIText"><%=layer.description%></span></td>
            <td>
                <%if(layer.styles.length>0) {%>
                <select class="DescartesUISelect form-control" name="style_<%=index%>">
                    <% _.forEach(layer.styles,function(style){ %>
                    <option value="<%=style.Name%>"><%=style.Title%></option>
                    <% }); %>
                </select>
                <%}%>
            </td>
            <td><span class="DescartesUIText"><%=layer.keywordList%></span></td>
            <% if (layer.metadataURL !== '-') { %>
            		<td><a href="<%=layer.metadataURL%>" target="_blank"><span class="DescartesUIText">Lien</span></a></td>
            <% } else { %>
           			<td><span class="DescartesUIText"><%=layer.metadataURL%></span></td>
            <% }%>
        </tr>
        <% }); %>
    </tbody>
</table>