]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
fix video update button, add color to danger zone
authorRigel Kent <sendmemail@rigelk.eu>
Wed, 1 Jul 2020 00:08:58 +0000 (02:08 +0200)
committerRigel Kent <par@rigelk.eu>
Wed, 1 Jul 2020 15:03:48 +0000 (17:03 +0200)
12 files changed:
client/src/app/+admin/users/user-edit/user-edit.component.html
client/src/app/+admin/users/user-edit/user-edit.component.scss
client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.scss
client/src/app/+my-account/my-account-settings/my-account-settings.component.html
client/src/app/+my-account/my-account-settings/my-account-settings.component.scss
client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html
client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html
client/src/app/+videos/+video-edit/video-update.component.html
client/src/app/shared/shared-main/buttons/button.component.html
client/src/app/shared/shared-main/buttons/button.component.scss
client/src/app/shared/shared-main/buttons/button.component.ts
client/src/sass/include/_mixins.scss

index 0454df7b70559e1d85a70278f31cb9e164e98638..417bbf618f0b708e072d27dc2ad40614d0cb513b 100644 (file)
       </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>
 <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() }">
index d4c1b600e83888dc2d92a6219c109845a8df376c..a41f1f71c1cd4e26720df7b8d16679367cdb1fcc 100644 (file)
@@ -8,6 +8,10 @@ label {
 
 .account-title {
   @include settings-big-title;
+
+  &.account-title-danger {
+    color: lighten($color: #c54130, $amount: 10);
+  }
 }
 
 input:not([type=submit]) {
index 7f78067323541951ee7ea3b58fd8405473a4f77b..fe78a57a430a3df6620f0d23cd7d5b8a8d1d9d44 100644 (file)
@@ -6,7 +6,7 @@
 
   button {
     @include peertube-button;
-    @include grey-button;
+    @include danger-button;
     @include disable-outline;
   }
 }
\ No newline at end of file
index 185f132751529c7df52246f5ee8188d524037730..eb7bb0d6f56cc6664273e2a9bb1babaa7b97fa74 100644 (file)
@@ -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">
index 3e1792e3e4738bae6843d4dfbb6c6bf9fe8d106d..1cdb1fab40585d3cffa0ecd806a32753f8783f9f 100644 (file)
 
 .account-title {
   @include settings-big-title;
+
+  &.account-title-danger {
+    color: lighten($color: #c54130, $amount: 10);
+  }
 }
 
 .progress {
index c029aabba227eba59e700259a870aeef09b7d8d3..3e07550c1be3d570929af158f09313c11cdf8471 100644 (file)
@@ -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>
 
index 2c40892ee59fab188d406334318eef0182029ca3..8af1687e6b8855d9affaf5600237fc2a4be49c7c 100644 (file)
   <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>
index 1517d499198674816650b5c9cdf1e16a859d2ac0..6c12393955a5ef6cd4f3e901aac815cd92dd47d1 100644 (file)
     ></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>
index d2b0eb81a8a329ed856445ff8850badc09f73949..43e2ca614135b8dcac6c18d3775329a06eebe4b9 100644 (file)
@@ -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>
 
index 5b27af3f4cef2b0f511627ab30463686ea2f5f48..f37decdefa89895414f2dfcb310cfd6a42117649 100644 (file)
@@ -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;
   }
 }
index e23b909458808e9777a04d3356a4b1799069ae46..1d2be0bf92060c6d398f542e59accb4362a63ceb 100644 (file)
@@ -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
+    }
+  }
 }
index ab9f982a27f24f782c220c45ab3c952abae190f2..003936bc30200f0ee283dbdac5d87af5786cda78 100644 (file)
 
 @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);
   }
 }
 
+@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;