{{define "body"}}
{{if .Data}}
<div class="row">
    <div class="col-xs-4 offset-4">
        <div class="card border-primary mx-auto">
        <div class="card-header">
            <strong>{{.BodyTitle}} - {{.Data.Username}}</strong>
        </div>
        <div class="card-body">
            <form class="form-horizontal" action="/user/totp/{{.Data.Username}}" method="post">
                <input type="hidden" name="token" value="{{.Token}}">
                {{if .Data.Secret}}
                <input type="hidden" name="url" value="{{.Data.URL}}">
                <div class="form-group">
                    <img src="{{.Data.Image}}" alt="{{.Data.Secret}}">
                </div>
                <div class="form-group">
                    <label class="col-form-label" for="secret">Secret</label>
                    <pre><code id="secret">{{.Data.Secret}}</code></pre>
                </div>
                {{end}}
                <div class="form-group">
                    <label class="col-form-label" for="pin">PIN</label>
                    <input class="form-control input-sm" type="text" id="pin" name="pin" autocomplete="off" autofocus required>
                </div>
                {{if .Data.Secret}}
                <button class="btn btn-sm btn-success" type="submit">Enable</button>
                {{else}}
                <button class="btn btn-sm btn-danger" type="submit">Disable</button>
                {{end}}
                <a href="/user/edit/{{.Data.Username}}" class="btn btn-sm btn-primary">Back</a>
            </form>
        </div>
        </div>
    </div>
</div>
{{end}}
{{end}}
