<div class="bs-sidebar col-sm-3" data-ng-include data-src="'partials/realm-menu.html'"></div>
<div id="content-area" class="col-sm-9" role="main">
    <ul class="nav nav-tabs nav-tabs-pf">
        <li><a href="#/realms/{{realm.realm}}/oauth-clients/{{oauth.id}}">Settings</a></li>
        <li class="active"><a href="#/realms/{{realm.realm}}/oauth-clients/{{oauth.id}}/credentials">Credentials</a></li>
        <li><a href="#/realms/{{realm.realm}}/oauth-clients/{{oauth.id}}/scope-mappings">Scope</a></li>
        <li><a href="#/realms/{{realm.realm}}/oauth-clients/{{oauth.id}}/installation">Installation</a></li>
    </ul>

    <div id="content">
        <ol class="breadcrumb" data-ng-hide="create">
            <li><a href="#/realms/{{realm.realm}}">{{realm.realm}}</a></li>
            <li><a href="#/realms/{{realm.realm}}/oauth-clients">OAuth Clients</a></li>
            <li><a href="#/realms/{{realm.realm}}/oauth-clients/{{oauth.id}}">{{oauth.name}}</a></li>
            <li class="active">Credentials</li>
        </ol>
        <h2 data-ng-hide="create"><span>{{oauth.name}}</span> Credentials</h2>
        <form class="form-horizontal" name="credentialForm" novalidate>
            <fieldset data-ng-show="passwordRequired">
                <legend uncollapsed><span class="text">Change Password</span></legend>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="password">New Password</label>
                    <div class="col-sm-4">
                        <input class="form-control" type="password" id="password" name="password" data-ng-model="password" autofocus
                               required>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label two-lines" for="password">New Password Confirmation</label>
                    <div class="col-sm-4">
                        <input class="form-control" type="password" id="confirmPassword" name="confirmPassword" data-ng-model="confirmPassword"
                               required>
                    </div>
                </div>
            </fieldset>

            <div class="pull-right form-actions" ng-show="password != null">
                <button class="btn btn-primary btn-lg" type="submit" data-ng-click="changePassword()" ng-show="password != null">Change Password</button>
            </div>

            <fieldset data-ng-show="totpRequired">
                <legend uncollapsed><span class="text">Change TOTP Key</span></legend>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="totp">New Key</label>
                    <div class="col-sm-4">
                        <input class="form-control" type="text" id="totp" name="totp" data-ng-model="totp" autofocus
                               required>
                        <button class="btn btn-primary"  type="submit" data-ng-click="generateTotp()">Generate
                        </button>
                    </div>
                </div>
            </fieldset>

            <div class="pull-right form-actions" ng-show="totp != null">
                <button class="btn btn-primary btn-lg"  type="submit" data-ng-click="changeTotp()" ng-show="totp != null">Save</button>
            </div>
        </form>
    </div>
</div>

