From 4bb6886d28cc5333bbe1523674bf5db141af456f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 23 Apr 2018 16:16:05 +0200 Subject: Rename account module to my-account --- .../account-videos/account-videos.component.html | 45 ------- .../account-videos/account-videos.component.scss | 114 ------------------ .../account-videos/account-videos.component.ts | 133 --------------------- 3 files changed, 292 deletions(-) delete mode 100644 client/src/app/account/account-videos/account-videos.component.html delete mode 100644 client/src/app/account/account-videos/account-videos.component.scss delete mode 100644 client/src/app/account/account-videos/account-videos.component.ts (limited to 'client/src/app/account/account-videos') diff --git a/client/src/app/account/account-videos/account-videos.component.html b/client/src/app/account/account-videos/account-videos.component.html deleted file mode 100644 index 66ce3a77b..000000000 --- a/client/src/app/account/account-videos/account-videos.component.html +++ /dev/null @@ -1,45 +0,0 @@ -
No results.
- -
-
-
-
- - -
- - - -
- {{ video.name }} - {{ video.createdAt | myFromNow }} - {{ video.views | myNumberFormatter }} views -
{{ video.privacy.label }}
-
- - -
-
- - Cancel - - - - - Delete - -
-
- -
- - - -
-
-
-
diff --git a/client/src/app/account/account-videos/account-videos.component.scss b/client/src/app/account/account-videos/account-videos.component.scss deleted file mode 100644 index f276ea389..000000000 --- a/client/src/app/account/account-videos/account-videos.component.scss +++ /dev/null @@ -1,114 +0,0 @@ -@import '_variables'; -@import '_mixins'; - -.action-selection-mode { - width: 174px; - display: flex; - justify-content: flex-end; - - .action-selection-mode-child { - position: fixed; - - .action-button { - display: inline-block; - } - - .action-button-cancel-selection { - @include peertube-button; - @include grey-button; - - margin-right: 10px; - } - - .action-button-delete-selection { - @include peertube-button; - @include orange-button; - } - - .icon.icon-delete-white { - @include icon(21px); - - position: relative; - top: -2px; - background-image: url('../../../assets/images/global/delete-white.svg'); - } - } -} - -/deep/ .action-button { - &.action-button-delete { - margin-right: 10px; - } -} - -.video { - display: flex; - min-height: 130px; - padding-bottom: 20px; - margin-bottom: 20px; - border-bottom: 1px solid #C6C6C6; - - &:first-child { - margin-top: 47px; - } - - .checkbox-container { - display: flex; - align-items: center; - margin-right: 20px; - margin-left: 12px; - - input[type=checkbox] { - @include peertube-checkbox(2px); - } - } - - my-video-thumbnail { - margin-right: 10px; - } - - .video-info { - flex-grow: 1; - - .video-info-name { - @include disable-default-a-behaviour; - - color: #000; - display: block; - font-size: 16px; - font-weight: $font-semibold; - } - - .video-info-date-views, .video-info-private { - font-size: 13px; - - &.video-info-private { - font-weight: $font-semibold; - } - } - } - - .video-buttons { - min-width: 190px; - } -} - -@media screen and (max-width: 800px) { - .video { - flex-direction: column; - height: auto; - text-align: center; - - input[type=checkbox] { - display: none; - } - - my-video-thumbnail { - margin-right: 0; - } - - .video-buttons { - margin-top: 10px; - } - } -} diff --git a/client/src/app/account/account-videos/account-videos.component.ts b/client/src/app/account/account-videos/account-videos.component.ts deleted file mode 100644 index 91bc1b695..000000000 --- a/client/src/app/account/account-videos/account-videos.component.ts +++ /dev/null @@ -1,133 +0,0 @@ -import { Component, OnInit, OnDestroy } from '@angular/core' -import { ActivatedRoute, Router } from '@angular/router' -import { Location } from '@angular/common' -import { immutableAssign } from '@app/shared/misc/utils' -import { ComponentPagination } from '@app/shared/rest/component-pagination.model' -import { NotificationsService } from 'angular2-notifications' -import 'rxjs/add/observable/from' -import 'rxjs/add/operator/concatAll' -import { Observable } from 'rxjs/Observable' -import { AuthService } from '../../core/auth' -import { ConfirmService } from '../../core/confirm' -import { AbstractVideoList } from '../../shared/video/abstract-video-list' -import { Video } from '../../shared/video/video.model' -import { VideoService } from '../../shared/video/video.service' - -@Component({ - selector: 'my-account-videos', - templateUrl: './account-videos.component.html', - styleUrls: [ './account-videos.component.scss' ] -}) -export class AccountVideosComponent extends AbstractVideoList implements OnInit, OnDestroy { - titlePage = 'My videos' - currentRoute = '/account/videos' - checkedVideos: { [ id: number ]: boolean } = {} - pagination: ComponentPagination = { - currentPage: 1, - itemsPerPage: 5, - totalItems: null - } - - protected baseVideoWidth = -1 - protected baseVideoHeight = 155 - - constructor (protected router: Router, - protected route: ActivatedRoute, - protected authService: AuthService, - protected notificationsService: NotificationsService, - protected confirmService: ConfirmService, - protected location: Location, - private videoService: VideoService) { - super() - } - - ngOnInit () { - super.ngOnInit() - - // this.generateSyndicationList() - } - - ngOnDestroy () { - super.ngOnDestroy() - } - - abortSelectionMode () { - this.checkedVideos = {} - } - - isInSelectionMode () { - return Object.keys(this.checkedVideos).some(k => this.checkedVideos[k] === true) - } - - getVideosObservable (page: number) { - const newPagination = immutableAssign(this.pagination, { currentPage: page }) - - return this.videoService.getMyVideos(newPagination, this.sort) - } - - generateSyndicationList () { - throw new Error('Method not implemented.') - } - - async deleteSelectedVideos () { - const toDeleteVideosIds = Object.keys(this.checkedVideos) - .filter(k => this.checkedVideos[k] === true) - .map(k => parseInt(k, 10)) - - const res = await this.confirmService.confirm(`Do you really want to delete ${toDeleteVideosIds.length} videos?`, 'Delete') - if (res === false) return - - const observables: Observable[] = [] - for (const videoId of toDeleteVideosIds) { - const o = this.videoService - .removeVideo(videoId) - .do(() => this.spliceVideosById(videoId)) - - observables.push(o) - } - - Observable.from(observables) - .concatAll() - .subscribe( - res => { - this.notificationsService.success('Success', `${toDeleteVideosIds.length} videos deleted.`) - this.buildVideoPages() - }, - - err => this.notificationsService.error('Error', err.message) - ) - } - - async deleteVideo (video: Video) { - const res = await this.confirmService.confirm(`Do you really want to delete ${video.name}?`, 'Delete') - if (res === false) return - - this.videoService.removeVideo(video.id) - .subscribe( - status => { - this.notificationsService.success('Success', `Video ${video.name} deleted.`) - this.spliceVideosById(video.id) - this.buildVideoPages() - }, - - error => this.notificationsService.error('Error', error.message) - ) - } - - protected buildVideoHeight () { - // In account videos, the video height is fixed - return this.baseVideoHeight - } - - private spliceVideosById (id: number) { - for (const key of Object.keys(this.loadedPages)) { - const videos = this.loadedPages[key] - const index = videos.findIndex(v => v.id === id) - - if (index !== -1) { - videos.splice(index, 1) - return - } - } - } -} -- cgit v1.2.3