pull/159/head
Chocobozzz 2017-12-04 11:17:08 +01:00
parent d2cc03aaad
commit be44767854
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
8 changed files with 8 additions and 11 deletions

View File

@ -8,7 +8,7 @@
<div class="video-info">
<div class="video-info-name">{{ video.name }}</div>
<span class="video-info-date-views">{{ video.createdAt | fromNow }} - {{ video.views | numberFormatter }} views</span>
<span class="video-info-date-views">{{ video.createdAt | myFromNow }} - {{ video.views | myNumberFormatter }} views</span>
</div>
<a class="edit-button" [routerLink]="[ '/videos', video.id, '/edit' ]">

View File

@ -1,8 +1,7 @@
import { Component, OnDestroy, OnInit } from '@angular/core'
import { AbstractVideoList } from '../../shared/video/abstract-video-list'
import { ActivatedRoute } from '@angular/router'
import { Router } from '@angular/router'
import { ActivatedRoute, Router } from '@angular/router'
import { NotificationsService } from 'angular2-notifications'
import { AbstractVideoList } from '../../shared/video/abstract-video-list'
import { VideoService } from '../../shared/video/video.service'
@Component({

View File

@ -1,8 +1,7 @@
import { Pipe, PipeTransform } from '@angular/core'
// Thanks: https://stackoverflow.com/questions/3177836/how-to-format-time-since-xxx-e-g-4-minutes-ago-similar-to-stack-exchange-site
@Pipe({name: 'fromNow'})
@Pipe({ name: 'myFromNow' })
export class FromNowPipe implements PipeTransform {
transform (value: number) {

View File

@ -2,7 +2,7 @@ import { Pipe, PipeTransform } from '@angular/core'
// Thanks: https://github.com/danrevah/ngx-pipes/blob/master/src/pipes/math/bytes.ts
@Pipe({name: 'numberFormatter'})
@Pipe({ name: 'myNumberFormatter' })
export class NumberFormatterPipe implements PipeTransform {
private dictionary: Array<{max: number, type: string}> = [
{ max: 1000, type: '' },

View File

@ -11,7 +11,7 @@
</a>
</span>
<span class="video-miniature-created-at-views">{{ video.createdAt | fromNow }} - {{ video.views | numberFormatter }} views</span>
<span class="video-miniature-created-at-views">{{ video.createdAt | myFromNow }} - {{ video.views | myNumberFormatter }} views</span>
<span class="video-miniature-account">{{ video.by }}</span>
</div>
</div>

View File

@ -7,7 +7,7 @@ async function up (utils: {
sequelize: Sequelize.Sequelize,
db: PeerTubeDatabase
}): Promise<void> {
await db.Avatar.sync()
await utils.db.Avatar.sync()
const data = {
type: Sequelize.INTEGER,

View File

@ -13,7 +13,6 @@ import { isActivityPubUrlValid } from '../../helpers/custom-validators/activityp
import { AVATARS_DIR } from '../../initializers'
import { CONFIG, CONSTRAINTS_FIELDS } from '../../initializers/constants'
import { sendDeleteAccount } from '../../lib/activitypub/send/send-delete'
import { AvatarModel } from '../avatar'
import { addMethodsToModel } from '../utils'
import { AccountAttributes, AccountInstance, AccountMethods } from './account-interface'

View File

@ -1,6 +1,6 @@
import * as Sequelize from 'sequelize'
import { addMethodsToModel } from '../utils'
import { AvatarAttributes, AvatarInstance, AvatarMethods } from './avatar-interface'
import { AvatarAttributes, AvatarInstance } from './avatar-interface'
let Avatar: Sequelize.Model<AvatarInstance, AvatarAttributes>