1
0
Fork 0

Add ability to click on the account in watch page

This commit is contained in:
Chocobozzz 2018-04-17 15:11:12 +02:00
parent 4195cd2bc5
commit 66dc590764
No known key found for this signature in database
GPG key ID: 583A612D890159BE
8 changed files with 24 additions and 14 deletions

View file

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core' import { Component, OnInit } from '@angular/core'
import { Router } from '@angular/router' import { Router, NavigationEnd } from '@angular/router'
import { getParameterByName } from '../shared/misc/utils' import { getParameterByName } from '../shared/misc/utils'
@Component({ @Component({
@ -14,8 +14,11 @@ export class HeaderComponent implements OnInit {
constructor (private router: Router) {} constructor (private router: Router) {}
ngOnInit () { ngOnInit () {
const searchQuery = getParameterByName('search', window.location.href) this.router.events
if (searchQuery) this.searchValue = searchQuery .filter(e => e instanceof NavigationEnd)
.map(() => getParameterByName('search', window.location.href))
.filter(searchQuery => !!searchQuery)
.subscribe(searchQuery => this.searchValue = searchQuery)
} }
doSearch () { doSearch () {

View file

@ -22,8 +22,11 @@
</div> </div>
<div class="video-info-by"> <div class="video-info-by">
By {{ video.by }} <a [routerLink]="[ '/videos', 'search' ]" [queryParams]="{ search: video.account.name }" title="Search videos of this account">
<img [src]="getAvatarPath()" alt="Account avatar" /> By {{ video.by }}
<img [src]="getAvatarPath()" alt="Account avatar" />
</a>
<my-video-feed [syndicationItems]="syndicationItems"></my-video-feed> <my-video-feed [syndicationItems]="syndicationItems"></my-video-feed>
</div> </div>
</div> </div>

View file

@ -73,6 +73,11 @@
align-items: center; align-items: center;
font-size: 13px; font-size: 13px;
a {
color: black;
display: inline-block;
}
img { img {
@include avatar(18px); @include avatar(18px);

View file

@ -7,7 +7,6 @@ import { Subscription } from 'rxjs/Subscription'
import { AuthService } from '../../core/auth' import { AuthService } from '../../core/auth'
import { AbstractVideoList } from '../../shared/video/abstract-video-list' import { AbstractVideoList } from '../../shared/video/abstract-video-list'
import { VideoService } from '../../shared/video/video.service' import { VideoService } from '../../shared/video/video.service'
import { FeedFormat } from '../../../../../shared/models/feeds/feed-format.enum'
@Component({ @Component({
selector: 'my-videos-search', selector: 'my-videos-search',
@ -64,6 +63,6 @@ export class VideoSearchComponent extends AbstractVideoList implements OnInit, O
} }
generateSyndicationList () { generateSyndicationList () {
throw new Error('Method not implemented.') throw new Error('Search does not support syndication.')
} }
} }

View file

@ -91,7 +91,7 @@
"safe-buffer": "^5.0.1", "safe-buffer": "^5.0.1",
"scripty": "^1.5.0", "scripty": "^1.5.0",
"sequelize": "4.37.6", "sequelize": "4.37.6",
"sequelize-typescript": "^0.6.1", "sequelize-typescript": "0.6.4-beta.0",
"sharp": "^0.20.0", "sharp": "^0.20.0",
"uuid": "^3.1.0", "uuid": "^3.1.0",
"validator": "^9.0.0", "validator": "^9.0.0",

View file

@ -418,7 +418,7 @@ async function removeVideo (req: express.Request, res: express.Response) {
} }
async function searchVideos (req: express.Request, res: express.Response, next: express.NextFunction) { async function searchVideos (req: express.Request, res: express.Response, next: express.NextFunction) {
const resultList = await VideoModel.searchAndPopulateAccountAndServerAndTags( const resultList = await VideoModel.searchAndPopulateAccountAndServer(
req.query.search, req.query.search,
req.query.start, req.query.start,
req.query.count, req.query.count,

View file

@ -696,7 +696,7 @@ export class VideoModel extends Model<VideoModel> {
}) })
} }
static async searchAndPopulateAccountAndServerAndTags (value: string, start: number, count: number, sort: string) { static async searchAndPopulateAccountAndServer (value: string, start: number, count: number, sort: string) {
const query: IFindOptions<VideoModel> = { const query: IFindOptions<VideoModel> = {
offset: start, offset: start,
limit: count, limit: count,

View file

@ -4585,7 +4585,7 @@ performance-now@^2.1.0:
version "2.1.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
pfeed@^1.1.2: pfeed@^1.1.5:
version "1.1.5" version "1.1.5"
resolved "https://registry.yarnpkg.com/pfeed/-/pfeed-1.1.5.tgz#6d0ab54209c60b45de03a15efaab7be867a3f71a" resolved "https://registry.yarnpkg.com/pfeed/-/pfeed-1.1.5.tgz#6d0ab54209c60b45de03a15efaab7be867a3f71a"
dependencies: dependencies:
@ -5408,9 +5408,9 @@ send@0.16.2:
range-parser "~1.2.0" range-parser "~1.2.0"
statuses "~1.4.0" statuses "~1.4.0"
sequelize-typescript@^0.6.1: sequelize-typescript@0.6.4-beta.0:
version "0.6.3" version "0.6.4-beta.0"
resolved "https://registry.yarnpkg.com/sequelize-typescript/-/sequelize-typescript-0.6.3.tgz#567ef7d12193c16aac7ee85e5d321e8980fb817d" resolved "https://registry.yarnpkg.com/sequelize-typescript/-/sequelize-typescript-0.6.4-beta.0.tgz#c36e4bfc030dd59b1211967ecace243601b2242e"
dependencies: dependencies:
"@types/bluebird" "3.5.18" "@types/bluebird" "3.5.18"
"@types/node" "6.0.41" "@types/node" "6.0.41"