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