{{define "admin"}}
<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <title>Kasino Admin</title>
    <link rel="stylesheet" type="text/css" href="/assets/semantic/semantic.min.css">
    <script src="/assets/js/jquery-3.1.1.min.js"></script>
    <script src="/assets/semantic/semantic.min.js"></script>
</head>
{{if .Loggedin}}
<body>
<div style="width: 98%; margin: 0 auto;">
    <h1>Kasino Admin <div class="ui inline loader"></div></h1>
    <p>
    <div class="ui right labeled icon addKofi button green">
        <i class="right plus icon"></i>
        Konfi Hinzufügen
    </div>
    <a href="#" class="ui right labeled icon uploadKofis button blue">
        <i class="right cloud upload icon"></i>
        Konfis Importieren
    </a>
    </p>

    <div id="msg"></div>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="ui celled table">
        <thead>
        <tr>
            <th>Name</th>
            <th>Gemeinde</th>
            <th>KonfiCoins</th>
            <th>Bearbeiten</th>
        </tr>
        </thead>
        <tbody id="konfis">
        <tr>
            <td colspan="3">Laden...</td>
        </tr>
        </tbody>
    </table>
</div>

<!-- Modals -->

<!-- Kofi löschen -->
<div class="ui small basic kofidel modal">
    <div class="ui icon header">
        <i class="trash outline icon"></i>
        Konfi löschen
    </div>
    <div class="content">
        <p>Willst du diesen Konfi wirklich löschen? Diese Aktion kann nicht Rückgängig gemacht werden!</p>
    </div>
    <div class="actions">
        <div class="ui red basic cancel inverted button">
            <i class="remove icon"></i>
            Nein
        </div>
        <div class="ui green ok inverted button">
            <i class="checkmark icon"></i>
            Ja!
        </div>
    </div>
</div>

<!-- Kofi hinzufügen -->
<div class="ui kofiadd modal">
    <i class="close icon"></i>
    <div class="header">
        Konfi hinzufügen
    </div>
    <div class="image content">
        <form action="#" method="post">
            <div class="ui input">
                <input type="text" id="name" placeholder="Name"/>
            </div><br/><br/>
            <div class="ui input">
                <input type="text" id="gemeinde" placeholder="Gemeinde"/>
            </div>
        </form>
    </div>
    <div class="actions">
        <div class="ui black deny button">
            Abbrechen
        </div>
        <div class="ui positive right labeled icon button">
            Hinzufügen
            <i class="checkmark icon"></i>
        </div>
    </div>
</div>

<!-- Kofis hochladen -->
<div class="ui kofiupload modal">
    <i class="close icon"></i>
    <div class="header">
        Konfis hochladen
    </div>
    <div class=" content">

    </div>
    <div class="actions">
        <div class="ui black deny button">
            Abbrechen
        </div>
        <div class="ui positive button">
            Hochladen
        </div>
    </div>
</div>
{{else}}
<body style="background: url(/assets/bg.jpg) no-repeat center fixed">
<div class="ui middle aligned center aligned grid" style="width: 30em; margin: 37vh auto;">
    <div class="column">
        <h2 class="ui blue header">
            <div class="content">
                Kasino Admin
            </div>
        </h2>
        <form class="ui large form" id="loginform" method="post">
            <div class="ui segment">
                <div class="field">
                    <div class="ui left icon input">
                        <i class="lock icon"></i>
                        <input type="password" name="password" id="password" placeholder="Passwort" autofocus>
                    </div>
                </div>
                <div class="ui fluid large blue submit button">Login</div>
            </div>

            <div id="msg"></div>

        </form>
    </div>
</div>
{{end}}

{{if .Loggedin}}
<script src="/assets/js/admin.js"></script>
{{else}}
<script src="/assets/js/login.js"></script>
{{end}}
</body>
</html>
{{end}}