<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Demo Backbone: Rzeczy do zrobienia</title>
    <link href="todos.css" media="all" rel="stylesheet" type="text/css"/>
    <script src="lib/json2.js"></script>
    <script src="lib/jquery.js"></script>
    <script src="lib/jquery.tmpl.js"></script>
    <script src="lib/underscore.js"></script>
    <script src="lib/backbone.js"></script>
    <script src="lib/backbone.localstorage.js"></script>
    <script src="todos.js"></script>
  </head>
  <body>

    <div id="todoapp">
      <div class="title">
        <h1>Do zrobienia</h1>
      </div>

      <div class="content">
        <div id="create-todo">
          <input id="new-todo" placeholder="Co należy zrobić?" type="text" />
        </div>

        <div id="todos">
          <ul id="todo-list"></ul>
        </div>

        <div id="todo-stats"></div>
      </div>
    </div>

    <!-- Szablony -->
    
    <script type="text/template" id="item-template">
      <div class="todo {{if done}}done{{/if}}">
        <div class="display" title="Kliknij dwukrotnie, aby edytować...">
          <input class="check" type="checkbox" {{if done}}checked="checked"{{/if}} />
          <div class="todo-content">${content}</div>
          <span class="todo-destroy"></span>
        </div>
        <div class="edit">
          <input class="todo-input" type="text" value="${content}" />
        </div>
      </div>
    </script>

    <script type="text/template" id="stats-template">
      {{if total}}
        <span class="todo-count">
          <span class="number">${ remaining }</span>
          <span class="word">${ remaining == 1 ? 'czynność' : 'czynności' }</span> wciąż do zrobienia.
        </span>
      {{/if}}
      {{if done}}
        <span class="todo-clear">
          <a href="#">
            Wyczyść <span class="number-done">${ done }</span>
            <span class="word-done">${ done == 1 ? 'ukończoną czynność' : 'ukończone czynności' }</span>
          </a>
        </span>
      {{/if}}
    </script>
  </body>
</html>