diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-04-10 21:15:28 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-04-10 21:16:36 +0200 |
commit | d8e689b864749648d03cf4391fd4a475126f01cd (patch) | |
tree | 299713e3c056873ba6fff5247b8f49a542f0bf45 /client/src/app/videos/video-watch | |
parent | a184c71b526000f60f00649d260638723d426e6a (diff) | |
download | PeerTube-d8e689b864749648d03cf4391fd4a475126f01cd.tar.gz PeerTube-d8e689b864749648d03cf4391fd4a475126f01cd.tar.zst PeerTube-d8e689b864749648d03cf4391fd4a475126f01cd.zip |
Client: add basic support for updating a video
Diffstat (limited to 'client/src/app/videos/video-watch')
-rw-r--r-- | client/src/app/videos/video-watch/video-watch.component.html | 6 | ||||
-rw-r--r-- | client/src/app/videos/video-watch/video-watch.component.ts | 5 |
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; |