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"> <td class="action-cell">
<my-action-dropdown <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" i18n-label label="Actions" [actions]="videoBlocklistActions" [entry]="videoBlock"
></my-action-dropdown> ></my-action-dropdown>
</td> </td>
@ -52,11 +52,13 @@
<div class="table-video-image"> <div class="table-video-image">
<img [src]="videoBlock.video.thumbnailPath"> <img [src]="videoBlock.video.thumbnailPath">
</div> </div>
<div class="table-video-text"> <div class="table-video-text">
<div> <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> <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 }} {{ videoBlock.video.name }}
</div> </div>
<div class="text-muted">by {{ videoBlock.video.channel?.displayName }} on {{ videoBlock.video.channel?.host }} </div> <div class="text-muted">by {{ videoBlock.video.channel?.displayName }} on {{ videoBlock.video.channel?.host }} </div>
</div> </div>
</div> </div>
@ -82,14 +84,12 @@
<td class="expand-cell" colspan="6"> <td class="expand-cell" colspan="6">
<div class="d-flex moderation-expanded"> <div class="d-flex moderation-expanded">
<!-- block right part (block details) --> <div class="left">
<div class="col-8"> <span class="moderation-expanded-label" i18n>Block reason:</span>
<span class="col-3 moderation-expanded-label" i18n>Block reason:</span> <span class="moderation-expanded-text" [innerHTML]="videoBlock.reasonHtml"></span>
<span class="col-9 moderation-expanded-text" [innerHTML]="videoBlock.reasonHtml"></span>
</div> </div>
<!-- block right part (video embed) --> <div class="right">
<div class="col-4">
<div class="screenratio"> <div class="screenratio">
<div [innerHTML]="videoBlock.embedHtml"></div> <div [innerHTML]="videoBlock.embedHtml"></div>
</div> </div>

View File

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

View File

@ -1,7 +1,9 @@
@use '_mixins' as *; @use '_mixins' as *;
@use '_variables' as *;
my-feed { my-feed {
@include margin-left(5px); @include margin-left(5px);
display: inline-block; display: inline-block;
width: 15px; 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 jobs found.</ng-container>
<ng-container *ngIf="jobType !== 'all'" i18n>No <code>{{ jobType }}</code> jobs found.</ng-container> <ng-container *ngIf="jobType !== 'all'" i18n>No <code>{{ jobType }}</code> jobs found.</ng-container>
</ng-container> </ng-container>
<ng-container *ngIf="jobState !== 'all'"> <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 <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> <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,18 +5,20 @@
min-width: 120px; min-width: 120px;
} }
.job-id { @media screen and (min-width: $primeng-breakpoint) {
max-width: 30vw !important; .job-id {
} max-width: 30vw !important;
}
.job-type, .job-type,
.job-state, .job-state,
.job-priority { .job-priority {
width: 150px !important; width: 150px !important;
} }
.job-date { .job-date {
width: 170px !important; width: 170px !important;
}
} }
.admin-sub-header { .admin-sub-header {

View File

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

View File

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

View File

@ -5,12 +5,18 @@
.moderation-expanded { .moderation-expanded {
font-size: 90%; font-size: 90%;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.moderation-expanded-label { .moderation-expanded-label {
@include margin-right(5px);
font-weight: $font-semibold; font-weight: $font-semibold;
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
text-align: end; text-align: end;
min-width: 100px;
} }
.moderation-expanded-text { .moderation-expanded-text {
@ -21,6 +27,17 @@
margin-bottom: 0 !important; margin-bottom: 0 !important;
} }
} }
.right {
width: 50%;
max-width: 500px;
}
@media screen and (max-width: $primeng-breakpoint) {
.right {
width: 100%;
}
}
} }
.screenratio { .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 { span {
position: absolute; position: absolute;
color: $grey-foreground-color; color: $grey-foreground-color;
@if $small { @if $small {
top: -1px; 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-player-factor: math.div(16, 9);
$video-watch-info-margin-left: 44px; $video-watch-info-margin-left: 44px;
$primeng-breakpoint: 960px;
/*** map theme ***/ /*** map theme ***/
// pass variables into a sass map, // pass variables into a sass map,

View File

@ -768,7 +768,7 @@ p-table {
max-width: 100%; max-width: 100%;
table { table {
min-width: breakpoint(lg); width: 100%;
} }
} }
@ -979,3 +979,40 @@ p-toast {
font-weight: 600; 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;
}
}
}
}
}