{{define "title"}}Set up your account{{end}}
{{define "page_title"}}Set up your account{{end}}

{{define "content"}}
<div class="row justify-content-center">
    <div class="col-lg-6">
        {{if .must_change_username}}
        <div class="alert alert-warning">
            <i class="bi bi-exclamation-triangle me-2"></i>
            You're signed in with the default admin account. Choose a new username and password before continuing.
        </div>
        {{else}}
        <div class="alert alert-info">
            <i class="bi bi-info-circle me-2"></i>
            Set your own password before continuing.
        </div>
        {{end}}
        <div class="card">
            <div class="card-header"><h5 class="mb-0"><i class="bi bi-person-gear me-2"></i>Choose your {{if .must_change_username}}credentials{{else}}password{{end}}</h5></div>
            <div class="card-body">
                {{if .error}}<div class="alert alert-danger">{{.error}}</div>{{end}}
                <form method="POST" action="/pymta-manager/first-login">
                    {{if .must_change_username}}
                    <div class="mb-3">
                        <label for="username" class="form-label">New username</label>
                        <input type="text" class="form-control" id="username" name="username" value="{{.username}}" required autofocus>
                    </div>
                    {{end}}
                    <div class="mb-3">
                        <label for="password" class="form-label">New password</label>
                        <input type="password" class="form-control" id="password" name="password" required minlength="10" {{if not .must_change_username}}autofocus{{end}}>
                        <div class="form-text">At least 10 characters, with a letter, a number, and a symbol.</div>
                    </div>
                    <div class="mb-4">
                        <label for="password_confirm" class="form-label">Confirm new password</label>
                        <input type="password" class="form-control" id="password_confirm" name="password_confirm" required minlength="10">
                    </div>
                    <div class="d-grid">
                        <button type="submit" class="btn btn-primary"><i class="bi bi-check-lg me-1"></i>Save and continue</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{{end}}
