{% extends "_base.jinja" %}

{% block title %}
Polaris - Dashboard made easy.
{% endblock title %}

{% block script %}
  {{ super() }}
  <script src="{{ cdn_url_for('polaris.js') }}"></script>
{% endblock %}

{% block body %}
<body ng-controller="IndexCtrl">
  <div id="index" class="container">
    <div class="slogan">
      <span>Polaris</span>
    </div>
    <div class="vision">
      <span>Dashboard made easy</span>
    </div>

    <div class="signup">
      <div class="signup-container">
        {% if oauth_enabled %}
        <div ng-hide="hideSocialSign" class="signup_with_social">
          <ul>
            {% for oauth_name in oauth_enabled %}
              {% set fa_icon = 'google-plus' if oauth_name == 'google' else oauth_name %}
              <li>
                  <a class="social_signup_button {{ oauth_name }}" href="oauth/{{ oauth_name }}">
                    <span class="fa fa-{{ fa_icon }}"></span>
                    <span>Log in with {{ oauth_name|capitalize }}</span>
                </a>
              </li>
            {% endfor %}
          </ul>
        </div>
        {% endif %}
        <div ng-hide="hideEmailSign" class="email-sign">
          <form ng-submit="submit($event)" class="form-inline" role="form" method="POST"
              {%raw%}action="{{url}}"{%endraw%}>
            {{ form.csrf_token }}
            <div class="form-group col-md-2">
              {{ form.email(class="form-control", placeholder="Email")  }}
            </div>
            <div class="form-group col-md-2">
              {{ form.password(class="form-control", placeholder="Password") }}
            </div>
            <div class="form-group">
              <input {%raw%}value="{{signMsg}}"{%endraw%}
                style="border:none;color:#fff;width:71px;"
                type="submit" class="form-control btn btn-info"/>
            </div>
          </form>
        </div>
      </div>

      <div class="signup_with_email">
        <div class="email_signup" style="position:relative;">
          <div class="sign-msg" style="text-align:right;">
            <span ng-click="logIn()" style="margin-right:11px;">
              Log in with <span ng-bind="sign[0]"></span>
            </span>
          </div>
          <div class="spacer"></div>
          <div class="or">or</div>
          <div class="sign-msg" style="text-align:left;">
            <span style="margin-left:11px;" ng-click="signUp()">
              Sign up with <span ng-bind="sign[1]"></span>
            </span>
          </div>
        </div>
      </div>
    </div>
  </div>
</body>
{% endblock body %}
