From 17119e4a546522468878cf115558b17949ab50d0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 12 Nov 2020 15:28:54 +0100 Subject: Reorganize left menu and account menu Add my-settings and my-library in left menu Move administration below my-library Split account menu: my-setting and my library --- .../my-account-subscriptions.component.html | 42 ----------- .../my-account-subscriptions.component.scss | 81 ---------------------- .../my-account-subscriptions.component.ts | 75 -------------------- 3 files changed, 198 deletions(-) delete mode 100644 client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.html delete mode 100644 client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.scss delete mode 100644 client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts (limited to 'client/src/app/+my-account/my-account-subscriptions') diff --git a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.html b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.html deleted file mode 100644 index 6ab3826ba..000000000 --- a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.html +++ /dev/null @@ -1,42 +0,0 @@ -

- - - My subscriptions - {{ pagination.totalItems }} - -

- -
-
- - - Clear filters -
-
- -
You don't have any subscriptions yet.
- -
- -
diff --git a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.scss b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.scss deleted file mode 100644 index 5ead45dd8..000000000 --- a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.scss +++ /dev/null @@ -1,81 +0,0 @@ -@import '_variables'; -@import '_mixins'; - -input[type=text] { - @include peertube-input-text(300px); -} - -.video-channel { - @include row-blocks; - - img { - @include avatar(80px); - - margin-right: 10px; - } - - .video-channel-info { - flex-grow: 1; - - a.video-channel-names { - @include disable-default-a-behaviour; - - width: fit-content; - display: flex; - align-items: baseline; - color: pvar(--mainForegroundColor); - - .video-channel-display-name { - font-weight: $font-semibold; - font-size: 18px; - } - - .video-channel-name { - font-size: 14px; - color: $grey-actor-name; - margin-left: 5px; - } - } - } - - .actor-owner { - @include actor-owner; - - margin-top: 0; - } -} - -.video-subscriptions-header { - margin-bottom: 30px; -} - -@media screen and (max-width: $small-view) { - .video-channel { - .video-channel-info { - padding-bottom: 10px; - text-align: center; - - .video-channel-names { - flex-direction: column; - align-items: center !important; - margin: auto; - } - } - - img { - margin-right: 0; - } - } -} - -@media screen and (max-width: $mobile-view) { - .video-subscriptions-header { - flex-direction: column; - - input[type=text] { - width: 100% !important; - } - } -} - - diff --git a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts deleted file mode 100644 index 994fe5142..000000000 --- a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { Subject } from 'rxjs' -import { Component, OnInit } from '@angular/core' -import { ComponentPagination, Notifier } from '@app/core' -import { VideoChannel } from '@app/shared/shared-main' -import { UserSubscriptionService } from '@app/shared/shared-user-subscription' -import { debounceTime } from 'rxjs/operators' - -@Component({ - selector: 'my-account-subscriptions', - templateUrl: './my-account-subscriptions.component.html', - styleUrls: [ './my-account-subscriptions.component.scss' ] -}) -export class MyAccountSubscriptionsComponent implements OnInit { - videoChannels: VideoChannel[] = [] - - pagination: ComponentPagination = { - currentPage: 1, - itemsPerPage: 10, - totalItems: null - } - - onDataSubject = new Subject() - - subscriptionsSearch: string - subscriptionsSearchChanged = new Subject() - - constructor ( - private userSubscriptionService: UserSubscriptionService, - private notifier: Notifier - ) {} - - ngOnInit () { - this.loadSubscriptions() - - this.subscriptionsSearchChanged - .pipe(debounceTime(500)) - .subscribe(() => { - this.pagination.currentPage = 1 - this.loadSubscriptions(false) - }) - } - - resetSearch () { - this.subscriptionsSearch = '' - this.onSubscriptionsSearchChanged() - } - - onSubscriptionsSearchChanged () { - this.subscriptionsSearchChanged.next() - } - - onNearOfBottom () { - // Last page - if (this.pagination.totalItems <= (this.pagination.currentPage * this.pagination.itemsPerPage)) return - - this.pagination.currentPage += 1 - this.loadSubscriptions() - } - - private loadSubscriptions (more = true) { - this.userSubscriptionService.listSubscriptions({ pagination: this.pagination, search: this.subscriptionsSearch }) - .subscribe( - res => { - this.videoChannels = more - ? this.videoChannels.concat(res.data) - : res.data - this.pagination.totalItems = res.total - - this.onDataSubject.next(res.data) - }, - - error => this.notifier.error(error.message) - ) - } -} -- cgit v1.2.3