1
0
Fork 0

Improve admin tables responsive

This commit is contained in:
Chocobozzz 2021-10-20 11:35:09 +02:00
parent dbb76162b9
commit d94b8ecf7d
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
12 changed files with 124 additions and 35 deletions

View File

@ -41,7 +41,7 @@
<td class="action-cell">
<my-action-dropdown
[ngClass]="{ 'show': expanded }" placement="bottom-right" container="body"
[ngClass]="{ 'show': expanded }" placement="bottom-right auto" container="body"
i18n-label label="Actions" [actions]="videoBlocklistActions" [entry]="videoBlock"
></my-action-dropdown>
</td>
@ -52,11 +52,13 @@
<div class="table-video-image">
<img [src]="videoBlock.video.thumbnailPath">
</div>
<div class="table-video-text">
<div>
<my-global-icon i18n-title title="The video was blocked due to automatic blocking of new videos" *ngIf="videoBlock.type === 2" iconName="robot"></my-global-icon>
{{ videoBlock.video.name }}
</div>
<div class="text-muted">by {{ videoBlock.video.channel?.displayName }} on {{ videoBlock.video.channel?.host }} </div>
</div>
</div>
@ -82,14 +84,12 @@
<td class="expand-cell" colspan="6">
<div class="d-flex moderation-expanded">
<!-- block right part (block details) -->
<div class="col-8">
<span class="col-3 moderation-expanded-label" i18n>Block reason:</span>
<span class="col-9 moderation-expanded-text" [innerHTML]="videoBlock.reasonHtml"></span>
<div class="left">
<span class="moderation-expanded-label" i18n>Block reason:</span>
<span class="moderation-expanded-text" [innerHTML]="videoBlock.reasonHtml"></span>
</div>
<!-- block right part (video embed) -->
<div class="col-4">
<div class="right">
<div class="screenratio">
<div [innerHTML]="videoBlock.embedHtml"></div>
</div>

View File

@ -1,4 +1,5 @@
@use '_mixins' as *;
@use '_variables' as *;
my-global-icon {
width: 24px;

View File

@ -1,7 +1,9 @@
@use '_mixins' as *;
@use '_variables' as *;
my-feed {
@include margin-left(5px);
display: inline-block;
width: 15px;
}
@ -42,3 +44,9 @@ my-global-icon {
}
}
}
@media screen and (max-width: $primeng-breakpoint) {
.video {
align-items: flex-start !important;
}
}

View File

@ -107,6 +107,7 @@
<ng-container *ngIf="jobType === 'all'" i18n>No jobs found.</ng-container>
<ng-container *ngIf="jobType !== 'all'" i18n>No <code>{{ jobType }}</code> jobs found.</ng-container>
</ng-container>
<ng-container *ngIf="jobState !== 'all'">
<ng-container *ngIf="jobType === 'all'" i18n>No <span class="badge" [ngClass]="getJobStateClass(jobState)">{{ jobState }}</span> jobs found.</ng-container>
<ng-container *ngIf="jobType !== 'all'" i18n>No <code>{{ jobType }}</code> jobs found that are <span class="badge" [ngClass]="getJobStateClass(jobState)">{{ jobState }}</span>.</ng-container>

View File

@ -5,6 +5,7 @@
min-width: 120px;
}
@media screen and (min-width: $primeng-breakpoint) {
.job-id {
max-width: 30vw !important;
}
@ -18,6 +19,7 @@
.job-date {
width: 170px !important;
}
}
.admin-sub-header {
flex-direction: row !important;

View File

@ -74,7 +74,7 @@
<p-tableCheckbox [value]="user" ariaLabel="Select this row" i18n-ariaLabel></p-tableCheckbox>
</td>
<td class="expand-cell">
<td class="expand-cell" [ngClass]="{ 'empty-cell': !user.blockedReason }">
<span *ngIf="user.blockedReason" class="expander" [pRowToggler]="user">
<i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
</span>

View File

@ -53,3 +53,13 @@ my-global-icon {
width: auto;
max-width: 100%;
}
@media screen and (max-width: $primeng-breakpoint) {
.progress {
width: 100%;
}
.empty-cell {
padding: 0;
}
}

View File

@ -1,12 +1,12 @@
<div class="d-flex moderation-expanded">
<!-- report left part (report details) -->
<div class="col-8">
<div class="left">
<!-- report metadata -->
<div class="d-flex" *ngIf="isAdminView && abuse.reporterAccount">
<span class="col-3 moderation-expanded-label" i18n>Reporter</span>
<span class="moderation-expanded-label" i18n>Reporter</span>
<span class="col-9 moderation-expanded-text">
<span class="moderation-expanded-text">
<a [routerLink]="[ '.' ]" [queryParams]="{ 'search': 'reporter:&quot;' + abuse.reporterAccount.displayName + '&quot;' }"
class="chip"
>
@ -25,8 +25,8 @@
</div>
<div class="d-flex" *ngIf="abuse.flaggedAccount">
<span class="col-3 moderation-expanded-label" i18n>Reportee</span>
<span class="col-9 moderation-expanded-text">
<span class="moderation-expanded-label" i18n>Reportee</span>
<span class="moderation-expanded-text">
<a [routerLink]="[ '.' ]" [queryParams]="{ 'search': 'reportee:&quot;' +abuse.flaggedAccount.displayName + '&quot;' }"
class="chip"
>
@ -45,22 +45,22 @@
</div>
<div class="d-flex" *ngIf="abuse.updatedAt">
<span class="col-3 moderation-expanded-label" i18n>Updated</span>
<time class="col-9 moderation-expanded-text abuse-details-date-updated">{{ abuse.updatedAt | date: 'medium' }}</time>
<span class="moderation-expanded-label" i18n>Updated</span>
<time class="moderation-expanded-text abuse-details-date-updated">{{ abuse.updatedAt | date: 'medium' }}</time>
</div>
<!-- report text -->
<div class="mt-3 d-flex">
<span class="col-3 moderation-expanded-label">
<span class="moderation-expanded-label">
<ng-container i18n>Report</ng-container>
<a [routerLink]="[ '.' ]" [queryParams]="{ 'search': '#' + abuse.id }" class="ml-1 text-muted">#{{ abuse.id }}</a>
</span>
<span class="col-9 moderation-expanded-text" [innerHTML]="abuse.reasonHtml"></span>
<span class="moderation-expanded-text" [innerHTML]="abuse.reasonHtml"></span>
</div>
<div *ngIf="getPredefinedReasons()" class="mt-2 d-flex">
<span class="col-3"></span>
<span class="col-9">
<span class="></span>
<span class=">
<a *ngFor="let reason of getPredefinedReasons()" [routerLink]="[ '.' ]"
[queryParams]="{ 'search': 'tag:' + reason.id }" class="chip rectangular bg-secondary text-light"
>
@ -70,21 +70,21 @@
</div>
<div *ngIf="abuse.video?.startAt" class="mt-2 d-flex">
<span class="col-3 moderation-expanded-label" i18n>Reported part</span>
<span class="col-9">
<span class="moderation-expanded-label" i18n>Reported part</span>
<span>
{{ startAt }}<ng-container *ngIf="abuse.video.endAt"> - {{ endAt }}</ng-container>
</span>
</div>
<div class="mt-3 d-flex" *ngIf="isAdminView && abuse.moderationComment">
<span class="col-3 moderation-expanded-label" i18n>Note</span>
<span class="col-9 moderation-expanded-text d-block" [innerHTML]="abuse.moderationCommentHtml"></span>
<span class="moderation-expanded-label" i18n>Note</span>
<span class="moderation-expanded-text d-block" [innerHTML]="abuse.moderationCommentHtml"></span>
</div>
</div>
<!-- report right part (video/comment details) -->
<div class="col-4">
<div class="right">
<div *ngIf="abuse.video" class="screenratio">
<div *ngIf="abuse.video.deleted" i18n>The video was deleted</div>
<div *ngIf="!abuse.video.deleted" [innerHTML]="abuse.embedHtml"></div>

View File

@ -5,12 +5,18 @@
.moderation-expanded {
font-size: 90%;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.moderation-expanded-label {
@include margin-right(5px);
font-weight: $font-semibold;
display: inline-block;
vertical-align: top;
text-align: end;
min-width: 100px;
}
.moderation-expanded-text {
@ -21,6 +27,17 @@
margin-bottom: 0 !important;
}
}
.right {
width: 50%;
max-width: 500px;
}
@media screen and (max-width: $primeng-breakpoint) {
.right {
width: 100%;
}
}
}
.screenratio {
@ -125,3 +142,13 @@ my-action-dropdown.show {
}
}
}
my-abuse-details {
width: 100%;
}
@media screen and (max-width: $primeng-breakpoint) {
.abuse-messages {
justify-content: flex-start !important;
}
}

View File

@ -701,6 +701,7 @@
span {
position: absolute;
color: $grey-foreground-color;
@if $small {
top: -1px;
}

View File

@ -98,6 +98,8 @@ $focus-box-shadow-form: 0 0 0 .2rem;
$video-watch-player-factor: math.div(16, 9);
$video-watch-info-margin-left: 44px;
$primeng-breakpoint: 960px;
/*** map theme ***/
// pass variables into a sass map,

View File

@ -768,7 +768,7 @@ p-table {
max-width: 100%;
table {
min-width: breakpoint(lg);
width: 100%;
}
}
@ -979,3 +979,40 @@ p-toast {
font-weight: 600;
}
}
@media screen and (max-width: $primeng-breakpoint) {
p-table {
td {
padding: 3px 0;
&.expand-cell {
padding: 5px;
}
}
.p-datatable-tbody {
td:last-child {
padding-bottom: 15px;
margin-bottom: 15px;
border-bottom: 1px solid $separator-border-color !important;
}
}
}
}
@media screen and (max-width: $mobile-view) {
p-table {
.p-datatable-header {
.caption {
flex-wrap: wrap;
> div {
width: 100%;
padding: 0 !important;
margin-bottom: 5px;
}
}
}
}
}