Translate the profile main view

This commit is contained in:
Johannes Zellner
2020-10-31 12:24:35 +01:00
parent f2aade3b36
commit 7bad9f3e3e
6 changed files with 154 additions and 65 deletions

View File

@@ -338,40 +338,41 @@
<div class="col-xs-8">
<table width="100%">
<tr>
<td class="text-muted" style="vertical-align: top;">Username</td>
<td class="text-muted" style="vertical-align: top;">{{ 'main.username' | tr }}</td>
<td class="text-right" style="vertical-align: top;">
{{ user.username }} &nbsp;&nbsp;&nbsp;
</td>
</tr>
<tr>
<td class="text-muted" style="vertical-align: top;">Display name</td>
<td class="text-muted" style="vertical-align: top;">{{ 'main.displayName' | tr }}</td>
<td class="text-right" style="vertical-align: top; white-space: nowrap;">
{{ user.displayName }} <a href="" ng-click="displayNameChange.show()" ng-hide="user.source || config.profileLocked"><i class="fa fa-edit text-small"></i></a>
</td>
</tr>
<tr>
<td class="text-muted" style="vertical-align: top;">Primary email</td>
<td class="text-muted" style="vertical-align: top;">{{ 'profile.primaryEmail' | tr }}</td>
<td class="text-right" style="vertical-align: top; white-space: nowrap;">
{{ user.email }} <a href="" ng-click="emailchange.show()" ng-hide="user.source || config.profileLocked"><i class="fa fa-edit text-small"></i></a>
</td>
</tr>
<tr>
<td class="text-muted" style="vertical-align: top;">Password recovery email</td>
<td class="text-muted" style="vertical-align: top;">{{ 'profile.passwordRecoveryEmail' | tr }}</td>
<td class="text-right" style="vertical-align: top; white-space: nowrap;">
{{ user.fallbackEmail }} <a href="" ng-click="fallbackEmailChange.show()" ng-hide="user.source || config.profileLocked"><i class="fa fa-edit text-small"></i></a>
</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr>
<td class="text-muted" style="vertical-align: top;">Language</td>
<td class="text-right" style="vertical-align: top; white-space: nowrap;">
<td class="text-muted" style="vertical-align: middle;">{{ 'profile.language' | tr }}</td>
<td class="text-right" style="vertical-align: middle;">
<multiselect ng-model="language" options="lang.label for lang in languages" data-multiple="false" filter-after-rows="5" scroll-after-rows="10"></multiselect>
</td>
</tr>
<tr>
<td class="text-right" colspan="2" style="vertical-align: top;">
<br/>
<button class="btn btn-primary" ng-click="twoFactorAuthentication.show()">{{ user.twoFactorAuthenticationEnabled ? 'Disable 2FA' : 'Enable 2FA' }}</button>
<button class="btn btn-primary" ng-click="passwordchange.show()" ng-hide="user.source">Change Password</button>
<button class="btn btn-primary" ng-click="twoFactorAuthentication.show()">{{ user.twoFactorAuthenticationEnabled ? 'profile.disable2FA' : 'profile.enable2FA' | tr }}</button>
<button class="btn btn-primary" ng-click="passwordchange.show()" ng-hide="user.source">{{ 'profile.changePassword' | tr }}</button>
</td>
</tr>
</table>
@@ -383,25 +384,25 @@
<br>
<div class="text-left">
<h3>App Passwords<button class="btn btn-primary btn-sm pull-right" ng-click="appPasswordAdd.show()"><i class="fa fa-plus"></i> New Password</button></h3>
<h3>{{ 'profile.appPasswords.title' | tr }}<button class="btn btn-primary btn-sm pull-right" ng-click="appPasswordAdd.show()"><i class="fa fa-plus"></i> {{ 'profile.appPasswords.newPassword' | tr }}</button></h3>
</div>
<div class="card">
<div class="grid-item-top">
<div class="row">
<div class="col-xs-12">
<p>App passwords are a security measure to protect your Cloudron user account. If you need to access a Cloudron app from an untrusted mobile app or client, you can log in with your username and the alternate password generated here.</p>
<p>{{ 'profile.appPasswords.description' | tr }}</p>
<table class="table table-hover">
<thead>
<tr>
<th style="width: 45%">Name</th>
<th style="width: 45%">App</th>
<th style="width: 10%" class="text-right">Actions</th>
<th style="width: 45%">{{ 'profile.appPasswords.name' | tr }}</th>
<th style="width: 45%">{{ 'profile.appPasswords.app' | tr }}</th>
<th style="width: 10%" class="text-right">{{ 'main.actions' | tr }}</th>
</tr>
</thead>
<tbody>
<tr ng-show="appPassword.passwords.length === 0">
<td colspan="3" class="text-center">No App Passwords created</td>
<td colspan="3" class="text-center">{{ 'profile.appPasswords.noPasswordsPlaceholder' | tr }}</td>
</tr>
<tr ng-repeat="password in appPassword.passwords">
<td class="text-left elide-table-cell">
@@ -411,7 +412,7 @@
<span class="arrow">{{ password.label }}</span>
</td>
<td class="text-right no-wrap" style="vertical-align: bottom">
<button class="btn btn-xs btn-danger pull-right" ng-click="appPassword.del(password.id)" title="Delete Password"><i class="far fa-trash-alt"></i></button>
<button class="btn btn-xs btn-danger pull-right" ng-click="appPassword.del(password.id)" uib-tooltip="{{ 'profile.appPasswords.deletePasswordTooltip' | tr }}"><i class="far fa-trash-alt"></i></button>
</td>
</tr>
</tbody>
@@ -424,25 +425,25 @@
<br ng-show="user.isAtLeastAdmin"/>
<div class="text-left" ng-show="user.isAtLeastAdmin">
<h3>API Tokens <button class="btn btn-primary btn-sm pull-right" ng-click="tokens.add.show()"><i class="fa fa-plus"></i> New API Token</button></h3>
<h3>{{ 'profile.apiTokens.title' | tr }} <button class="btn btn-primary btn-sm pull-right" ng-click="tokens.add.show()"><i class="fa fa-plus"></i> {{ 'profile.apiTokens.newApiToken' | tr }}</button></h3>
</div>
<div class="card" ng-show="user.isAtLeastAdmin">
<div class="grid-item-top">
<div class="row">
<div class="col-xs-12">
<p>Use these personal access tokens to authenticate to the <a target="_blank" href="https://docs.cloudron.io/api.html">Cloudron API</a></p>
<p ng-bind-html="'profile.apiTokens.description' | tr:translationData"></p>
<table class="table table-hover" style="margin: 0;">
<thead>
<tr>
<th style="width: 45%">Name</th>
<th style="width: 45%">Expires At</th>
<th style="width: 10%" class="text-right">Actions</th>
<th style="width: 45%">{{ 'profile.apiTokens.name' | tr }}</th>
<th style="width: 45%">{{ 'profile.apiTokens.expiresAt' | tr }}</th>
<th style="width: 10%" class="text-right">{{ 'main.actions' | tr }}</th>
</tr>
</thead>
<tbody>
<tr ng-show="tokens.apiTokens.length === 0">
<td colspan="3" class="text-center">No API Tokens created</td>
<td colspan="3" class="text-center">{{ 'profile.apiTokens.noTokensPlaceholder' | tr }}</td>
</tr>
<tr ng-repeat="token in tokens.apiTokens">
<td class="elide-table-cell" style="text-overflow: ellipsis; white-space: nowrap;">
@@ -452,7 +453,7 @@
{{ token.expires | prettyShortDate }}
</td>
<td class="text-right no-wrap" style="vertical-align: bottom">
<button class="btn btn-xs btn-danger" ng-click="tokens.revokeToken(token)" uib-tooltip="Revoke Token"><i class="far fa-trash-alt"></i></button>
<button class="btn btn-xs btn-danger" ng-click="tokens.revokeToken(token)" uib-tooltip="{{ 'profile.apiTokens.revokeTokenTooltip' | tr }}"><i class="far fa-trash-alt"></i></button>
</td>
</tr>
</tbody>
@@ -465,15 +466,15 @@
<br/>
<div class="text-left">
<h3>Login Tokens</h3>
<h3>{{ 'profile.loginTokens.title' | tr }}</h3>
</div>
<div class="card">
<div class="grid-item-top">
<div class="row">
<div class="col-xs-12">
<p>You have {{ tokens.webadminTokens.length }} active web token(s) and {{ tokens.cliTokens.length }} CLI token(s).</p>
<button class="btn btn-outline btn-danger pull-right" ng-click="tokens.revokeAllWebAndCliTokens()" ng-disabled="tokens.busy"><i class="fa fa-circle-notch fa-spin" ng-show="tokens.busy"></i> Logout From All</button>
<p>{{ 'profile.loginTokens.description' | tr:tokens }}</p>
<button class="btn btn-outline btn-danger pull-right" ng-click="tokens.revokeAllWebAndCliTokens()" ng-disabled="tokens.busy"><i class="fa fa-circle-notch fa-spin" ng-show="tokens.busy"></i> {{ 'profile.loginTokens.logoutAll' | tr }}</button>
<br/>
</div>
</div>