Unify paginator disabling when no result is displayable, fix batch domain add for...
authorRigel Kent <sendmemail@rigelk.eu>
Sun, 19 Apr 2020 21:42:06 +0000 (23:42 +0200)
committerRigel Kent <par@rigelk.eu>
Fri, 1 May 2020 14:41:02 +0000 (16:41 +0200)
18 files changed:
client/src/app/+admin/follows/followers-list/followers-list.component.html
client/src/app/+admin/follows/followers-list/followers-list.component.ts
client/src/app/+admin/follows/following-list/following-list.component.html
client/src/app/+admin/follows/following-list/following-list.component.scss
client/src/app/+admin/follows/following-list/following-list.component.ts
client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html
client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.html
client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.html
client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts
client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html
client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.html
client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts
client/src/app/+admin/system/jobs/jobs.component.html
client/src/app/+admin/users/user-list/user-list.component.html
client/src/app/+my-account/my-account-blocklist/my-account-blocklist.component.html
client/src/app/+my-account/my-account-blocklist/my-account-server-blocklist.component.html
client/src/app/+my-account/my-account-ownership/my-account-ownership.component.html
client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html

index d4f2b8dcc9c1859c176ab8c580ac40121b8340ee..41f557510ae05aa8c92c8362371790dc0aa0f62a 100644 (file)
@@ -1,6 +1,8 @@
 <p-table
-  [value]="followers" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
+  [value]="followers" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
   [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
+  [showCurrentPageReport]="true" i18n-currentPageReportTemplate
+  currentPageReportTemplate="Showing {first} to {last} of {totalRecords} followers"
 >
   <ng-template pTemplate="caption">
     <div class="caption">
index 81a91c1d183580f26a52d77ac03d5d8be0713915..00f447bb211f60ac3910b9d2deaae3400a98944a 100644 (file)
@@ -14,7 +14,8 @@ import { I18n } from '@ngx-translate/i18n-polyfill'
 export class FollowersListComponent extends RestTable implements OnInit {
   followers: ActorFollow[] = []
   totalRecords = 0
-  rowsPerPage = 10
+  rowsPerPageOptions = [ 20, 50, 100 ]
+  rowsPerPage = this.rowsPerPageOptions[0]
   sort: SortMeta = { field: 'createdAt', order: -1 }
   pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
 
index e4189d3341beed1586a1cdd2af49a3dc0d8c6cf8..5fb0f490099160135883047ecca32365ab71dafb 100644 (file)
@@ -1,6 +1,8 @@
 <p-table
-  [value]="following" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
+  [value]="following" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
   [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
+  [showCurrentPageReport]="true" i18n-currentPageReportTemplate
+  currentPageReportTemplate="Showing {first} to {last} of {totalRecords} hosts"
 >
   <ng-template pTemplate="caption">
     <div class="caption">
 
   <ng-template pTemplate="body" let-follow>
     <tr>
-      <td>{{ follow.following.host }}</td>
+      <td>
+        <a [href]="'https://' + follow.following.host" i18n-title title="Open instance in a new tab" target="_blank" rel="noopener noreferrer">
+          {{ follow.following.host }}
+          <span class="glyphicon glyphicon-new-window"></span>
+        </a>
+      </td>
 
       <td *ngIf="follow.state === 'accepted'" i18n>Accepted</td>
       <td *ngIf="follow.state === 'pending'" i18n>Pending</td>
       <td colspan="6">
         <div class="empty-table-message">
           <ng-container *ngIf="search" i18n>No host found matching current filters.</ng-container>
-          <ng-container *ngIf="!search" i18n>Your instance is not follwing any host.</ng-container>
+          <ng-container *ngIf="!search" i18n>Your instance is not following anyone.</ng-container>
         </div>
       </td>
     </tr>
   </ng-template>
 </p-table>
 
-<my-batch-domains-modal #batchDomainsModal i18n-action action="Follow domains" (domains)="addFollowing($event)"></my-batch-domains-modal>
+<my-batch-domains-modal #batchDomainsModal i18n-action action="Follow domains" (domains)="addFollowing($event)">
+  <ng-container ngProjectAs="warning">
+    <div i18n *ngIf="httpEnabled() === false"  class="alert alert-warning">
+      It seems that you are not on a HTTPS server. Your webserver needs to have TLS activated in order to follow servers.
+    </div>
+  </ng-container>
+</my-batch-domains-modal>
index f4656b88daac8bb5811c6f9bfd270e0b4514127c..563f8d2bccbe697a6bc24e2bfa71774275913626 100644 (file)
@@ -1,6 +1,20 @@
 @import '_variables';
 @import '_mixins';
 
+a {
+  @include disable-default-a-behaviour;
+  display: inline-block;
+
+  &, &:hover {
+    color: var(--mainForegroundColor);
+  }
+
+  span {
+    font-size: 80%;
+    color: var(--inputPlaceholderColor);
+  }
+}
+
 .caption {
   justify-content: flex-end;
 
index a4dd073026527499fa47d89a2d8d9f47e1f5f193..e1b1f8aeba8b01ec76e08efb4b130b6b4b044b30 100644 (file)
@@ -18,7 +18,8 @@ export class FollowingListComponent extends RestTable implements OnInit {
 
   following: ActorFollow[] = []
   totalRecords = 0
-  rowsPerPage = 10
+  rowsPerPageOptions = [ 20, 50, 100 ]
+  rowsPerPage = this.rowsPerPageOptions[0]
   sort: SortMeta = { field: 'createdAt', order: -1 }
   pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
 
@@ -43,6 +44,10 @@ export class FollowingListComponent extends RestTable implements OnInit {
     this.batchDomainsModal.openModal()
   }
 
+  httpEnabled () {
+    return window.location.protocol === 'https:'
+  }
+
   async addFollowing (hosts: string[]) {
     this.followService.follow(hosts).subscribe(
       () => {
index f3b9809708440a2c08365655859f35c1b155db17..debde2f856cc392c4e3080c96c0362d37f92f2b0 100644 (file)
@@ -12,7 +12,7 @@
 </div>
 
 <p-table
-  [value]="videoRedundancies" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
+  [value]="videoRedundancies" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage"
   [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
 >
   <ng-template pTemplate="header">
index df0a8247ee5242b137b5b7e6a94cf7bb9dd705ba..ffc8a8e399eafa650b00cba392276dce06b31dd0 100644 (file)
@@ -1,5 +1,5 @@
 <p-table
-  [value]="blockedAccounts" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
+  [value]="blockedAccounts" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
   [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
   [showCurrentPageReport]="true" i18n-currentPageReportTemplate
   currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} muted accounts"
index d4e6933afef5ab89273fd976d9c4e33a779a6c7e..d1098800bfdb421b2862bfcb7f638e6ee09065a8 100644 (file)
@@ -1,5 +1,5 @@
 <p-table
-  [value]="blockedServers" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
+  [value]="blockedServers" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
   [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
   [showCurrentPageReport]="true" i18n-currentPageReportTemplate
   currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} muted instances"
   </ng-template>
 </p-table>
 
-<my-batch-domains-modal #batchDomainsModal i18n-action action="Mute domains" (domains)="onDomainsToBlock($event)">
-  <ng-container ngProjectAs="warning">
-    <div i18n *ngIf="httpEnabled() === false"  class="alert alert-warning">
-      It seems that you are not on a HTTPS server. Your webserver needs to have TLS activated in order to follow servers.
-    </div>
-  </ng-container>
-</my-batch-domains-modal>
+<my-batch-domains-modal #batchDomainsModal i18n-action action="Mute domains" (domains)="onDomainsToBlock($event)"></my-batch-domains-modal>
index 4efadc3861191ed60e6f817472cd6c84164f5ea4..344e2d135d27d0259cf91b73779d4b22c72e22d1 100644 (file)
@@ -51,10 +51,6 @@ export class InstanceServerBlocklistComponent extends RestTable implements OnIni
       )
   }
 
-  httpEnabled () {
-    return window.location.protocol === 'https:'
-  }
-
   addServersToBlock () {
     this.batchDomainsModal.openModal()
   }
index 9e084cb73700de59b2f25518513688fc299320b4..6dacfe243fd7b0dd0d6cb5a1a03012acbca7e72c 100644 (file)
 
               <!-- report text -->
               <div class="mt-3 d-flex">
-                <span class="col-3 moderation-expanded-label" i18n>Report</span>
+                <span class="col-3 moderation-expanded-label" i18n>Report #{{ videoAbuse.id }}</span>
                 <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.reasonHtml"></span>
               </div>
               <div class="mt-3 d-flex" *ngIf="videoAbuse.moderationComment">
index eade57b71ccd7f4630bc1238d09b54f7642a8b65..5eabcb37f0018619aebc99db13d8b3c8903cfb0a 100644 (file)
@@ -1,5 +1,5 @@
 <p-table
-  [value]="blacklist" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
+  [value]="blacklist" [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}'}} blacklisted videos"
index f18c2e6ca3ff8f037555b97bf10989c3eee41523..a8973f2b2d6887e5966476ecedd0a90deb4d6475 100644 (file)
@@ -89,10 +89,10 @@ export class PluginListInstalledComponent implements OnInit {
 
   getNoResultMessage () {
     if (this.pluginType === PluginType.PLUGIN) {
-      return this.i18n('You don\'t have plugins installed yet.')
+      return this.i18n("You don't have plugins installed yet.")
     }
 
-    return this.i18n('You don\'t have themes installed yet.')
+    return this.i18n("You don't have themes installed yet.")
   }
 
   isUpdateAvailable (plugin: PeerTubePlugin) {
index e9765ca7738d3db188ab6e6ff297b91e98c19bb8..0e31db5477c90d282106ce26b915322a9d3af4ef 100644 (file)
@@ -19,7 +19,7 @@
 </div>
 
 <p-table
-  [value]="jobs" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" dataKey="uniqId"
+  [value]="jobs" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" dataKey="uniqId"
   [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" [first]="pagination.start"
   [tableStyle]="{'table-layout':'auto'}"
 >
index a555af4c43db04804f3849e3949425811f94d56e..e7624f48f6d5a39e310c617ef04c498d2702470d 100644 (file)
@@ -8,7 +8,7 @@
 </div>
 
 <p-table
-  [value]="users" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
+  [value]="users" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage"
   [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
   [(selection)]="selectedUsers"
   [showCurrentPageReport]="true" i18n-currentPageReportTemplate
index 8a93bc9b4f7381ac1eb625d48a38dc87b54dbf54..fb9e6546ed71930f487595b49a7a78969662d488 100644 (file)
@@ -3,7 +3,7 @@
 </div>
 
 <p-table
-  [value]="blockedAccounts" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
+  [value]="blockedAccounts" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage"
   [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
 >
 
index 0f7ca1f85ce66105f7d86e49b10d2be01fd3ce02..6359b4461b707ee0d732428590803437830c70a2 100644 (file)
@@ -3,7 +3,7 @@
 </div>
 
 <p-table
-  [value]="blockedServers" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
+  [value]="blockedServers" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage"
   [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
 >
 
index c5fd3ccb9e3818c46272bcc345315931ca65cf79..354176a116ef9555219425b53768ea1ff81240f9 100644 (file)
@@ -1,7 +1,7 @@
 <p-table
     [value]="videoChangeOwnerships"
     [lazy]="true"
-    [paginator]="true"
+    [paginator]="totalRecords > 0"
     [totalRecords]="totalRecords"
     [rows]="rowsPerPage"
     [sortField]="sort.field"
index b67c053e6ae7bc8c9bbac831a4872c1faed8b6b5..4b1856b51d5afc1ddc89edf2aab5cce0d853c1f0 100644 (file)
@@ -1,5 +1,5 @@
 <p-table
-  [value]="videoImports" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
+  [value]="videoImports" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage"
   [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
 >
   <ng-template pTemplate="header">