Skip to content

Commit

Permalink
display reported timestamp in video-abuse-detail
Browse files Browse the repository at this point in the history
  • Loading branch information
rigelk committed Jun 15, 2020
1 parent 0c4a36c commit 6f595e1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@
</span>
</div>

<div *ngIf="videoAbuse.startAt" class="mt-2 d-flex">
<span class="col-3 moderation-expanded-label" i18n>Reported parts</span>
<span class="col-9">
{{ startAt }}<ng-container *ngIf="videoAbuse.endAt"> - {{ endAt }}</ng-container>
</span>
</div>

<div class="mt-3 d-flex" *ngIf="videoAbuse.moderationComment">
<span class="col-3 moderation-expanded-label" i18n>Note</span>
<span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.moderationCommentHtml"></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Actor } from '@app/shared/actor/actor.model'
import { VideoAbusePredefinedReasons } from '../../../../../../shared/models/videos/abuse/video-abuse-reason.model'
import { ProcessedVideoAbuse } from './video-abuse-list.component'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { durationToString } from '@app/shared/misc/utils'

@Component({
selector: 'my-video-abuse-details',
Expand Down Expand Up @@ -30,12 +31,21 @@ export class VideoAbuseDetailsComponent {
}

get predefinedReasons () {
if (!this.videoAbuse.predefinedReasons) return []
return this.videoAbuse.predefinedReasons.map(r => ({
id: r,
label: this.predefinedReasonsTranslations[r]
}))
}

get startAt () {
return durationToString(this.videoAbuse.startAt)
}

get endAt () {
return durationToString(this.videoAbuse.endAt)
}

switchToDefaultAvatar ($event: Event) {
($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL()
}
Expand Down
1 change: 0 additions & 1 deletion client/src/app/shared/video-abuse/video-abuse.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export class VideoAbuseService {
predefinedReasonId: {
prefix: 'tag:',
handler: v => {
console.log(v)
try {
const id = parseInt(v, 10)
return id
Expand Down
3 changes: 1 addition & 2 deletions client/src/app/shared/video/modals/video-report.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ export class VideoReportComponent extends FormReactive implements OnInit {

error: string = null
predefinedReasons: { id: PredefinedReasons, label: string, description?: string, help?: string }[] = []
embedHtml: SafeHtml

private openedModal: NgbModalRef

embedHtml: SafeHtml

constructor (
protected formValidatorService: FormValidatorService,
private modalService: NgbModal,
Expand Down

0 comments on commit 6f595e1

Please sign in to comment.