1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
import { Component } from '@angular/core';
import { NotificationsService } from 'angular2-notifications';
import { Utils, VideoAbuseService, VideoAbuse} from '../../../shared';
@Component({
selector: 'my-video-abuse-list',
templateUrl: './video-abuse-list.component.html',
styleUrls: [ './video-abuse-list.component.scss' ]
})
export class VideoAbuseListComponent {
videoAbusesSource = null;
tableSettings = {
mode: 'external',
attr: {
class: 'table-hover'
},
hideSubHeader: true,
actions: {
position: 'right',
add: false,
edit: false,
delete: false
},
pager: {
display: true,
perPage: 10
},
columns: {
id: {
title: 'ID',
sortDirection: 'asc'
},
reason: {
title: 'Reason',
sort: false
},
reporterPodHost: {
title: 'Reporter pod host',
sort: false
},
reporterUsername: {
title: 'Reporter username',
sort: false
},
videoId: {
title: 'Video',
type: 'html',
sort: false,
valuePrepareFunction: this.buildVideoLink
},
createdAt: {
title: 'Created Date',
valuePrepareFunction: Utils.dateToHuman
}
}
}
constructor(
private notificationsService: NotificationsService,
private videoAbuseService: VideoAbuseService
) {
this.videoAbusesSource = this.videoAbuseService.getDataSource();
}
buildVideoLink(videoId: string) {
// TODO: transform to routerLink
// https://github.com/akveo/ng2-smart-table/issues/57
return `<a href="/videos/${videoId}" title="Go to the video">${videoId}</a>`;
}
}
|