<%
var inspector = obj._prefs && obj._prefs.inspector && obj._prefs.inspector === obj.id;
var disabled = obj._prefs && obj._prefs.disabled && obj._prefs.disabled.indexOf(obj.id) >= 0;
var refreshable = (
  obj.Datasource.type === 'shape' ||
  obj.Datasource.type === 'ogr' ||
  obj.Datasource.type === 'csv' ||
  obj.Datasource.type === 'geojson' ||
  obj.Datasource.type === 'topojson'
);
var hideable = !(obj.Datasource.type === 'gdal');
%>
<div data-layer='<%=obj.id%>' class='contain keyline-bottom clearfix layer js-layer col12 small quiet'>
  <span class='pad0 col0'>
    <a href='#' id='zoom-<%=obj.id%>' title='Zoom to extent' class='icon marker inline round js-zoom-to'></a>
  </span>
  <a class='js-onpane block col8 contain pad0y pad1x quiet' href='#layers-<%=obj.id%>'>
    <%=obj.id%>
    <input type='hidden' class='datasourceType' value='<%=obj.Datasource.type%>' />
    <span class='code quiet'><%= (obj.Datasource.type) %></span>
  </a>

  <div class='center col6 pin-right small'>
      <span class='pad0 col4 fr center layer-label'>
        <a href='#' id='del-<%=obj.id%>' class='inline round icon trash js-delete'></a>
      </span>
      <span class='pad0 col4 fr center'>
        <% if (refreshable) { %>
          <a href='#' id='refresh-<%=obj.id%>' class='icon refresh inline round js-refresh-source'></a>
        <% } %>
      </span>
    <span class='pad0 col4 fr center'>
      <% if (hideable) { %>
        <a href='#refresh' class='icon xrayswatch js-xrayswatch x inline round fill-darken1 <%=disabled ? 'disabled' : ''%> <%=obj.geometry||'unknown'%>' style='background-color:<%=this.xraycolor(obj.id)%>'></a>
      <% } %>
    </span>
    <% if ('minzoom' && 'maxzoom' in obj) { %>
    <div class='center col3 fr pad1x'>
      <span class='inline zooms pad0 micro'><%= obj.minzoom %>-<%= obj.maxzoom %></span>
    </div>
    <% } %>
  </div>

</div>
