pstuifzand/ekster

View on GitHub
cmd/eksterd/templates/auth.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">
</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>

            <div class="box">
                <form action="/auth/approve" method="post">
                    <input type="hidden" name="state" value="{{ .State }}" />

                    <div class="field">
                        <label class="label">Client ID</label>
                        <div class="control">
                            <p>{{ .ClientID }}</p>
                        </div>
                        <div class="control">
                            <p>{{ .App.Name }}</p>
                        </div>
                        <div class="control">
                            <p><img src="{{ .App.IconURL }}" /></p>
                        </div>
                    </div>

                    <div class="field">
                        <label class="label">RedirectURI</label>
                        <div class="control">
                            <p>{{ .RedirectURI }}</p>
                        </div>
                    </div>

                    <div class="field">
                        <label class="label">Scope</label>
                        <div class="control">
                            <p>{{ .Scope }}</p>
                        </div>
                    </div>

                    <div class="field">
                        <label class="label">Select a channel</label>
                        <div class="control">
                            <div class="select">
                                <select name="channel">
                                    {{ range .Channels }}
                                        <option value="{{ .UID }}">{{ .Name }}</option>
                                    {{ end }}
                                </select>
                            </div>
                        </div>
                    </div>

                    <div class="field">
                        <div class="control">
                            <button type="submit" name="accept" value="approve" class="button is-primary">
                                Approve
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </section>
</body>
</html>