<!DOCTYPE html>
<html>
  <head>
    <title>select List{{#parent_id}} for {{parent_label}}{{/parent_id}}</title>
    {{>head}}
  </head>
  <body>
    <div data-role="page" data-wq-sync-refresh="true">
      <div data-role="header">
        {{>home}}
        <h1>select List{{#parent_id}} for {{parent_label}}{{/parent_id}}</h1>
        {{#page_config.can_add}}
        <a href="{{rt}}/selects/new{{#parent_id}}?{{parent_page}}_id={{parent_id}}{{/parent_id}}" data-icon="plus">
          Add New
        </a>
        {{/page_config.can_add}}
      </div>
      <div role="main" class="ui-content">
        {{#parent_id}}
        <p>
          <a href="{{rt}}/{{parent_url}}">&lt; Back to {{parent_label}}</a>
        </p>
        {{/parent_id}}
        {{#unsynced}}
        <ul data-role="listview" data-inset="true">
          <li data-role="list-divider">Outbox</li>
          {{#unsyncedItems}}
          <li data-icon="{{#error}}alert{{/error}}{{^error}}minus{{/error}}">
            <a href="{{rt}}/outbox/{{id}}/edit">
              {{#label}}{{label}}{{/label}}
              {{^label}}Unsynced Item #{{id}}{{/label}}
            </a>
          </li>
          {{/unsyncedItems}}
          <li>
            <div class="ui-grid-a ui-responsive">
              <div class="ui-block-a">
                {{#is_authenticated}}
                <button class="sync" data-icon="refresh" data-wq-action="sync">
                  {{#syncing}}Syncing...{{/syncing}}
                  {{^syncing}}Sync Now{{/syncing}}
                </button>
                {{/is_authenticated}}
                {{^is_authenticated}}
                <a href="{{rt}}/login" data-role="button" data-icon="lock">
                  Log in to Sync
                </a>
                {{/is_authenticated}}
              </div>
              <div class="ui-block-b">
                <button type="button" data-icon="delete" data-wq-action="empty-outbox">
                  Discard
                </button>
              </div>
            </div>
          </li>
        </ul>
        {{/unsynced}}
          <ul data-role="listview" data-filter="true" data-inset="true">
            {{#unsynced}}
            <li data-role="list-divider">Synced Items</li>
            {{/unsynced}}
            {{#list}}
            <li>
              <a href="{{rt}}/selects/{{id}}">{{label}}</a>
            </li>
            {{/list}}
            {{#page_config.can_add}}
            <li data-icon="plus" data-theme="b">
              <a href="{{rt}}/selects/new{{#parent_id}}?{{parent_page}}_id={{parent_id}}{{/parent_id}}">Add select</a>
            </li>
            {{/page_config.can_add}}
          </ul>
      </div>
      {{>paginator}}
    </div>
  </body>
</html>
