aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-02-14 11:47:01 +0100
committerChocobozzz <me@florianbigard.com>2023-02-14 11:51:44 +0100
commit98bd5e2256bfdeba6d5ab07f0421acfde1a0de26 (patch)
treea1193f1af10f0da7a532d4aa6d5045e51c3d16a9 /client/src/app/+videos
parent4ea827076df39935375d66fffb5e1e27e667111e (diff)
downloadPeerTube-98bd5e2256bfdeba6d5ab07f0421acfde1a0de26.tar.gz
PeerTube-98bd5e2256bfdeba6d5ab07f0421acfde1a0de26.tar.zst
PeerTube-98bd5e2256bfdeba6d5ab07f0421acfde1a0de26.zip
Refactor login redirection/button links
Correctly handle external auth redirection in all cases
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r--client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.ts2
-rw-r--r--client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.html5
-rw-r--r--client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts7
3 files changed, 2 insertions, 12 deletions
diff --git a/client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.ts b/client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.ts
index 0fef246b3..d0c138834 100644
--- a/client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.ts
+++ b/client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.ts
@@ -82,7 +82,7 @@ export class VideoRateComponent implements OnInit, OnChanges, OnDestroy {
82 getRatePopoverText () { 82 getRatePopoverText () {
83 if (this.isUserLoggedIn) return undefined 83 if (this.isUserLoggedIn) return undefined
84 84
85 return $localize`You need to be <a href="/login">logged in</a> to rate this video.` 85 return $localize`You need to be logged in to rate this video.`
86 } 86 }
87 87
88 private checkUserRating () { 88 private checkUserRating () {
diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.html b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.html
index 6bc201f32..203e9ce62 100644
--- a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.html
+++ b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.html
@@ -74,10 +74,7 @@
74 (click)="hideModals()" (key.enter)="hideModals()" 74 (click)="hideModals()" (key.enter)="hideModals()"
75 > 75 >
76 76
77 <input 77 <my-login-link i18n-label label="Login to comment" className="peertube-button-link orange-button"></my-login-link>
78 type="submit" i18n-value value="Login to comment" class="peertube-button orange-button"
79 (click)="gotoLogin()"
80 >
81 </div> 78 </div>
82</ng-template> 79</ng-template>
83 80
diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts
index 9a9bfe710..033097084 100644
--- a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts
+++ b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts
@@ -13,7 +13,6 @@ import {
13 SimpleChanges, 13 SimpleChanges,
14 ViewChild 14 ViewChild
15} from '@angular/core' 15} from '@angular/core'
16import { Router } from '@angular/router'
17import { Notifier, User } from '@app/core' 16import { Notifier, User } from '@app/core'
18import { VIDEO_COMMENT_TEXT_VALIDATOR } from '@app/shared/form-validators/video-comment-validators' 17import { VIDEO_COMMENT_TEXT_VALIDATOR } from '@app/shared/form-validators/video-comment-validators'
19import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' 18import { FormReactive, FormReactiveService } from '@app/shared/shared-forms'
@@ -52,7 +51,6 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges,
52 private notifier: Notifier, 51 private notifier: Notifier,
53 private videoCommentService: VideoCommentService, 52 private videoCommentService: VideoCommentService,
54 private modalService: NgbModal, 53 private modalService: NgbModal,
55 private router: Router,
56 @Inject(LOCALE_ID) private localeId: string 54 @Inject(LOCALE_ID) private localeId: string
57 ) { 55 ) {
58 super() 56 super()
@@ -161,11 +159,6 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges,
161 return window.location.href 159 return window.location.href
162 } 160 }
163 161
164 gotoLogin () {
165 this.hideModals()
166 this.router.navigate([ '/login' ])
167 }
168
169 cancelCommentReply () { 162 cancelCommentReply () {
170 this.cancel.emit(null) 163 this.cancel.emit(null)
171 this.form.value['text'] = this.textareaElement.nativeElement.value = '' 164 this.form.value['text'] = this.textareaElement.nativeElement.value = ''