pstuifzand/ekster

View on GitHub
cmd/eksterd/templates/index.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Ekster</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css">
<link rel="micropub" href="{{ .Baseurl }}/micropub" />
<link rel="authorization_endpoint" href="{{ .Baseurl }}/auth" />
<link rel="token_endpoint" href="{{ .Baseurl }}/auth/token" />
</head>
<body>
    <section class="section">
        <div class="container">


            <nav class="navbar" role="navigation" aria-label="main navigation">
                <div class="navbar-brand">
                    <a class="navbar-item" href="/">
                        Ekster
                    </a>

                    <a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="menu">
                        <span aria-hidden="true"></span>
                        <span aria-hidden="true"></span>
                        <span aria-hidden="true"></span>
                    </a>
                </div>

                {{ if .Session.LoggedIn }}
                    <div id="menu" class="navbar-menu">
                        <a class="navbar-item" href="/settings">
                            Settings
                        </a>
                        <a class="navbar-item" href="/logs">
                            Logs
                        </a>
                        <a class="navbar-item" href="{{ .Session.Me }}">
                            Profile
                        </a>
                    </div>
                {{ end }}
            </nav>

            <h1 class="title">Ekster - Microsub server</h1>

            {{ if .Session.LoggedIn }}
                <h2 class="title">Logout</h2>
                <form action="/session/logout" method="post">
                    <button type="submit" class="button is-info">Logout</button>
                </form>
            {{ else }}
                <h2 class="title">Sign in to Ekster</h2>
                <form action="/session" method="post">
                    <div class="field">
                        <label class="label" for="url"></label>
                        <div class="control">
                            <input type="text" name="url" id="url" class="input" placeholder="https://example.com/">
                        </div>
                    </div>
                    <div class="field is-grouped">
                        <div class="control">
                            <button type="submit" class="button is-info">Login</button>
                        </div>
                    </div>
                </form>
            {{ end }}
        </div>
    </section>
</body>
</html>