aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-17 15:11:12 +0200
committerChocobozzz <me@florianbigard.com>2018-04-17 15:11:12 +0200
commit66dc59076413b9a4aa0899d3192b0bdf03ee654d (patch)
tree7743a66a4d7a9fb1dba1d4d744c059dcd35c9224
parent4195cd2bc5046d4cdf1c677c27cd41f427d7a13a (diff)
downloadPeerTube-66dc59076413b9a4aa0899d3192b0bdf03ee654d.tar.gz
PeerTube-66dc59076413b9a4aa0899d3192b0bdf03ee654d.tar.zst
PeerTube-66dc59076413b9a4aa0899d3192b0bdf03ee654d.zip
Add ability to click on the account in watch page
-rw-r--r--client/src/app/header/header.component.ts9
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.html7
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.scss5
-rw-r--r--client/src/app/videos/video-list/video-search.component.ts3
-rw-r--r--package.json2
-rw-r--r--server/controllers/api/videos/index.ts2
-rw-r--r--server/models/video/video.ts2
-rw-r--r--yarn.lock8
8 files changed, 24 insertions, 14 deletions
diff --git a/client/src/app/header/header.component.ts b/client/src/app/header/header.component.ts
index 6b0ee67ff..42de2dd92 100644
--- a/client/src/app/header/header.component.ts
+++ b/client/src/app/header/header.component.ts
@@ -1,5 +1,5 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { Router } from '@angular/router' 2import { Router, NavigationEnd } from '@angular/router'
3import { getParameterByName } from '../shared/misc/utils' 3import { getParameterByName } from '../shared/misc/utils'
4 4
5@Component({ 5@Component({
@@ -14,8 +14,11 @@ export class HeaderComponent implements OnInit {
14 constructor (private router: Router) {} 14 constructor (private router: Router) {}
15 15
16 ngOnInit () { 16 ngOnInit () {
17 const searchQuery = getParameterByName('search', window.location.href) 17 this.router.events
18 if (searchQuery) this.searchValue = searchQuery 18 .filter(e => e instanceof NavigationEnd)
19 .map(() => getParameterByName('search', window.location.href))
20 .filter(searchQuery => !!searchQuery)
21 .subscribe(searchQuery => this.searchValue = searchQuery)
19 } 22 }
20 23
21 doSearch () { 24 doSearch () {
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 52e3e429a..91e590094 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.html
+++ b/client/src/app/videos/+video-watch/video-watch.component.html
@@ -22,8 +22,11 @@
22 </div> 22 </div>
23 23
24 <div class="video-info-by"> 24 <div class="video-info-by">
25 By {{ video.by }} 25 <a [routerLink]="[ '/videos', 'search' ]" [queryParams]="{ search: video.account.name }" title="Search videos of this account">
26 <img [src]="getAvatarPath()" alt="Account avatar" /> 26 By {{ video.by }}
27 <img [src]="getAvatarPath()" alt="Account avatar" />
28 </a>
29
27 <my-video-feed [syndicationItems]="syndicationItems"></my-video-feed> 30 <my-video-feed [syndicationItems]="syndicationItems"></my-video-feed>
28 </div> 31 </div>
29 </div> 32 </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 8a3e2584b..3ebeccd4b 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.scss
+++ b/client/src/app/videos/+video-watch/video-watch.component.scss
@@ -73,6 +73,11 @@
73 align-items: center; 73 align-items: center;
74 font-size: 13px; 74 font-size: 13px;
75 75
76 a {
77 color: black;
78 display: inline-block;
79 }
80
76 img { 81 img {
77 @include avatar(18px); 82 @include avatar(18px);
78 83
diff --git a/client/src/app/videos/video-list/video-search.component.ts b/client/src/app/videos/video-list/video-search.component.ts
index ef9afa757..46a9dd48e 100644
--- a/client/src/app/videos/video-list/video-search.component.ts
+++ b/client/src/app/videos/video-list/video-search.component.ts
@@ -7,7 +7,6 @@ import { Subscription } from 'rxjs/Subscription'
7import { AuthService } from '../../core/auth' 7import { AuthService } from '../../core/auth'
8import { AbstractVideoList } from '../../shared/video/abstract-video-list' 8import { AbstractVideoList } from '../../shared/video/abstract-video-list'
9import { VideoService } from '../../shared/video/video.service' 9import { VideoService } from '../../shared/video/video.service'
10import { FeedFormat } from '../../../../../shared/models/feeds/feed-format.enum'
11 10
12@Component({ 11@Component({
13 selector: 'my-videos-search', 12 selector: 'my-videos-search',
@@ -64,6 +63,6 @@ export class VideoSearchComponent extends AbstractVideoList implements OnInit, O
64 } 63 }
65 64
66 generateSyndicationList () { 65 generateSyndicationList () {
67 throw new Error('Method not implemented.') 66 throw new Error('Search does not support syndication.')
68 } 67 }
69} 68}
diff --git a/package.json b/package.json
index e3007bea9..6a6275fb9 100644
--- a/package.json
+++ b/package.json
@@ -91,7 +91,7 @@
91 "safe-buffer": "^5.0.1", 91 "safe-buffer": "^5.0.1",
92 "scripty": "^1.5.0", 92 "scripty": "^1.5.0",
93 "sequelize": "4.37.6", 93 "sequelize": "4.37.6",
94 "sequelize-typescript": "^0.6.1", 94 "sequelize-typescript": "0.6.4-beta.0",
95 "sharp": "^0.20.0", 95 "sharp": "^0.20.0",
96 "uuid": "^3.1.0", 96 "uuid": "^3.1.0",
97 "validator": "^9.0.0", 97 "validator": "^9.0.0",
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index 244099015..b4cd67158 100644
--- a/server/controllers/api/videos/index.ts
+++ b/server/controllers/api/videos/index.ts
@@ -418,7 +418,7 @@ async function removeVideo (req: express.Request, res: express.Response) {
418} 418}
419 419
420async function searchVideos (req: express.Request, res: express.Response, next: express.NextFunction) { 420async function searchVideos (req: express.Request, res: express.Response, next: express.NextFunction) {
421 const resultList = await VideoModel.searchAndPopulateAccountAndServerAndTags( 421 const resultList = await VideoModel.searchAndPopulateAccountAndServer(
422 req.query.search, 422 req.query.search,
423 req.query.start, 423 req.query.start,
424 req.query.count, 424 req.query.count,
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index ffb9725b4..a7923b477 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -696,7 +696,7 @@ export class VideoModel extends Model<VideoModel> {
696 }) 696 })
697 } 697 }
698 698
699 static async searchAndPopulateAccountAndServerAndTags (value: string, start: number, count: number, sort: string) { 699 static async searchAndPopulateAccountAndServer (value: string, start: number, count: number, sort: string) {
700 const query: IFindOptions<VideoModel> = { 700 const query: IFindOptions<VideoModel> = {
701 offset: start, 701 offset: start,
702 limit: count, 702 limit: count,
diff --git a/yarn.lock b/yarn.lock
index 2b445860f..73488620a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4585,7 +4585,7 @@ performance-now@^2.1.0:
4585 version "2.1.0" 4585 version "2.1.0"
4586 resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" 4586 resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
4587 4587
4588pfeed@^1.1.2: 4588pfeed@^1.1.5:
4589 version "1.1.5" 4589 version "1.1.5"
4590 resolved "https://registry.yarnpkg.com/pfeed/-/pfeed-1.1.5.tgz#6d0ab54209c60b45de03a15efaab7be867a3f71a" 4590 resolved "https://registry.yarnpkg.com/pfeed/-/pfeed-1.1.5.tgz#6d0ab54209c60b45de03a15efaab7be867a3f71a"
4591 dependencies: 4591 dependencies:
@@ -5408,9 +5408,9 @@ send@0.16.2:
5408 range-parser "~1.2.0" 5408 range-parser "~1.2.0"
5409 statuses "~1.4.0" 5409 statuses "~1.4.0"
5410 5410
5411sequelize-typescript@^0.6.1: 5411sequelize-typescript@0.6.4-beta.0:
5412 version "0.6.3" 5412 version "0.6.4-beta.0"
5413 resolved "https://registry.yarnpkg.com/sequelize-typescript/-/sequelize-typescript-0.6.3.tgz#567ef7d12193c16aac7ee85e5d321e8980fb817d" 5413 resolved "https://registry.yarnpkg.com/sequelize-typescript/-/sequelize-typescript-0.6.4-beta.0.tgz#c36e4bfc030dd59b1211967ecace243601b2242e"
5414 dependencies: 5414 dependencies:
5415 "@types/bluebird" "3.5.18" 5415 "@types/bluebird" "3.5.18"
5416 "@types/node" "6.0.41" 5416 "@types/node" "6.0.41"