{% load unicorn %}
<div>
  <div>
    <button unicorn:click="$reset">$reset</button>
    <button unicorn:click="$refresh">$refresh</button>

    {% if is_editing %}
    <input type="text" unicorn:model.defer="name" />
    <button unicorn:click="save">Save</button>
    <button unicorn:click="cancel">Cancel</button>
    {% else %}
    <h3>{{ name }}</h3>
    <a href="#" unicorn:click.prevent="edit">Edit</a>
    {% endif %}
  </div>

  <button unicorn:click="load_table">Load table</button>

  <div>Favorite count: {{ favorite_count }}</div>

  <button u:click="show_filter=True">Show Filter</button>

  {% if show_filter %}
  {% unicorn 'nested.filter' %}
  {% endif %}

  <table>
    <thead>
      <tr>
        <td>Name</td>
        <td>Label</td>
        <td>Datetime</td>
        <td>Favorite</td>
        <td>Action</td>
      </tr>
    </thead>
    {% for flavor in flavors %}
    {% unicorn 'nested.row' key=flavor.id model=flavor %}
    {% endfor %}
  </table>

  <button unicorn:click="load_table">Load table</button>

</div>
