<!DOCTYPE html>
<html>
<head>
  <title><%= config.name %> - ToDo</title>
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <%- include('./include/ogp'); %>
  <link rel="stylesheet" href="/stylesheets/style.css" />
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css"
    integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
</head>
<body>
  <%- include('./include/header'); %>

  <% if (isAuth) { %>
    <div class="container">
      <%- include('./include/message'); %>
      <div class="row">
        <div class="col-md-6">
          <form action="" method="post">
            <input type="hidden" name="_csrf" value="<%= csrfToken %>">
            <label>タスクの追加</label>
            <input required id="focus" type="text" name="add" placeholder="何をする？"/>
            <input type="submit" value="追加"/>
          </form>
        </div>
        <div class="col-md-6">
          <ul>
            <% for(let todo of todos){ %>
              <li><span><%= todo.content %></span></li>
            <% } %>
          </ul>
        </div>
      </div>
    </div>
  <% } else { %>
    <div class="center">
      <h1>Welcome to the <%= config.name %></h1>
      <a class="btn btn-primary" href="<%= config.server.root %>/signup" role="button">Sign up now!</a>
    </div><br>
  <% } %>

  <script src="/javascripts/focus.js"></script>

  <%- include('./include/footer'); %>

  <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
    integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
    crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"
    integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut"
    crossorigin="anonymous"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"
    integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k"
    crossorigin="anonymous"></script>
</body>
</html>
