Implement new design for user and org settings

Fixes #1376
This commit is contained in:
Joseph Schorr 2016-04-25 15:17:18 -04:00
parent d63ec8c6b0
commit fe735b8048
25 changed files with 784 additions and 614 deletions

View file

@ -28,24 +28,16 @@
<span class="cor-tab" tab-title="Robot Accounts" tab-init="showRobots()" tab-target="#robots">
<i class="fa ci-robot"></i>
</span>
<span class="cor-tab" tab-title="User Settings" tab-target="#settings">
<i class="fa fa-gears"></i>
</span>
<span class="cor-tab" tab-title="Billing" tab-target="#usage"
quay-show="Features.BILLING">
<i class="fa fa-credit-card"></i>
</span>
<span class="cor-tab" tab-title="Billing Invoices" tab-target="#invoices"
tab-init="showInvoices()" quay-show="Features.BILLING">
<i class="fa ci-invoice"></i>
</span>
<span class="cor-tab" tab-title="External Logins" tab-target="#external"
quay-show="!hasSingleSignin">
<span class="cor-tab" tab-title="External Logins And Applications" tab-target="#external"
tab-init="showApplications()">
<i class="fa fa-external-link-square"></i>
</span>
<span class="cor-tab" tab-title="Authorized Applications" tab-target="#applications"
tab-init="showApplications()">
<i class="fa ci-application"></i>
<span class="cor-tab" tab-title="Usage Logs" tab-target="#logs" tab-init="showLogs()"
quay-show="Features.USER_LOG_ACCESS">
<i class="fa fa-bar-chart"></i>
</span>
<span class="cor-tab" tab-title="User Settings" tab-target="#settings" tab-init="showBilling()">
<i class="fa fa-gears"></i>
</span>
</div> <!-- /cor-tabs -->
@ -60,149 +52,129 @@
<div class="robots-manager" user="viewuser" is-enabled="showRobotsCounter"></div>
</div>
<!-- External Logins -->
<!-- Usage Logs -->
<div id="logs" class="tab-pane">
<div class="logs-view" user="viewuser" makevisible="showLogsCounter"></div>
</div>
<!-- External Logins And Applications -->
<div id="external" class="tab-pane" quay-show="!hasSingleSignin">
<div class="external-logins-manager" user="viewuser"></div>
</div>
<!-- Applications -->
<div id="applications" class="tab-pane">
<div class="external-logins-manager" user="viewuser"
quay-show="!hasSingleSignin"></div>
<div style="margin: 50px" quay-show="!hasSingleSignin">
</div>
<div class="authorized-apps-manager" user="viewuser" is-enabled="showAppsCounter"></div>
</div>
<!-- Plan and Usage -->
<div id="usage" class="tab-pane" quay-require="['BILLING']">
<h3>Plan Usage and Billing</h3>
<div class="plan-manager" user="viewuser" has-subscription="hasSubscription"></div>
<hr ng-show="hasSubscription">
<div class="billing-options" user="viewuser" ng-show="hasSubscription"></div>
</div>
<!-- Billing Invoices -->
<div id="invoices" class="tab-pane" quay-require="['BILLING']">
<h3>Billing Invoices</h3>
<div class="billing-invoices" user="viewuser"
makevisible="showInvoicesCounter"></div>
</div>
<!-- Settings -->
<div id="settings" class="tab-pane">
<h3>User Settings</h3>
<!-- E-mail address -->
<div class="co-panel" quay-show="Features.MAILING">
<div class="co-panel-heading"><i class="fa fa-envelope-o"></i> E-mail Address</div>
<div class="panel-body" style="padding-top: 5px;">
<div class="co-alert co-alert-success" ng-show="changeEmailInfo.state == 'sent'">
An e-mail has been sent to {{ sentEmail }} to verify the change.
</div>
<div class="cor-loader" ng-show="changeEmailInfo.state == 'sending'"></div>
<div ng-show="changeEmailInfo.state != 'sending'">
<form class="form-change user-settings-form"
id="changeEmailForm" name="changeEmailForm"
ng-submit="changeEmail(); changeEmailForm.$setPristine()"
ng-show="!awaitingConfirmation && !registering">
<div class="row">
<table class="col-md-6">
<tr>
<td>Current E-mail Address:</td>
<td>{{ context.viewuser.email }}</td>
</tr>
<tr>
<td>New E-mail Address:</td>
<td>
<input type="email" class="form-control"
placeholder="Your new e-mail address"
ng-model="changeEmailInfo.email" required>
</td>
</tr>
</table>
</div>
<button class="btn btn-primary"
ng-disabled="changeEmailForm.$invalid || changeEmail.email == context.viewuser.email"
type="submit">
Change E-mail Address
</button>
</form>
</div>
<!-- Encrypted Password -->
<div class="settings-section">
<h3>Docker CLI Password</h3>
<div ng-if="!Features.REQUIRE_ENCRYPTED_BASIC_AUTH">
The Docker CLI stores passwords entered on the command line in <strong>plaintext</strong>. It is therefore highly recommended to generate an an encrypted version of your password to use for <code>docker login</code>.
</div>
</div> <!-- /E-mail -->
<!-- Password -->
<div class="co-panel" style="margin-bottom: 0px">
<div class="co-panel-heading"><i class="fa fa-lock"></i> Password</div>
<div class="panel-body" style="padding-top: 5px;">
<div class="cor-loader" ng-show="changePasswordInfo.state == 'changing'"></div>
<!-- Encrypted Password -->
<div class="row" ng-show="changePasswordInfo.state !='changing'">
<div class="panel">
<div class="panel-title">Generate Encrypted Password</div>
<div class="panel-body">
<div class="co-alert co-alert-info" ng-if="!Features.REQUIRE_ENCRYPTED_BASIC_AUTH">
Due to Docker storing passwords entered on the command line in <strong>plaintext</strong>, it is highly recommended to use the button below to generate an an encrypted version of your password.
</div>
<div class="co-alert co-alert-warning" ng-if="Features.REQUIRE_ENCRYPTED_BASIC_AUTH">
This installation is set to <strong>require</strong> encrypted passwords when
using the Docker command line interface. To generate an encrypted password, click the button below.
</div>
<button class="btn btn-primary" ng-click="generateClientToken()">
<i class="fa fa-key" style="margin-right: 6px;"></i>Generate Encrypted Password
</button>
</div>
</div>
</div>
<!-- Change Password -->
<div class="row" quay-show="Config.AUTHENTICATION_TYPE == 'Database' && changePasswordInfo.state !='changing'">
<div class="panel">
<div class="panel-title">Change Password</div>
<span class="help-block" ng-show="changePasswordInfo.state == 'changed'">
Password changed successfully
</span>
<div class="panel-body">
<div class="co-alert co-alert-warning">Note: Changing your password will also invalidate any generated encrypted passwords.</div>
<form class="form-change col-md-6" id="changePasswordForm" name="changePasswordForm" ng-submit="changePassword(); changePasswordForm.$setPristine()"
ng-show="!awaitingConfirmation && !registering">
<input type="password" class="form-control" placeholder="Your new password" ng-model="changePasswordInfo.password" required
ng-pattern="/^.{8,}$/">
<input type="password" class="form-control" placeholder="Verify your new password" ng-model="changePasswordInfo.repeatPassword"
match="changePasswordInfo.password" required ng-pattern="/^.{8,}$/">
<button class="btn btn-danger" ng-disabled="changePasswordForm.$invalid" type="submit"
analytics-on analytics-event="change_pass">Change Password</button>
</form>
</div>
</div>
</div>
<div ng-if="Features.REQUIRE_ENCRYPTED_BASIC_AUTH">
This installation is set to <strong>require</strong> encrypted passwords when
using the Docker command line interface.
</div>
</div> <!-- /Password -->
<!-- Convert -->
<div class="co-panel" quay-show="Config.AUTHENTICATION_TYPE == 'Database'">
<div class="co-panel-heading"><i class="fa fa-group"></i> Convert to organization</div>
<div class="panel-body" style="padding-top: 5px;">
<div class="convert-user-to-org" user="viewuser"></div>
</div>
<table class="co-list-table" style="margin-top: 10px;">
<tr>
<td>CLI Password:</td>
<td>
<a ng-click="generateClientToken()">Generate Encrypted Password</a>
</td>
</tr>
</table>
</div>
</div> <!-- /Convert -->
</div> <!-- /cor-tab-content -->
<!-- User Settings -->
<div class="settings-section">
<h3>User Settings</h3>
<table class="co-list-table">
<tr>
<td>Username:</td>
<td>
{{ context.viewuser.username }}
<div class="help-text">Usernames cannot currently be changed. Please <a href="/contact">contact support</a> to migrate accounts.</div>
</td>
</tr>
<tr>
<td>Avatar:</td>
<td>
<span class="avatar" size="48" data="context.viewuser.avatar"></span>
<div class="help-text" ng-if="Config.AVATAR_KIND == 'local'">Avatar is generated based off of your username.</div>
<div class="help-text" ng-if="Config.AVATAR_KIND == 'gravatar'">Avatar is served by <a href="http://gravatar.com" rel="nofollow" target="_blank">Gravatar</a> based on the {{ context.viewuser.email }} e-mail address.</div>
</td>
</tr>
<tr quay-show="Features.MAILING">
<td>Email Address:</td>
<td>
<a class="co-modify-link" ng-click="showChangeEmail()">{{ context.viewuser.email }}</a>
</td>
</tr>
<tr quay-show="Config.AUTHENTICATION_TYPE == 'Database'">
<td>Password:</td>
<td>
<a class="co-modify-link" ng-click="showChangePassword()">Change password</a>
</td>
</tr>
<tr quay-show="Config.AUTHENTICATION_TYPE == 'Database'">
<td>Account Type:</td>
<td>
<a class="co-modify-link" ng-click="showChangeAccount()">Individual account</a>
</td>
</tr>
</table>
</div>
<!-- Billing Information -->
<div class="settings-section">
<h3>Billing Information</h3>
<div class="billing-management-panel" user="context.viewuser" is-enabled="showBillingCounter"></div>
</div>
</div> <!-- /cor-tab-content -->
</div>
</div>
<!-- Change email dialog -->
<div class="cor-confirm-dialog"
dialog-context="changeEmailInfo"
dialog-action="changeEmail(info, callback)"
dialog-title="Change E-mail Address"
dialog-action-title="Change Email"
dialog-form="context.emailform">
<form name="context.emailform" class="co-single-field-dialog">
Please enter a new email address. A verification email will be sent before being applied.
<input type="email" class="form-control" placeholder="Your new e-mail address"
ng-model="changeEmailInfo.email" required>
</form>
</div>
<!-- Change password dialog -->
<div class="cor-confirm-dialog"
dialog-context="changePasswordInfo"
dialog-action="changePassword(info, callback)"
dialog-title="Change Password"
dialog-action-title="Change Password"
dialog-form="context.passwordform">
<form name="context.passwordform" class="co-single-field-dialog">
Enter a new password. Passwords must be at least 8 characters in length.
<input type="password" class="form-control" placeholder="Your new password" ng-model="changePasswordInfo.password" required
ng-pattern="/^.{8,}$/">
<input type="password" class="form-control" placeholder="Verify your new password" ng-model="changePasswordInfo.repeatPassword"
match="changePasswordInfo.password" required ng-pattern="/^.{8,}$/">
</form>
</div>
<!-- Convert account dialog -->
<div class="convert-user-to-org" info="convertAccountInfo"></div>
<!-- Modal message dialog -->
<div class="modal fade" id="clientTokenModal">
<div class="co-dialog modal fade" id="clientTokenModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">