<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>SINAVI J-Framework loggingサンプル</title>
<link rel="stylesheet" type="text/css" href="assets/lib/bootstrap/css/bootstrap.css" media="screen, projection" />
<script type="text/javascript" src="assets/lib/jquery/jquery-1.9.1.js"></script>
<script type="text/javascript" src="assets/lib/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/lib/jquery-plugin/jquery.placeholder.js"></script>
<script type="text/javascript" src="assets/lib/knockout/knockout-3.1.0.js"></script>
<script type="text/javascript" src="assets/lib/log-showcase/js/knockout-extends/knockout-date-extention.js"></script>
<script type="text/javascript" src="assets/lib/log-showcase/js/namespace/namespace.js"></script>
<script type="text/javascript" src="assets/lib/log-showcase/js/settings/ajax-setup.js"></script>
<script type="text/javascript" src="assets/lib/log-showcase/js/app/logging.js"></script>

<script type="text/javascript">
  $(document).ready(function() {
    var viewModel = new jfw.vm.LoggingViewModel();
    viewModel.bind();
  });
</script>

</head>
<body data-spy="scroll" data-target="#navbar-menu">
  <header class="navbar navbar-default navbar-static-top" role="navigation">
    <div class="container">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed"
          data-toggle="collapse" data-target=".navbar-collapse">
          <span class="icon-bar"></span> <span class="icon-bar"></span> <span
            class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="index.html">HOME</a>
      </div>
      <div class="navbar-collapse collapse" style="height: 1px;">
        <ul class="nav navbar-nav">
          <li class="dropdown"></li>
          <li class="dropdown"></li>
        </ul>
        <ul class="nav navbar-nav navbar-right">
          <li>
            <a href="http://ctc-g.github.io/sinavi-jfw/docs/index.html" target="_blank">API</a>
          </li>
          <li><a href="mailto:sinavi-jframework@ctc-g.co.jp">Contact</a></li>
        </ul>
      </div>
    </div>
  </header>
  <div class="container">
    <div class="row">
      <div class="col-md-12" role="main">
        <div class="page-header">
          <h1>ログサンプル</h1>
        </div>
      </div>
      <div class="row">
        <div class="col-md-12">
          <div id="messages-container" class="alert">
            <div id="error-messages"
              data-bind="visible: handler.errors().length > 0">
              <div data-bind="foreach: handler.errors">
                <div data-bind="text: message, css:'list-group-item list-group-item-danger'"></div>
              </div>
            </div>
            <div id="infomation-messages" 
              data-bind="visible: messages().length > 0">
              <div data-bind="foreach: messages" class="list-group">
                <div data-bind="text: message, css: 'list-group-item list-group-item-info'"></div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-md-12">
          <div id="login-container">
            <form id="login-form" action="/jfw-log-showcase/login" method="post" class="form-horizontal" role="form">
              <fieldset>
                <legend>ログイン</legend>
                <div class="form-group" data-bind="css: {'has-warning has-feedback': failed}">
                  <label class="col-sm-2 control-label" for="name">ユーザ名</label>
                  <div class="col-sm-8">
                    <input type="text"
                      class="form-control"
                      id="name"
                      name="name"
                      title="ユーザ名を入力してください。" 
                      placeholder="ユーザ名は「admin」か「user」のどちらかを入力してください。"
                      data-bind="value: auth.username" />
                    <span data-bind="css: {'glyphicon glyphicon-warning-sign form-control-feedback': failed}"></span>
                    <div data-bind="visible: failed, foreach: messages">
                      <p data-bind="text: message, css: 'help-block'"></p>
                    </div>
                  </div>
                </div>
                <div class="form-group" data-bind="css: {'has-warning has-feedback': failed}">
                  <label class="col-sm-2 control-label" for="password">パスワード</label>
                  <div class="col-sm-8">
                    <input type="password"
                      id="password"
                      class="form-control"
                      name="password"
                      title="パスワードを入力してください。" 
                      placeholder="パスワードはユーザ名と同じ値を入力してください。"
                      data-bind="value: auth.password" />
                    <span data-bind="css: {'glyphicon glyphicon-warning-sign form-control-feedback': failed}"></span>
                    <div data-bind="visible: failed, foreach: messages">
                      <p data-bind="text: message, css: 'help-block'"></p>
                    </div>
                  </div>
                </div>
                <div class="form-group">
                  <div class="col-sm-offset-2 col-sm-8">
                    <button id="login" class="btn btn-primary" data-bind="click: login">ログイン</button>
                  </div>
              </div>
              </fieldset>
            </form>
          </div>
        </div>
      </div>
      <div class="row" data-bind="visible: executable">
        <div class="col-md-12">
          <div id="logging-container">
            <form id="logging-form" action="/jfw-log-showcase/log/profile" method="post" class="form-horizontal" role="form">
              <fieldset>
                <legend>ログ出力</legend>
                <div class="form-group">
                  <div class="col-sm-offset-2 col-sm-8">
                    <button id="logging" class="btn btn-primary" data-bind="click: logging">ロギング</button>
                  </div>
                </div>
              </fieldset>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</body>
</html>