<!DOCTYPE html>
<html lang="en" style="background-color: #fafafa;">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=450">
    <title>Jugendwettbewerb Informatik: Programmieren – leichter, als du denkst!</title>
    <link rel="stylesheet" href="/static/lib/bulma/medal-bulma-0.7.5.css">
    <link rel="icon" href="/static/images/favicon.png" type="image/png">
    <style>
       ::placeholder {
          color: #888 !important;
       }
       .blogin {
          padding: 0px;
          margin: -20px;
       }
    </style>
  </head>
  <body style="background-color: {{#if server_message}}#fbebeb{{else}}white{{/if}};">
    <div class="container" style="padding: 1.5rem;">
      <div class="columns">
        <div class="column is-7">
          {{#if firstlogin }}
            <img style="float:left; margin-right: 10px;" src="/static/images/klein.png">
          {{else}}
            <a href="/">
              <img style="float:left; margin-right: 10px;" src="/static/images/klein.png">
            </a>
          {{/if}}
          <h1 class="title">Jugendwettbewerb Informatik</h1>
          <h2 class="subtitle">Programmieren – leichter, als du denkst!</h2>
        </div>
        <div class="column is-5">
          {{#if logged_in}}
            {{#if firstlogin }}{{else}}
              <div class="columns" style="margin-bottom: 0px;">
                <div class="column is-8">
                  Eingeloggt als <em>{{ username }}</em>
                  {{#if firstname}}{{#if lastname}}
                    {{firstname}} {{lastname}}
                  {{/if}}{{/if}}
                  {{#if teacher}}
                    [Lehrer]
                  {{/if}}
                </div>
                <div class="column"><a href="/logout" class="button is-small is-danger" type="submit">⨯ &nbsp; Logout</a></div>
              </div>
              <div class="columns">
                <div class="column">
                  <a href="/profile" class="button is-info is-small">👤 &nbsp; Profil</a>
                  {{#if teacher}}
                    <a href="/group/" class="button is-warning is-small">⚙ &nbsp; Gruppenverwaltung</a>
                    <a href="/teacher" class="button is-success is-small">👨‍🏫 &nbsp; Lehrer-Informationen</a>
                  {{/if}}
                  {{#if admin}}
                    <a href="/admin/" class="button is-primary is-small">⚙ &nbsp; Administration</a>
                  {{/if}}
                </div>
              </div>
            {{/if}}
          {{else}}
            <!-- form action="/login" method="post">
              <div class="columns blogin">
                <div class="column is-three-fifths"><input class="input is-small" type="text" name="username" autofocus placeholder="Benutzername" style="width:50%"><input class="input is-small" type="password" name="password" placeholder="Passwort" style="width:50%"></div>
                <div class="column"><input class="button is-small is-success" type="submit" value="↪ &nbsp; Login" onclick="login();"></div>
              </div>
            </form -->
            <form action="/clogin" method="post" autocomplete="off" class="columns blogin">
              <!-- <div class=> -->
                <div class="column is-8"><input class="input is-small" type="text" name="code" placeholder="Gruppencode oder Logincode" autofocus></div>
                <div class="column"><input class="button is-small is-success" type="submit" value="↪ &nbsp; Login" style="font-weight:bold;">
                   &nbsp; <a href="https://bwinf.de/jugendwettbewerb/teilnehmen/schueler/" style="font-size: small;"> (?)</a>
                </div>
              <!-- </div> -->
            </form>
            {{#if self_url}}
              {{#each oauth_links}}
                <div class="columns blogin">
                  <div class="column">
                     <a class="button is-small is-info"  style="font-weight:bold;float:right;" href="{{ this.2 }}{{ ../self_url }}/oauth/{{ this.0 }}">{{ this.1 }}</a>
                     <div style="clear:both;"></div>
                  </div>
                </div>
              {{/each}}
            {{/if}}
          {{/if}}
        </div>
      </div>

      {{#if server_message}}
        {{#if firstlogin }}{{else}}
          <div class="columns">
            <div class="column is-8 is-offset-2">
              <div class="notification is-danger">
                {{{ server_message }}}
              </div>
            </div>
          </div>
        {{/if}}
      {{/if}}

      {{~> page}}
    </div>
    <footer class="footer">
      <div class="content has-text-centered">
        <p>
          <img src="/static/images/dachmarke_72.png" style="width:119px; height:72px; vertical-align: middle; margin-right:20px;"> Der <strong>Jugendwettbewerb Informatik</strong> ist ein Angebot der
          {{#if firstlogin }}
            Bundesweiten Informatikwettbewerbe.
          {{else}}
            <a href="https://bwinf.de">Bundesweiten Informatikwettbewerbe</a>.
          {{/if}}
        </p>
        <p>
           <a href="https://git.bwinf.de/bwinf/medal">Quellcode</a>
           &nbsp;  &nbsp;  ·  &nbsp;  &nbsp;
           <a href="https://bwinf.de/jugendwettbewerb/datenschutz/">Datenschutz</a>
           &nbsp;  &nbsp;  ·  &nbsp;  &nbsp;
           <a href="https://bwinf.de/impressum/">Impressum</a>
           &nbsp;  &nbsp;  ·  &nbsp;  &nbsp;
           <nobr>🖂 <a href="mailto:jugendwettbewerb@bwinf.de">jugendwettbewerb@bwinf.de</a></nobr>
           {{#if teacher}}
           &nbsp;  &nbsp;  ·  &nbsp;  &nbsp;
           <nobr>☏ 0228 9762 6999</nobr>
           {{/if}}
        </p>
        <!--  <p>Diese Wettbewerbsplattform ist freie Software.</p> -->
      </div>
    </footer>
  </body>
</html>
