Empty states for tables
This commit is contained in:
parent
e0a929179a
commit
d384061366
|
@ -41,4 +41,15 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template pTemplate="emptymessage">
|
||||||
|
<tr>
|
||||||
|
<td colspan="6">
|
||||||
|
<div class="empty-table-message">
|
||||||
|
<ng-container *ngIf="search" i18n>No follower found matching current filters.</ng-container>
|
||||||
|
<ng-container *ngIf="!search" i18n>Your instance doesn't have any follower.</ng-container>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</ng-template>
|
||||||
</p-table>
|
</p-table>
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { I18n } from '@ngx-translate/i18n-polyfill'
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-followers-list',
|
selector: 'my-followers-list',
|
||||||
templateUrl: './followers-list.component.html',
|
templateUrl: './followers-list.component.html',
|
||||||
styleUrls: [ './followers-list.component.scss' ]
|
styleUrls: [ '../follows.component.scss', './followers-list.component.scss' ]
|
||||||
})
|
})
|
||||||
export class FollowersListComponent extends RestTable implements OnInit {
|
export class FollowersListComponent extends RestTable implements OnInit {
|
||||||
followers: ActorFollow[] = []
|
followers: ActorFollow[] = []
|
||||||
|
|
|
@ -45,6 +45,17 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template pTemplate="emptymessage">
|
||||||
|
<tr>
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</ng-template>
|
||||||
</p-table>
|
</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)"></my-batch-domains-modal>
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { BatchDomainsModalComponent } from '@app/+admin/config/shared/batch-doma
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-followers-list',
|
selector: 'my-followers-list',
|
||||||
templateUrl: './following-list.component.html',
|
templateUrl: './following-list.component.html',
|
||||||
styleUrls: [ './following-list.component.scss' ]
|
styleUrls: [ '../follows.component.scss', './following-list.component.scss' ]
|
||||||
})
|
})
|
||||||
export class FollowingListComponent extends RestTable implements OnInit {
|
export class FollowingListComponent extends RestTable implements OnInit {
|
||||||
@ViewChild('batchDomainsModal') batchDomainsModal: BatchDomainsModalComponent
|
@ViewChild('batchDomainsModal') batchDomainsModal: BatchDomainsModalComponent
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
|
@import "mixins";
|
||||||
|
|
||||||
.form-sub-title {
|
.form-sub-title {
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
margin-right: 30px;
|
margin-right: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.empty-table-message {
|
||||||
|
@include empty-state;
|
||||||
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width: 40px;"></th>
|
<th style="width: 40px;"></th>
|
||||||
<th style="width: 160px;" i18n *ngIf="isDisplayingRemoteVideos()">Strategy</th>
|
<th style="width: 160px;" i18n *ngIf="isDisplayingRemoteVideos()">Strategy</th>
|
||||||
<th i18n pSortableColumn="name">Video name <p-sortIcon field="name"></p-sortIcon></th>
|
<th i18n pSortableColumn="name">Video name <p-sortIcon field="name"></p-sortIcon></th >
|
||||||
<th i18n>Video URL</th>
|
<th i18n>Video URL</th>
|
||||||
<th style="width: 100px;" i18n *ngIf="isDisplayingRemoteVideos()">Total size</th>
|
<th style="width: 100px;" i18n *ngIf="isDisplayingRemoteVideos()">Total size</th>
|
||||||
<th style="width: 80px;"></th>
|
<th style="width: 80px;"></th>
|
||||||
|
@ -68,6 +68,17 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template pTemplate="emptymessage">
|
||||||
|
<tr>
|
||||||
|
<td colspan="6">
|
||||||
|
<div class="empty-table-message">
|
||||||
|
<ng-container *ngIf="isDisplayingRemoteVideos()" i18n>Your instance doesn't mirror any video.</ng-container>
|
||||||
|
<ng-container *ngIf="!isDisplayingRemoteVideos()" i18n>Your instance has no mirrored videos.</ng-container>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</ng-template>
|
||||||
</p-table>
|
</p-table>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { RedundancyService } from '@app/shared/video/redundancy.service'
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-video-redundancies-list',
|
selector: 'my-video-redundancies-list',
|
||||||
templateUrl: './video-redundancies-list.component.html',
|
templateUrl: './video-redundancies-list.component.html',
|
||||||
styleUrls: [ './video-redundancies-list.component.scss' ]
|
styleUrls: [ '../follows.component.scss', './video-redundancies-list.component.scss' ]
|
||||||
})
|
})
|
||||||
export class VideoRedundanciesListComponent extends RestTable implements OnInit {
|
export class VideoRedundanciesListComponent extends RestTable implements OnInit {
|
||||||
private static LOCAL_STORAGE_DISPLAY_TYPE = 'video-redundancies-list-display-type'
|
private static LOCAL_STORAGE_DISPLAY_TYPE = 'video-redundancies-list-display-type'
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
<ng-template pTemplate="header">
|
<ng-template pTemplate="header">
|
||||||
<tr>
|
<tr>
|
||||||
<th i18n>Account</th>
|
<th style="width: 100%;" i18n>Account</th>
|
||||||
<th style="width: 190px;" i18n pSortableColumn="createdAt">Muted at <p-sortIcon field="createdAt"></p-sortIcon></th>
|
<th style="width: 190px;" i18n pSortableColumn="createdAt">Muted at <p-sortIcon field="createdAt"></p-sortIcon></th>
|
||||||
<th style="width: 100px;"></th> <!-- column for action buttons -->
|
<th style="width: 100px;"></th> <!-- column for action buttons -->
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -25,11 +25,38 @@
|
||||||
|
|
||||||
<ng-template pTemplate="body" let-accountBlock>
|
<ng-template pTemplate="body" let-accountBlock>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ accountBlock.blockedAccount.nameWithHost }}</td>
|
<td>
|
||||||
|
<a [href]="accountBlock.blockedAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer">
|
||||||
|
<div class="chip two-lines">
|
||||||
|
<img
|
||||||
|
class="avatar"
|
||||||
|
[src]="accountBlock.blockedAccount.avatar?.path"
|
||||||
|
(error)="switchToDefaultAvatar($event)"
|
||||||
|
alt="Avatar"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
{{ accountBlock.blockedAccount.displayName }}
|
||||||
|
<span class="text-muted">{{ accountBlock.blockedAccount.nameWithHost }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
|
||||||
<td>{{ accountBlock.createdAt }}</td>
|
<td>{{ accountBlock.createdAt }}</td>
|
||||||
<td class="action-cell">
|
<td class="action-cell">
|
||||||
<button class="unblock-button" (click)="unblockAccount(accountBlock)" i18n>Unmute</button>
|
<button class="unblock-button" (click)="unblockAccount(accountBlock)" i18n>Unmute</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template pTemplate="emptymessage">
|
||||||
|
<tr>
|
||||||
|
<td colspan="6">
|
||||||
|
<div class="empty-table-message">
|
||||||
|
<ng-container *ngIf="search" i18n>No account found matching current filters.</ng-container>
|
||||||
|
<ng-container *ngIf="!search" i18n>No account found.</ng-container>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</ng-template>
|
||||||
</p-table>
|
</p-table>
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { I18n } from '@ngx-translate/i18n-polyfill'
|
||||||
import { RestPagination, RestTable } from '@app/shared'
|
import { RestPagination, RestTable } from '@app/shared'
|
||||||
import { SortMeta } from 'primeng/api'
|
import { SortMeta } from 'primeng/api'
|
||||||
import { AccountBlock, BlocklistService } from '@app/shared/blocklist'
|
import { AccountBlock, BlocklistService } from '@app/shared/blocklist'
|
||||||
|
import { Actor } from '@app/shared/actor/actor.model'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-instance-account-blocklist',
|
selector: 'my-instance-account-blocklist',
|
||||||
|
@ -34,6 +35,10 @@ export class InstanceAccountBlocklistComponent extends RestTable implements OnIn
|
||||||
return 'InstanceAccountBlocklistComponent'
|
return 'InstanceAccountBlocklistComponent'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switchToDefaultAvatar ($event: Event) {
|
||||||
|
($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL()
|
||||||
|
}
|
||||||
|
|
||||||
unblockAccount (accountBlock: AccountBlock) {
|
unblockAccount (accountBlock: AccountBlock) {
|
||||||
const blockedAccount = accountBlock.blockedAccount
|
const blockedAccount = accountBlock.blockedAccount
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
<ng-template pTemplate="header">
|
<ng-template pTemplate="header">
|
||||||
<tr>
|
<tr>
|
||||||
<th i18n>Instance</th>
|
<th style="width: 100%;" i18n>Instance</th>
|
||||||
<th style="width: 190px;" i18n pSortableColumn="createdAt">Muted at <p-sortIcon field="createdAt"></p-sortIcon></th>
|
<th style="width: 190px;" i18n pSortableColumn="createdAt">Muted at <p-sortIcon field="createdAt"></p-sortIcon></th>
|
||||||
<th style="width: 100px;"></th> <!-- column for action buttons -->
|
<th style="width: 100px;"></th> <!-- column for action buttons -->
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -41,6 +41,17 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template pTemplate="emptymessage">
|
||||||
|
<tr>
|
||||||
|
<td colspan="6">
|
||||||
|
<div class="empty-table-message">
|
||||||
|
<ng-container *ngIf="search" i18n>No server found matching current filters.</ng-container>
|
||||||
|
<ng-container *ngIf="!search" i18n>No server found.</ng-container>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</ng-template>
|
||||||
</p-table>
|
</p-table>
|
||||||
|
|
||||||
<my-batch-domains-modal #batchDomainsModal i18n-action action="Mute domains" (domains)="onDomainsToBlock($event)">
|
<my-batch-domains-modal #batchDomainsModal i18n-action action="Mute domains" (domains)="onDomainsToBlock($event)">
|
||||||
|
|
|
@ -15,6 +15,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.empty-table-message {
|
||||||
|
@include empty-state;
|
||||||
|
}
|
||||||
|
|
||||||
.moderation-expanded {
|
.moderation-expanded {
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
<div class="chip two-lines">
|
<div class="chip two-lines">
|
||||||
<img
|
<img
|
||||||
class="avatar"
|
class="avatar"
|
||||||
[src]="videoAbuse.reporterAccount.avatar.path"
|
[src]="videoAbuse.reporterAccount.avatar?.path"
|
||||||
(error)="switchToDefaultAvatar($event)"
|
(error)="switchToDefaultAvatar($event)"
|
||||||
alt="Avatar"
|
alt="Avatar"
|
||||||
>
|
>
|
||||||
|
@ -175,6 +175,17 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template pTemplate="emptymessage">
|
||||||
|
<tr>
|
||||||
|
<td colspan="6">
|
||||||
|
<div class="empty-table-message">
|
||||||
|
<ng-container *ngIf="search" i18n>No video abuses found matching current filters.</ng-container>
|
||||||
|
<ng-container *ngIf="!search" i18n>No video abuses found.</ng-container>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</ng-template>
|
||||||
</p-table>
|
</p-table>
|
||||||
|
|
||||||
<my-moderation-comment-modal #moderationCommentModal (commentUpdated)="onModerationCommentUpdated()"></my-moderation-comment-modal>
|
<my-moderation-comment-modal #moderationCommentModal (commentUpdated)="onModerationCommentUpdated()"></my-moderation-comment-modal>
|
||||||
|
|
|
@ -82,5 +82,16 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template pTemplate="emptymessage">
|
||||||
|
<tr>
|
||||||
|
<td colspan="6">
|
||||||
|
<div class="empty-table-message">
|
||||||
|
<ng-container *ngIf="search" i18n>No blacklisted video found matching current filters.</ng-container>
|
||||||
|
<ng-container *ngIf="!search" i18n>No blacklisted video found.</ng-container>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</ng-template>
|
||||||
</p-table>
|
</p-table>
|
||||||
|
|
||||||
|
|
|
@ -876,6 +876,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@mixin empty-state {
|
||||||
|
min-height: 40vh;
|
||||||
|
max-height: 500px;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
@mixin admin-sub-header-responsive ($horizontal-margins) {
|
@mixin admin-sub-header-responsive ($horizontal-margins) {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue