Commit e4dfae91 authored by Marcelo Rivera's avatar Marcelo Rivera

(feat): allow to pick between the two versions of the entity

1 merge request!782On strike creation create a copy of flagged content for potential jury assessment
Pipeline #117966451 running with stages
......@@ -16,14 +16,49 @@
<p>{{ report.appeal_note }}</p>
</div>
<div
class="m-juryDutySessionContent__entityVersion"
*ngIf="report.original_entity"
>
<ng-container *ngIf="showOriginal">
<span>
Currently displaying the <b>reported</b> version of the entity.
</span>
<a (click)="toggleVersion()">
Show current version
</a>
</ng-container>
<ng-container *ngIf="!showOriginal">
<span>
Currently displaying the <b>current</b> version of the entity.
</span>
<a (click)="toggleVersion()">
Show reported version
</a>
</ng-container>
</div>
<ng-container *ngIf="report.entity; else noEntity">
<minds-card
*ngIf="report.entity"
class=""
[object]="report.entity"
[flags]="{ hideToolbar: true }"
hostClass="mdl-card m-border"
></minds-card>
<ng-container
*ngIf="showOriginal && report.original_entity; else currentVersion"
>
<minds-card
*ngIf="report.original_entity"
[object]="report.original_entity"
[flags]="{ hideToolbar: true }"
hostClass="mdl-card m-border"
></minds-card>
</ng-container>
<ng-template #currentVersion>
<minds-card
*ngIf="report.entity"
[object]="report.entity"
[flags]="{ hideToolbar: true }"
hostClass="mdl-card m-border"
></minds-card>
</ng-template>
</ng-container>
<ng-template #noEntity>
<p>The post could not be loaded. Please overturn the report</p>
......@@ -31,15 +66,15 @@
<div class="m-juryDutySessionContent__options">
<button class="m-btn m-btn--slim" (click)="uphold()">
<ng-container *ngIf="report.is_appeal; else upholdLabel"
>Reject Appeal</ng-container
>
<ng-container *ngIf="report.is_appeal; else upholdLabel">
Reject Appeal
</ng-container>
<ng-template #upholdLabel>Uphold Report</ng-template>
</button>
<button class="m-btn m-btn--slim" (click)="overturn()">
<ng-container *ngIf="report.is_appeal; else overturnLabel"
>Accept Appeal</ng-container
>
<ng-container *ngIf="report.is_appeal; else overturnLabel">
Accept Appeal
</ng-container>
<ng-template #overturnLabel>Overturn Report</ng-template>
</button>
</div>
......
......@@ -84,6 +84,14 @@
}
}
.m-juryDutySessionContent__entityVersion {
padding-top: 8px;
a {
cursor: pointer;
}
}
.m-juryDutySessionContent__options .m-btn {
margin: 16px;
}
import {
Component,
Input,
AfterViewInit,
ViewChild,
ElementRef,
ChangeDetectorRef,
} from '@angular/core';
import { OverlayModalService } from '../../../../services/ux/overlay-modal';
import { Client } from '../../../../services/api';
import { Session } from '../../../../services/session';
import { REASONS } from '../../../../services/list-options';
import { Component, Input } from '@angular/core';
import { JurySessionService } from './session.service';
@Component({
......@@ -19,6 +8,7 @@ import { JurySessionService } from './session.service';
export class JuryDutySessionContentComponent {
@Input() report;
decided: boolean = false;
showOriginal: boolean = true;
constructor(private sessionService: JurySessionService) {}
......@@ -39,6 +29,10 @@ export class JuryDutySessionContentComponent {
return friendlyString;
}
toggleVersion() {
this.showOriginal = !this.showOriginal;
}
async overturn() {
this.decided = true;
await this.sessionService.overturn(this.report);
......
Please register or to comment