{%- if table %}
  <form>
    {%- if view.show_controls %}
      <div class="btn-group">
        <a class="btn dropdown-toggle" data-toggle="dropdown">
          Select
          <span class="caret"></span>
        </a>
        <ul class="dropdown-menu">
          <li><a href="">All</a></li>
          <li><a href="">All</a></li>
          <!-- dropdown menu links -->
        </ul>
      </div>
    {%- endif %}

    <table class="table table-striped table-bordered table-condensed"
        id="{{ view.name }}">
      <thead>
      <tr>
        {%- if view.show_controls %}
          <th style="width: 1%;"></th>
        {%- endif %}
        {%- for col in view.columns %}
          <th style="width: {{ col.width }}%;">{{ col.label }}</th>
        {%- endfor %}
      </tr>
      </thead>

      <tbody>
      {%- for line in table %}
        <tr>
          {%- if view.show_controls %}
            <td><input type="checkbox"></td>
          {%- endif %}
          {%- for cell in line %}
            <td>{{ cell }}</td>
          {%- endfor %}
        </tr>
      {%- endfor %}
      </tbody>

      <tfoot>
      <tr>
        {%- if view.show_controls %}
          <th></th>
        {%- endif %}
        {%- for col in view.columns %}
          <th>{{ col.label }}</th>
        {%- endfor %}
      </tr>
      </tfoot>
    </table>
  </form>

  {%- deferJS %}
    <script type="text/javascript">
      require(['Abilian'],
          function (Abilian) {
            Abilian.fn.onAppInit(
                function () {
                  {{ js }}
                }
            );
          });
    </script>
  {%- enddeferJS %}

{%- else %}
  <p class="text-muted">No data.</p>
{%- endif %}
<div style="clear: both;"></div>
