aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/video-watch
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos/video-watch')
-rw-r--r--client/src/app/videos/video-watch/video-watch.component.html6
-rw-r--r--client/src/app/videos/video-watch/video-watch.component.ts5
2 files changed, 11 insertions, 0 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 a6ec7b20f..2a6b15dc9 100644
--- a/client/src/app/videos/video-watch/video-watch.component.html
+++ b/client/src/app/videos/video-watch/video-watch.component.html
@@ -79,6 +79,12 @@
79 </button> 79 </button>
80 80
81 <ul dropdownMenu id="more-menu" role="menu" aria-labelledby="single-button"> 81 <ul dropdownMenu id="more-menu" role="menu" aria-labelledby="single-button">
82 <li *ngIf="canUserUpdateVideo()" role="menuitem">
83 <a class="dropdown-item" title="Update this video" href="#" [routerLink]="[ '/videos/edit', video.id ]">
84 <span class="glyphicon glyphicon-pencil"></span> Update
85 </a>
86 </li>
87
82 <li role="menuitem"> 88 <li role="menuitem">
83 <a class="dropdown-item" title="Get magnet URI" href="#" (click)="showMagnetUriModal($event)"> 89 <a class="dropdown-item" title="Get magnet URI" href="#" (click)="showMagnetUriModal($event)">
84 <span class="glyphicon glyphicon-magnet"></span> Magnet 90 <span class="glyphicon glyphicon-magnet"></span> Magnet
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 37ed70a99..e04626a67 100644
--- a/client/src/app/videos/video-watch/video-watch.component.ts
+++ b/client/src/app/videos/video-watch/video-watch.component.ts
@@ -187,6 +187,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
187 return this.authService.isLoggedIn(); 187 return this.authService.isLoggedIn();
188 } 188 }
189 189
190 canUserUpdateVideo() {
191 return this.authService.getUser() !== null &&
192 this.authService.getUser().username === this.video.author;
193 }
194
190 private checkUserRating() { 195 private checkUserRating() {
191 // Unlogged users do not have ratings 196 // Unlogged users do not have ratings
192 if (this.isUserLoggedIn() === false) return; 197 if (this.isUserLoggedIn() === false) return;