aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-29 15:35:41 +0200
committerChocobozzz <me@florianbigard.com>2021-07-29 15:35:41 +0200
commit7e8f19603ba314706141f58c9fe8a50eb0ffa7b2 (patch)
tree504524d6c987e0607c24aec8479e3f75b5fcc7bc /client/src/app/+videos
parentaf7fd04a6706fb781e4622167b08dc6c9376f06a (diff)
downloadPeerTube-7e8f19603ba314706141f58c9fe8a50eb0ffa7b2.tar.gz
PeerTube-7e8f19603ba314706141f58c9fe8a50eb0ffa7b2.tar.zst
PeerTube-7e8f19603ba314706141f58c9fe8a50eb0ffa7b2.zip
Redirect to search page for origin instance
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r--client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.html62
-rw-r--r--client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.scss18
-rw-r--r--client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts4
3 files changed, 51 insertions, 33 deletions
diff --git a/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.html b/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.html
index 598bc485d..362a21905 100644
--- a/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.html
+++ b/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.html
@@ -1,54 +1,62 @@
1<div class="video-attribute"> 1<div class="attribute">
2 <span i18n class="video-attribute-label">Privacy</span> 2 <span i18n class="attribute-label">Privacy</span>
3 <span class="video-attribute-value">{{ video.privacy.label }}</span> 3 <span class="attribute-value">{{ video.privacy.label }}</span>
4</div> 4</div>
5 5
6<div *ngIf="video.isLocal === false" class="video-attribute"> 6<div *ngIf="video.isLocal === false" class="attribute">
7 <span i18n class="video-attribute-label">Origin</span> 7 <span i18n class="attribute-label">Origin</span>
8 <a class="video-attribute-value" target="_blank" rel="noopener noreferrer" [href]="getVideoUrl()">{{ video.originInstanceHost }}</a> 8 <a
9 class="attribute-value" target="_blank" rel="noopener noreferrer"
10 routerLink="/search" [queryParams]="{ host: getVideoHost() }"
11 >{{ video.originInstanceHost }}</a>
12
13 <a
14 i18n-title title="Open the video on the origin instance" class="glyphicon glyphicon-new-window"
15 target="_blank" rel="noopener noreferrer" [href]="getVideoUrl()"
16 ></a>
9</div> 17</div>
10 18
11<div *ngIf="!!video.originallyPublishedAt" class="video-attribute"> 19<div *ngIf="!!video.originallyPublishedAt" class="attribute">
12 <span i18n class="video-attribute-label">Originally published</span> 20 <span i18n class="attribute-label">Originally published</span>
13 <span class="video-attribute-value">{{ video.originallyPublishedAt | date: 'dd MMMM yyyy' }}</span> 21 <span class="attribute-value">{{ video.originallyPublishedAt | date: 'dd MMMM yyyy' }}</span>
14</div> 22</div>
15 23
16<div class="video-attribute"> 24<div class="attribute">
17 <span i18n class="video-attribute-label">Category</span> 25 <span i18n class="attribute-label">Category</span>
18 <span *ngIf="!video.category.id" class="video-attribute-value">{{ video.category.label }}</span> 26 <span *ngIf="!video.category.id" class="attribute-value">{{ video.category.label }}</span>
19 <a 27 <a
20 *ngIf="video.category.id" class="video-attribute-value" 28 *ngIf="video.category.id" class="attribute-value"
21 [routerLink]="[ '/search' ]" [queryParams]="{ categoryOneOf: [ video.category.id ] }" 29 [routerLink]="[ '/search' ]" [queryParams]="{ categoryOneOf: [ video.category.id ] }"
22 >{{ video.category.label }}</a> 30 >{{ video.category.label }}</a>
23</div> 31</div>
24 32
25<div class="video-attribute"> 33<div class="attribute">
26 <span i18n class="video-attribute-label">Licence</span> 34 <span i18n class="attribute-label">Licence</span>
27 <span *ngIf="!video.licence.id" class="video-attribute-value">{{ video.licence.label }}</span> 35 <span *ngIf="!video.licence.id" class="attribute-value">{{ video.licence.label }}</span>
28 <a 36 <a
29 *ngIf="video.licence.id" class="video-attribute-value" 37 *ngIf="video.licence.id" class="attribute-value"
30 [routerLink]="[ '/search' ]" [queryParams]="{ licenceOneOf: [ video.licence.id ] }" 38 [routerLink]="[ '/search' ]" [queryParams]="{ licenceOneOf: [ video.licence.id ] }"
31 >{{ video.licence.label }}</a> 39 >{{ video.licence.label }}</a>
32</div> 40</div>
33 41
34<div class="video-attribute"> 42<div class="attribute">
35 <span i18n class="video-attribute-label">Language</span> 43 <span i18n class="attribute-label">Language</span>
36 <span *ngIf="!video.language.id" class="video-attribute-value">{{ video.language.label }}</span> 44 <span *ngIf="!video.language.id" class="attribute-value">{{ video.language.label }}</span>
37 <a 45 <a
38 *ngIf="video.language.id" class="video-attribute-value" 46 *ngIf="video.language.id" class="attribute-value"
39 [routerLink]="[ '/search' ]" [queryParams]="{ languageOneOf: [ video.language.id ] }" 47 [routerLink]="[ '/search' ]" [queryParams]="{ languageOneOf: [ video.language.id ] }"
40 >{{ video.language.label }}</a> 48 >{{ video.language.label }}</a>
41</div> 49</div>
42 50
43<div class="video-attribute video-attribute-tags"> 51<div class="attribute attribute-tags">
44 <span i18n class="video-attribute-label">Tags</span> 52 <span i18n class="attribute-label">Tags</span>
45 <a 53 <a
46 *ngFor="let tag of getVideoTags()" 54 *ngFor="let tag of getVideoTags()"
47 class="video-attribute-value" [routerLink]="[ '/search' ]" [queryParams]="{ tagsOneOf: [ tag ] }" 55 class="attribute-value" [routerLink]="[ '/search' ]" [queryParams]="{ tagsOneOf: [ tag ] }"
48 >{{ tag }}</a> 56 >{{ tag }}</a>
49</div> 57</div>
50 58
51<div class="video-attribute" *ngIf="!video.isLive"> 59<div class="attribute" *ngIf="!video.isLive">
52 <span i18n class="video-attribute-label">Duration</span> 60 <span i18n class="attribute-label">Duration</span>
53 <span class="video-attribute-value">{{ video.duration | myDurationFormatter }}</span> 61 <span class="attribute-value">{{ video.duration | myDurationFormatter }}</span>
54</div> 62</div>
diff --git a/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.scss b/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.scss
index 45190a3e3..26bead124 100644
--- a/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.scss
+++ b/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.scss
@@ -1,13 +1,13 @@
1@use '_variables' as *; 1@use '_variables' as *;
2@use '_mixins' as *; 2@use '_mixins' as *;
3 3
4.video-attribute { 4.attribute {
5 font-size: 13px; 5 font-size: 13px;
6 display: block; 6 display: block;
7 margin-bottom: 12px; 7 margin-bottom: 12px;
8} 8}
9 9
10.video-attribute-label { 10.attribute-label {
11 @include padding-right(5px); 11 @include padding-right(5px);
12 12
13 min-width: 142px; 13 min-width: 142px;
@@ -16,7 +16,7 @@
16 font-weight: $font-bold; 16 font-weight: $font-bold;
17} 17}
18 18
19a.video-attribute-value { 19a.attribute-value {
20 @include disable-default-a-behaviour; 20 @include disable-default-a-behaviour;
21 color: pvar(--mainForegroundColor); 21 color: pvar(--mainForegroundColor);
22 22
@@ -25,16 +25,22 @@ a.video-attribute-value {
25 } 25 }
26} 26}
27 27
28.video-attribute-tags { 28.attribute-tags {
29 .video-attribute-value:not(:nth-child(2)) { 29 .attribute-value:not(:nth-child(2)) {
30 &::before { 30 &::before {
31 content: ', '; 31 content: ', ';
32 } 32 }
33 } 33 }
34} 34}
35 35
36.glyphicon-new-window {
37 color: pvar(--inputPlaceholderColor);
38 margin-left: 5px;
39 font-size: 12px;
40}
41
36@media screen and (max-width: 1600px) { 42@media screen and (max-width: 1600px) {
37 .video-attributes .video-attribute { 43 .attributes .attribute {
38 margin-bottom: 5px; 44 margin-bottom: 5px;
39 } 45 }
40} 46}
diff --git a/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts b/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts
index 5cb77f0c8..9429581ac 100644
--- a/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts
+++ b/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts
@@ -17,6 +17,10 @@ export class VideoAttributesComponent {
17 return this.video.url 17 return this.video.url
18 } 18 }
19 19
20 getVideoHost () {
21 return this.video.channel.host
22 }
23
20 getVideoTags () { 24 getVideoTags () {
21 if (!this.video || Array.isArray(this.video.tags) === false) return [] 25 if (!this.video || Array.isArray(this.video.tags) === false) return []
22 26