<div class="user-quota mb-3">
<div>
- <label i18n>Total video quota:</label>
- <ng-container i18n>{{ userVideoQuotaUsed | bytes: 0 }} used</ng-container> / {{ userVideoQuota }}
+ <div class="progress" i18n-title title="Total video quota">
+ <div class="progress-bar" role="progressbar" [style]="{ width: userVideoQuotaPercentage + '%' }" [attr.aria-valuenow]="userVideoQuotaUsed" aria-valuemin="0" [attr.aria-valuemax]="userVideoQuota">{{ userVideoQuotaUsed | bytes: 0 }}</div>
+ <span class="ml-auto mr-2">{{ userVideoQuota }}</span>
+ </div>
</div>
- <div *ngIf="hasDailyQuota()">
- <label i18n>Daily video quota:</label>
- <ng-container>{{ userVideoQuotaUsedDaily | bytes: 0 }} used</ng-container> / {{ userVideoQuotaDaily }}
+ <div *ngIf="hasDailyQuota()" class="mt-3">
+ <div class="progress" i18n-title title="Daily video quota">
+ <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>
+ <span class="ml-auto mr-2">{{ userVideoQuotaDaily }}</span>
+ </div>
</div>
</div>
.account-title {
@include settings-big-title;
}
+
+.progress {
+ width: 500px;
+}
userVideoQuota = '0'
userVideoQuotaUsed = 0
+ userVideoQuotaPercentage = 15
userVideoQuotaDaily = '0'
userVideoQuotaUsedDaily = 0
+ userVideoQuotaDailyPercentage = 15
constructor (
private viewportScroller: ViewportScroller,
() => {
if (this.user.videoQuota !== -1) {
this.userVideoQuota = new BytesPipe().transform(this.user.videoQuota, 0).toString()
+ this.userVideoQuotaPercentage = this.user.videoQuota * 100 / this.userVideoQuotaUsed
} else {
this.userVideoQuota = this.i18n('Unlimited')
}
if (this.user.videoQuotaDaily !== -1) {
this.userVideoQuotaDaily = new BytesPipe().transform(this.user.videoQuotaDaily, 0).toString()
+ this.userVideoQuotaDailyPercentage = this.user.videoQuotaDaily * 100 / this.userVideoQuotaUsedDaily
} else {
this.userVideoQuotaDaily = this.i18n('Unlimited')
}
<div class="actor">
<img [src]="actor.avatarUrl" alt="Avatar" />
+ <div class="actor-img-edit-container">
+ <div class="actor-img-edit-button" [ngbTooltip]="'(extensions: '+ avatarExtensions +', max size: 100KB)'" placement="right" container="body">
+ <my-global-icon iconName="edit"></my-global-icon>
+ <input #avatarfileInput type="file" name="avatarfile" id="avatarfile" [accept]="avatarExtensions" (change)="onAvatarChange()"/>
+ </div>
+ </div>
+
<div class="actor-info">
<div class="actor-info-names">
<div class="actor-info-display-name">{{ actor.displayName }}</div>
<div i18n class="actor-info-followers">{{ actor.followersCount }} subscribers</div>
</div>
</div>
-
- <div class="button-file">
- <span i18n>Change the avatar</span>
- <input #avatarfileInput type="file" name="avatarfile" id="avatarfile" [accept]="avatarExtensions" (change)="onAvatarChange()" />
- </div>
- <div i18n class="file-max-size">(extensions: {{ avatarExtensions }}, max size: {{ maxAvatarSize | bytes }})</div>
</ng-container>
\ No newline at end of file
display: flex;
img {
- @include avatar(50px);
+ @include avatar(100px);
margin-right: 15px;
}
+ .actor-img-edit-container {
+ position: relative;
+ width: 0;
+
+ .actor-img-edit-button {
+ @include peertube-button-file(21px);
+ @include button-with-icon(19px);
+
+ margin-top: 10px;
+ margin-bottom: 5px;
+ border-radius: 50%;
+ top: 55px;
+ right: 45px;
+ cursor: pointer;
+
+ input {
+ width: 30px;
+ height: 30px;
+ }
+
+ my-global-icon {
+ right: 7px;
+ }
+ }
+ }
+
.actor-info {
+ justify-content: center;
+ display: inline-flex;
+ flex-direction: column;
+
.actor-info-names {
display: flex;
align-items: center;
.actor-info-followers {
font-size: 15px;
+ padding-bottom: .5rem;
}
}
}
-
-.button-file {
- @include peertube-button-file(160px);
-
- margin-top: 10px;
- margin-bottom: 5px;
-}
-
-.file-max-size {
- display: inline-block;
- font-size: 13px;
-
- position: relative;
- top: -10px;
-}
</div>
<!-- Hidden because we want to load the component -->
-<form [hidden]="!isUploadingVideo" novalidate [formGroup]="form">
+<form [hidden]="!isUploadingVideo" novalidate [formGroup]="form" class="mb-3">
<my-video-edit
[form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions"
[validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels"
background-color: var(--secondaryColor);
}
}
+
+.progress-bar {
+ background-color: var(--mainColor);
+}
+.progress-bar-secondary {
+ background-color: var(--secondaryColor);
+}
@import '~bootstrap/scss/badge';
//@import '~bootstrap/scss/jumbotron';
@import '~bootstrap/scss/alert';
-//@import '~bootstrap/scss/progress';
+@import '~bootstrap/scss/progress';
//@import '~bootstrap/scss/media';
//@import '~bootstrap/scss/list-group';
@import '~bootstrap/scss/close';