diff options
Diffstat (limited to 'client/src/app/+my-account/my-account-settings')
3 files changed, 17 insertions, 5 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.html b/client/src/app/+my-account/my-account-settings/my-account-settings.component.html index ddcde828c..6fee087fb 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.html +++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.html | |||
@@ -8,13 +8,17 @@ | |||
8 | 8 | ||
9 | <div class="user-quota mb-3"> | 9 | <div class="user-quota mb-3"> |
10 | <div> | 10 | <div> |
11 | <label i18n>Total video quota:</label> | 11 | <div class="progress" i18n-title title="Total video quota"> |
12 | <ng-container i18n>{{ userVideoQuotaUsed | bytes: 0 }} used</ng-container> / {{ userVideoQuota }} | 12 | <div class="progress-bar" role="progressbar" [style]="{ width: userVideoQuotaPercentage + '%' }" [attr.aria-valuenow]="userVideoQuotaUsed" aria-valuemin="0" [attr.aria-valuemax]="userVideoQuota">{{ userVideoQuotaUsed | bytes: 0 }}</div> |
13 | <span class="ml-auto mr-2">{{ userVideoQuota }}</span> | ||
14 | </div> | ||
13 | </div> | 15 | </div> |
14 | 16 | ||
15 | <div *ngIf="hasDailyQuota()"> | 17 | <div *ngIf="hasDailyQuota()" class="mt-3"> |
16 | <label i18n>Daily video quota:</label> | 18 | <div class="progress" i18n-title title="Daily video quota"> |
17 | <ng-container>{{ userVideoQuotaUsedDaily | bytes: 0 }} used</ng-container> / {{ userVideoQuotaDaily }} | 19 | <div class="progress-bar progress-bar-secondary" role="progressbar" [style]="{ width: userVideoQuotaDailyPercentage + '%' }" [attr.aria-valuenow]="userVideoQuotaUsedDaily" aria-valuemin="0" [attr.aria-valuemax]="userVideoQuotaDaily">{{ userVideoQuotaUsedDaily | bytes: 0 }}</div> |
20 | <span class="ml-auto mr-2">{{ userVideoQuotaDaily }}</span> | ||
21 | </div> | ||
18 | </div> | 22 | </div> |
19 | </div> | 23 | </div> |
20 | 24 | ||
diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.scss b/client/src/app/+my-account/my-account-settings/my-account-settings.component.scss index 7eb60c7fb..2b90cc8cf 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.scss +++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.scss | |||
@@ -13,3 +13,7 @@ | |||
13 | .account-title { | 13 | .account-title { |
14 | @include settings-big-title; | 14 | @include settings-big-title; |
15 | } | 15 | } |
16 | |||
17 | .progress { | ||
18 | width: 500px; | ||
19 | } | ||
diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts index ada98401c..5f2db9854 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts | |||
@@ -17,9 +17,11 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked { | |||
17 | 17 | ||
18 | userVideoQuota = '0' | 18 | userVideoQuota = '0' |
19 | userVideoQuotaUsed = 0 | 19 | userVideoQuotaUsed = 0 |
20 | userVideoQuotaPercentage = 15 | ||
20 | 21 | ||
21 | userVideoQuotaDaily = '0' | 22 | userVideoQuotaDaily = '0' |
22 | userVideoQuotaUsedDaily = 0 | 23 | userVideoQuotaUsedDaily = 0 |
24 | userVideoQuotaDailyPercentage = 15 | ||
23 | 25 | ||
24 | constructor ( | 26 | constructor ( |
25 | private viewportScroller: ViewportScroller, | 27 | private viewportScroller: ViewportScroller, |
@@ -40,12 +42,14 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked { | |||
40 | () => { | 42 | () => { |
41 | if (this.user.videoQuota !== -1) { | 43 | if (this.user.videoQuota !== -1) { |
42 | this.userVideoQuota = new BytesPipe().transform(this.user.videoQuota, 0).toString() | 44 | this.userVideoQuota = new BytesPipe().transform(this.user.videoQuota, 0).toString() |
45 | this.userVideoQuotaPercentage = this.user.videoQuota * 100 / this.userVideoQuotaUsed | ||
43 | } else { | 46 | } else { |
44 | this.userVideoQuota = this.i18n('Unlimited') | 47 | this.userVideoQuota = this.i18n('Unlimited') |
45 | } | 48 | } |
46 | 49 | ||
47 | if (this.user.videoQuotaDaily !== -1) { | 50 | if (this.user.videoQuotaDaily !== -1) { |
48 | this.userVideoQuotaDaily = new BytesPipe().transform(this.user.videoQuotaDaily, 0).toString() | 51 | this.userVideoQuotaDaily = new BytesPipe().transform(this.user.videoQuotaDaily, 0).toString() |
52 | this.userVideoQuotaDailyPercentage = this.user.videoQuotaDaily * 100 / this.userVideoQuotaUsedDaily | ||
49 | } else { | 53 | } else { |
50 | this.userVideoQuotaDaily = this.i18n('Unlimited') | 54 | this.userVideoQuotaDaily = this.i18n('Unlimited') |
51 | } | 55 | } |