diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-04-26 21:42:36 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-04-26 21:42:36 +0200 |
commit | ab683a8e0d998cfd9dfb9562d3c616f3e6e1dbfd (patch) | |
tree | 8f6d77c733b56a3778156eb717b188a1addc7676 /client/src/app/videos/video-watch | |
parent | 32502eda29f67ef111391d751f61132f8103fda8 (diff) | |
download | PeerTube-ab683a8e0d998cfd9dfb9562d3c616f3e6e1dbfd.tar.gz PeerTube-ab683a8e0d998cfd9dfb9562d3c616f3e6e1dbfd.tar.zst PeerTube-ab683a8e0d998cfd9dfb9562d3c616f3e6e1dbfd.zip |
Format video blacklist
Diffstat (limited to 'client/src/app/videos/video-watch')
-rw-r--r-- | client/src/app/videos/video-watch/video-watch.component.html | 22 | ||||
-rw-r--r-- | client/src/app/videos/video-watch/video-watch.component.ts | 42 |
2 files changed, 33 insertions, 31 deletions
diff --git a/client/src/app/videos/video-watch/video-watch.component.html b/client/src/app/videos/video-watch/video-watch.component.html index 124a3ba8b..5e758401e 100644 --- a/client/src/app/videos/video-watch/video-watch.component.html +++ b/client/src/app/videos/video-watch/video-watch.component.html | |||
@@ -79,17 +79,17 @@ | |||
79 | </a> | 79 | </a> |
80 | </li> | 80 | </li> |
81 | 81 | ||
82 | <li *ngIf="isVideoRemovable()" role="menuitem"> | 82 | <li *ngIf="isVideoRemovable()" role="menuitem"> |
83 | <a class="dropdown-item" title="Delete this video" href="#" (click)="removeVideo($event)"> | 83 | <a class="dropdown-item" title="Delete this video" href="#" (click)="removeVideo($event)"> |
84 | <span class="glyphicon glyphicon-remove"></span> Delete | 84 | <span class="glyphicon glyphicon-remove"></span> Delete |
85 | </a> | 85 | </a> |
86 | </li> | 86 | </li> |
87 | 87 | ||
88 | <li *ngIf="isVideoBlacklistable()" role="menuitem"> | 88 | <li *ngIf="isVideoBlacklistable()" role="menuitem"> |
89 | <a class="dropdown-item" title="Blacklist this video" href="#" (click)="blacklistVideo($event)"> | 89 | <a class="dropdown-item" title="Blacklist this video" href="#" (click)="blacklistVideo($event)"> |
90 | <span class="glyphicon glyphicon-eye-close"></span> Blacklist | 90 | <span class="glyphicon glyphicon-eye-close"></span> Blacklist |
91 | </a> | 91 | </a> |
92 | </li> | 92 | </li> |
93 | </ul> | 93 | </ul> |
94 | </div> | 94 | </div> |
95 | </div> | 95 | </div> |
diff --git a/client/src/app/videos/video-watch/video-watch.component.ts b/client/src/app/videos/video-watch/video-watch.component.ts index f582df45c..07b2a1d1f 100644 --- a/client/src/app/videos/video-watch/video-watch.component.ts +++ b/client/src/app/videos/video-watch/video-watch.component.ts | |||
@@ -171,41 +171,43 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
171 | 171 | ||
172 | removeVideo(event: Event) { | 172 | removeVideo(event: Event) { |
173 | event.preventDefault(); | 173 | event.preventDefault(); |
174 | |||
174 | this.confirmService.confirm('Do you really want to delete this video?', 'Delete').subscribe( | 175 | this.confirmService.confirm('Do you really want to delete this video?', 'Delete').subscribe( |
175 | res => { | 176 | res => { |
176 | if (res === false) return; | 177 | if (res === false) return; |
177 | 178 | ||
178 | this.videoService.removeVideo(this.video.id) | 179 | this.videoService.removeVideo(this.video.id) |
179 | .subscribe( | 180 | .subscribe( |
180 | status => { | 181 | status => { |
181 | this.notificationsService.success('Success', `Video ${this.video.name} deleted.`) | 182 | this.notificationsService.success('Success', `Video ${this.video.name} deleted.`); |
182 | // Go back to the video-list. | 183 | // Go back to the video-list. |
183 | this.router.navigate(['/videos/list']) | 184 | this.router.navigate(['/videos/list']); |
184 | }, | 185 | }, |
185 | 186 | ||
186 | error => this.notificationsService.error('Error', error.text) | 187 | error => this.notificationsService.error('Error', error.text) |
187 | ); | 188 | ); |
188 | } | 189 | } |
189 | ); | 190 | ); |
190 | } | 191 | } |
191 | 192 | ||
192 | blacklistVideo(event: Event) { | 193 | blacklistVideo(event: Event) { |
193 | event.preventDefault() | 194 | event.preventDefault(); |
195 | |||
194 | this.confirmService.confirm('Do you really want to blacklist this video ?', 'Blacklist').subscribe( | 196 | this.confirmService.confirm('Do you really want to blacklist this video ?', 'Blacklist').subscribe( |
195 | res => { | 197 | res => { |
196 | if (res === false) return; | 198 | if (res === false) return; |
197 | 199 | ||
198 | this.videoService.blacklistVideo(this.video.id) | 200 | this.videoService.blacklistVideo(this.video.id) |
199 | .subscribe( | 201 | .subscribe( |
200 | status => { | 202 | status => { |
201 | this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`) | 203 | this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`); |
202 | this.router.navigate(['/videos/list']) | 204 | this.router.navigate(['/videos/list']); |
203 | }, | 205 | }, |
204 | 206 | ||
205 | error => this.notificationsService.error('Error', error.text) | 207 | error => this.notificationsService.error('Error', error.text) |
206 | ) | 208 | ); |
207 | } | 209 | } |
208 | ) | 210 | ); |
209 | } | 211 | } |
210 | 212 | ||
211 | showReportModal(event: Event) { | 213 | showReportModal(event: Event) { |