aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-25 14:32:19 +0200
committerChocobozzz <me@florianbigard.com>2018-04-25 14:32:19 +0200
commit03e12d7c4954e1071fdeb7ef362ea5c3965d4075 (patch)
treee77e8e6dbf1ee2fcc1644600af5cc404d685083c
parent6b738c7a31591a83fdcd9c78b6b1f98e543c378b (diff)
downloadPeerTube-03e12d7c4954e1071fdeb7ef362ea5c3965d4075.tar.gz
PeerTube-03e12d7c4954e1071fdeb7ef362ea5c3965d4075.tar.zst
PeerTube-03e12d7c4954e1071fdeb7ef362ea5c3965d4075.zip
Add account link in videos list
-rw-r--r--client/src/app/shared/video/video-miniature.component.html2
-rw-r--r--client/src/app/shared/video/video-miniature.component.scss6
-rw-r--r--client/src/app/shared/video/video.model.ts2
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.html2
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.scss10
-rw-r--r--server/models/video/video.ts6
-rw-r--r--server/tests/utils/videos/videos.ts2
-rw-r--r--shared/models/videos/video.model.ts2
8 files changed, 24 insertions, 8 deletions
diff --git a/client/src/app/shared/video/video-miniature.component.html b/client/src/app/shared/video/video-miniature.component.html
index 233432142..d0b305509 100644
--- a/client/src/app/shared/video/video-miniature.component.html
+++ b/client/src/app/shared/video/video-miniature.component.html
@@ -12,6 +12,6 @@
12 </span> 12 </span>
13 13
14 <span class="video-miniature-created-at-views">{{ video.publishedAt | myFromNow }} - {{ video.views | myNumberFormatter }} views</span> 14 <span class="video-miniature-created-at-views">{{ video.publishedAt | myFromNow }} - {{ video.views | myNumberFormatter }} views</span>
15 <span class="video-miniature-account">{{ video.by }}</span> 15 <a class="video-miniature-account" [routerLink]="[ '/account', video.account.id ]">{{ video.by }}</a>
16 </div> 16 </div>
17</div> 17</div>
diff --git a/client/src/app/shared/video/video-miniature.component.scss b/client/src/app/shared/video/video-miniature.component.scss
index ece090828..588eea3a7 100644
--- a/client/src/app/shared/video/video-miniature.component.scss
+++ b/client/src/app/shared/video/video-miniature.component.scss
@@ -39,12 +39,18 @@
39 } 39 }
40 40
41 .video-miniature-account { 41 .video-miniature-account {
42 @include disable-default-a-behaviour;
43
42 display: block; 44 display: block;
43 overflow: hidden; 45 overflow: hidden;
44 text-overflow: ellipsis; 46 text-overflow: ellipsis;
45 white-space: nowrap; 47 white-space: nowrap;
46 font-size: 13px; 48 font-size: 13px;
47 color: #585858; 49 color: #585858;
50
51 &:hover {
52 color: #303030;
53 }
48 } 54 }
49 } 55 }
50} 56}
diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/video/video.model.ts
index a284c1688..2e85f40ef 100644
--- a/client/src/app/shared/video/video.model.ts
+++ b/client/src/app/shared/video/video.model.ts
@@ -35,6 +35,8 @@ export class Video implements VideoServerModel {
35 nsfw: boolean 35 nsfw: boolean
36 36
37 account: { 37 account: {
38 id: number
39 uuid: string
38 name: string 40 name: string
39 displayName: string 41 displayName: string
40 url: string 42 url: string
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 abda5043e..036d75d3c 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.html
+++ b/client/src/app/videos/+video-watch/video-watch.component.html
@@ -23,7 +23,7 @@
23 23
24 <div class="video-info-by"> 24 <div class="video-info-by">
25 <a [routerLink]="[ '/account', video.account.id ]" title="Go the account page"> 25 <a [routerLink]="[ '/account', video.account.id ]" title="Go the account page">
26 By {{ video.by }} 26 <span>By {{ video.by }}</span>
27 <img [src]="getAvatarPath()" alt="Account avatar" /> 27 <img [src]="getAvatarPath()" alt="Account avatar" />
28 </a> 28 </a>
29 </div> 29 </div>
diff --git a/client/src/app/videos/+video-watch/video-watch.component.scss b/client/src/app/videos/+video-watch/video-watch.component.scss
index 1b44f0d6a..b4d9841fe 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.scss
+++ b/client/src/app/videos/+video-watch/video-watch.component.scss
@@ -68,14 +68,16 @@
68 font-size: 15px; 68 font-size: 15px;
69 } 69 }
70 70
71 .video-info-by { 71 .video-info-by a {
72 @include disable-default-a-behaviour;
73
72 display: flex; 74 display: flex;
73 align-items: center; 75 align-items: center;
74 font-size: 13px; 76 font-size: 13px;
77 color: #000;
75 78
76 a { 79 span:hover {
77 color: black; 80 opacity: 0.8;
78 display: inline-block;
79 } 81 }
80 82
81 img { 83 img {
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index f23fac2ab..ea466fccd 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -104,13 +104,13 @@ enum ScopeNames {
104 videoChannelId?: number 104 videoChannelId?: number
105 }) => { 105 }) => {
106 const accountInclude = { 106 const accountInclude = {
107 attributes: [ 'name' ], 107 attributes: [ 'id', 'name' ],
108 model: AccountModel.unscoped(), 108 model: AccountModel.unscoped(),
109 required: true, 109 required: true,
110 where: {}, 110 where: {},
111 include: [ 111 include: [
112 { 112 {
113 attributes: [ 'preferredUsername', 'url', 'serverId', 'avatarId' ], 113 attributes: [ 'id', 'uuid', 'preferredUsername', 'url', 'serverId', 'avatarId' ],
114 model: ActorModel.unscoped(), 114 model: ActorModel.unscoped(),
115 required: true, 115 required: true,
116 where: VideoModel.buildActorWhereWithFilter(options.filter), 116 where: VideoModel.buildActorWhereWithFilter(options.filter),
@@ -1078,6 +1078,8 @@ export class VideoModel extends Model<VideoModel> {
1078 updatedAt: this.updatedAt, 1078 updatedAt: this.updatedAt,
1079 publishedAt: this.publishedAt, 1079 publishedAt: this.publishedAt,
1080 account: { 1080 account: {
1081 id: formattedAccount.id,
1082 uuid: formattedAccount.uuid,
1081 name: formattedAccount.name, 1083 name: formattedAccount.name,
1082 displayName: formattedAccount.displayName, 1084 displayName: formattedAccount.displayName,
1083 url: formattedAccount.url, 1085 url: formattedAccount.url,
diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts
index 2ba3a860b..d1d8c07df 100644
--- a/server/tests/utils/videos/videos.ts
+++ b/server/tests/utils/videos/videos.ts
@@ -486,6 +486,8 @@ async function completeVideoCheck (
486 expect(video.privacy.label).to.deep.equal(VIDEO_PRIVACIES[attributes.privacy]) 486 expect(video.privacy.label).to.deep.equal(VIDEO_PRIVACIES[attributes.privacy])
487 expect(video.nsfw).to.equal(attributes.nsfw) 487 expect(video.nsfw).to.equal(attributes.nsfw)
488 expect(video.description).to.equal(attributes.description) 488 expect(video.description).to.equal(attributes.description)
489 expect(video.account.id).to.be.a('number')
490 expect(video.account.uuid).to.be.a('string')
489 expect(video.account.host).to.equal(attributes.account.host) 491 expect(video.account.host).to.equal(attributes.account.host)
490 expect(video.account.name).to.equal(attributes.account.name) 492 expect(video.account.name).to.equal(attributes.account.name)
491 expect(video.likes).to.equal(attributes.likes) 493 expect(video.likes).to.equal(attributes.likes)
diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts
index 259826689..ba1881da3 100644
--- a/shared/models/videos/video.model.ts
+++ b/shared/models/videos/video.model.ts
@@ -40,6 +40,8 @@ export interface Video {
40 nsfw: boolean 40 nsfw: boolean
41 41
42 account: { 42 account: {
43 id: number
44 uuid: string
43 name: string 45 name: string
44 displayName: string 46 displayName: string
45 url: string 47 url: string