Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

fix video update button, add color to danger zone

Rigel Kent1fe1e14cb30a
diff --git a/client/src/app/+admin/users/user-edit/user-edit.component.html b/client/src/app/+admin/users/user-edit/user-edit.component.html
index 0454df7b70..417bbf618f 100644
--- a/client/src/app/+admin/users/user-edit/user-edit.component.html
+++ b/client/src/app/+admin/users/user-edit/user-edit.component.html
@@ -37,13 +37,13 @@
</a>
</div>
<div>
- <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'reportee:' + user?.account.displayName }">
+ <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'reportee:&quot;' + user?.account.displayName + '&quot;' }">
<div class="dashboard-num">{{ user.videoAbusesCount }}</div>
<div class="dashboard-label" i18n>Incriminated in reports</div>
</a>
</div>
<div>
- <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'reporter:' + user?.account.displayName + ' state:accepted' }">
+ <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'reporter:&quot;' + user?.account.displayName + '&quot; state:accepted' }">
<div class="dashboard-num">{{ user.videoAbusesAcceptedCount }} / {{ user.videoAbusesCreatedCount }}</div>
<div class="dashboard-label" i18n>Authored reports accepted</div>
</a>
@@ -183,7 +183,7 @@
<div *ngIf="!isCreation() && user" class="form-row mt-4"> <!-- danger zone grid -->
<div class="form-group col-12 col-lg-4 col-xl-3">
<div class="anchor" id="danger"></div> <!-- danger zone anchor -->
- <div i18n class="account-title">DANGER ZONE</div>
+ <div i18n class="account-title account-title-danger">DANGER ZONE</div>
</div>
<div class="form-group form-group-right col-12 col-lg-8 col-xl-9" [ngClass]="{ 'form-row': isInBigView() }">
diff --git a/client/src/app/+admin/users/user-edit/user-edit.component.scss b/client/src/app/+admin/users/user-edit/user-edit.component.scss
index d4c1b600e8..a41f1f71c1 100644
--- a/client/src/app/+admin/users/user-edit/user-edit.component.scss
+++ b/client/src/app/+admin/users/user-edit/user-edit.component.scss
@@ -8,6 +8,10 @@ label {
.account-title {
@include settings-big-title;
+
+ &.account-title-danger {
+ color: lighten($color: #c54130, $amount: 10);
+ }
}
input:not([type=submit]) {
diff --git a/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.scss b/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.scss
index 7f78067323..fe78a57a43 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.scss
+++ b/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.scss
@@ -6,7 +6,7 @@
button {
@include peertube-button;
- @include grey-button;
+ @include danger-button;
@include disable-outline;
}
}
\ No newline at end of file
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 185f132751..eb7bb0d6f5 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
@@ -88,7 +88,7 @@
<div class="form-row mt-5"> <!-- danger zone grid -->
<div class="form-group col-12 col-lg-4 col-xl-3">
- <h2 i18n class="account-title">DANGER ZONE</h2>
+ <h2 i18n class="account-title account-title-danger">DANGER ZONE</h2>
</div>
<div class="form-group form-group-right col-12 col-lg-8 col-xl-9">
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 3e1792e3e4..1cdb1fab40 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
@@ -12,6 +12,10 @@
.account-title {
@include settings-big-title;
+
+ &.account-title-danger {
+ color: lighten($color: #c54130, $amount: 10);
+ }
}
.progress {
diff --git a/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html b/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html
index c029aabba2..3e07550c1b 100644
--- a/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html
+++ b/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html
@@ -1,7 +1,9 @@
<h1 class="sr-only" i18n>Imports</h1>
<p-table
- [value]="videoImports" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage"
+ [value]="videoImports" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
+ [showCurrentPageReport]="true" i18n-currentPageReportTemplate
+ currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} imports"
(onPage)="onPage($event)" [expandedRowKeys]="expandedRows"
>
<ng-template pTemplate="header">
@@ -11,7 +13,7 @@
<th style="width: 55%" i18n>Video</th>
<th style="width: 150px" i18n>State</th>
<th style="width: 150px" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
- <th style="width: 60px"></th>
+ <th style="width: 70px"></th>
</tr>
</ng-template>
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html
index 2c40892ee5..8af1687e6b 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html
@@ -79,12 +79,9 @@
<div class="submit-container">
<div i18n *ngIf="videoUploaded === false" class="message-submit">Publish will be available when upload is finished</div>
- <div class="submit-button"
- (click)="updateSecondStep()"
- [ngClass]="{ disabled: isPublishingButtonDisabled() }"
- >
- <my-global-icon iconName="circle-tick" aria-hidden="true"></my-global-icon>
- <input [disabled]="isPublishingButtonDisabled()" type="button" i18n-value value="Publish" />
- </div>
+ <my-button className="orange-button" i18n-label label="Publish" icon="circle-tick"
+ (click)="updateSecondStep()" (keydown.enter)="updateSecondStep()"
+ [disabled]="isPublishingButtonDisabled()"
+ ></my-button>
</div>
</form>
diff --git a/client/src/app/+videos/+video-edit/video-update.component.html b/client/src/app/+videos/+video-edit/video-update.component.html
index 1517d49919..6c12393955 100644
--- a/client/src/app/+videos/+video-edit/video-update.component.html
+++ b/client/src/app/+videos/+video-edit/video-update.component.html
@@ -13,10 +13,10 @@
></my-video-edit>
<div class="submit-container">
- <div class="submit-button" (click)="update()" [ngClass]="{ disabled: !form.valid || isUpdatingVideo === true }">
- <my-global-icon iconName="circle-tick" aria-hidden="true"></my-global-icon>
- <input type="button" i18n-value value="Update" />
- </div>
+ <my-button className="orange-button" i18n-label label="Update" icon="circle-tick"
+ (click)="update()" (keydown.enter)="update()"
+ [disabled]="!form.valid || isUpdatingVideo === true"
+ ></my-button>
</div>
</form>
</div>
diff --git a/client/src/app/shared/shared-main/buttons/button.component.html b/client/src/app/shared/shared-main/buttons/button.component.html
index d2b0eb81a8..43e2ca6141 100644
--- a/client/src/app/shared/shared-main/buttons/button.component.html
+++ b/client/src/app/shared/shared-main/buttons/button.component.html
@@ -1,4 +1,4 @@
-<span class="action-button" [ngClass]="className" [title]="getTitle()">
+<span class="action-button" [ngClass]="getClasses()" [title]="getTitle()">
<my-global-icon *ngIf="!loading" [iconName]="icon"></my-global-icon>
<my-small-loader [loading]="loading"></my-small-loader>
diff --git a/client/src/app/shared/shared-main/buttons/button.component.scss b/client/src/app/shared/shared-main/buttons/button.component.scss
index 5b27af3f4c..f37decdefa 100644
--- a/client/src/app/shared/shared-main/buttons/button.component.scss
+++ b/client/src/app/shared/shared-main/buttons/button.component.scss
@@ -9,9 +9,9 @@ my-small-loader ::ng-deep .root {
.action-button {
@include peertube-button-link;
- @include button-with-icon(21px, 0, -2px);
+ @include button-with-icon(21px, 0, -1px);
- > :nth-child(2) {
+ > span:nth-child(2) {
margin-left: 5px;
}
}
diff --git a/client/src/app/shared/shared-main/buttons/button.component.ts b/client/src/app/shared/shared-main/buttons/button.component.ts
index e23b909458..1d2be0bf92 100644
--- a/client/src/app/shared/shared-main/buttons/button.component.ts
+++ b/client/src/app/shared/shared-main/buttons/button.component.ts
@@ -13,8 +13,16 @@ export class ButtonComponent {
@Input() icon: GlobalIconName = undefined
@Input() title: string = undefined
@Input() loading = false
+ @Input() disabled = false
getTitle () {
return this.title || this.label
}
+
+ getClasses () {
+ return {
+ [this.className]: true,
+ disabled: this.disabled
+ }
+ }
}
diff --git a/client/src/sass/include/_mixins.scss b/client/src/sass/include/_mixins.scss
index ab9f982a27..003936bc30 100644
--- a/client/src/sass/include/_mixins.scss
+++ b/client/src/sass/include/_mixins.scss
@@ -175,11 +175,8 @@
@mixin grey-button {
@include button-focus($grey-button-outline-color);
-
- &, &:active, &:focus {
- background-color: $grey-background-color;
- color: pvar(--greyForegroundColor);
- }
+ background-color: $grey-background-color;
+ color: pvar(--greyForegroundColor);
&:hover, &:active, &:focus, &[disabled], &.disabled {
color: pvar(--greyForegroundColor);
@@ -195,6 +192,27 @@
}
}
+@mixin danger-button {
+ $color: lighten($color: #c54130, $amount: 10);
+ $text: #fff6f5;
+
+ @include button-focus(scale-color($color, $alpha: -95%));
+ background-color: $color;
+ color: $text;
+
+ &:hover, &:active, &:focus, &[disabled], &.disabled {
+ background-color: lighten($color: $color, $amount: 10);
+ }
+
+ &[disabled], &.disabled {
+ cursor: default;
+ }
+
+ my-global-icon {
+ @include apply-svg-color($text)
+ }
+}
+
@mixin peertube-button {
border: none;
font-weight: $font-semibold;