Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Global client redesign

Chocobozzzf83674c1439a
diff --git a/client/e2e/src/po/admin-config.po.ts b/client/e2e/src/po/admin-config.po.ts
index 8e3d90f459..778959c80f 100644
--- a/client/e2e/src/po/admin-config.po.ts
+++ b/client/e2e/src/po/admin-config.po.ts
@@ -8,7 +8,7 @@ export class AdminConfigPage {
'basic-configuration': 'APPEARANCE',
'instance-information': 'INSTANCE'
}
- await go('/admin/config/edit-custom#' + tab)
+ await go('/admin/settings/config/edit-custom#' + tab)
await $('h2=' + waitTitles[tab]).waitForDisplayed()
}
diff --git a/client/e2e/src/po/admin-plugin.po.ts b/client/e2e/src/po/admin-plugin.po.ts
index 0259f34d6c..0d6aca7f48 100644
--- a/client/e2e/src/po/admin-plugin.po.ts
+++ b/client/e2e/src/po/admin-plugin.po.ts
@@ -3,7 +3,7 @@ import { browserSleep, go } from '../utils'
export class AdminPluginPage {
async navigateToPluginSearch () {
- await go('/admin/plugins/search')
+ await go('/admin/settings/plugins/search')
await $('my-plugin-search').waitForDisplayed()
}
diff --git a/client/e2e/src/po/my-account.po.ts b/client/e2e/src/po/my-account.po.ts
index cc1555e9b9..1054c117be 100644
--- a/client/e2e/src/po/my-account.po.ts
+++ b/client/e2e/src/po/my-account.po.ts
@@ -77,7 +77,7 @@ export class MyAccountPage {
async countVideos (names: string[]) {
const elements = await $$('.video').filter(async e => {
- const t = await e.$('.video-miniature-name').getText()
+ const t = await e.$('.video-name').getText()
return names.some(n => t.includes(n))
})
@@ -140,7 +140,7 @@ export class MyAccountPage {
private async getVideoElement (name: string) {
const video = async () => {
const videos = await $$('.video').filter(async e => {
- const t = await e.$('.video-miniature-name').getText()
+ const t = await e.$('.video-name').getText()
return t.includes(name)
})
diff --git a/client/e2e/src/po/video-list.po.ts b/client/e2e/src/po/video-list.po.ts
index 81afbd992a..c2dad85716 100644
--- a/client/e2e/src/po/video-list.po.ts
+++ b/client/e2e/src/po/video-list.po.ts
@@ -66,25 +66,25 @@ export class VideoListPage {
}
async getVideosListName () {
- const elems = await $$('.videos .video-miniature .video-miniature-name')
+ const elems = await $$('.videos .video-miniature .video-name')
const texts = await elems.map(e => e.getText())
return texts.map(t => t.trim())
}
videoExists (name: string) {
- return $('.video-miniature-name=' + name).isDisplayed()
+ return $('.video-name=' + name).isDisplayed()
}
async videoIsBlurred (name: string) {
- const filter = await $('.video-miniature-name=' + name).getCSSProperty('filter')
+ const filter = await $('.video-name=' + name).getCSSProperty('filter')
return filter.value !== 'none'
}
async clickOnVideo (videoName: string) {
const video = async () => {
- const videos = await $$('.videos .video-miniature .video-miniature-name').filter(async e => {
+ const videos = await $$('.videos .video-miniature .video-name').filter(async e => {
const t = await e.getText()
return t === videoName
@@ -106,7 +106,7 @@ export class VideoListPage {
async clickOnFirstVideo () {
const video = () => $('.videos .video-miniature .video-thumbnail')
- const videoName = () => $('.videos .video-miniature .video-miniature-name')
+ const videoName = () => $('.videos .video-miniature .video-name')
await video().waitForClickable()
@@ -119,7 +119,7 @@ export class VideoListPage {
}
private waitForList () {
- return $('.videos .video-miniature .video-miniature-name').waitForDisplayed()
+ return $('.videos .video-miniature .video-name').waitForDisplayed()
}
private waitForTitle (title: string) {
diff --git a/client/e2e/src/po/video-watch.po.ts b/client/e2e/src/po/video-watch.po.ts
index 544930c6ce..699a0b635f 100644
--- a/client/e2e/src/po/video-watch.po.ts
+++ b/client/e2e/src/po/video-watch.po.ts
@@ -199,7 +199,7 @@ export class VideoWatchPage {
await textarea.setValue(comment)
- const confirmButton = await $('.comment-buttons .orange-button')
+ const confirmButton = await $('.comment-buttons .primary-button')
await confirmButton.waitForClickable()
await confirmButton.click()
@@ -218,7 +218,7 @@ export class VideoWatchPage {
await textarea.waitForClickable()
await textarea.setValue(comment)
- const confirmButton = await $('my-video-comment .comment-buttons .orange-button')
+ const confirmButton = await $('my-video-comment .comment-buttons .primary-button')
await confirmButton.waitForClickable()
await confirmButton.click()
diff --git a/client/package.json b/client/package.json
index a211ac541f..42d3ad03e5 100644
--- a/client/package.json
+++ b/client/package.json
@@ -89,6 +89,7 @@
"buffer": "^6.0.3",
"chart.js": "^4.3.0",
"chartjs-plugin-zoom": "~2.0.1",
+ "color-bits": "^1.0.4",
"core-js": "^3.22.8",
"debug": "^4.3.1",
"dompurify": "^3.1.6",
diff --git a/client/src/app/+about/about-follows/about-follows.component.html b/client/src/app/+about/about-follows/about-follows.component.html
index 34427452c4..c4bda1944d 100644
--- a/client/src/app/+about/about-follows/about-follows.component.html
+++ b/client/src/app/+about/about-follows/about-follows.component.html
@@ -11,7 +11,7 @@
{{ follower.name }}
</a>
- <button i18n class="peertube-button-link grey-button mt-1" *ngIf="!loadedAllFollowers && canLoadMoreFollowers()" (click)="loadAllFollowers()">Show full list</button>
+ <button i18n class="peertube-button-link secondary-button mt-1" *ngIf="!loadedAllFollowers && canLoadMoreFollowers()" (click)="loadAllFollowers()">Show full list</button>
</div>
<div class="col-xl-6 col-md-12">
@@ -23,7 +23,7 @@
{{ following.name }}
</a>
- <button i18n class="peertube-button-link grey-button mt-1" *ngIf="!loadedAllFollowings && canLoadMoreFollowings()" (click)="loadAllFollowings()">Show full list</button>
+ <button i18n class="peertube-button-link secondary-button mt-1" *ngIf="!loadedAllFollowings && canLoadMoreFollowings()" (click)="loadAllFollowings()">Show full list</button>
</div>
</div>
diff --git a/client/src/app/+about/about-instance/about-instance.component.html b/client/src/app/+about/about-instance/about-instance.component.html
index 876f29821c..5754aa7dc6 100644
--- a/client/src/app/+about/about-instance/about-instance.component.html
+++ b/client/src/app/+about/about-instance/about-instance.component.html
@@ -1,15 +1,15 @@
-<div class="banner" *ngIf="instanceBannerUrl">
- <img [src]="instanceBannerUrl" alt="Instance banner">
-</div>
-
<div class="margin-content mt-4">
+ <div class="banner mb-4" *ngIf="instanceBannerUrl">
+ <img class="rounded" [src]="instanceBannerUrl" alt="Instance banner">
+ </div>
+
<div class="row ">
<div class="col-md-12 col-xl-6">
<div class="d-flex justify-content-between">
<h1 i18n class="fw-semibold fs-5">About {{ instanceName }}</h1>
- <a routerLink="/about/contact" i18n *ngIf="isContactFormEnabled" class="peertube-button-link orange-button h-100 d-flex align-items-center">Contact us</a>
+ <a routerLink="/about/contact" i18n *ngIf="isContactFormEnabled" class="peertube-button-link primary-button h-100 d-flex align-items-center">Contact us</a>
</div>
<div class="mb-4" *ngIf="categories.length !== 0 || languages.length !== 0">
diff --git a/client/src/app/+about/about-instance/about-instance.component.scss b/client/src/app/+about/about-instance/about-instance.component.scss
index ffb8ce307f..cb7324f067 100644
--- a/client/src/app/+about/about-instance/about-instance.component.scss
+++ b/client/src/app/+about/about-instance/about-instance.component.scss
@@ -15,8 +15,11 @@
.middle-title {
margin-top: 0;
+ text-transform: uppercase;
+ color: pvar(--fg);
+ font-weight: $font-bold;
- @include in-content-small-title;
+ @include font-size(22px);
@include margin-bottom(1.5rem);
}
@@ -42,9 +45,6 @@
.middle-title,
.section-title {
display: inline-block;
- }
-
- .section-title {
- color: var(--mainForegroundColor);
+ color: pvar(--fg-400);
}
}
diff --git a/client/src/app/+about/about-instance/contact-admin-modal.component.html b/client/src/app/+about/about-instance/contact-admin-modal.component.html
index 0a2c30b307..8f414d1682 100644
--- a/client/src/app/+about/about-instance/contact-admin-modal.component.html
+++ b/client/src/app/+about/about-instance/contact-admin-modal.component.html
@@ -50,11 +50,11 @@
<div class="form-group inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
- <input type="submit" i18n-value value="Submit" class="peertube-button orange-button" [disabled]="!form.valid" />
+ <input type="submit" i18n-value value="Submit" class="peertube-button primary-button" [disabled]="!form.valid" />
</div>
</form>
diff --git a/client/src/app/+about/about-instance/contact-admin-modal.component.scss b/client/src/app/+about/about-instance/contact-admin-modal.component.scss
index 80b962a37d..dc4010c8a5 100644
--- a/client/src/app/+about/about-instance/contact-admin-modal.component.scss
+++ b/client/src/app/+about/about-instance/contact-admin-modal.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
.modal-subtitle {
line-height: 1rem;
diff --git a/client/src/app/+about/about-peertube/about-peertube.component.html b/client/src/app/+about/about-peertube/about-peertube.component.html
index a066f0e465..73ea2bd757 100644
--- a/client/src/app/+about/about-peertube/about-peertube.component.html
+++ b/client/src/app/+about/about-peertube/about-peertube.component.html
@@ -11,12 +11,12 @@
</p>
<p i18n>
- It is free and open-source software, under <a class="link-orange" href="https://github.com/Chocobozzz/PeerTube/blob/develop/LICENSE">AGPLv3
+ It is free and open-source software, under <a class="link-primary" href="https://github.com/Chocobozzz/PeerTube/blob/develop/LICENSE">AGPLv3
licence</a>.
</p>
<p i18n>
- For more information, please visit <a class="link-orange" target="_blank" rel="noopener noreferrer" href="https://joinpeertube.org">joinpeertube.org</a>.
+ For more information, please visit <a class="link-primary" target="_blank" rel="noopener noreferrer" href="https://joinpeertube.org">joinpeertube.org</a>.
</p>
</div>
@@ -25,7 +25,7 @@
<div class="card">
<div class="card-body">
<div class="card-title">
- <a i18n class="link-orange" target="_blank" rel="noopener noreferrer" href="https://docs.joinpeertube.org/use/setup-account">Use PeerTube documentation</a>
+ <a i18n class="link-primary" target="_blank" rel="noopener noreferrer" href="https://docs.joinpeertube.org/use/setup-account">Use PeerTube documentation</a>
</div>
<div i18n class="card-text">
@@ -37,7 +37,7 @@
<div class="card">
<div class="card-body">
<div class="card-title">
- <a i18n class="link-orange" target="_blank" rel="noopener noreferrer" href="https://docs.joinpeertube.org/use/third-party-application">PeerTube Applications</a>
+ <a i18n class="link-primary" target="_blank" rel="noopener noreferrer" href="https://docs.joinpeertube.org/use/third-party-application">PeerTube Applications</a>
</div>
<div i18n class="card-text">
@@ -49,7 +49,7 @@
<div class="card">
<div class="card-body">
<div class="card-title">
- <a i18n class="link-orange" target="_blank" rel="noopener noreferrer" href="https://docs.joinpeertube.org/contribute/getting-started">Contribute on PeerTube</a>
+ <a i18n class="link-primary" target="_blank" rel="noopener noreferrer" href="https://docs.joinpeertube.org/contribute/getting-started">Contribute on PeerTube</a>
</div>
<div i18n class="card-text">
@@ -112,7 +112,7 @@
Web peers are not publicly accessible: because we use the websocket transport, the protocol is different from classic BitTorrent tracker.
When you are in a web browser, you send a signal containing your IP address to the tracker that will randomly choose other peers
to forward the information to.
- See <a class="link-orange" href="https://github.com/yciabaud/webtorrent/blob/beps/bep_webrtc.rst">this document</a> for more information
+ See <a class="link-primary" href="https://github.com/yciabaud/webtorrent/blob/beps/bep_webrtc.rst">this document</a> for more information
</li>
</ul>
diff --git a/client/src/app/+about/about.component.html b/client/src/app/+about/about.component.html
index 149a999fa2..2241fe716e 100644
--- a/client/src/app/+about/about.component.html
+++ b/client/src/app/+about/about.component.html
@@ -1,13 +1,7 @@
<div>
- <div class="sub-menu mb-0" [ngClass]="{ 'sub-menu-fixed': !isBroadcastMessageDisplayed }">
- <a myPluginSelector pluginSelectorId="about-menu-instance" i18n routerLink="instance" routerLinkActive="active" class="sub-menu-entry">Instance</a>
-
- <a myPluginSelector pluginSelectorId="about-menu-peertube" i18n routerLink="peertube" routerLinkActive="active" class="sub-menu-entry">PeerTube</a>
-
- <a myPluginSelector pluginSelectorId="about-menu-network" i18n routerLink="follows" routerLinkActive="active" class="sub-menu-entry">Network</a>
+ <div class="margin-content">
+ <my-horizontal-menu [menuEntries]="menuEntries"></my-horizontal-menu>
</div>
- <div [ngClass]="{ 'sub-menu-offset-content': !isBroadcastMessageDisplayed }">
- <router-outlet></router-outlet>
- </div>
+ <router-outlet></router-outlet>
</div>
diff --git a/client/src/app/+about/about.component.ts b/client/src/app/+about/about.component.ts
index f0f26f902f..01672ba6a7 100644
--- a/client/src/app/+about/about.component.ts
+++ b/client/src/app/+about/about.component.ts
@@ -1,22 +1,30 @@
import { Component } from '@angular/core'
-import { ScreenService } from '@app/core'
-import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router'
-import { PluginSelectorDirective } from '../shared/shared-main/plugins/plugin-selector.directive'
-import { NgClass } from '@angular/common'
+import { RouterOutlet } from '@angular/router'
+import { HorizontalMenuComponent, HorizontalMenuEntry } from '@app/shared/shared-main/menu/horizontal-menu.component'
@Component({
selector: 'my-about',
templateUrl: './about.component.html',
standalone: true,
- imports: [ NgClass, PluginSelectorDirective, RouterLink, RouterLinkActive, RouterOutlet ]
+ imports: [ RouterOutlet, HorizontalMenuComponent ]
})
export class AboutComponent {
- constructor (
- private screenService: ScreenService
- ) { }
-
- get isBroadcastMessageDisplayed () {
- return this.screenService.isBroadcastMessageDisplayed
- }
+ menuEntries: HorizontalMenuEntry[] = [
+ {
+ label: $localize`Platform`,
+ routerLink: '/about/instance',
+ pluginSelectorId: 'about-menu-instance'
+ },
+ {
+ label: $localize`PeerTube`,
+ routerLink: '/about/peertube',
+ pluginSelectorId: 'about-menu-peertube'
+ },
+ {
+ label: $localize`Network`,
+ routerLink: '/about/follows',
+ pluginSelectorId: 'about-menu-network'
+ }
+ ]
}
diff --git a/client/src/app/+accounts/account-video-channels/account-video-channels.component.html b/client/src/app/+accounts/account-video-channels/account-video-channels.component.html
index e3b4997737..644504cf39 100644
--- a/client/src/app/+accounts/account-video-channels/account-video-channels.component.html
+++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.html
@@ -17,7 +17,7 @@
></my-actor-avatar>
<h2 class="fs-5 lh-1 fw-bold m-0">
- <a [routerLink]="getVideoChannelLink(videoChannel)" i18n-title title="See this video channel">
+ <a class="text-decoration-none" [routerLink]="getVideoChannelLink(videoChannel)" i18n-title title="See this video channel">
{{ videoChannel.displayName }}
</a>
</h2>
@@ -35,7 +35,7 @@
<my-subscribe-button [videoChannels]="[videoChannel]"></my-subscribe-button>
- <a i18n class="button-show-channel peertube-button-link orange-button-inverted" [routerLink]="getVideoChannelLink(videoChannel)">Show this channel</a>
+ <a i18n class="button-show-channel peertube-button-link primary-button" [routerLink]="getVideoChannelLink(videoChannel)">Show this channel</a>
<div class="videos-overflow-workaround">
<div class="videos">
@@ -47,7 +47,7 @@
></my-video-miniature>
<div *ngIf="getTotalVideosOf(videoChannel)" class="miniature-show-channel">
- <a i18n [routerLink]="getVideoChannelLink(videoChannel)">SHOW THIS CHANNEL ></a>
+ <a class="link-primary" i18n [routerLink]="getVideoChannelLink(videoChannel)">SHOW THIS CHANNEL ></a>
</div>
</div>
</div>
diff --git a/client/src/app/+accounts/account-video-channels/account-video-channels.component.scss b/client/src/app/+accounts/account-video-channels/account-video-channels.component.scss
index 9a415a3202..8842b5403b 100644
--- a/client/src/app/+accounts/account-video-channels/account-video-channels.component.scss
+++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.scss
@@ -9,7 +9,7 @@
.channel {
max-width: $max-channels-width;
- background-color: pvar(--channelBackgroundColor);
+ background-color: pvar(--bg-secondary-350);
display: grid;
grid-template-columns: 1fr auto;
@@ -36,7 +36,7 @@
}
a {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
@include peertube-word-wrap;
}
@@ -60,7 +60,7 @@
max-height: 80px;
- @include fade-text(50px, pvar(--channelBackgroundColor));
+ @include fade-text(50px, pvar(--bg-secondary-350));
}
}
@@ -95,14 +95,9 @@ my-subscribe-button {
height: 100%;
position: absolute;
right: 0;
- background: linear-gradient(90deg, transparent 0, pvar(--channelBackgroundColor) 45px);
+ background: linear-gradient(90deg, transparent 0, pvar(--bg-secondary-350) 45px);
padding: (math.div($video-thumbnail-medium-height, 2) - 10px) 15px 0 60px;
z-index: z(miniature) + 1;
-
- a {
- color: pvar(--mainColor);
- font-weight: $font-semibold;
- }
}
.button-show-channel {
@@ -130,11 +125,6 @@ my-subscribe-button {
}
}
- .show-channel a {
- @include peertube-button-link;
- @include orange-button-inverted;
- }
-
.videos {
display: none;
}
diff --git a/client/src/app/+accounts/account-videos/account-videos.component.html b/client/src/app/+accounts/account-videos/account-videos.component.html
index 86cfca3e12..887667ddfd 100644
--- a/client/src/app/+accounts/account-videos/account-videos.component.html
+++ b/client/src/app/+accounts/account-videos/account-videos.component.html
@@ -1,11 +1,10 @@
+<h1 class="visually-hidden" i18n>Videos</h1>
+
<my-videos-list
#videosList
*ngIf="account"
- [title]="title"
- displayTitle="false"
-
[getVideosObservableFunction]="getVideosObservableFunction"
[getSyndicationItemsFunction]="getSyndicationItemsFunction"
diff --git a/client/src/app/+accounts/account-videos/account-videos.component.ts b/client/src/app/+accounts/account-videos/account-videos.component.ts
index 02478de241..55f05b4c8f 100644
--- a/client/src/app/+accounts/account-videos/account-videos.component.ts
+++ b/client/src/app/+accounts/account-videos/account-videos.component.ts
@@ -21,7 +21,6 @@ export class AccountVideosComponent implements OnInit, OnDestroy, DisableForReus
getVideosObservableFunction = this.getVideosObservable.bind(this)
getSyndicationItemsFunction = this.getSyndicationItems.bind(this)
- title = $localize`Videos`
defaultSort = '-publishedAt' as VideoSortField
account: Account
diff --git a/client/src/app/+accounts/accounts.component.html b/client/src/app/+accounts/accounts.component.html
index ac11705a5a..c3d7dadd32 100644
--- a/client/src/app/+accounts/accounts.component.html
+++ b/client/src/app/+accounts/accounts.component.html
@@ -1,5 +1,5 @@
<div *ngIf="account" class="root">
- <div class="account-info d-md-grid d-block">
+ <div class="margin-content account-info d-md-grid d-block">
<div class="account-avatar-row">
<my-actor-avatar [size]="getAccountAvatarSize()" actorType="account" [actor]="account"></my-actor-avatar>
@@ -48,7 +48,7 @@
<div class="description-html" [innerHTML]="accountDescriptionHTML"></div>
</div>
- <button *ngIf="hasShowMoreDescription()" class="show-more d-md-none d-block button-unstyle"
+ <button *ngIf="hasShowMoreDescription()" class="show-more peertube-button-like-link d-md-none d-block"
(click)="accountDescriptionExpanded = !accountDescriptionExpanded"
title="Show the complete description" i18n-title i18n
>
@@ -56,7 +56,7 @@
</button>
<div class="buttons">
- <a *ngIf="isManageable()" routerLink="/my-account" class="peertube-button-link orange-button" i18n>
+ <a *ngIf="isManageable()" routerLink="/my-account" class="peertube-button-link primary-button" i18n>
Manage account
</a>
@@ -64,14 +64,15 @@
</div>
</div>
- <div class="links" [ngClass]="{ 'on-channel-page': isOnChannelPage() }">
+ <div class="margin-content horizontal-menu mb-3">
<ng-template #linkTemplate let-item="item">
<a [routerLink]="item.routerLink" routerLinkActive="active" class="sub-menu-entry">{{ item.label }}</a>
</ng-template>
- <my-list-overflow [hidden]="hideMenu" [items]="links" [itemTemplate]="linkTemplate"></my-list-overflow>
+ <my-horizontal-menu [hidden]="hideMenu" [menuEntries]="links"></my-horizontal-menu>
<my-simple-search-input
+ class="ms-auto"
[alwaysShow]="!isInSmallView()" (searchChanged)="searchChanged($event)"
(inputDisplayChanged)="onSearchInputDisplayChanged($event)" name="search-videos"
i18n-iconTitle icon-title="Search account videos"
diff --git a/client/src/app/+accounts/accounts.component.scss b/client/src/app/+accounts/accounts.component.scss
index 0709db6b25..579656f757 100644
--- a/client/src/app/+accounts/accounts.component.scss
+++ b/client/src/app/+accounts/accounts.component.scss
@@ -4,28 +4,21 @@
@use '_miniature' as *;
.root {
- --myFontSize: 1rem;
- --myGreyFontSize: 1rem;
+ --co-font-size: 1rem;
+ --co-secondary-font-size: 1rem;
}
-.section-label {
- @include section-label-responsive;
+my-horizontal-menu {
+ flex-grow: 1;
+
+ @include margin-right(3rem);
}
-.links {
+.horizontal-menu {
display: flex;
justify-content: space-between;
align-items: center;
-
- @include grid-videos-miniature-margins;
-
- &.on-channel-page {
- max-width: $max-channels-width;
- }
-
- simple-search-input {
- @include margin-left(auto);
- }
+ flex-wrap: wrap;
}
my-copy-button {
@@ -36,17 +29,12 @@ my-copy-button {
grid-template-columns: 1fr min-content;
grid-template-rows: auto auto;
- background-color: pvar(--submenuBackgroundColor);
-
- @include grid-videos-miniature-margins(false, 15px);
- @include padding-top(3.75rem);
- @include padding-bottom(3.75rem);
@include margin-bottom(3rem);
@include font-size(1rem);
}
.account-avatar-row {
- @include avatar-row-responsive(2rem, var(--myGreyFontSize));
+ @include avatar-row-responsive(2rem, var(--co-secondary-font-size));
}
.actor-display-name {
@@ -93,7 +81,7 @@ my-copy-button {
.description:not(.expanded) {
max-height: 70px;
- @include fade-text(30px, pvar(--submenuBackgroundColor));
+ @include fade-text(30px, pvar(--bg));
}
.buttons {
@@ -103,8 +91,8 @@ my-copy-button {
@media screen and (max-width: $mobile-view) {
.root {
- --myFontSize: 14px;
- --myGreyFontSize: 13px;
+ --co-font-size: 14px;
+ --co-secondary-font-size: 13px;
}
.links {
diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts
index 9a0ed81ff3..b2fbcad028 100644
--- a/client/src/app/+accounts/accounts.component.ts
+++ b/client/src/app/+accounts/accounts.component.ts
@@ -7,6 +7,7 @@ import { AccountService } from '@app/shared/shared-main/account/account.service'
import { DropdownAction } from '@app/shared/shared-main/buttons/action-dropdown.component'
import { VideoChannel } from '@app/shared/shared-main/channel/video-channel.model'
import { VideoChannelService } from '@app/shared/shared-main/channel/video-channel.service'
+import { HorizontalMenuComponent, HorizontalMenuEntry } from '@app/shared/shared-main/menu/horizontal-menu.component'
import { VideoService } from '@app/shared/shared-main/video/video.service'
import { BlocklistService } from '@app/shared/shared-moderation/blocklist.service'
import { AccountReportComponent } from '@app/shared/shared-moderation/report-modals'
@@ -16,7 +17,6 @@ import { Subscription } from 'rxjs'
import { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators'
import { ActorAvatarComponent } from '../shared/shared-actor-image/actor-avatar.component'
import { CopyButtonComponent } from '../shared/shared-main/buttons/copy-button.component'
-import { ListOverflowComponent, ListOverflowItem } from '../shared/shared-main/menu/list-overflow.component'
import { SimpleSearchInputComponent } from '../shared/shared-main/search/simple-search-input.component'
import { AccountBlockBadgesComponent } from '../shared/shared-moderation/account-block-badges.component'
import { UserModerationDropdownComponent } from '../shared/shared-moderation/user-moderation-dropdown.component'
@@ -37,11 +37,12 @@ import { SubscribeButtonComponent } from '../shared/shared-user-subscription/sub
RouterLink,
SubscribeButtonComponent,
RouterLinkActive,
- ListOverflowComponent,
+ HorizontalMenuComponent,
SimpleSearchInputComponent,
RouterOutlet,
AccountReportComponent,
- DatePipe
+ DatePipe,
+ HorizontalMenuComponent
]
})
export class AccountsComponent implements OnInit, OnDestroy {
@@ -52,7 +53,7 @@ export class AccountsComponent implements OnInit, OnDestroy {
videoChannels: VideoChannel[] = []
- links: ListOverflowItem[] = []
+ links: HorizontalMenuEntry[] = []
hideMenu = false
accountVideosCount: number
diff --git a/client/src/app/+admin/admin-moderation.component.html b/client/src/app/+admin/admin-moderation.component.html
new file mode 100644
index 0000000000..0657de482c
--- /dev/null
+++ b/client/src/app/+admin/admin-moderation.component.html
@@ -0,0 +1,11 @@
+<div class="root">
+ <a i18n class="visually-hidden-focusable skip-to-content-sub-menu" href="#admin-moderation-content" (click)="$event.preventDefault(); adminContent.focus()">Skip the sub menu</a>
+
+ <div class="margin-content">
+ <my-horizontal-menu i18n-h1 h1="Moderation" h1Icon="moderation" [menuEntries]="menuEntries"></my-horizontal-menu>
+ </div>
+
+ <div #adminContent tabindex="-1" id="admin-moderation-content" class="margin-content outline-0">
+ <router-outlet></router-outlet>
+ </div>
+</div>
diff --git a/client/src/app/+admin/admin-moderation.component.ts b/client/src/app/+admin/admin-moderation.component.ts
new file mode 100644
index 0000000000..b074578692
--- /dev/null
+++ b/client/src/app/+admin/admin-moderation.component.ts
@@ -0,0 +1,87 @@
+import { Component, OnInit } from '@angular/core'
+import { RouterOutlet } from '@angular/router'
+import { AuthService, ServerService } from '@app/core'
+import { HorizontalMenuComponent, HorizontalMenuEntry } from '@app/shared/shared-main/menu/horizontal-menu.component'
+import { UserRight, UserRightType } from '@peertube/peertube-models'
+
+@Component({
+ templateUrl: './admin-moderation.component.html',
+ standalone: true,
+ imports: [ HorizontalMenuComponent, RouterOutlet ]
+})
+export class AdminModerationComponent implements OnInit {
+ menuEntries: HorizontalMenuEntry[] = []
+
+ constructor (
+ private auth: AuthService,
+ private server: ServerService
+ ) { }
+
+ ngOnInit () {
+ this.server.configReloaded.subscribe(() => this.buildMenu())
+
+ this.buildMenu()
+ }
+
+ private buildMenu () {
+ this.menuEntries = []
+
+ if (this.hasRight(UserRight.MANAGE_ABUSES)) {
+ this.menuEntries.push({
+ label: $localize`Reports`,
+ routerLink: '/admin/moderation/abuses/list'
+ })
+ }
+
+ if (this.hasRight(UserRight.MANAGE_REGISTRATIONS)) {
+ this.menuEntries.push({
+ label: $localize`Registrations`,
+ routerLink: '/admin/moderation/registrations/list'
+ })
+ }
+
+ if (this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)) {
+ this.menuEntries.push({
+ label: $localize`Video blocks`,
+ routerLink: '/admin/moderation/video-blocks/list'
+ })
+ }
+
+ if (this.hasRight(UserRight.MANAGE_ACCOUNTS_BLOCKLIST) || this.hasRight(UserRight.MANAGE_SERVERS_BLOCKLIST)) {
+ const item: HorizontalMenuEntry = {
+ label: $localize`Mutes`,
+ routerLink: '',
+ children: []
+ }
+
+ if (this.hasRight(UserRight.MANAGE_ACCOUNTS_BLOCKLIST)) {
+ item.children.push({
+ label: $localize`Muted accounts`,
+ routerLink: '/admin/moderation/blocklist/accounts'
+ })
+ }
+
+ if (this.hasRight(UserRight.MANAGE_SERVERS_BLOCKLIST)) {
+ item.children.push({
+ label: $localize`Muted servers`,
+ routerLink: '/admin/moderation/blocklist/servers'
+ })
+ }
+
+ item.routerLink = item.children[0].routerLink
+
+ this.menuEntries.push(item)
+ }
+
+ if (this.hasRight(UserRight.MANAGE_INSTANCE_WATCHED_WORDS)) {
+ this.menuEntries.push({
+ label: $localize`Watched words`,
+ routerLink: '/admin/moderation/watched-words/list'
+ })
+ }
+ }
+
+ private hasRight (right: UserRightType) {
+ return this.auth.getUser().hasRight(right)
+ }
+}
diff --git a/client/src/app/+admin/admin-overview.component.html b/client/src/app/+admin/admin-overview.component.html
new file mode 100644
index 0000000000..4622b7cb94
--- /dev/null
+++ b/client/src/app/+admin/admin-overview.component.html
@@ -0,0 +1,11 @@
+<div class="root">
+ <a i18n class="visually-hidden-focusable skip-to-content-sub-menu" href="#admin-overview-content" (click)="$event.preventDefault(); adminContent.focus()">Skip the sub menu</a>
+
+ <div class="margin-content">
+ <my-horizontal-menu i18n-h1 h1="Overview" h1Icon="overview" [menuEntries]="menuEntries"></my-horizontal-menu>
+ </div>
+
+ <div #adminContent tabindex="-1" id="admin-overview-content" class="margin-content outline-0">
+ <router-outlet></router-outlet>
+ </div>
+</div>
diff --git a/client/src/app/+admin/admin-overview.component.ts b/client/src/app/+admin/admin-overview.component.ts
new file mode 100644
index 0000000000..ffd9aee126
--- /dev/null
+++ b/client/src/app/+admin/admin-overview.component.ts
@@ -0,0 +1,54 @@
+import { Component, OnInit } from '@angular/core'
+import { RouterOutlet } from '@angular/router'
+import { AuthService } from '@app/core'
+import { HorizontalMenuComponent, HorizontalMenuEntry } from '@app/shared/shared-main/menu/horizontal-menu.component'
+import { UserRight, UserRightType } from '@peertube/peertube-models'
+
+@Component({
+ templateUrl: './admin-overview.component.html',
+ standalone: true,
+ imports: [ HorizontalMenuComponent, RouterOutlet ]
+})
+export class AdminOverviewComponent implements OnInit {
+ menuEntries: HorizontalMenuEntry[] = []
+
+ constructor (
+ private auth: AuthService
+ ) { }
+
+ ngOnInit () {
+ this.buildMenu()
+ }
+
+ private buildMenu () {
+ this.menuEntries = []
+
+ if (this.hasRight(UserRight.MANAGE_USERS)) {
+ this.menuEntries.push({
+ label: $localize`Users`,
+ routerLink: '/admin/overview/users'
+ })
+ }
+
+ if (this.hasRight(UserRight.SEE_ALL_VIDEOS)) {
+ this.menuEntries.push({
+ label: $localize`Videos`,
+ routerLink: '/admin/overview/videos',
+ queryParams: {
+ search: 'isLocal:true'
+ }
+ })
+ }
+
+ if (this.hasRight(UserRight.SEE_ALL_COMMENTS)) {
+ this.menuEntries.push({
+ label: $localize`Comments`,
+ routerLink: '/admin/overview/comments'
+ })
+ }
+ }
+
+ private hasRight (right: UserRightType) {
+ return this.auth.getUser().hasRight(right)
+ }
+}
diff --git a/client/src/app/+admin/admin-settings.component.html b/client/src/app/+admin/admin-settings.component.html
new file mode 100644
index 0000000000..742aa4e68e
--- /dev/null
+++ b/client/src/app/+admin/admin-settings.component.html
@@ -0,0 +1,11 @@
+<div class="root">
+ <a i18n class="visually-hidden-focusable skip-to-content-sub-menu" href="#admin-settings-content" (click)="$event.preventDefault(); adminContent.focus()">Skip the sub menu</a>
+
+ <div class="margin-content">
+ <my-horizontal-menu i18n-h1 h1="Settings" h1Icon="config" [menuEntries]="menuEntries"></my-horizontal-menu>
+ </div>
+
+ <div #adminContent tabindex="-1" id="admin-settings-content" class="margin-content outline-0">
+ <router-outlet></router-outlet>
+ </div>
+</div>
diff --git a/client/src/app/+admin/admin-settings.component.ts b/client/src/app/+admin/admin-settings.component.ts
new file mode 100644
index 0000000000..e028edcef1
--- /dev/null
+++ b/client/src/app/+admin/admin-settings.component.ts
@@ -0,0 +1,179 @@
+import { Component, OnInit } from '@angular/core'
+import { RouterOutlet } from '@angular/router'
+import { AuthService, ServerService } from '@app/core'
+import { HorizontalMenuComponent, HorizontalMenuEntry } from '@app/shared/shared-main/menu/horizontal-menu.component'
+import { PluginType, UserRight, UserRightType } from '@peertube/peertube-models'
+
+@Component({
+ templateUrl: './admin-settings.component.html',
+ standalone: true,
+ imports: [ HorizontalMenuComponent, RouterOutlet ]
+})
+export class AdminSettingsComponent implements OnInit {
+ menuEntries: HorizontalMenuEntry[] = []
+
+ constructor (
+ private auth: AuthService,
+ private server: ServerService
+ ) { }
+
+ ngOnInit () {
+ this.server.configReloaded.subscribe(() => this.buildMenu())
+
+ this.buildMenu()
+ }
+
+ private buildMenu () {
+ this.menuEntries = []
+
+ this.buildConfigurationItems()
+ this.buildFederationItems()
+ this.buildPluginItems()
+ this.buildRunnerItems()
+ this.buildSystemItems()
+ }
+
+ private buildFederationItems () {
+ if (!this.hasRight(UserRight.MANAGE_SERVER_FOLLOW)) return
+
+ this.menuEntries.push({
+ label: $localize`Federation`,
+ routerLink: '/admin/settings/follows/following-list',
+ children: [
+ {
+ label: $localize`Following`,
+ routerLink: '/admin/settings/follows/following-list'
+ },
+ {
+ label: $localize`Followers`,
+ routerLink: '/admin/settings/follows/followers-list'
+ },
+ {
+ label: $localize`Video redundancies`,
+ routerLink: '/admin/settings/follows/video-redundancies-list'
+ }
+ ]
+ })
+ }
+
+ private buildConfigurationItems () {
+ if (this.hasRight(UserRight.MANAGE_CONFIGURATION)) {
+ this.menuEntries.push({ label: $localize`Configuration`, routerLink: '/admin/settings/config' })
+ }
+ }
+
+ private buildPluginItems () {
+ if (this.hasRight(UserRight.MANAGE_PLUGINS)) {
+ this.menuEntries.push({
+ label: $localize`Plugins/Themes`,
+ routerLink: '/admin/settings/plugins',
+ queryParams: {
+ pluginType: PluginType.PLUGIN
+ },
+ children: [
+ {
+ label: 'Installed plugins',
+ routerLink: '/admin/settings/plugins/list-installed',
+ queryParams: {
+ pluginType: PluginType.PLUGIN
+ }
+ },
+ {
+ label: 'Search plugins',
+ routerLink: '/admin/settings/plugins/search',
+ queryParams: {
+ pluginType: PluginType.PLUGIN
+ }
+ },
+ {
+ label: 'Installed themes',
+ routerLink: '/admin/settings/plugins/list-installed',
+ queryParams: {
+ pluginType: PluginType.THEME
+ }
+ },
+ {
+ label: 'Search themes',
+ routerLink: '/admin/settings/plugins/search',
+ queryParams: {
+ pluginType: PluginType.THEME
+ }
+ }
+ ]
+ })
+ }
+ }
+
+ private buildRunnerItems () {
+ if (!this.isRemoteRunnersEnabled() || !this.hasRight(UserRight.MANAGE_RUNNERS)) return
+
+ this.menuEntries.push({
+ label: $localize`Runners`,
+ routerLink: '/admin/settings/system/runners/runners-list',
+ children: [
+ {
+ label: $localize`Remote runners`,
+ routerLink: '/admin/settings/system/runners/runners-list'
+ },
+
+ {
+ label: $localize`Runner jobs`,
+ routerLink: '/admin/settings/system/runners/jobs-list'
+ },
+
+ {
+ label: $localize`Registration tokens`,
+ routerLink: '/admin/settings/system/runners/registration-tokens-list'
+ }
+ ]
+ })
+ }
+
+ private buildSystemItems () {
+ const systemItems: HorizontalMenuEntry = {
+ label: $localize`System`,
+ routerLink: '',
+ children: []
+ }
+
+ if (this.hasRight(UserRight.MANAGE_JOBS)) {
+ systemItems.children.push({
+ label: $localize`Local jobs`,
+ routerLink: '/admin/settings/system/jobs'
+ })
+ }
+
+ if (this.hasRight(UserRight.MANAGE_LOGS)) {
+ systemItems.children.push({
+ label: $localize`Logs`,
+ routerLink: '/admin/settings/system/logs'
+ })
+ }
+
+ if (this.hasRight(UserRight.MANAGE_DEBUG)) {
+ systemItems.children.push({
+ label: $localize`Debug`,
+ routerLink: '/admin/settings/system/debug'
+ })
+ }
+
+ if (systemItems.children.length === 0) return
+
+ systemItems.routerLink = systemItems.children[0].routerLink
+
+ this.menuEntries.push(systemItems)
+ }
+
+ private hasRight (right: UserRightType) {
+ return this.auth.getUser().hasRight(right)
+ }
+
+ private isRemoteRunnersEnabled () {
+ const config = this.server.getHTMLConfig()
+
+ return config.transcoding.remoteRunners.enabled ||
+ config.live.transcoding.remoteRunners.enabled ||
+ config.videoStudio.remoteRunners.enabled ||
+ config.videoTranscription.remoteRunners.enabled
+ }
+}
diff --git a/client/src/app/+admin/admin.component.html b/client/src/app/+admin/admin.component.html
deleted file mode 100644
index 64986685d7..0000000000
--- a/client/src/app/+admin/admin.component.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<div class="root">
- <a i18n class="visually-hidden-focusable skip-to-content-sub-menu" href="#admin-content" (click)="$event.preventDefault(); adminContent.focus()">Skip the sub menu</a>
-
- <my-top-menu-dropdown [menuEntries]="menuEntries"></my-top-menu-dropdown>
-
- <div #adminContent tabindex="-1" id="admin-content" class="margin-content outline-0" [ngClass]="{ 'sub-menu-offset-content': !isBroadcastMessageDisplayed }">
- <router-outlet></router-outlet>
- </div>
-</div>
diff --git a/client/src/app/+admin/admin.component.scss b/client/src/app/+admin/admin.component.scss
deleted file mode 100644
index bdc0f8ce1f..0000000000
--- a/client/src/app/+admin/admin.component.scss
+++ /dev/null
@@ -1,10 +0,0 @@
-@use '_variables' as *;
-@use '_mixins' as *;
-
-my-top-menu-dropdown {
- flex-grow: 1;
-}
-
-.root {
- @include sub-menu-h1;
-}
diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts
deleted file mode 100644
index d021ce52fc..0000000000
--- a/client/src/app/+admin/admin.component.ts
+++ /dev/null
@@ -1,240 +0,0 @@
-import { NgClass } from '@angular/common'
-import { Component, OnInit } from '@angular/core'
-import { RouterOutlet } from '@angular/router'
-import { AuthService, ScreenService, ServerService } from '@app/core'
-import { ListOverflowItem } from '@app/shared/shared-main/menu/list-overflow.component'
-import { TopMenuDropdownParam } from '@app/shared/shared-main/menu/top-menu-dropdown.component'
-import { UserRight, UserRightType } from '@peertube/peertube-models'
-import { TopMenuDropdownComponent } from '../shared/shared-main/menu/top-menu-dropdown.component'
-
-@Component({
- templateUrl: './admin.component.html',
- styleUrls: [ './admin.component.scss' ],
- standalone: true,
- imports: [ TopMenuDropdownComponent, NgClass, RouterOutlet ]
-})
-export class AdminComponent implements OnInit {
- items: ListOverflowItem[] = []
- menuEntries: TopMenuDropdownParam[] = []
-
- constructor (
- private auth: AuthService,
- private screen: ScreenService,
- private server: ServerService
- ) { }
-
- get isBroadcastMessageDisplayed () {
- return this.screen.isBroadcastMessageDisplayed
- }
-
- ngOnInit () {
- this.server.configReloaded.subscribe(() => this.buildMenu())
-
- this.buildMenu()
- }
-
- private buildMenu () {
- this.menuEntries = []
-
- this.buildOverviewItems()
- this.buildFederationItems()
- this.buildModerationItems()
- this.buildConfigurationItems()
- this.buildPluginItems()
- this.buildSystemItems()
- }
-
- private buildOverviewItems () {
- const overviewItems: TopMenuDropdownParam = {
- label: $localize`Overview`,
- children: []
- }
-
- if (this.hasRight(UserRight.MANAGE_USERS)) {
- overviewItems.children.push({
- label: $localize`Users`,
- routerLink: '/admin/users',
- iconName: 'user'
- })
- }
-
- if (this.hasRight(UserRight.SEE_ALL_VIDEOS)) {
- overviewItems.children.push({
- label: $localize`Videos`,
- routerLink: '/admin/videos',
- queryParams: {
- search: 'isLocal:true'
- },
- iconName: 'videos'
- })
- }
-
- if (this.hasRight(UserRight.SEE_ALL_COMMENTS)) {
- overviewItems.children.push({
- label: $localize`Comments`,
- routerLink: '/admin/comments',
- iconName: 'message-circle'
- })
- }
-
- if (overviewItems.children.length !== 0) {
- this.menuEntries.push(overviewItems)
- }
- }
-
- private buildFederationItems () {
- if (!this.hasRight(UserRight.MANAGE_SERVER_FOLLOW)) return
-
- this.menuEntries.push({
- label: $localize`Federation`,
- children: [
- {
- label: $localize`Following`,
- routerLink: '/admin/follows/following-list',
- iconName: 'following'
- },
- {
- label: $localize`Followers`,
- routerLink: '/admin/follows/followers-list',
- iconName: 'follower'
- },
- {
- label: $localize`Video redundancies`,
- routerLink: '/admin/follows/video-redundancies-list',
- iconName: 'videos'
- }
- ]
- })
- }
-
- private buildModerationItems () {
- const moderationItems: TopMenuDropdownParam = {
- label: $localize`Moderation`,
- children: []
- }
-
- if (this.hasRight(UserRight.MANAGE_REGISTRATIONS)) {
- moderationItems.children.push({
- label: $localize`Registrations`,
- routerLink: '/admin/moderation/registrations/list',
- iconName: 'user'
- })
- }
-
- if (this.hasRight(UserRight.MANAGE_ABUSES)) {
- moderationItems.children.push({
- label: $localize`Reports`,
- routerLink: '/admin/moderation/abuses/list',
- iconName: 'flag'
- })
- }
-
- if (this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)) {
- moderationItems.children.push({
- label: $localize`Video blocks`,
- routerLink: '/admin/moderation/video-blocks/list',
- iconName: 'cross'
- })
- }
-
- if (this.hasRight(UserRight.MANAGE_ACCOUNTS_BLOCKLIST)) {
- moderationItems.children.push({
- label: $localize`Muted accounts`,
- routerLink: '/admin/moderation/blocklist/accounts',
- iconName: 'user-x'
- })
- }
-
- if (this.hasRight(UserRight.MANAGE_SERVERS_BLOCKLIST)) {
- moderationItems.children.push({
- label: $localize`Muted servers`,
- routerLink: '/admin/moderation/blocklist/servers',
- iconName: 'peertube-x'
- })
- }
-
- if (this.hasRight(UserRight.MANAGE_INSTANCE_WATCHED_WORDS)) {
- moderationItems.children.push({
- label: $localize`Watched words`,
- routerLink: '/admin/moderation/watched-words/list',
- iconName: 'eye-open'
- })
- }
-
- if (moderationItems.children.length !== 0) this.menuEntries.push(moderationItems)
- }
-
- private buildConfigurationItems () {
- if (this.hasRight(UserRight.MANAGE_CONFIGURATION)) {
- this.menuEntries.push({ label: $localize`Configuration`, routerLink: '/admin/config' })
- }
- }
-
- private buildPluginItems () {
- if (this.hasRight(UserRight.MANAGE_PLUGINS)) {
- this.menuEntries.push({ label: $localize`Plugins/Themes`, routerLink: '/admin/plugins' })
- }
- }
-
- private buildSystemItems () {
- const systemItems: TopMenuDropdownParam = {
- label: $localize`System`,
- children: []
- }
-
- if (this.isRemoteRunnersEnabled() && this.hasRight(UserRight.MANAGE_RUNNERS)) {
- systemItems.children.push({
- label: $localize`Remote runners`,
- iconName: 'codesandbox',
- routerLink: '/admin/system/runners/runners-list'
- })
-
- systemItems.children.push({
- label: $localize`Runner jobs`,
- iconName: 'globe',
- routerLink: '/admin/system/runners/jobs-list'
- })
- }
-
- if (this.hasRight(UserRight.MANAGE_JOBS)) {
- systemItems.children.push({
- label: $localize`Local jobs`,
- iconName: 'circle-tick',
- routerLink: '/admin/system/jobs'
- })
- }
-
- if (this.hasRight(UserRight.MANAGE_LOGS)) {
- systemItems.children.push({
- label: $localize`Logs`,
- iconName: 'playlists',
- routerLink: '/admin/system/logs'
- })
- }
-
- if (this.hasRight(UserRight.MANAGE_DEBUG)) {
- systemItems.children.push({
- label: $localize`Debug`,
- iconName: 'cog',
- routerLink: '/admin/system/debug'
- })
- }
-
- if (systemItems.children.length !== 0) {
- this.menuEntries.push(systemItems)
- }
- }
-
- private hasRight (right: UserRightType) {
- return this.auth.getUser().hasRight(right)
- }
-
- private isRemoteRunnersEnabled () {
- const config = this.server.getHTMLConfig()
-
- return config.transcoding.remoteRunners.enabled ||
- config.live.transcoding.remoteRunners.enabled ||
- config.videoStudio.remoteRunners.enabled ||
- config.videoTranscription.remoteRunners.enabled
- }
-}
diff --git a/client/src/app/+admin/config/config.routes.ts b/client/src/app/+admin/config/config.routes.ts
index 96a4f3771b..072c2dd21e 100644
--- a/client/src/app/+admin/config/config.routes.ts
+++ b/client/src/app/+admin/config/config.routes.ts
@@ -3,7 +3,7 @@ import { EditCustomConfigComponent } from '@app/+admin/config/edit-custom-config
import { UserRightGuard } from '@app/core'
import { UserRight } from '@peertube/peertube-models'
-export const ConfigRoutes: Routes = [
+export const configRoutes: Routes = [
{
path: 'config',
canActivate: [ UserRightGuard ],
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html
index 15bd1c2e0b..b5f31e5d96 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html
@@ -4,7 +4,7 @@
<h2 i18n>APPEARANCE</h2>
<div i18n class="inner-form-description">
- Use <a class="link-orange" routerLink="/admin/plugins">plugins & themes</a> for more involved changes, or add slight <a class="link-orange" routerLink="/admin/config/edit-custom" fragment="advanced-configuration">customizations</a>.
+ Use <a class="link-primary" routerLink="/admin/settings/plugins">plugins & themes</a> for more involved changes, or add slight <a class="link-primary" routerLink="/admin/settings/config/edit-custom" fragment="advanced-configuration">customizations</a>.
</div>
</div>
@@ -14,13 +14,7 @@
<div class="form-group">
<label i18n for="themeDefault">Theme</label>
- <div class="peertube-select-container">
- <select formControlName="default" id="themeDefault" class="form-control">
- <option i18n value="default">{{ getDefaultThemeLabel() }}</option>
-
- <option *ngFor="let theme of availableThemes" [value]="theme.id">{{ theme.label }}</option>
- </select>
- </div>
+ <my-select-options formControlName="default" inputId="themeDefault" [items]="availableThemes"></my-select-options>
</div>
</ng-container>
@@ -42,7 +36,7 @@
<div class="form-group" formGroupName="trending">
<ng-container formGroupName="videos">
<ng-container formGroupName="algorithms">
- <label i18n for="trendingVideosAlgorithmsDefault">Default trending page</label>
+ <label i18n for="trendingVideosAlgorithmsDefault">Default trending algorithm</label>
<div class="peertube-select-container">
<select id="trendingVideosAlgorithmsDefault" formControlName="default" class="form-control">
@@ -151,7 +145,7 @@
<div class="title-col">
<h2 i18n>NEW USERS</h2>
<div i18n class="inner-form-description">
- Manage <a class="link-orange" routerLink="/admin/users">users</a> to set their quota individually.
+ Manage <a class="link-primary" routerLink="/admin/overview/users">users</a> to set their quota individually.
</div>
</div>
@@ -296,7 +290,7 @@
i18n-labelText labelText="Allow import with HTTP URL (e.g. YouTube)"
>
<ng-container ngProjectAs="description">
- <span i18n>⚠️ If enabled, we recommend to use <a class="link-orange" href="https://docs.joinpeertube.org/maintain/configuration#security">a HTTP proxy</a> to prevent private URL access from your PeerTube server</span>
+ <span i18n>⚠️ If enabled, we recommend to use <a class="link-primary" href="https://docs.joinpeertube.org/maintain/configuration#security">a HTTP proxy</a> to prevent private URL access from your PeerTube server</span>
</ng-container>
</my-peertube-checkbox>
</div>
@@ -393,7 +387,7 @@
>
<ng-container ngProjectAs="description">
<span i18n>
- Use <a routerLink="/admin/system/runners/runners-list">remote runners</a> to process transcription tasks.
+ Use <a routerLink="/admin/settings/system/runners/runners-list">remote runners</a> to process transcription tasks.
Remote runners has to register on your instance first.
</span>
</ng-container>
@@ -472,7 +466,7 @@
<div i18n>⚠️ This functionality depends heavily on the moderation of instances followed by the search index you select.</div>
<div i18n>
- You should only use moderated search indexes in production, or <a class="link-orange" href="https://framagit.org/framasoft/peertube/search-index">host your own</a>.
+ You should only use moderated search indexes in production, or <a class="link-primary" href="https://framagit.org/framasoft/peertube/search-index">host your own</a>.
</div>
</ng-container>
@@ -595,7 +589,7 @@
<div class="title-col">
<h2 i18n>FEDERATION</h2>
<div i18n class="inner-form-description">
- Manage <a class="link-orange" routerLink="/admin/follows">relations</a> with other instances.
+ Manage <a class="link-primary" routerLink="/admin/settings/follows">relations</a> with other instances.
</div>
</div>
@@ -646,7 +640,7 @@
<div i18n>⚠️ This functionality requires a lot of attention and extra moderation.</div>
<span i18n>
- See <a class="link-orange" href="https://docs.joinpeertube.org/admin/following-instances#automatically-follow-other-instances" rel="noopener noreferrer" target="_blank">the documentation</a> for more information about the expected URL
+ See <a class="link-primary" href="https://docs.joinpeertube.org/admin/following-instances#automatically-follow-other-instances" rel="noopener noreferrer" target="_blank">the documentation</a> for more information about the expected URL
</span>
</ng-container>
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts
index 6b136742f9..4fe9c9ccbe 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts
+++ b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts
@@ -2,7 +2,7 @@ import { NgClass, NgFor, NgIf } from '@angular/common'
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'
import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'
import { RouterLink } from '@angular/router'
-import { MenuService, ThemeService } from '@app/core'
+import { ThemeService } from '@app/core'
import { AlertComponent } from '@app/shared/shared-main/common/alert.component'
import { HTMLServerConfig } from '@peertube/peertube-models'
import { pairwise } from 'rxjs/operators'
@@ -12,7 +12,6 @@ import { PeertubeCheckboxComponent } from '../../../shared/shared-forms/peertube
import { SelectCustomValueComponent } from '../../../shared/shared-forms/select/select-custom-value.component'
import { SelectOptionsComponent } from '../../../shared/shared-forms/select/select-options.component'
import { HelpComponent } from '../../../shared/shared-main/buttons/help.component'
-import { PeerTubeTemplateDirective } from '../../../shared/shared-main/common/peertube-template.directive'
import { UserRealQuotaInfoComponent } from '../../shared/user-real-quota-info.component'
import { ConfigService } from '../shared/config.service'
@@ -34,7 +33,6 @@ import { ConfigService } from '../shared/config.service'
NgClass,
UserRealQuotaInfoComponent,
SelectOptionsComponent,
- PeerTubeTemplateDirective,
AlertComponent
]
})
@@ -53,7 +51,6 @@ export class EditBasicConfigurationComponent implements OnInit, OnChanges {
constructor (
private configService: ConfigService,
- private menuService: MenuService,
private themeService: ThemeService
) {}
@@ -62,7 +59,11 @@ export class EditBasicConfigurationComponent implements OnInit, OnChanges {
this.checkSignupField()
this.checkImportSyncField()
- this.availableThemes = this.themeService.buildAvailableThemes()
+ this.availableThemes = [
+ this.themeService.getDefaultThemeItem(),
+
+ ...this.themeService.buildAvailableThemes()
+ ]
this.exportExpirationOptions = [
{ id: 1000 * 3600 * 24, label: $localize`1 day` },
@@ -156,17 +157,22 @@ export class EditBasicConfigurationComponent implements OnInit, OnChanges {
}
buildLandingPageOptions () {
- this.defaultLandingPageOptions = this.menuService.buildCommonLinks(this.serverConfig)
- .links
- .map(o => ({
- id: o.path,
- label: o.label,
- description: o.path
- }))
- }
+ let links: { label: string, path: string }[] = []
+
+ if (this.serverConfig.homepage.enabled) {
+ links.push({ label: $localize`Home`, path: '/home' })
+ }
+
+ links = links.concat([
+ { label: $localize`Discover`, path: '/videos/overview' },
+ { label: $localize`Browse videos`, path: '/videos/browse' }
+ ])
- getDefaultThemeLabel () {
- return this.themeService.getDefaultThemeLabel()
+ this.defaultLandingPageOptions = links.map(o => ({
+ id: o.path,
+ label: o.label,
+ description: o.path
+ }))
}
private checkImportSyncField () {
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
index f2e704ba22..294299e20f 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
@@ -87,6 +87,7 @@
</span>
<input
+ class="peertube-button primary-button"
(click)="formValidated()" type="submit" i18n-value value="Update configuration"
[disabled]="!form.valid || !hasConsistentOptions() || !isUpdateAllowed()"
>
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss
index 01fb2c5357..f2884ad299 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
$form-base-input-width: 340px;
$form-max-width: 500px;
@@ -33,8 +34,8 @@ input[type=number] {
input[type=number] + span {
position: absolute;
- top: 0.2em;
- right: 2.5rem;
+ top: 0.4em;
+ right: 3em;
@media screen and (max-width: $mobile-view) {
display: none;
@@ -42,13 +43,13 @@ input[type=number] {
}
input[disabled] {
- background-color: #f9f9f9;
+ opacity: 0.8;
pointer-events: none;
}
}
input[type=checkbox] {
- @include peertube-checkbox(1px);
+ @include peertube-checkbox;
}
.peertube-select-container {
@@ -65,8 +66,6 @@ my-select-custom-value {
input[type=submit] {
display: flex;
- @include peertube-button;
- @include orange-button;
@include margin-left(auto);
+ .form-error {
@@ -131,18 +130,6 @@ ngb-tabset:not(.previews) ::ng-deep {
height: 0;
width: 100%;
justify-content: right;
-
- .callout-link {
- position: relative;
- right: 3.3em;
- top: .3em;
- font-size: 90%;
- color: pvar(--mainColor);
- background-color: pvar(--mainBackgroundColor);
- padding: 0 .3em;
-
- @include peertube-button-link;
- }
}
my-actor-banner-edit {
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html b/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html
index 71cb054911..4b12ac768e 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html
@@ -106,7 +106,7 @@
<div class="title-col">
<h2 i18n>MODERATION & NSFW</h2>
<div i18n class="inner-form-description">
- Manage <a class="link-orange" routerLink="/admin/users">users</a> to build a moderation team.
+ Manage <a class="link-primary" routerLink="/admin/overview/users">users</a> to build a moderation team.
</div>
</div>
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html b/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html
index b55a3d9b03..a60372dd1a 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html
@@ -166,7 +166,7 @@
>
<ng-container ngProjectAs="description">
<span i18n>
- Use <a routerLink="/admin/system/runners/runners-list">remote runners</a> to process live transcoding.
+ Use <a routerLink="/admin/settings/system/runners/runners-list">remote runners</a> to process live transcoding.
Remote runners has to register on your instance first.
</span>
</ng-container>
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html
index 5b1efceff1..3c804f0cca 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html
@@ -4,7 +4,7 @@
<div class="title-col"></div>
<div class="content-col">
- <div class="callout callout-orange">
+ <div class="callout callout-primary">
<span i18n>
Estimating a server's capacity to transcode and stream videos isn't easy and we can't tune PeerTube automatically.
</span>
@@ -12,7 +12,7 @@
<br />
<span i18n>
- However, you may want to read <a class="link-orange" target="_blank" rel="noopener noreferrer" href="https://docs.joinpeertube.org/admin/configuration#vod-transcoding">our guidelines</a> before tweaking the following values.
+ However, you may want to read <a class="link-primary" target="_blank" rel="noopener noreferrer" href="https://docs.joinpeertube.org/admin/configuration#vod-transcoding">our guidelines</a> before tweaking the following values.
</span>
</div>
</div>
@@ -192,7 +192,7 @@
>
<ng-container ngProjectAs="description">
<span i18n>
- Use <a routerLink="/admin/system/runners/runners-list">remote runners</a> to process VOD transcoding.
+ Use <a routerLink="/admin/settings/system/runners/runners-list">remote runners</a> to process VOD transcoding.
Remote runners has to register on your instance first.
</span>
</ng-container>
@@ -278,7 +278,7 @@
>
<ng-container ngProjectAs="description">
<span i18n>
- Use <a routerLink="/admin/system/runners/runners-list">remote runners</a> to process studio transcoding tasks.
+ Use <a routerLink="/admin/settings/system/runners/runners-list">remote runners</a> to process studio transcoding tasks.
Remote runners has to register on your instance first.
</span>
</ng-container>
diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.html b/client/src/app/+admin/follows/followers-list/followers-list.component.html
index 8bb1871dde..c665dce361 100644
--- a/client/src/app/+admin/follows/followers-list/followers-list.component.html
+++ b/client/src/app/+admin/follows/followers-list/followers-list.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="follower" aria-hidden="true"></my-global-icon>
- <h1 i18n>Followers of your instance</h1>
- </div>
-</div>
-
<p-table
[value]="followers" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
[rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order"
@@ -16,7 +9,7 @@
<div class="caption">
<div class="left-buttons">
<my-action-dropdown
- *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange"
+ *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="primary"
[actions]="bulkActions" [entry]="selectedRows"
>
</my-action-dropdown>
diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.scss b/client/src/app/+admin/follows/followers-list/followers-list.component.scss
index f00d413a90..c442dca4c8 100644
--- a/client/src/app/+admin/follows/followers-list/followers-list.component.scss
+++ b/client/src/app/+admin/follows/followers-list/followers-list.component.scss
@@ -1,22 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
-a {
- display: inline-block;
-
- @include disable-default-a-behaviour;
-
- &,
- &:hover {
- color: pvar(--mainForegroundColor);
- }
-
- span {
- font-size: 80%;
- color: pvar(--inputPlaceholderColor);
- }
-}
-
.action-cell {
my-button:first-child {
@include margin-right(10px);
diff --git a/client/src/app/+admin/follows/following-list/follow-modal.component.html b/client/src/app/+admin/follows/following-list/follow-modal.component.html
index 43c89c3e34..dd306ab6ca 100644
--- a/client/src/app/+admin/follows/following-list/follow-modal.component.html
+++ b/client/src/app/+admin/follows/following-list/follow-modal.component.html
@@ -32,11 +32,11 @@
<div class="form-group inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
- <input type="submit" i18n-value value="Follow" class="peertube-button orange-button" [disabled]="!form.valid" />
+ <input type="submit" i18n-value value="Follow" class="peertube-button primary-button" [disabled]="!form.valid" />
</div>
</form>
</div>
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.html b/client/src/app/+admin/follows/following-list/following-list.component.html
index ab13f64498..fbe173de92 100644
--- a/client/src/app/+admin/follows/following-list/following-list.component.html
+++ b/client/src/app/+admin/follows/following-list/following-list.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="following" aria-hidden="true"></my-global-icon>
- <h1 i18n>Subscriptions of your instance</h1>
- </div>
-</div>
-
<p-table
[value]="following" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
[rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order"
@@ -16,7 +9,7 @@
<div class="caption">
<div class="left-buttons">
<my-action-dropdown
- *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange"
+ *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="primary"
[actions]="bulkActions" [entry]="selectedRows"
>
</my-action-dropdown>
@@ -27,7 +20,7 @@
</button>
</div>
- <div class="ms-auto d-flex gap-1">
+ <div class="ms-auto d-flex gap-1 flex-wrap">
<my-advanced-input-filter [filters]="searchFilters" (search)="onSearch($event)"></my-advanced-input-filter>
<my-button i18n-label label="Refresh" icon="refresh" (click)="reloadData()"></my-button>
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.scss b/client/src/app/+admin/follows/following-list/following-list.component.scss
index 3f184e2b57..89bde6b87d 100644
--- a/client/src/app/+admin/follows/following-list/following-list.component.scss
+++ b/client/src/app/+admin/follows/following-list/following-list.component.scss
@@ -2,19 +2,7 @@
@use '_mixins' as *;
a {
- display: inline-block;
-
- @include disable-default-a-behaviour;
-
- &,
- &:hover {
- color: pvar(--mainForegroundColor);
- }
-
- span {
- font-size: 80%;
- color: pvar(--inputPlaceholderColor);
- }
+ color: pvar(--fg);
}
my-delete-button {
diff --git a/client/src/app/+admin/follows/follows.routes.ts b/client/src/app/+admin/follows/follows.routes.ts
index e187f83ea3..5679412308 100644
--- a/client/src/app/+admin/follows/follows.routes.ts
+++ b/client/src/app/+admin/follows/follows.routes.ts
@@ -5,7 +5,7 @@ import { UserRight } from '@peertube/peertube-models'
import { FollowersListComponent } from './followers-list'
import { FollowingListComponent } from './following-list/following-list.component'
-export const FollowsRoutes: Routes = [
+export const followsRoutes: Routes = [
{
path: 'follows',
canActivate: [ UserRightGuard ],
diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html
index 7ded2a6f97..d0fde3d308 100644
--- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html
+++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="videos" aria-hidden="true"></my-global-icon>
- <h1 i18n>Videos redundancies</h1>
- </div>
-</div>
-
<div class="admin-sub-header">
<div class="select-filter-block">
<label for="displayType" i18n>Display</label>
diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.scss b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.scss
index cd4f48f46e..b62e79e4fa 100644
--- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.scss
+++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.scss
@@ -1,20 +1,9 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
a {
- display: inline-block;
-
- @include disable-default-a-behaviour;
-
- &,
- &:hover {
- color: pvar(--mainForegroundColor);
- }
-
- span {
- font-size: 80%;
- color: pvar(--inputPlaceholderColor);
- }
+ color: pvar(--fg);
}
.expansion-block {
diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts
index 2fb0a20110..c9c8fb368d 100644
--- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts
+++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts
@@ -39,7 +39,7 @@ import { VideoRedundancyInformationComponent } from './video-redundancy-informat
]
})
export class VideoRedundanciesListComponent extends RestTable implements OnInit {
- private static LOCAL_STORAGE_DISPLAY_TYPE = 'video-redundancies-list-display-type'
+ private static LS_DISPLAY_TYPE = 'video-redundancies-list-display-type'
videoRedundancies: VideoRedundancy[] = []
totalRecords = 0
@@ -211,12 +211,12 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit
}
private loadSelectLocalStorage () {
- const displayType = peertubeLocalStorage.getItem(VideoRedundanciesListComponent.LOCAL_STORAGE_DISPLAY_TYPE)
+ const displayType = peertubeLocalStorage.getItem(VideoRedundanciesListComponent.LS_DISPLAY_TYPE)
if (displayType) this.displayType = displayType as VideoRedundanciesTarget
}
private saveSelectLocalStorage () {
- peertubeLocalStorage.setItem(VideoRedundanciesListComponent.LOCAL_STORAGE_DISPLAY_TYPE, this.displayType)
+ peertubeLocalStorage.setItem(VideoRedundanciesListComponent.LS_DISPLAY_TYPE, this.displayType)
}
private bytesToHuman (bytes: number) {
diff --git a/client/src/app/+admin/moderation/abuse-list/abuse-list.component.html b/client/src/app/+admin/moderation/abuse-list/abuse-list.component.html
index 6603252386..f620f15a26 100644
--- a/client/src/app/+admin/moderation/abuse-list/abuse-list.component.html
+++ b/client/src/app/+admin/moderation/abuse-list/abuse-list.component.html
@@ -1,8 +1 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="flag" aria-hidden="true"></my-global-icon>
- <h1 i18n>Reports</h1>
- </div>
-</div>
-
<my-abuse-list-table viewType="admin"></my-abuse-list-table>
diff --git a/client/src/app/+admin/moderation/moderation.routes.ts b/client/src/app/+admin/moderation/moderation.routes.ts
index d354f8dcc2..639f9b6818 100644
--- a/client/src/app/+admin/moderation/moderation.routes.ts
+++ b/client/src/app/+admin/moderation/moderation.routes.ts
@@ -7,7 +7,7 @@ import { UserRight } from '@peertube/peertube-models'
import { RegistrationListComponent } from './registration-list'
import { WatchedWordsListAdminComponent } from './watched-words-list/watched-words-list-admin.component'
-export const ModerationRoutes: Routes = [
+export const moderationRoutes: Routes = [
{
path: 'moderation',
children: [
@@ -90,7 +90,7 @@ export const ModerationRoutes: Routes = [
},
{
path: 'video-comments/list',
- redirectTo: '/admin/comments/list',
+ redirectTo: '/admin/overview/comments/list',
pathMatch: 'full'
},
diff --git a/client/src/app/+admin/moderation/registration-list/process-registration-modal.component.html b/client/src/app/+admin/moderation/registration-list/process-registration-modal.component.html
index 17d18f9805..5fac1bd798 100644
--- a/client/src/app/+admin/moderation/registration-list/process-registration-modal.component.html
+++ b/client/src/app/+admin/moderation/registration-list/process-registration-modal.component.html
@@ -66,11 +66,11 @@
<div class="modal-footer inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
- <input type="submit" [value]="getSubmitValue()" class="peertube-button orange-button" [disabled]="!form.valid">
+ <input type="submit" [value]="getSubmitValue()" class="peertube-button primary-button" [disabled]="!form.valid">
</div>
</form>
</ng-template>
diff --git a/client/src/app/+admin/moderation/registration-list/registration-list.component.html b/client/src/app/+admin/moderation/registration-list/registration-list.component.html
index 7e7a823c3c..054180fdf0 100644
--- a/client/src/app/+admin/moderation/registration-list/registration-list.component.html
+++ b/client/src/app/+admin/moderation/registration-list/registration-list.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="user" aria-hidden="true"></my-global-icon>
- <h1 i18n>Registration requests</h1>
- </div>
-</div>
-
<p-table
[value]="registrations" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
[rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id"
@@ -16,7 +9,7 @@
<div class="caption">
<div class="left-buttons">
<my-action-dropdown
- *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange"
+ *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="primary"
[actions]="bulkActions" [entry]="selectedRows"
>
</my-action-dropdown>
@@ -62,7 +55,7 @@
<td class="action-cell">
<my-action-dropdown
[ngClass]="{ 'show': expanded }" placement="bottom-right top-right left auto" container="body"
- i18n-label label="Actions" [actions]="registrationActions" [entry]="registration"
+ i18n-label label="Actions" [actions]="registrationActions" [entry]="registration" buttonSize="small"
></my-action-dropdown>
</td>
diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html
index 9ac8edb7ff..8616726614 100644
--- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html
+++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="cross" aria-hidden="true"></my-global-icon>
- <h1 i18n>Video blocks</h1>
- </div>
-</div>
-
<p-table
[value]="blocklist" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
[rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id"
@@ -48,7 +41,7 @@
<td class="action-cell">
<my-action-dropdown
[ngClass]="{ 'show': expanded }" placement="bottom-right auto" container="body"
- i18n-label label="Actions" [actions]="videoBlocklistActions" [entry]="videoBlock"
+ i18n-label label="Actions" [actions]="videoBlocklistActions" [entry]="videoBlock" buttonSize="small"
></my-action-dropdown>
</td>
diff --git a/client/src/app/+admin/moderation/watched-words-list/watched-words-list-admin.component.html b/client/src/app/+admin/moderation/watched-words-list/watched-words-list-admin.component.html
index 99b711b8ab..370a11fc3b 100644
--- a/client/src/app/+admin/moderation/watched-words-list/watched-words-list-admin.component.html
+++ b/client/src/app/+admin/moderation/watched-words-list/watched-words-list-admin.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="eye-open" aria-hidden="true"></my-global-icon>
- <h1 i18n>Instance watched words lists</h1>
- </div>
-</div>
-
<em class="d-block" i18n>Video name/description and comments that contain any of the watched words are automatically tagged with the name of the list.</em>
<em class="d-block mb-3" i18n>These automatic tags can be used to filter comments and videos.</em>
diff --git a/client/src/app/+admin/overview/comments/index.ts b/client/src/app/+admin/overview/comments/index.ts
index c487f7a810..eb08b41776 100644
--- a/client/src/app/+admin/overview/comments/index.ts
+++ b/client/src/app/+admin/overview/comments/index.ts
@@ -1,2 +1 @@
export * from './video-comment-list.component'
-export * from './video-comment.routes'
diff --git a/client/src/app/+admin/overview/comments/video-comment-list.component.html b/client/src/app/+admin/overview/comments/video-comment-list.component.html
index 8b6a7d7db1..c48853e9f9 100644
--- a/client/src/app/+admin/overview/comments/video-comment-list.component.html
+++ b/client/src/app/+admin/overview/comments/video-comment-list.component.html
@@ -1,12 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon class="top--1px" iconName="message-circle" aria-hidden="true"></my-global-icon>
- <h1 i18n>Video comments</h1>
-
- <my-feed [syndicationItems]="syndicationItems"></my-feed>
- </div>
-</div>
-
<em i18n>This view also shows comments from muted accounts.</em>
<my-video-comment-list-admin-owner mode="admin"></my-video-comment-list-admin-owner>
diff --git a/client/src/app/+admin/overview/comments/video-comment.routes.ts b/client/src/app/+admin/overview/comments/video-comment.routes.ts
deleted file mode 100644
index f670274300..0000000000
--- a/client/src/app/+admin/overview/comments/video-comment.routes.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { Routes } from '@angular/router'
-import { UserRightGuard } from '@app/core'
-import { UserRight } from '@peertube/peertube-models'
-import { VideoCommentListComponent } from './video-comment-list.component'
-
-export const commentRoutes: Routes = [
- {
- path: 'comments',
- canActivate: [ UserRightGuard ],
- data: {
- userRight: UserRight.SEE_ALL_COMMENTS
- },
- children: [
- {
- path: '',
- redirectTo: 'list',
- pathMatch: 'full'
- },
- {
- path: 'list',
- component: VideoCommentListComponent,
- data: {
- meta: {
- title: $localize`Comments list`
- }
- }
- }
- ]
- }
-]
diff --git a/client/src/app/+admin/overview/overview.routes.ts b/client/src/app/+admin/overview/overview.routes.ts
index 72d6835d71..ecd628fe52 100644
--- a/client/src/app/+admin/overview/overview.routes.ts
+++ b/client/src/app/+admin/overview/overview.routes.ts
@@ -1,10 +1,132 @@
-import { Routes } from '@angular/router'
-import { commentRoutes } from './comments'
-import { usersRoutes } from './users'
-import { videosRoutes } from './videos'
-
-export const OverviewRoutes: Routes = [
- ...commentRoutes,
- ...usersRoutes,
- ...videosRoutes
+import { Routes, UrlSegment } from '@angular/router'
+import { VideoCommentListComponent } from './comments'
+import { UserCreateComponent, UserListComponent, UserUpdateComponent } from './users'
+import { VideoListComponent } from './videos'
+import { UserRightGuard } from '@app/core'
+import { UserRight } from '@peertube/peertube-models'
+
+function basePathRedirect ({ url }: { url: UrlSegment[] }) {
+ return `/admin/overview/${url.map(u => u.path).join('/')}`
+}
+
+export const overviewRoutes: Routes = [
+ {
+ path: 'comments',
+ pathMatch: 'prefix',
+ redirectTo: basePathRedirect
+ },
+
+ {
+ path: 'videos',
+ pathMatch: 'prefix',
+ redirectTo: basePathRedirect
+ },
+
+ {
+ path: 'users',
+ pathMatch: 'prefix',
+ redirectTo: basePathRedirect
+ },
+
+ {
+ path: 'overview',
+
+ children: [
+ {
+ path: '',
+ pathMatch: 'full',
+ redirectTo: 'users'
+ },
+
+ {
+ path: 'comments',
+ canActivate: [ UserRightGuard ],
+ data: {
+ userRight: UserRight.SEE_ALL_COMMENTS
+ },
+ children: [
+ {
+ path: '',
+ redirectTo: 'list',
+ pathMatch: 'full'
+ },
+ {
+ path: 'list',
+ component: VideoCommentListComponent,
+ data: {
+ meta: {
+ title: $localize`Comments list`
+ }
+ }
+ }
+ ]
+ },
+
+ {
+ path: 'users',
+ canActivate: [ UserRightGuard ],
+ data: {
+ userRight: UserRight.MANAGE_USERS
+ },
+ children: [
+ {
+ path: '',
+ redirectTo: 'list',
+ pathMatch: 'full'
+ },
+ {
+ path: 'list',
+ component: UserListComponent,
+ data: {
+ meta: {
+ title: $localize`Users list`
+ }
+ }
+ },
+ {
+ path: 'create',
+ component: UserCreateComponent,
+ data: {
+ meta: {
+ title: $localize`Create a user`
+ }
+ }
+ },
+ {
+ path: 'update/:id',
+ component: UserUpdateComponent,
+ data: {
+ meta: {
+ title: $localize`Update a user`
+ }
+ }
+ }
+ ]
+ },
+
+ {
+ path: 'videos',
+ canActivate: [ UserRightGuard ],
+ data: {
+ userRight: UserRight.SEE_ALL_VIDEOS
+ },
+ children: [
+ {
+ path: '',
+ redirectTo: 'list',
+ pathMatch: 'full'
+ },
+ {
+ path: 'list',
+ component: VideoListComponent,
+ data: {
+ meta: {
+ title: $localize`Videos list`
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
]
diff --git a/client/src/app/+admin/overview/users/index.ts b/client/src/app/+admin/overview/users/index.ts
index 6f15ab578d..6792f7a76c 100644
--- a/client/src/app/+admin/overview/users/index.ts
+++ b/client/src/app/+admin/overview/users/index.ts
@@ -1,3 +1,2 @@
export * from './user-edit'
export * from './user-list'
-export * from './users.routes'
diff --git a/client/src/app/+admin/overview/users/user-edit/user-create.component.ts b/client/src/app/+admin/overview/users/user-edit/user-create.component.ts
index f62e077cc7..8800e07143 100644
--- a/client/src/app/+admin/overview/users/user-edit/user-create.component.ts
+++ b/client/src/app/+admin/overview/users/user-edit/user-create.component.ts
@@ -108,7 +108,7 @@ export class UserCreateComponent extends UserEdit implements OnInit {
.subscribe({
next: () => {
this.notifier.success($localize`User ${userCreate.username} created.`)
- this.router.navigate([ '/admin/users/list' ])
+ this.router.navigate([ '/admin/overview/users/list' ])
},
error: err => {
diff --git a/client/src/app/+admin/overview/users/user-edit/user-edit.component.html b/client/src/app/+admin/overview/users/user-edit/user-edit.component.html
index dd307b2673..674569849c 100644
--- a/client/src/app/+admin/overview/users/user-edit/user-edit.component.html
+++ b/client/src/app/+admin/overview/users/user-edit/user-edit.component.html
@@ -1,15 +1,15 @@
<nav aria-label="breadcrumb">
<ol class="pt-breadcrumb">
<li class="breadcrumb-item">
- <a routerLink="/admin/users" i18n>Users</a>
+ <a routerLink="/admin/overview/users" i18n>Users</a>
</li>
@if (isCreation()) {
- <li class="breadcrumb-item active" i18n>Create</li>
+ <li class="breadcrumb-item" i18n>Create</li>
} @else {
- <li class="breadcrumb-item active" i18n>Edit</li>
+ <li class="breadcrumb-item" i18n>Edit</li>
- <li class="breadcrumb-item active" aria-current="page">
+ <li class="breadcrumb-item" aria-current="page">
<a *ngIf="user" [routerLink]="[ '/a', user?.username ]">{{ user?.username }}</a>
</li>
}
@@ -207,7 +207,7 @@
</my-peertube-checkbox>
</div>
- <input class="peertube-button orange-button" type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
+ <input class="peertube-button primary-button" type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
</form>
<div class="d-none d-xxl-block col-7">
diff --git a/client/src/app/+admin/overview/users/user-edit/user-edit.component.scss b/client/src/app/+admin/overview/users/user-edit/user-edit.component.scss
index 66a03d93eb..cb5fd3c773 100644
--- a/client/src/app/+admin/overview/users/user-edit/user-edit.component.scss
+++ b/client/src/app/+admin/overview/users/user-edit/user-edit.component.scss
@@ -1,6 +1,8 @@
@use 'sass:math';
@use '_variables' as *;
@use '_mixins' as *;
+@use 'form-mixins' as *;
+@use '_button-mixins' as *;
$form-base-input-width: 340px;
@@ -54,7 +56,7 @@ my-select-custom-value {
> a,
> div {
padding: 20px;
- background: pvar(--submenuBackgroundColor);
+ background: pvar(--bg-secondary-400);
border-radius: 4px;
box-sizing: border-box;
height: 100%;
@@ -65,14 +67,14 @@ my-select-custom-value {
.dashboard-text {
text-align: center;
font-size: 130%;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
line-height: 30px;
margin-bottom: 20px;
}
.dashboard-label {
font-size: 90%;
- color: pvar(--inputPlaceholderColor);
+ color: pvar(--fg-300);
text-align: center;
}
}
diff --git a/client/src/app/+admin/overview/users/user-edit/user-password.component.html b/client/src/app/+admin/overview/users/user-edit/user-password.component.html
index dfe186e1be..1f8fca0502 100644
--- a/client/src/app/+admin/overview/users/user-edit/user-password.component.html
+++ b/client/src/app/+admin/overview/users/user-edit/user-password.component.html
@@ -6,9 +6,12 @@
formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }"
autocomplete="new-password"
>
- <button class="btn btn-sm btn-outline-secondary" (click)="togglePasswordVisibility()" type="button">
- <ng-container *ngIf="!showPassword" i18n>Show</ng-container>
- <ng-container *ngIf="!!showPassword" i18n>Hide</ng-container>
+ <button class="btn btn-outline-secondary" (click)="togglePasswordVisibility()" type="button">
+ @if (showPassword) {
+ <ng-container i18n>Hide</ng-container>
+ } @else {
+ <ng-container i18n>Show</ng-container>
+ }
</button>
</div>
diff --git a/client/src/app/+admin/overview/users/user-edit/user-password.component.scss b/client/src/app/+admin/overview/users/user-edit/user-password.component.scss
index ccf9cf9d0a..460d92f308 100644
--- a/client/src/app/+admin/overview/users/user-edit/user-password.component.scss
+++ b/client/src/app/+admin/overview/users/user-edit/user-password.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
input[type=text],
input[type=password] {
diff --git a/client/src/app/+admin/overview/users/user-edit/user-update.component.ts b/client/src/app/+admin/overview/users/user-edit/user-update.component.ts
index fe42b0df26..77333adb85 100644
--- a/client/src/app/+admin/overview/users/user-edit/user-update.component.ts
+++ b/client/src/app/+admin/overview/users/user-edit/user-update.component.ts
@@ -126,7 +126,7 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy {
.subscribe({
next: () => {
this.notifier.success($localize`User ${this.user.username} updated.`)
- this.router.navigate([ '/admin/users/list' ])
+ this.router.navigate([ '/admin/overview/users/list' ])
},
error: err => {
diff --git a/client/src/app/+admin/overview/users/user-list/user-list.component.html b/client/src/app/+admin/overview/users/user-list/user-list.component.html
index 21ec15efed..4420c57330 100644
--- a/client/src/app/+admin/overview/users/user-list/user-list.component.html
+++ b/client/src/app/+admin/overview/users/user-list/user-list.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="user" aria-hidden="true"></my-global-icon>
- <h1 i18n>Users</h1>
- </div>
-</div>
-
<p-table
[value]="users" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
[rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id" [resizableColumns]="true"
@@ -15,12 +8,12 @@
<div class="caption">
<div class="left-buttons">
<my-action-dropdown
- *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange"
+ *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="primary"
[actions]="bulkActions" [entry]="selectedRows"
>
</my-action-dropdown>
- <a *ngIf="!isInSelectionMode()" class="peertube-create-button" routerLink="/admin/users/create">
+ <a *ngIf="!isInSelectionMode()" class="peertube-create-button" routerLink="/admin/overview/users/create">
<my-global-icon iconName="user-add" aria-hidden="true"></my-global-icon>
<ng-container i18n>Create user</ng-container>
</a>
@@ -97,7 +90,7 @@
<td class="action-cell">
<my-user-moderation-dropdown
*ngIf="!isInSelectionMode()" [user]="user" [account]="user.accountMutedStatus" [displayOptions]="userModerationDisplayOptions"
- container="body" (userChanged)="onUserChanged()" (userDeleted)="onUserChanged()">
+ container="body" (userChanged)="onUserChanged()" (userDeleted)="onUserChanged()" buttonSize="small">
</my-user-moderation-dropdown>
</td>
diff --git a/client/src/app/+admin/overview/users/user-list/user-list.component.scss b/client/src/app/+admin/overview/users/user-list/user-list.component.scss
index 9b9502ffea..21ec7b1403 100644
--- a/client/src/app/+admin/overview/users/user-list/user-list.component.scss
+++ b/client/src/app/+admin/overview/users/user-list/user-list.component.scss
@@ -3,11 +3,6 @@
@use '_mixins' as *;
@use 'bootstrap/scss/functions' as *;
-.sub-title-container my-global-icon {
- position: relative;
- top: -2px;
-}
-
.banned-info {
font-style: italic;
}
diff --git a/client/src/app/+admin/overview/users/user-list/user-list.component.ts b/client/src/app/+admin/overview/users/user-list/user-list.component.ts
index 3122fc00e9..ac46127f06 100644
--- a/client/src/app/+admin/overview/users/user-list/user-list.component.ts
+++ b/client/src/app/+admin/overview/users/user-list/user-list.component.ts
@@ -71,7 +71,7 @@ type UserForList = User & {
]
})
export class UserListComponent extends RestTable <User> implements OnInit {
- private static readonly LOCAL_STORAGE_SELECTED_COLUMNS_KEY = 'admin-user-list-selected-columns'
+ private static readonly LS_SELECTED_COLUMNS_KEY = 'admin-user-list-selected-columns'
@ViewChild('userBanModal', { static: true }) userBanModal: UserBanModalComponent
@@ -184,7 +184,7 @@ export class UserListComponent extends RestTable <User> implements OnInit {
}
loadSelectedColumns () {
- const result = this.peertubeLocalStorage.getItem(UserListComponent.LOCAL_STORAGE_SELECTED_COLUMNS_KEY)
+ const result = this.peertubeLocalStorage.getItem(UserListComponent.LS_SELECTED_COLUMNS_KEY)
if (result) {
try {
@@ -201,7 +201,7 @@ export class UserListComponent extends RestTable <User> implements OnInit {
}
saveSelectedColumns () {
- this.peertubeLocalStorage.setItem(UserListComponent.LOCAL_STORAGE_SELECTED_COLUMNS_KEY, JSON.stringify(this.selectedColumns))
+ this.peertubeLocalStorage.setItem(UserListComponent.LS_SELECTED_COLUMNS_KEY, JSON.stringify(this.selectedColumns))
}
getIdentifier () {
diff --git a/client/src/app/+admin/overview/users/users.routes.ts b/client/src/app/+admin/overview/users/users.routes.ts
deleted file mode 100644
index d66b8c762d..0000000000
--- a/client/src/app/+admin/overview/users/users.routes.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import { Routes } from '@angular/router'
-import { UserRightGuard } from '@app/core'
-import { UserRight } from '@peertube/peertube-models'
-import { UserCreateComponent, UserUpdateComponent } from './user-edit'
-import { UserListComponent } from './user-list'
-
-export const usersRoutes: Routes = [
- {
- path: 'users',
- canActivate: [ UserRightGuard ],
- data: {
- userRight: UserRight.MANAGE_USERS
- },
- children: [
- {
- path: '',
- redirectTo: 'list',
- pathMatch: 'full'
- },
- {
- path: 'list',
- component: UserListComponent,
- data: {
- meta: {
- title: $localize`Users list`
- }
- }
- },
- {
- path: 'create',
- component: UserCreateComponent,
- data: {
- meta: {
- title: $localize`Create a user`
- }
- }
- },
- {
- path: 'update/:id',
- component: UserUpdateComponent,
- data: {
- meta: {
- title: $localize`Update a user`
- }
- }
- }
- ]
- }
-]
diff --git a/client/src/app/+admin/overview/videos/index.ts b/client/src/app/+admin/overview/videos/index.ts
index 7398b16635..d5950e43f2 100644
--- a/client/src/app/+admin/overview/videos/index.ts
+++ b/client/src/app/+admin/overview/videos/index.ts
@@ -1,3 +1,2 @@
export * from './video-admin.service'
export * from './video-list.component'
-export * from './video.routes'
diff --git a/client/src/app/+admin/overview/videos/video-list.component.html b/client/src/app/+admin/overview/videos/video-list.component.html
index f82d5363b3..7e65384516 100644
--- a/client/src/app/+admin/overview/videos/video-list.component.html
+++ b/client/src/app/+admin/overview/videos/video-list.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="videos" aria-hidden="true"></my-global-icon>
- <h1 i18n>Videos</h1>
- </div>
-</div>
-
<p-table
[value]="videos" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
[rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id" [resizableColumns]="true"
@@ -16,7 +9,7 @@
<div class="caption">
<div class="left-buttons">
<my-action-dropdown
- *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange"
+ *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="primary"
[actions]="bulkActions" [entry]="selectedRows"
>
</my-action-dropdown>
@@ -63,7 +56,7 @@
<td class="action-cell">
<my-video-actions-dropdown
placement="bottom auto" buttonDirection="horizontal" buttonStyled="true" [video]="video" [displayOptions]="videoActionsOptions"
- (videoRemoved)="reloadData()" (videoFilesRemoved)="reloadData()" (transcodingCreated)="reloadData()"
+ (videoRemoved)="reloadData()" (videoFilesRemoved)="reloadData()" (transcodingCreated)="reloadData()" buttonSize="small"
></my-video-actions-dropdown>
</td>
diff --git a/client/src/app/+admin/overview/videos/video-list.component.scss b/client/src/app/+admin/overview/videos/video-list.component.scss
index c836479c94..ac17ce7f78 100644
--- a/client/src/app/+admin/overview/videos/video-list.component.scss
+++ b/client/src/app/+admin/overview/videos/video-list.component.scss
@@ -29,6 +29,8 @@ my-embed {
.right-form {
display: flex;
+ flex-wrap: wrap;
+ row-gap: 0.5rem;
> *:not(:last-child) {
@include margin-right(10px);
diff --git a/client/src/app/+admin/overview/videos/video.routes.ts b/client/src/app/+admin/overview/videos/video.routes.ts
deleted file mode 100644
index dfffd26967..0000000000
--- a/client/src/app/+admin/overview/videos/video.routes.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { Routes } from '@angular/router'
-import { UserRightGuard } from '@app/core'
-import { UserRight } from '@peertube/peertube-models'
-import { VideoListComponent } from './video-list.component'
-
-export const videosRoutes: Routes = [
- {
- path: 'videos',
- canActivate: [ UserRightGuard ],
- data: {
- userRight: UserRight.SEE_ALL_VIDEOS
- },
- children: [
- {
- path: '',
- redirectTo: 'list',
- pathMatch: 'full'
- },
- {
- path: 'list',
- component: VideoListComponent,
- data: {
- meta: {
- title: $localize`Videos list`
- }
- }
- }
- ]
- }
-]
diff --git a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.html b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.html
index e80855a023..3dc651b162 100644
--- a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.html
+++ b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.html
@@ -1,5 +1,3 @@
-<my-plugin-navigation [pluginType]="pluginType"></my-plugin-navigation>
-
<div class="no-results" *ngIf="pagination.totalItems === 0">
{{ getNoResultMessage() }}
</div>
@@ -8,10 +6,10 @@
<ng-container *ngFor="let plugin of plugins">
<my-plugin-card [plugin]="plugin" [version]="plugin.version" [pluginType]="pluginType">
<div ngProjectAs="buttons">
- <my-edit-button
+ <my-button
*ngIf="!isTheme(plugin)" [ptRouterLink]="getShowRouterLink(plugin)" label="Settings" i18n-label
- [responsiveLabel]="true"
- ></my-edit-button>
+ [responsiveLabel]="true" icon="config"
+ ></my-button>
<my-button
class="update-button" *ngIf="isUpdateAvailable(plugin)" (click)="update(plugin)" [loading]="isUpdating(plugin)"
diff --git a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts
index 6bea42fceb..984b0039c8 100644
--- a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts
+++ b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts
@@ -1,4 +1,4 @@
-import { Subject } from 'rxjs'
+import { NgFor, NgIf } from '@angular/common'
import { Component, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service'
@@ -6,13 +6,11 @@ import { ComponentPagination, ConfirmService, hasMoreItems, Notifier } from '@ap
import { PluginService } from '@app/core/plugins/plugin.service'
import { compareSemVer } from '@peertube/peertube-core-utils'
import { PeerTubePlugin, PluginType, PluginType_Type } from '@peertube/peertube-models'
-import { DeleteButtonComponent } from '../../../shared/shared-main/buttons/delete-button.component'
+import { Subject } from 'rxjs'
import { ButtonComponent } from '../../../shared/shared-main/buttons/button.component'
-import { EditButtonComponent } from '../../../shared/shared-main/buttons/edit-button.component'
-import { PluginCardComponent } from '../shared/plugin-card.component'
+import { DeleteButtonComponent } from '../../../shared/shared-main/buttons/delete-button.component'
import { InfiniteScrollerDirective } from '../../../shared/shared-main/common/infinite-scroller.directive'
-import { NgIf, NgFor } from '@angular/common'
-import { PluginNavigationComponent } from '../shared/plugin-navigation.component'
+import { PluginCardComponent } from '../shared/plugin-card.component'
@Component({
selector: 'my-plugin-list-installed',
@@ -20,12 +18,10 @@ import { PluginNavigationComponent } from '../shared/plugin-navigation.component
styleUrls: [ './plugin-list-installed.component.scss' ],
standalone: true,
imports: [
- PluginNavigationComponent,
NgIf,
InfiniteScrollerDirective,
NgFor,
PluginCardComponent,
- EditButtonComponent,
ButtonComponent,
DeleteButtonComponent
]
@@ -194,7 +190,7 @@ export class PluginListInstalledComponent implements OnInit {
}
getShowRouterLink (plugin: PeerTubePlugin) {
- return [ '/admin', 'plugins', 'show', this.pluginService.nameToNpmName(plugin.name, plugin.type) ]
+ return [ '/admin', 'settings', 'plugins', 'show', this.pluginService.nameToNpmName(plugin.name, plugin.type) ]
}
getPluginOrThemeHref (name: string) {
diff --git a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html
index 96aca5b5a7..ee2af426be 100644
--- a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html
+++ b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html
@@ -1,23 +1,27 @@
-<my-plugin-navigation [pluginType]="pluginType"></my-plugin-navigation>
-
<my-alert class="mt-3" type="primary" i18n *ngIf="pluginInstalled">
To load your new installed plugins or themes, refresh the page.
</my-alert>
<div class="result-and-search">
- <ng-container *ngIf="!search">
- <my-global-icon iconName="trending" aria-hidden="true"></my-global-icon>
- <ng-container *ngIf="!isThemeSearch()" i18n>Popular plugins</ng-container>
- <ng-container *ngIf="isThemeSearch()" i18n>Popular themes</ng-container>
- </ng-container>
+ @if (!search) {
+ <div>
+ <my-global-icon iconName="trending" aria-hidden="true"></my-global-icon>
- <ng-container *ngIf="search && !isSearching">
+ @if (isThemeSearch()) {
+ <ng-container i18n>Popular themes</ng-container>
+ } @else {
+ <ng-container i18n>Popular plugins</ng-container>
+ }
+ </div>
+ }
+
+ @if (search && !isSearching) {
<my-global-icon iconName="search"></my-global-icon>
<ng-container i18n>
{{ pagination.totalItems }} {pagination.totalItems, plural, =1 {result} other {results}} for "{{ search }}"
</ng-container>
- </ng-container>
+ }
<div class="search-bar">
<input type="text" (input)="onSearchChange($event)" i18n-placeholder placeholder="Search..." myAutofocus />
@@ -34,13 +38,15 @@
<div ngProjectAs="badges">
<span i18n *ngIf="plugin.installed" class="pt-badge badge-success">Installed</span>
- <span *ngIf="plugin.official" class="pt-badge badge-primary" i18n i18n-title title="This plugin is developed by Framasoft, the not-for-profit that develops PeerTube">
- Official
- </span>
+ <span
+ *ngIf="plugin.official" class="pt-badge badge-primary"
+ i18n i18n-title title="This plugin is developed by Framasoft, the not-for-profit that develops PeerTube"
+ >Official</span>
- <span *ngIf="plugin.recommended" class="pt-badge badge-primary" i18n i18n-title title="This plugin is recommended by Framasoft, the not-for-profit that develops PeerTube">
- Recommended
- </span>
+ <span
+ *ngIf="plugin.recommended" class="pt-badge badge-primary"
+ i18n i18n-title title="This plugin is recommended by Framasoft, the not-for-profit that develops PeerTube"
+ >Recommended</span>
</div>
<div ngProjectAs="buttons">
diff --git a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.scss b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.scss
index 8c311bc9a5..ab7150720e 100644
--- a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.scss
+++ b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.scss
@@ -1,20 +1,23 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
.result-and-search {
font-size: 22px;
font-weight: 600;
margin: 30px 0 15px;
display: flex;
+ flex-wrap: wrap;
+ row-gap: 0.5rem;
+ justify-content: space-between;
my-global-icon {
+ @include global-icon-size(24px);
@include margin-right(5px);
}
}
.search-bar {
- @include margin-left(auto);
-
input {
@include peertube-input-text(500px);
}
diff --git a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts
index edd4baf46d..753657062d 100644
--- a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts
+++ b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts
@@ -14,7 +14,6 @@ import { EditButtonComponent } from '../../../shared/shared-main/buttons/edit-bu
import { AutofocusDirective } from '../../../shared/shared-main/common/autofocus.directive'
import { InfiniteScrollerDirective } from '../../../shared/shared-main/common/infinite-scroller.directive'
import { PluginCardComponent } from '../shared/plugin-card.component'
-import { PluginNavigationComponent } from '../shared/plugin-navigation.component'
@Component({
selector: 'my-plugin-search',
@@ -22,7 +21,6 @@ import { PluginNavigationComponent } from '../shared/plugin-navigation.component
styleUrls: [ './plugin-search.component.scss' ],
standalone: true,
imports: [
- PluginNavigationComponent,
NgIf,
GlobalIconComponent,
AutofocusDirective,
@@ -138,7 +136,7 @@ export class PluginSearchComponent implements OnInit {
}
getShowRouterLink (plugin: PeerTubePluginIndex) {
- return [ '/admin', 'plugins', 'show', this.pluginService.nameToNpmName(plugin.name, this.pluginType) ]
+ return [ '/admin', 'settings', 'plugins', 'show', this.pluginService.nameToNpmName(plugin.name, this.pluginType) ]
}
isThemeSearch () {
diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html
index c778d5ce87..709ba83aaf 100644
--- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html
+++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.html
@@ -1,6 +1,6 @@
<ng-container *ngIf="plugin">
- <h2>
+ <h2 class="mb-4">
<ng-container>{{ pluginTypeLabel }}</ng-container>
{{ plugin.name }}
</h2>
@@ -10,7 +10,7 @@
<my-dynamic-form-field [hidden]="isSettingHidden(setting)" [form]="form" [setting]="setting" [formErrors]="formErrors"></my-dynamic-form-field>
</div>
- <input type="submit" i18n value="Update plugin settings" [disabled]="!form.valid">
+ <input class="peertube-button primary-button mt-3" type="submit" i18n value="Update plugin settings" [disabled]="!form.valid">
</form>
<div *ngIf="!hasRegisteredSettings()" i18n class="no-settings">
diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.scss b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.scss
deleted file mode 100644
index 97d8604cab..0000000000
--- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.scss
+++ /dev/null
@@ -1,14 +0,0 @@
-@use '_variables' as *;
-@use '_mixins' as *;
-
-h2 {
- margin-bottom: 20px;
-}
-
-input[type=submit],
-button {
- margin-top: 10px;
-
- @include peertube-button;
- @include orange-button;
-}
diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
index 348637c5b5..a0ac993554 100644
--- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
+++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
@@ -15,7 +15,6 @@ import { BuildFormArgument } from '@app/shared/form-validators/form-validator.mo
@Component({
selector: 'my-plugin-show-installed',
templateUrl: './plugin-show-installed.component.html',
- styleUrls: [ './plugin-show-installed.component.scss' ],
standalone: true,
imports: [ NgIf, FormsModule, ReactiveFormsModule, NgFor, DynamicFormFieldComponent ]
})
diff --git a/client/src/app/+admin/plugins/plugins.routes.ts b/client/src/app/+admin/plugins/plugins.routes.ts
index 40660f1f41..ee241232b2 100644
--- a/client/src/app/+admin/plugins/plugins.routes.ts
+++ b/client/src/app/+admin/plugins/plugins.routes.ts
@@ -5,7 +5,7 @@ import { PluginShowInstalledComponent } from '@app/+admin/plugins/plugin-show-in
import { UserRightGuard } from '@app/core'
import { UserRight } from '@peertube/peertube-models'
-export const PluginsRoutes: Routes = [
+export const pluginsRoutes: Routes = [
{
path: 'plugins',
canActivate: [ UserRightGuard ],
@@ -15,7 +15,7 @@ export const PluginsRoutes: Routes = [
children: [
{
path: '',
- redirectTo: 'list-installed',
+ redirectTo: 'list-installed?pluginType=1',
pathMatch: 'full'
},
{
diff --git a/client/src/app/+admin/plugins/shared/plugin-card.component.html b/client/src/app/+admin/plugins/shared/plugin-card.component.html
index 442d7f6f24..8ec9573b07 100644
--- a/client/src/app/+admin/plugins/shared/plugin-card.component.html
+++ b/client/src/app/+admin/plugins/shared/plugin-card.component.html
@@ -5,12 +5,12 @@
<span class="plugin-version">{{ version }}</span>
- <a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="plugin.homepage" i18n-title title="Plugin homepage (new window)">
+ <a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="plugin.homepage" i18n-title title="Homepage (new window)">
<my-global-icon iconName="home"></my-global-icon>
</a>
- <a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="getPluginOrThemeHref(plugin.name)" i18n-title title="Plugin homepage (new window)">
- <my-global-icon iconName="npm"></my-global-icon>
+ <a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="getPluginOrThemeHref(plugin.name)" i18n-title title="NPM page (new window)">
+ <my-global-icon iconName="registry"></my-global-icon>
</a>
<ng-content select="badges"></ng-content>
diff --git a/client/src/app/+admin/plugins/shared/plugin-card.component.scss b/client/src/app/+admin/plugins/shared/plugin-card.component.scss
index bd327e1aef..81d0152912 100644
--- a/client/src/app/+admin/plugins/shared/plugin-card.component.scss
+++ b/client/src/app/+admin/plugins/shared/plugin-card.component.scss
@@ -3,7 +3,7 @@
.plugin {
margin: 15px 0;
- background-color: pvar(--submenuBackgroundColor);
+ background-color: pvar(--bg-secondary-400);
}
.first-row {
@@ -25,10 +25,10 @@
@include margin-left(10px);
my-global-icon {
- @include apply-svg-color(pvar(--greyForegroundColor));
+ color: pvar(--fg-400);
&[iconName=npm] {
- @include fill-svg-color(pvar(--greyForegroundColor));
+ @include fill-svg-color(pvar(--fg-400));
}
}
}
@@ -51,11 +51,6 @@
}
}
-.action-button {
- @include peertube-button-link;
- @include button-with-icon(21px, 0, -2px);
-}
-
@media screen and (max-width: $small-view) {
.first-row {
flex-wrap: wrap;
diff --git a/client/src/app/+admin/plugins/shared/plugin-navigation.component.html b/client/src/app/+admin/plugins/shared/plugin-navigation.component.html
deleted file mode 100644
index 456c45118a..0000000000
--- a/client/src/app/+admin/plugins/shared/plugin-navigation.component.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<div class="root">
- <div class="btn-group select-button" role="group" i18n-aria-label aria-label="Navigate between installed plugins and themes or find new ones">
- <a i18n routerLink="/admin/plugins/list-installed" [queryParams]="{ pluginType: pluginType }" routerLinkActive="active">Installed</a>
- <a i18n routerLink="/admin/plugins/search" [queryParams]="{ pluginType: pluginType }" routerLinkActive="active">Search</a>
- </div>
-
- <div class="btn-group select-button" role="group" i18n-aria-label aria-label="Navigate between plugins and themes">
- <a i18n [ngClass]="{ active: pluginType === 1 }" routerLink="." [queryParams]="{ pluginType: 1 }" queryParamsHandling="merge" class="">Plugins</a>
- <a i18n [ngClass]="{ active: pluginType === 2 }" routerLink="." [queryParams]="{ pluginType: 2 }" queryParamsHandling="merge" class="">Themes</a>
- </div>
-</div>
diff --git a/client/src/app/+admin/plugins/shared/plugin-navigation.component.scss b/client/src/app/+admin/plugins/shared/plugin-navigation.component.scss
deleted file mode 100644
index 5802acd56b..0000000000
--- a/client/src/app/+admin/plugins/shared/plugin-navigation.component.scss
+++ /dev/null
@@ -1,11 +0,0 @@
-@use '_variables' as *;
-@use '_mixins' as *;
-
-.root {
- display: flex;
- justify-content: center;
-}
-
-.btn-group:not(:last-child) {
- @include margin-right(15px);
-}
diff --git a/client/src/app/+admin/plugins/shared/plugin-navigation.component.ts b/client/src/app/+admin/plugins/shared/plugin-navigation.component.ts
deleted file mode 100644
index 74496f92a4..0000000000
--- a/client/src/app/+admin/plugins/shared/plugin-navigation.component.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Component, Input } from '@angular/core'
-import { PluginType_Type } from '@peertube/peertube-models'
-import { NgClass } from '@angular/common'
-import { RouterLink, RouterLinkActive } from '@angular/router'
-
-@Component({
- selector: 'my-plugin-navigation',
- templateUrl: './plugin-navigation.component.html',
- styleUrls: [ './plugin-navigation.component.scss' ],
- standalone: true,
- imports: [ RouterLink, RouterLinkActive, NgClass ]
-})
-export class PluginNavigationComponent {
- @Input() pluginType: PluginType_Type
-}
diff --git a/client/src/app/+admin/routes.ts b/client/src/app/+admin/routes.ts
index 81e047fca7..95837b4fd3 100644
--- a/client/src/app/+admin/routes.ts
+++ b/client/src/app/+admin/routes.ts
@@ -1,18 +1,12 @@
-import { Routes } from '@angular/router'
-import { ConfigRoutes, EditConfigurationService } from '@app/+admin/config'
-import { ModerationRoutes } from '@app/+admin/moderation/moderation.routes'
-import { PluginsRoutes } from '@app/+admin/plugins/plugins.routes'
-import { DebugService, JobService, LogsService, RunnerService, SystemRoutes } from '@app/+admin/system'
-import { AdminComponent } from './admin.component'
-import { FollowsRoutes } from './follows'
-import { OverviewRoutes, VideoAdminService } from './overview'
-import { AdminRegistrationService } from './moderation/registration-list'
-import { PluginApiService } from './plugins/shared/plugin-api.service'
-import { ConfigService } from './config/shared/config.service'
-import { CustomPageService } from '@app/shared/shared-main/custom-page/custom-page.service'
+import { Route, Routes, UrlSegment } from '@angular/router'
+import { configRoutes, EditConfigurationService } from '@app/+admin/config'
+import { moderationRoutes } from '@app/+admin/moderation/moderation.routes'
+import { pluginsRoutes } from '@app/+admin/plugins/plugins.routes'
+import { DebugService, JobService, LogsService, RunnerService, systemRoutes } from '@app/+admin/system'
import { CustomMarkupService } from '@app/shared/shared-custom-markup/custom-markup.service'
import { DynamicElementService } from '@app/shared/shared-custom-markup/dynamic-element.service'
import { InstanceFollowService } from '@app/shared/shared-instance/instance-follow.service'
+import { CustomPageService } from '@app/shared/shared-main/custom-page/custom-page.service'
import { AbuseService } from '@app/shared/shared-moderation/abuse.service'
import { BlocklistService } from '@app/shared/shared-moderation/blocklist.service'
import { BulkService } from '@app/shared/shared-moderation/bulk.service'
@@ -24,51 +18,145 @@ import { UserAdminService } from '@app/shared/shared-users/user-admin.service'
import { VideoCommentService } from '@app/shared/shared-video-comment/video-comment.service'
import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-playlist.service'
import { WatchedWordsListService } from '@app/shared/standalone-watched-words/watched-words-list.service'
+import { AdminModerationComponent } from './admin-moderation.component'
+import { AdminOverviewComponent } from './admin-overview.component'
+import { AdminSettingsComponent } from './admin-settings.component'
+import { ConfigService } from './config/shared/config.service'
+import { followsRoutes } from './follows'
+import { AdminRegistrationService } from './moderation/registration-list'
+import { overviewRoutes, VideoAdminService } from './overview'
+import { PluginApiService } from './plugins/shared/plugin-api.service'
+
+const commonConfig = {
+ path: '',
+ providers: [
+ BlocklistService,
+ UserAdminService,
+ BulkService,
+ AdminRegistrationService,
+ CustomMarkupService,
+ CustomPageService,
+ DebugService,
+ EditConfigurationService,
+ InstanceFollowService,
+ JobService,
+ LogsService,
+ PluginApiService,
+ RunnerService,
+ TwoFactorService,
+ UserAdminService,
+ VideoAdminService,
+ VideoBlockService,
+ VideoCommentService,
+ ConfigService,
+ AbuseService,
+ DynamicElementService,
+ FindInBulkService,
+ SearchService,
+ VideoPlaylistService,
+ WatchedWordsListService
+ ]
+}
+
+function isOverviewRoute (segments: UrlSegment[]) {
+ if (segments.length === 0) return false
+
+ const rootPath = segments[0].path
+
+ return overviewRoutes.some(r => r.path === rootPath || r.path.startsWith(`${rootPath}/`))
+}
+
+function isModerationRoute (segments: UrlSegment[]) {
+ if (segments.length === 0) return false
+
+ const rootPath = segments[0].path
+
+ return moderationRoutes.some(r => r.path === rootPath || r.path.startsWith(`${rootPath}/`))
+}
+
+function baseSettingsPathRedirect ({ url }: { url: UrlSegment[] }) {
+ return `/admin/settings/${url.map(u => u.path).join('/')}`
+}
export default [
{
path: '',
- component: AdminComponent,
- providers: [
- BlocklistService,
- UserAdminService,
- BulkService,
- AdminRegistrationService,
- CustomMarkupService,
- CustomPageService,
- DebugService,
- EditConfigurationService,
- InstanceFollowService,
- JobService,
- LogsService,
- PluginApiService,
- RunnerService,
- TwoFactorService,
- UserAdminService,
- VideoAdminService,
- VideoBlockService,
- VideoCommentService,
- ConfigService,
- AbuseService,
- DynamicElementService,
- FindInBulkService,
- SearchService,
- VideoPlaylistService,
- WatchedWordsListService
+ pathMatch: 'full',
+ redirectTo: 'overview'
+ },
+
+ {
+ ...commonConfig,
+
+ component: AdminModerationComponent,
+ canMatch: [
+ (_route: Route, segments: UrlSegment[]) => {
+ return isModerationRoute(segments)
+ }
],
+
+ children: moderationRoutes
+ },
+
+ {
+ ...commonConfig,
+
+ component: AdminOverviewComponent,
+ canMatch: [
+ (_route: Route, segments: UrlSegment[]) => {
+ return isOverviewRoute(segments)
+ }
+ ],
+
+ children: overviewRoutes
+ },
+
+ {
+ path: 'config',
+ pathMatch: 'prefix',
+ redirectTo: baseSettingsPathRedirect
+ },
+
+ {
+ path: 'follows',
+ pathMatch: 'prefix',
+ redirectTo: baseSettingsPathRedirect
+ },
+
+ {
+ path: 'system',
+ pathMatch: 'prefix',
+ redirectTo: baseSettingsPathRedirect
+ },
+
+ {
+ path: 'plugins',
+ pathMatch: 'prefix',
+ redirectTo: baseSettingsPathRedirect
+ },
+
+ {
+ ...commonConfig,
+
+ path: 'settings',
+ component: AdminSettingsComponent,
+ canMatch: [
+ (_route: Route, segments: UrlSegment[]) => {
+ return !isOverviewRoute(segments) && !isModerationRoute(segments)
+ }
+ ],
+
children: [
{
path: '',
- redirectTo: 'users',
+ redirectTo: 'config',
pathMatch: 'full'
},
- ...FollowsRoutes,
- ...OverviewRoutes,
- ...ModerationRoutes,
- ...SystemRoutes,
- ...ConfigRoutes,
- ...PluginsRoutes
+ ...configRoutes,
+ ...followsRoutes,
+ ...systemRoutes,
+ ...pluginsRoutes
]
}
] satisfies Routes
diff --git a/client/src/app/+admin/shared/user-email-info.component.scss b/client/src/app/+admin/shared/user-email-info.component.scss
index d34947edd0..8c937cd43a 100644
--- a/client/src/app/+admin/shared/user-email-info.component.scss
+++ b/client/src/app/+admin/shared/user-email-info.component.scss
@@ -2,7 +2,7 @@
@use '_mixins' as *;
a {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
&:hover {
text-decoration: underline;
diff --git a/client/src/app/+admin/system/debug/debug.component.html b/client/src/app/+admin/system/debug/debug.component.html
index 465e662d64..c43f5e88f7 100644
--- a/client/src/app/+admin/system/debug/debug.component.html
+++ b/client/src/app/+admin/system/debug/debug.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon>
- <h1 i18n>Debug</h1>
- </div>
-</div>
-
<h2 class="fs-5" i18n>IP address</h2>
<p i18n>PeerTube thinks your web browser public IP is <strong>{{ debug?.ip }}</strong>.</p>
diff --git a/client/src/app/+admin/system/jobs/jobs.component.html b/client/src/app/+admin/system/jobs/jobs.component.html
index 2c343eb948..1ceb355f37 100644
--- a/client/src/app/+admin/system/jobs/jobs.component.html
+++ b/client/src/app/+admin/system/jobs/jobs.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="circle-tick" aria-hidden="true"></my-global-icon>
- <h1 i18n>Local jobs</h1>
- </div>
-</div>
-
<div class="admin-sub-header">
<div class="select-filter-block">
<label for="jobType" i18n>Job type</label>
diff --git a/client/src/app/+admin/system/jobs/jobs.component.scss b/client/src/app/+admin/system/jobs/jobs.component.scss
index 5b16c1a987..0ce18bd30d 100644
--- a/client/src/app/+admin/system/jobs/jobs.component.scss
+++ b/client/src/app/+admin/system/jobs/jobs.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use 'form-mixins' as *;
.select-job-state {
display: block;
diff --git a/client/src/app/+admin/system/jobs/jobs.component.ts b/client/src/app/+admin/system/jobs/jobs.component.ts
index 3f1f67ae34..52c373a59a 100644
--- a/client/src/app/+admin/system/jobs/jobs.component.ts
+++ b/client/src/app/+admin/system/jobs/jobs.component.ts
@@ -38,8 +38,8 @@ import { JobService } from './job.service'
]
})
export class JobsComponent extends RestTable implements OnInit {
- private static LOCAL_STORAGE_STATE = 'jobs-list-state'
- private static LOCAL_STORAGE_TYPE = 'jobs-list-type'
+ private static LS_STATE = 'jobs-list-state'
+ private static LS_TYPE = 'jobs-list-type'
jobState?: JobStateClient
jobStates: JobStateClient[] = [ 'all', 'active', 'completed', 'failed', 'waiting', 'delayed' ]
@@ -175,15 +175,15 @@ export class JobsComponent extends RestTable implements OnInit {
}
private loadJobStateAndType () {
- const state = peertubeLocalStorage.getItem(JobsComponent.LOCAL_STORAGE_STATE)
+ const state = peertubeLocalStorage.getItem(JobsComponent.LS_STATE)
if (state) this.jobState = state as JobState
- const jobType = peertubeLocalStorage.getItem(JobsComponent.LOCAL_STORAGE_TYPE)
+ const jobType = peertubeLocalStorage.getItem(JobsComponent.LS_TYPE)
if (jobType) this.jobType = jobType as JobType
}
private saveJobStateAndType () {
- peertubeLocalStorage.setItem(JobsComponent.LOCAL_STORAGE_STATE, this.jobState)
- peertubeLocalStorage.setItem(JobsComponent.LOCAL_STORAGE_TYPE, this.jobType)
+ peertubeLocalStorage.setItem(JobsComponent.LS_STATE, this.jobState)
+ peertubeLocalStorage.setItem(JobsComponent.LS_TYPE, this.jobType)
}
}
diff --git a/client/src/app/+admin/system/logs/logs.component.html b/client/src/app/+admin/system/logs/logs.component.html
index dee0fe5f56..de603680b3 100644
--- a/client/src/app/+admin/system/logs/logs.component.html
+++ b/client/src/app/+admin/system/logs/logs.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="playlists" aria-hidden="true"></my-global-icon>
- <h1 i18n>Logs</h1>
- </div>
-</div>
-
<div class="header">
<div>
diff --git a/client/src/app/+admin/system/logs/logs.component.scss b/client/src/app/+admin/system/logs/logs.component.scss
index 364a1a8172..c2e3847a54 100644
--- a/client/src/app/+admin/system/logs/logs.component.scss
+++ b/client/src/app/+admin/system/logs/logs.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
.logs {
font-family: monospace;
@@ -92,7 +93,7 @@
my-copy-button {
position: absolute;
right: 5px;
- background: pvar(--mainBackgroundHoverColor);
+ background: pvar(--bg-secondary-300);
}
@include on-small-main-col {
diff --git a/client/src/app/+admin/system/logs/logs.component.ts b/client/src/app/+admin/system/logs/logs.component.ts
index e98750937e..ea2fe38769 100644
--- a/client/src/app/+admin/system/logs/logs.component.ts
+++ b/client/src/app/+admin/system/logs/logs.component.ts
@@ -31,7 +31,7 @@ import { LogsService } from './logs.service'
]
})
export class LogsComponent implements OnInit {
- private static LOCAL_STORAGE_LOG_TYPE_CHOICE_KEY = 'admin-logs-log-type-choice'
+ private static LS_LOG_TYPE_CHOICE_KEY = 'admin-logs-log-type-choice'
@ViewChild('logsElement', { static: true }) logsElement: ElementRef<HTMLElement>
@ViewChild('logsContent', { static: true }) logsContent: ElementRef<HTMLElement>
@@ -69,7 +69,7 @@ export class LogsComponent implements OnInit {
refresh () {
this.logs = []
- this.localStorage.setItem(LogsComponent.LOCAL_STORAGE_LOG_TYPE_CHOICE_KEY, this.logType)
+ this.localStorage.setItem(LogsComponent.LS_LOG_TYPE_CHOICE_KEY, this.logType)
this.load()
}
@@ -175,7 +175,7 @@ export class LogsComponent implements OnInit {
}
private loadPreviousChoices () {
- this.logType = this.localStorage.getItem(LogsComponent.LOCAL_STORAGE_LOG_TYPE_CHOICE_KEY)
+ this.logType = this.localStorage.getItem(LogsComponent.LS_LOG_TYPE_CHOICE_KEY)
if (this.logType !== 'standard' && this.logType !== 'audit') this.logType = 'audit'
}
diff --git a/client/src/app/+admin/system/runners/runner-job-list/runner-job-list.component.html b/client/src/app/+admin/system/runners/runner-job-list/runner-job-list.component.html
index ec026025b0..3c49fd0872 100644
--- a/client/src/app/+admin/system/runners/runner-job-list/runner-job-list.component.html
+++ b/client/src/app/+admin/system/runners/runner-job-list/runner-job-list.component.html
@@ -1,17 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon class="top--1px" iconName="globe" aria-hidden="true"></my-global-icon>
- <h1 i18n>Runner jobs</h1>
- </div>
-
- <div>
- <a routerLink="/admin/system/runners/runners-list" class="peertube-button-link peertube-button-icon grey-button">
- <my-global-icon iconName="codesandbox" aria-hidden="true"></my-global-icon>
- <ng-container i18n>Remote runners</ng-container>
- </a>
- </div>
-</div>
-
<p-table
[value]="runnerJobs" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
[rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order"
@@ -46,13 +32,13 @@
<div class="caption">
<div class="left-buttons">
<my-action-dropdown
- *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange"
+ *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="primary"
[actions]="bulkActions" [entry]="selectedRows"
>
</my-action-dropdown>
</div>
- <div class="ms-auto d-flex">
+ <div class="ms-auto d-flex flex-wrap gap-2">
<my-advanced-input-filter class="me-2" [filters]="inputFilters" (search)="onSearch($event)"></my-advanced-input-filter>
<my-button i18n-label label="Refresh" icon="refresh" (click)="reloadData()"></my-button>
@@ -73,7 +59,7 @@
<td class="action-cell">
<my-action-dropdown
placement="bottom-right top-right left auto" container="body"
- i18n-label label="Actions" [actions]="actions" [entry]="runnerJob"
+ i18n-label label="Actions" [actions]="actions" [entry]="runnerJob" buttonSize="small"
></my-action-dropdown>
</td>
diff --git a/client/src/app/+admin/system/runners/runner-list/runner-list.component.html b/client/src/app/+admin/system/runners/runner-list/runner-list.component.html
index 1a4913a315..08eb4ca42b 100644
--- a/client/src/app/+admin/system/runners/runner-list/runner-list.component.html
+++ b/client/src/app/+admin/system/runners/runner-list/runner-list.component.html
@@ -1,17 +1,3 @@
-<div class="sub-title-container">
- <span class="sub-title">
- <my-global-icon iconName="codesandbox" aria-hidden="true"></my-global-icon>
- <h1 i18n>Remote runners</h1>
- </span>
-
- <div>
- <a routerLink="/admin/system/runners/registration-tokens-list" class="peertube-button-link peertube-button-icon grey-button">
- <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon>
- <ng-container i18n>Runner registration tokens</ng-container>
- </a>
- </div>
-</div>
-
<p-table
[value]="runners" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
[rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order"
@@ -36,7 +22,7 @@
<td class="action-cell">
<my-action-dropdown
placement="bottom-right top-right left auto" container="body"
- i18n-label label="Actions" [actions]="actions" [entry]="runner"
+ i18n-label label="Actions" [actions]="actions" [entry]="runner" buttonSize="small"
></my-action-dropdown>
</td>
diff --git a/client/src/app/+admin/system/runners/runner-registration-token-list/runner-registration-token-list.component.html b/client/src/app/+admin/system/runners/runner-registration-token-list/runner-registration-token-list.component.html
index 9c2d552913..8455df7be9 100644
--- a/client/src/app/+admin/system/runners/runner-registration-token-list/runner-registration-token-list.component.html
+++ b/client/src/app/+admin/system/runners/runner-registration-token-list/runner-registration-token-list.component.html
@@ -1,17 +1,3 @@
-<div class="sub-title-container">
- <span class="sub-title">
- <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon>
- <h1 i18n>Runner registration tokens</h1>
- </span>
-
- <div>
- <a routerLink="/admin/system/runners/runners-list" class="peertube-button-link peertube-button-icon grey-button">
- <my-global-icon iconName="codesandbox" aria-hidden="true"></my-global-icon>
- <ng-container i18n>Remote runners</ng-container>
- </a>
- </div>
-</div>
-
<p-table
[value]="registrationTokens" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
[rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order"
@@ -32,7 +18,7 @@
<ng-template pTemplate="caption">
<div class="caption">
<div class="left-buttons">
- <my-button theme="orange" i18n-label label="Generate token" icon="add" (click)="generateToken()"></my-button>
+ <my-button theme="primary" i18n-label label="Generate token" icon="add" (click)="generateToken()"></my-button>
</div>
</div>
</ng-template>
@@ -42,7 +28,7 @@
<td class="action-cell">
<my-action-dropdown
placement="bottom-right top-right left auto" container="body"
- i18n-label label="Actions" [actions]="actions" [entry]="registrationToken"
+ i18n-label label="Actions" [actions]="actions" [entry]="registrationToken" buttonSize="small"
></my-action-dropdown>
</td>
diff --git a/client/src/app/+admin/system/system.routes.ts b/client/src/app/+admin/system/system.routes.ts
index 169d52952b..15b8bff850 100644
--- a/client/src/app/+admin/system/system.routes.ts
+++ b/client/src/app/+admin/system/system.routes.ts
@@ -6,7 +6,7 @@ import { JobsComponent } from './jobs/jobs.component'
import { LogsComponent } from './logs'
import { RunnersRoutes } from './runners'
-export const SystemRoutes: Routes = [
+export const systemRoutes: Routes = [
{
path: 'system',
children: [
diff --git a/client/src/app/+error-page/error-page.component.html b/client/src/app/+error-page/error-page.component.html
index 83de1f84a9..9c5500e2d3 100644
--- a/client/src/app/+error-page/error-page.component.html
+++ b/client/src/app/+error-page/error-page.component.html
@@ -12,7 +12,7 @@
}
</div>
- <my-login-link className="peertube-button-big-link orange-button mt-5"></my-login-link>
+ <my-login-link className="peertube-button-big-link primary-button mt-5"></my-login-link>
</div>
} @else if (status === 403) {
<div class="box">
diff --git a/client/src/app/+error-page/routes.ts b/client/src/app/+error-page/routes.ts
index 07bfc34b3d..7f7a6969e8 100644
--- a/client/src/app/+error-page/routes.ts
+++ b/client/src/app/+error-page/routes.ts
@@ -1,13 +1,10 @@
import { Routes } from '@angular/router'
import { ErrorPageComponent } from './error-page.component'
-import { MenuGuards } from '@app/core'
export default [
{
path: '',
component: ErrorPageComponent,
- canActivate: [ MenuGuards.close(true) ],
- canDeactivate: [ MenuGuards.open(true) ],
data: {
meta: {
title: $localize`Not found`
diff --git a/client/src/app/+home/home.component.ts b/client/src/app/+home/home.component.ts
index 15c009feec..689cdf34b1 100644
--- a/client/src/app/+home/home.component.ts
+++ b/client/src/app/+home/home.component.ts
@@ -1,6 +1,6 @@
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'
-import { CustomMarkupContainerComponent } from '../shared/shared-custom-markup/custom-markup-container.component'
import { CustomPageService } from '@app/shared/shared-main/custom-page/custom-page.service'
+import { CustomMarkupContainerComponent } from '../shared/shared-custom-markup/custom-markup-container.component'
@Component({
templateUrl: './home.component.html',
diff --git a/client/src/app/+login/login.component.html b/client/src/app/+login/login.component.html
index 35168405b9..6fc6506944 100644
--- a/client/src/app/+login/login.component.html
+++ b/client/src/app/+login/login.component.html
@@ -4,15 +4,9 @@
</div>
</ng-template>
-<h1 class="title-page-v2">
- <strong class="underline-orange">{{ instanceName }}</strong>
-
- >
-
- <ng-container i18n>Login</ng-container>
-</h1>
-
<div class="margin-content">
+ <h1 class="title-page" i18n>Login on {{ instanceName }}</h1>
+
<ng-container *ngIf="!externalAuthError && !isAuthenticatedWithExternalAuth">
<my-alert type="primary">
@@ -22,25 +16,25 @@
@if (signupAllowed) {
<p i18n>
- This instance allows registration. However, be careful to check the <a class="link-orange terms-anchor d-inline" (click)="onTermsClick($event, instanceInformation)" href="/about/instance#terms">Terms</a><a class="terms-link" target="_blank" routerLink="/about/instance" fragment="terms">Terms</a> before creating an account.
- You may also search for another instance to match your exact needs at: <a class="link-orange" href="https://joinpeertube.org/instances" target="_blank" rel="noopener noreferrer">https://joinpeertube.org/instances</a>.
+ This instance allows registration. However, be careful to check the <a class="link-primary terms-anchor d-inline" (click)="onTermsClick($event, instanceInformation)" href="/about/instance#terms">Terms</a><a class="terms-link" target="_blank" routerLink="/about/instance" fragment="terms">Terms</a> before creating an account.
+ You may also search for another instance to match your exact needs at: <a class="link-primary" href="https://joinpeertube.org/instances" target="_blank" rel="noopener noreferrer">https://joinpeertube.org/instances</a>.
</p>
} @else {
<p i18n>
- Currently this instance doesn't allow for user registration, you may check the <a class="link-orange terms-anchor d-inline" (click)="onTermsClick($event, instanceInformation)" href="/about/instance#terms">Terms</a><a class="terms-link" target="_blank" routerLink="/about/instance" fragment="terms">Terms</a> for more details or find an instance that gives you the possibility to sign up for an account and upload your videos there.
- Find yours among multiple instances at: <a class="link-orange" href="https://joinpeertube.org/instances" target="_blank" rel="noopener noreferrer">https://joinpeertube.org/instances</a>.
+ Currently this instance doesn't allow for user registration, you may check the <a class="link-primary terms-anchor d-inline" (click)="onTermsClick($event, instanceInformation)" href="/about/instance#terms">Terms</a><a class="terms-link" target="_blank" routerLink="/about/instance" fragment="terms">Terms</a> for more details or find an instance that gives you the possibility to sign up for an account and upload your videos there.
+ Find yours among multiple instances at: <a class="link-primary" href="https://joinpeertube.org/instances" target="_blank" rel="noopener noreferrer">https://joinpeertube.org/instances</a>.
</p>
}
</my-alert>
<my-alert type="danger" i18n *ngIf="externalAuthError">
- Sorry but there was an issue with the external login process. Please <a class="link-orange" routerLink="/about">contact an administrator</a>.
+ Sorry but there was an issue with the external login process. Please <a class="link-primary" routerLink="/about">contact an administrator</a>.
</my-alert>
<my-alert *ngIf="error" type="danger">
{{ error }}
- <a *ngIf="error === 'User email is not verified.'" class="ms-1 link-orange" i18n routerLink="/verify-account/ask-send-email">
+ <a *ngIf="error === 'User email is not verified.'" class="ms-1 link-primary" i18n routerLink="/verify-account/ask-send-email">
Request new verification email
</a>
</my-alert>
@@ -87,16 +81,16 @@
></my-input-text>
</div>
- <input type="submit" class="peertube-button orange-button w-100" i18n-value value="Login" [disabled]="!form.valid">
+ <input type="submit" class="peertube-button primary-button w-100" i18n-value value="Login" [disabled]="!form.valid">
<div *ngIf="!otpStep" class="additional-links d-flex justify-content-center mt-4 mb-5 text-center">
- <button type="button" i18n class="button-unstyle link-orange mx-3" (click)="openForgotPasswordModal()" i18n-title title="Click here to reset your password">
+ <button type="button" i18n class="button-unstyle link-primary mx-3" (click)="openForgotPasswordModal()" i18n-title title="Click here to reset your password">
I forgot my password
</button>
<ng-container *ngIf="signupAllowed">
<span class="lh-1">·</span>
- <a i18n routerLink="/signup" class="link-orange mx-3">Create an account</a>
+ <a i18n routerLink="/signup" class="link-primary mx-3">Create an account</a>
</ng-container>
</div>
</form>
@@ -158,12 +152,12 @@
<div class="modal-footer inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button d-none d-sm-block"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button d-none d-sm-block"
(click)="hideForgotPasswordModal()" (key.enter)="hideForgotPasswordModal()"
>
<input
- type="submit" i18n-value="Password reset button" value="Reset" class="peertube-button orange-button"
+ type="submit" i18n-value="Password reset button" value="Reset" class="peertube-button primary-button"
(click)="askResetPassword()" [disabled]="!forgotPasswordEmailInput.validity.valid"
>
</div>
diff --git a/client/src/app/+login/login.component.scss b/client/src/app/+login/login.component.scss
index bf9beee668..8de4de5b80 100644
--- a/client/src/app/+login/login.component.scss
+++ b/client/src/app/+login/login.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
label {
display: block;
@@ -17,7 +18,6 @@ input[type=email] {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
- margin: auto;
> div {
flex: 1 1;
@@ -31,8 +31,7 @@ my-alert {
my-alert {
display: block;
-
- @include margin(0, auto, 2rem);
+ margin-bottom: 2rem;
}
.login-form-and-externals {
@@ -54,7 +53,7 @@ my-alert {
cursor: pointer;
border: 1px solid #d1d7e0;
border-radius: 5px;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
margin: 10px 10px 0 0;
display: flex;
justify-content: center;
diff --git a/client/src/app/+manage/routes.ts b/client/src/app/+manage/routes.ts
index 194d2fdacb..569b47cab2 100644
--- a/client/src/app/+manage/routes.ts
+++ b/client/src/app/+manage/routes.ts
@@ -1,6 +1,6 @@
import { Routes } from '@angular/router'
-import { VideoChannelCreateComponent } from './video-channel-edit/video-channel-create.component'
-import { VideoChannelUpdateComponent } from './video-channel-edit/video-channel-update.component'
+import { VideoChannelCreateComponent } from '@app/shared/standalone-channels/video-channel-create.component'
+import { VideoChannelUpdateComponent } from '@app/shared/standalone-channels/video-channel-update.component'
export default [
{
diff --git a/client/src/app/+my-account/my-account-abuses/my-account-abuses-list.component.html b/client/src/app/+my-account/my-account-abuses/my-account-abuses-list.component.html
index 48371bf483..dfb32b17a1 100644
--- a/client/src/app/+my-account/my-account-abuses/my-account-abuses-list.component.html
+++ b/client/src/app/+my-account/my-account-abuses/my-account-abuses-list.component.html
@@ -1,8 +1 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="flag" aria-hidden="true"></my-global-icon>
- <h1 i18n>Reports</h1>
- </div>
-</div>
-
<my-abuse-list-table viewType="user"></my-abuse-list-table>
diff --git a/client/src/app/+my-account/my-account-applications/my-account-applications.component.html b/client/src/app/+my-account/my-account-applications/my-account-applications.component.html
index 63d3fae208..34448f8fe4 100644
--- a/client/src/app/+my-account/my-account-applications/my-account-applications.component.html
+++ b/client/src/app/+my-account/my-account-applications/my-account-applications.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="codesandbox" aria-hidden="true"></my-global-icon>
- <h1 i18n>Applications</h1>
- </div>
-</div>
-
<div class="pt-two-cols"> <!-- built-in token grid -->
<div class="title-col">
@@ -29,7 +22,7 @@
<div class="form-group-description" i18n>⚠️ Never share your feed token with anyone.</div>
</div>
- <input (click)="renewToken()" class="peertube-button orange-button mt-4" type="submit" i18n-value value="Renew token">
+ <input (click)="renewToken()" class="peertube-button primary-button mt-4" type="submit" i18n-value value="Renew token">
</div>
</div>
diff --git a/client/src/app/+my-account/my-account-comments-on-my-videos/comments-on-my-videos.component.html b/client/src/app/+my-account/my-account-comments-on-my-videos/comments-on-my-videos.component.html
deleted file mode 100644
index 597acee178..0000000000
--- a/client/src/app/+my-account/my-account-comments-on-my-videos/comments-on-my-videos.component.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="message-circle" aria-hidden="true"></my-global-icon>
- <h1 i18n>Comments on your videos</h1>
- </div>
-</div>
-
-<my-video-comment-list-admin-owner mode="user"></my-video-comment-list-admin-owner>
-
diff --git a/client/src/app/+my-account/my-account-import-export/my-account-export.component.html b/client/src/app/+my-account/my-account-import-export/my-account-export.component.html
index 9427f652d5..ccb0ce6070 100644
--- a/client/src/app/+my-account/my-account-import-export/my-account-export.component.html
+++ b/client/src/app/+my-account/my-account-import-export/my-account-export.component.html
@@ -58,14 +58,14 @@
</td>
<td>
- <a i18n *ngIf="export.privateDownloadUrl" [href]="export.privateDownloadUrl" class="peertube-button-link grey-button">Download your archive</a>
+ <a i18n *ngIf="export.privateDownloadUrl" [href]="export.privateDownloadUrl" class="peertube-button-link secondary-button">Download your archive</a>
</td>
</tr>
</table>
<div class="mt-3">
<input
- class="peertube-button orange-button"
+ class="peertube-button primary-button"
[disabled]="isRequestArchiveDisabled()"
(click)="openNewArchiveModal()"
type="submit" i18n-value value="Request a new archive"
@@ -109,12 +109,12 @@
<div class="modal-footer inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
<input
- type="submit" i18n-value value="Request an archive" class="peertube-button orange-button"
+ type="submit" i18n-value value="Request an archive" class="peertube-button primary-button"
(click)="requestNewArchive()"
/>
</div>
diff --git a/client/src/app/+my-account/my-account-import-export/my-account-import-export.component.html b/client/src/app/+my-account/my-account-import-export/my-account-import-export.component.html
index aefcddf3a0..8abb757f68 100644
--- a/client/src/app/+my-account/my-account-import-export/my-account-import-export.component.html
+++ b/client/src/app/+my-account/my-account-import-export/my-account-import-export.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="cloud-download" aria-hidden="true"></my-global-icon>
- <h1 i18n>Import/Export</h1>
- </div>
-</div>
-
<my-account-import #accountImport [videoQuotaUsed]="videoQuotaUsed" class="d-block mb-5"></my-account-import>
<my-account-export [videoQuotaUsed]="videoQuotaUsed"></my-account-export>
diff --git a/client/src/app/+my-account/my-account-import-export/my-account-import.component.html b/client/src/app/+my-account/my-account-import-export/my-account-import.component.html
index a9c9295f19..24dda897ca 100644
--- a/client/src/app/+my-account/my-account-import-export/my-account-import.component.html
+++ b/client/src/app/+my-account/my-account-import-export/my-account-import.component.html
@@ -62,7 +62,7 @@
Upload completed. Your archive import will be processed as soon as possible.
</my-alert>
- <div [hidden]="uploadingArchive || archiveUploadFinished" class="button-file form-control" i18n-ngbTooltip ngbTooltip="(extension: .zip)">
+ <div [hidden]="uploadingArchive || archiveUploadFinished" class="button-file primary-button form-control" i18n-ngbTooltip ngbTooltip="(extension: .zip)">
<span i18n>Select the archive file to import</span>
<input
aria-label="Select the file to import"
diff --git a/client/src/app/+my-account/my-account-import-export/my-account-import.component.scss b/client/src/app/+my-account/my-account-import-export/my-account-import.component.scss
index 265501b562..340bd7b4e1 100644
--- a/client/src/app/+my-account/my-account-import-export/my-account-import.component.scss
+++ b/client/src/app/+my-account/my-account-import-export/my-account-import.component.scss
@@ -2,8 +2,7 @@
@use '_mixins' as *;
.button-file {
- @include peertube-button-file(max-content);
- @include orange-button;
+ width: max-content;
}
my-alert {
diff --git a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html
index dec372636f..11eca2f05f 100644
--- a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html
+++ b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html
@@ -1,24 +1,17 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="bell" aria-hidden="true"></my-global-icon>
- <h1 i18n>Notifications</h1>
- </div>
-</div>
-
<div class="header">
- <a class="peertube-button-link grey-button" routerLink="/my-account/settings" fragment="notifications">
- <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon>
- <span i18n>Notification preferences</span>
- </a>
-
- <div class="peertube-select-container peertube-select-button ms-2 me-2">
+ <div class="peertube-select-container me-auto">
<select [(ngModel)]="notificationSortType" (ngModelChange)="onChangeSortColumn()" class="form-control" i18n-ariaLabel aria-label="Sort by">
<option value="createdAt" i18n>Newest first</option>
<option value="read" [disabled]="!hasUnreadNotifications()" i18n>Unread first</option>
</select>
</div>
- <button class="ms-auto peertube-button grey-button" [disabled]="!hasUnreadNotifications()" (click)="markAllAsRead()">
+ <a class="peertube-button-link secondary-button" routerLink="/my-account/settings" fragment="notifications">
+ <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon>
+ <span i18n>Notification preferences</span>
+ </a>
+
+ <button class="peertube-button secondary-button" [disabled]="!hasUnreadNotifications()" (click)="markAllAsRead()">
<ng-container *ngIf="hasUnreadNotifications()">
<my-global-icon iconName="tick" aria-hidden="true"></my-global-icon>
diff --git a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.scss b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.scss
index cee3389915..c6ffc709bf 100644
--- a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.scss
+++ b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.scss
@@ -1,62 +1,15 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_button-mixins' as *;
+@use '_form-mixins' as *;
.header {
display: flex;
+ flex-wrap: wrap;
+ gap: 0.5rem;
margin-bottom: 1.25rem;
- a {
- @include button-with-icon(18px, 3px, -1px);
- }
-
- button {
- @include button-with-icon(20px, 3px, -1px);
- }
-
.peertube-select-container {
@include peertube-select-container(auto);
}
}
-
-@media screen and (max-width: $mobile-view) {
- .header {
- flex-direction: column;
-
- > :first-child,
- .peertube-select-container {
- margin-bottom: 15px;
- }
-
- .peertube-select-container {
- @include margin-left(0 !important);
- }
- }
-}
-
-@media screen and (min-width: $mobile-view) and (max-width: $small-view) {
- .header {
- a {
- font-size: 0;
- padding: 0 13px;
- }
-
- .peertube-select-container {
- width: auto !important;
- }
- }
-}
-
-@media screen and (min-width: $mobile-view) and (max-width: #{$small-view + $menu-width}) {
- :host-context(.main-col:not(.expanded)) {
- .header {
- a {
- font-size: 0;
- padding: 0 13px;
- }
-
- .peertube-select-container {
- width: auto !important;
- }
- }
- }
-}
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.html b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.html
index 082f24d02f..ed795d3b37 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.html
+++ b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.html
@@ -31,5 +31,5 @@
></my-input-text>
</div>
- <input type="submit" i18n-value value="Change email" [disabled]="!form.valid">
+ <input class="peertube-button primary-button" type="submit" i18n-value value="Change email" [disabled]="!form.valid">
</form>
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.scss b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.scss
index 6bc4a7c2f5..ac35fde645 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.scss
+++ b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
form {
max-width: 340px;
@@ -14,11 +15,6 @@ input[type=email] {
@include peertube-input-text(100%);
}
-input[type=submit] {
- @include peertube-button;
- @include orange-button;
-}
-
.pending-email {
margin-bottom: 15px;
}
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.html b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.html
index 0f29289905..260b7bed16 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.html
+++ b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.html
@@ -18,5 +18,5 @@
[formError]="formErrors['new-confirmed-password']" autocomplete="new-password"
></my-input-text>
- <input type="submit" i18n-value value="Change password" [disabled]="!form.valid">
+ <input class="mt-3 peertube-button primary-button" type="submit" i18n-value value="Change password" [disabled]="!form.valid">
</form>
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.scss b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.scss
index f4cc18d8dc..9fd685b4ee 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.scss
+++ b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.scss
@@ -13,10 +13,3 @@ my-input-text {
my-input-text + my-input-text {
margin-top: 15px;
}
-
-input[type=submit] {
- margin-top: 15px;
-
- @include peertube-button;
- @include orange-button;
-}
diff --git a/client/src/app/+my-account/my-account-settings/my-account-email-preferences/my-account-email-preferences.component.html b/client/src/app/+my-account/my-account-settings/my-account-email-preferences/my-account-email-preferences.component.html
index 68419ea04a..33f941abc9 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-email-preferences/my-account-email-preferences.component.html
+++ b/client/src/app/+my-account/my-account-settings/my-account-email-preferences/my-account-email-preferences.component.html
@@ -17,5 +17,5 @@
</my-peertube-checkbox>
</div>
- <input class="peertube-button orange-button" type="submit" i18n-value value="Save email settings" [disabled]="!form.valid">
+ <input class="peertube-button primary-button" type="submit" i18n-value value="Save email settings" [disabled]="!form.valid">
</form>
diff --git a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.html b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.html
index 1a42ebb840..042f9934a9 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.html
+++ b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.html
@@ -35,5 +35,5 @@
</div>
</div>
- <input type="submit" i18n-value value="Save profile" [disabled]="!form.valid">
+ <input class="mt-3 peertube-button primary-button" type="submit" i18n-value value="Save profile" [disabled]="!form.valid">
</form>
diff --git a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.scss b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.scss
index c60a1b4217..df928180d6 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.scss
+++ b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
input#username + .muted {
margin-top: 5px;
@@ -9,13 +10,6 @@ input[type=text] {
@include peertube-input-text(340px);
}
-input[type=submit] {
- margin-top: 15px;
-
- @include peertube-button;
- @include orange-button;
-}
-
textarea {
max-width: 100%;
diff --git a/client/src/app/+my-account/my-account-settings/my-account-two-factor/my-account-two-factor-button.component.html b/client/src/app/+my-account/my-account-settings/my-account-two-factor/my-account-two-factor-button.component.html
index 831b294d13..9e8ae11ba3 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-two-factor/my-account-two-factor-button.component.html
+++ b/client/src/app/+my-account/my-account-settings/my-account-two-factor/my-account-two-factor-button.component.html
@@ -2,11 +2,11 @@
<ng-container *ngIf="!twoFactorEnabled">
<p i18n>Two factor authentication adds an additional layer of security to your account by requiring a numeric code from another device (most commonly mobile phones) when you log in.</p>
- <my-button [ptRouterLink]="[ '/my-account/two-factor-auth' ]" theme="orange" i18n>Enable two-factor authentication</my-button>
+ <my-button [ptRouterLink]="[ '/my-account/two-factor-auth' ]" theme="primary" i18n>Enable two-factor authentication</my-button>
</ng-container>
<ng-container *ngIf="twoFactorEnabled">
- <my-button theme="orange" (click)="disableTwoFactor()" i18n>Disable two-factor authentication</my-button>
+ <my-button theme="primary" (click)="disableTwoFactor()" i18n>Disable two-factor authentication</my-button>
</ng-container>
</div>
diff --git a/client/src/app/+my-account/my-account-settings/my-account-two-factor/my-account-two-factor.component.html b/client/src/app/+my-account/my-account-settings/my-account-two-factor/my-account-two-factor.component.html
index eefd315017..efc668a1bb 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-two-factor/my-account-two-factor.component.html
+++ b/client/src/app/+my-account/my-account-settings/my-account-two-factor/my-account-two-factor.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon>
- <h1 i18n>Two factor authentication</h1>
- </div>
-</div>
-
<div i18n *ngIf="twoFactorAlreadyEnabled === true" class="root already-enabled">
Two factor authentication is already enabled.
</div>
@@ -21,7 +14,7 @@
[formError]="formErrorsPassword['current-password']" autocomplete="current-password"
></my-input-text>
- <input class="peertube-button orange-button mt-3" type="submit" i18n-value value="Confirm" [disabled]="!formPassword.valid">
+ <input class="peertube-button primary-button mt-3" type="submit" i18n-value value="Confirm" [disabled]="!formPassword.valid">
</form>
</ng-container>
@@ -49,7 +42,7 @@
[formError]="formErrorsOTP['otp-token']" autocomplete="otp-token"
></my-input-text>
- <input class="peertube-button orange-button mt-3" type="submit" i18n-value value="Confirm" [disabled]="!formOTP.valid">
+ <input class="peertube-button primary-button mt-3" type="submit" i18n-value value="Confirm" [disabled]="!formOTP.valid">
</form>
</ng-container>
diff --git a/client/src/app/+my-account/my-account.component.html b/client/src/app/+my-account/my-account.component.html
index 2bf1949169..2add8a60ad 100644
--- a/client/src/app/+my-account/my-account.component.html
+++ b/client/src/app/+my-account/my-account.component.html
@@ -1,9 +1,11 @@
<div class="root">
- <a i18n class="visually-hidden-focusable skip-to-content-sub-menu" href="#my-account-content" (click)="$event.preventDefault(); myAccountContent.focus()">Skip the sub menu</a>
+ <div class="margin-content">
+ <a i18n class="visually-hidden-focusable skip-to-content-sub-menu" href="#my-account-content" (click)="$event.preventDefault(); myAccountContent.focus()">Skip the sub menu</a>
- <my-top-menu-dropdown [menuEntries]="menuEntries"></my-top-menu-dropdown>
+ <my-horizontal-menu i18n-h1 h1="My account" h1Icon="cog" [menuEntries]="menuEntries"></my-horizontal-menu>
+ </div>
- <div #myAccountContent tabindex="-1" id="my-account-content" class="margin-content pb-5 outline-0" [ngClass]="{ 'sub-menu-offset-content': !isBroadcastMessageDisplayed }">
+ <div #myAccountContent tabindex="-1" id="my-account-content" class="margin-content pb-5 outline-0">
<router-outlet></router-outlet>
</div>
</div>
diff --git a/client/src/app/+my-account/my-account.component.scss b/client/src/app/+my-account/my-account.component.scss
deleted file mode 100644
index d50db5e28c..0000000000
--- a/client/src/app/+my-account/my-account.component.scss
+++ /dev/null
@@ -1,13 +0,0 @@
-@use '_variables' as *;
-@use '_mixins' as *;
-
-.root {
- flex-direction: column;
- width: 100%;
-
- @include sub-menu-h1;
-
- > my-top-menu-dropdown:nth-child(1) {
- flex-grow: 1;
- }
-}
diff --git a/client/src/app/+my-account/my-account.component.ts b/client/src/app/+my-account/my-account.component.ts
index 9a7f586ed6..a7c479c932 100644
--- a/client/src/app/+my-account/my-account.component.ts
+++ b/client/src/app/+my-account/my-account.component.ts
@@ -1,28 +1,21 @@
-import { NgClass } from '@angular/common'
import { Component, OnInit } from '@angular/core'
import { RouterOutlet } from '@angular/router'
-import { AuthUser, PluginService, ScreenService } from '@app/core'
-import { TopMenuDropdownComponent, TopMenuDropdownParam } from '../shared/shared-main/menu/top-menu-dropdown.component'
+import { AuthUser, PluginService } from '@app/core'
+import { HorizontalMenuComponent, HorizontalMenuEntry } from '@app/shared/shared-main/menu/horizontal-menu.component'
@Component({
templateUrl: './my-account.component.html',
- styleUrls: [ './my-account.component.scss' ],
standalone: true,
- imports: [ TopMenuDropdownComponent, NgClass, RouterOutlet ]
+ imports: [ HorizontalMenuComponent, RouterOutlet ]
})
export class MyAccountComponent implements OnInit {
- menuEntries: TopMenuDropdownParam[] = []
+ menuEntries: HorizontalMenuEntry[] = []
user: AuthUser
constructor (
- private pluginService: PluginService,
- private screenService: ScreenService
+ private pluginService: PluginService
) { }
- get isBroadcastMessageDisplayed () {
- return this.screenService.isBroadcastMessageDisplayed
- }
-
ngOnInit (): void {
this.pluginService.ensurePluginsAreLoaded('my-account')
.then(() => this.buildMenu())
@@ -54,36 +47,19 @@ export class MyAccountComponent implements OnInit {
{
label: $localize`Moderation`,
+ routerLink: '/my-account/blocklist/accounts',
children: [
{
label: $localize`Muted accounts`,
- routerLink: '/my-account/blocklist/accounts',
- iconName: 'user-x'
+ routerLink: '/my-account/blocklist/accounts'
},
{
label: $localize`Muted servers`,
- routerLink: '/my-account/blocklist/servers',
- iconName: 'peertube-x'
+ routerLink: '/my-account/blocklist/servers'
},
{
label: $localize`Abuse reports`,
- routerLink: '/my-account/abuses',
- iconName: 'flag'
- },
- {
- label: $localize`Comments on your videos`,
- routerLink: '/my-account/videos/comments',
- iconName: 'message-circle'
- },
- {
- label: $localize`Watched words`,
- routerLink: '/my-account/watched-words/list',
- iconName: 'eye-open'
- },
- {
- label: $localize`Auto tag policies`,
- routerLink: '/my-account/auto-tag-policies',
- iconName: 'no'
+ routerLink: '/my-account/abuses'
}
]
},
diff --git a/client/src/app/+my-account/routes.ts b/client/src/app/+my-account/routes.ts
index 8a3bb209b8..4ec4c64833 100644
--- a/client/src/app/+my-account/routes.ts
+++ b/client/src/app/+my-account/routes.ts
@@ -1,4 +1,5 @@
import { Routes } from '@angular/router'
+import { userResolver } from '@app/core/routing/user.resolver'
import { AbuseService } from '@app/shared/shared-moderation/abuse.service'
import { BlocklistService } from '@app/shared/shared-moderation/blocklist.service'
import { BulkService } from '@app/shared/shared-moderation/bulk.service'
@@ -6,21 +7,16 @@ import { VideoBlockService } from '@app/shared/shared-moderation/video-block.ser
import { PluginPagesComponent } from '@app/shared/shared-plugin-pages/plugin-pages.component'
import { TwoFactorService } from '@app/shared/shared-users/two-factor.service'
import { VideoCommentService } from '@app/shared/shared-video-comment/video-comment.service'
-import { WatchedWordsListService } from '@app/shared/standalone-watched-words/watched-words-list.service'
import { CanDeactivateGuard, LoginGuard } from '../core'
import { MyAccountAbusesListComponent } from './my-account-abuses/my-account-abuses-list.component'
import { MyAccountApplicationsComponent } from './my-account-applications/my-account-applications.component'
-import { MyAccountAutoTagPoliciesComponent } from './my-account-auto-tag-policies/my-account-auto-tag-policies.component'
import { MyAccountBlocklistComponent } from './my-account-blocklist/my-account-blocklist.component'
import { MyAccountServerBlocklistComponent } from './my-account-blocklist/my-account-server-blocklist.component'
-import { CommentsOnMyVideosComponent } from './my-account-comments-on-my-videos/comments-on-my-videos.component'
import { MyAccountImportExportComponent, UserImportExportService } from './my-account-import-export'
import { MyAccountNotificationsComponent } from './my-account-notifications/my-account-notifications.component'
import { MyAccountSettingsComponent } from './my-account-settings/my-account-settings.component'
import { MyAccountTwoFactorComponent } from './my-account-settings/my-account-two-factor/my-account-two-factor.component'
-import { MyAccountWatchedWordsListComponent } from './my-account-watched-words-list/my-account-watched-words-list.component'
import { MyAccountComponent } from './my-account.component'
-import { userResolver } from '@app/core/routing/user.resolver'
export default [
{
@@ -31,10 +27,9 @@ export default [
TwoFactorService,
BlocklistService,
AbuseService,
- VideoCommentService,
VideoBlockService,
BulkService,
- WatchedWordsListService
+ VideoCommentService
],
resolve: {
user: userResolver
@@ -165,12 +160,7 @@ export default [
},
{
path: 'videos/comments',
- component: CommentsOnMyVideosComponent,
- data: {
- meta: {
- title: $localize`Comments on your videos`
- }
- }
+ redirectTo: '/my-library/videos/comments'
},
{
path: 'import-export',
@@ -184,21 +174,13 @@ export default [
},
{
path: 'watched-words/list',
- component: MyAccountWatchedWordsListComponent,
- data: {
- meta: {
- title: $localize`Your watched words`
- }
- }
+ redirectTo: '/my-library/watched-words/list',
+ pathMatch: 'full'
},
{
path: 'auto-tag-policies',
- component: MyAccountAutoTagPoliciesComponent,
- data: {
- meta: {
- title: $localize`Your automatic tag policies`
- }
- }
+ redirectTo: '/my-library/auto-tag-policies',
+ pathMatch: 'full'
},
{
path: 'p',
diff --git a/client/src/app/+my-library/+my-video-channels/my-video-channels.component.html b/client/src/app/+my-library/+my-video-channels/my-video-channels.component.html
index d4d1c09313..d8501fdd18 100644
--- a/client/src/app/+my-library/+my-video-channels/my-video-channels.component.html
+++ b/client/src/app/+my-library/+my-video-channels/my-video-channels.component.html
@@ -1,23 +1,10 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="channel" aria-hidden="true"></my-global-icon>
- <h1 i18n>My channels</h1>
- <span *ngIf="pagination.totalItems" [title]="getTotalTitle()" class="pt-badge badge-secondary">{{ pagination.totalItems }}</span>
- </div>
-
- <div>
- <a routerLink="/my-library/video-channel-syncs" class="peertube-button-link grey-button peertube-button-icon">
- <my-global-icon iconName="repeat" aria-hidden="true"></my-global-icon>
- <ng-container i18n>My synchronizations</ng-container>
- </a>
- </div>
-</div>
-
<my-channels-setup-message [hideLink]="true"></my-channels-setup-message>
-<div class="video-channels-header d-flex justify-content-between gap-2">
+<div class="video-channels-header d-flex justify-content-between align-items-end gap-2 flex-wrap">
<my-advanced-input-filter (search)="onSearch($event)"></my-advanced-input-filter>
+ <span *ngIf="pagination.totalItems" class="total-items">{{ getTotalTitle() }}</span>
+
<a class="peertube-create-button" routerLink="/manage/create">
<my-global-icon iconName="add" aria-hidden="true"></my-global-icon>
<ng-container i18n>Create video channel</ng-container>
@@ -43,14 +30,14 @@
{videoChannel.followersCount, plural, =0 {No subscribers} =1 {1 subscriber} other {{{ videoChannel.followersCount }} subscribers}}
</a>
- <div class="d-flex">
+ <div class="channel-videos">
<span i18n>{videoChannel.videosCount, plural, =0 {No videos} =1 {1 video} other {{{ videoChannel.videosCount }} videos}}</span>
<span class="mx-1">·</span>
<span i18n>{videoChannel.totalViews, plural, =0 {No views} =1 {1 view} other {{{ videoChannel.totalViews | myNumberFormatter }} views}}</span>
</div>
<div class="video-channel-buttons">
- <my-edit-button label [ptRouterLink]="[ '/manage/update', videoChannel.nameWithHost ]"></my-edit-button>
+ <my-edit-button label [ptRouterLink]="[ '/my-library/video-channels/update', videoChannel.nameWithHost ]"></my-edit-button>
<my-delete-button label (click)="deleteVideoChannel(videoChannel)"></my-delete-button>
</div>
diff --git a/client/src/app/+my-library/+my-video-channels/my-video-channels.component.scss b/client/src/app/+my-library/+my-video-channels/my-video-channels.component.scss
index 8367ef2dd6..153b64846e 100644
--- a/client/src/app/+my-library/+my-video-channels/my-video-channels.component.scss
+++ b/client/src/app/+my-library/+my-video-channels/my-video-channels.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
.sub-title my-global-icon {
position: relative;
@@ -32,7 +33,7 @@ my-edit-button {
width: fit-content;
display: flex;
align-items: baseline;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
@include disable-default-a-behaviour;
}
@@ -44,13 +45,14 @@ my-edit-button {
.video-channel-name {
font-size: 14px;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
@include margin-left(5px);
}
.video-channel-followers {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
+ text-decoration: none;
}
.video-channel-buttons {
@@ -69,10 +71,6 @@ my-edit-button {
}
@media screen and (max-width: $small-view) {
- .video-channels-header {
- text-align: center;
- }
-
.video-channel {
padding-bottom: 10px;
@@ -101,17 +99,6 @@ my-edit-button {
}
}
-@media screen and (max-width: $mobile-view) {
- .video-channels-header {
- flex-direction: column;
-
- input[type=text] {
- width: 100% !important;
- margin-bottom: 12px;
- }
- }
-}
-
@media screen and (min-width: breakpoint(lg)) {
:host-context(.main-col:not(.expanded)) {
.video-channel-buttons {
@@ -121,9 +108,7 @@ my-edit-button {
}
@media screen and (min-width: $small-view) {
- :host-context(.expanded) {
- .video-channel-buttons {
- float: right;
- }
+ .video-channel-buttons {
+ float: right;
}
}
diff --git a/client/src/app/+my-library/+my-video-channels/my-video-channels.component.ts b/client/src/app/+my-library/+my-video-channels/my-video-channels.component.ts
index 998b910ee2..c3a9b635a2 100644
--- a/client/src/app/+my-library/+my-video-channels/my-video-channels.component.ts
+++ b/client/src/app/+my-library/+my-video-channels/my-video-channels.component.ts
@@ -226,7 +226,7 @@ export class MyVideoChannelsComponent {
getTotalTitle () {
return formatICU(
- $localize`You have ${this.pagination.totalItems} {total, plural, =1 {channel} other {channels}}`,
+ $localize`${this.pagination.totalItems} {total, plural, =1 {channel} other {channels}}`,
{ total: this.pagination.totalItems }
)
}
diff --git a/client/src/app/+my-library/+my-video-channels/routes.ts b/client/src/app/+my-library/+my-video-channels/routes.ts
index 6e96545d82..9c02f9f71b 100644
--- a/client/src/app/+my-library/+my-video-channels/routes.ts
+++ b/client/src/app/+my-library/+my-video-channels/routes.ts
@@ -1,4 +1,6 @@
import { Routes } from '@angular/router'
+import { VideoChannelCreateComponent } from '@app/shared/standalone-channels/video-channel-create.component'
+import { VideoChannelUpdateComponent } from '@app/shared/standalone-channels/video-channel-update.component'
import { MyVideoChannelsComponent } from './my-video-channels.component'
export default [
@@ -13,10 +15,20 @@ export default [
},
{
path: 'create',
- redirectTo: '/manage/create'
+ component: VideoChannelCreateComponent,
+ data: {
+ meta: {
+ title: $localize`Create a new video channel`
+ }
+ }
},
{
path: 'update/:videoChannelName',
- redirectTo: '/manage/update/:videoChannelName'
+ component: VideoChannelUpdateComponent,
+ data: {
+ meta: {
+ title: $localize`Update video channel`
+ }
+ }
}
] satisfies Routes
diff --git a/client/src/app/+my-library/comments-on-my-videos/comments-on-my-videos.component.html b/client/src/app/+my-library/comments-on-my-videos/comments-on-my-videos.component.html
new file mode 100644
index 0000000000..531cddb0e9
--- /dev/null
+++ b/client/src/app/+my-library/comments-on-my-videos/comments-on-my-videos.component.html
@@ -0,0 +1,2 @@
+<my-video-comment-list-admin-owner mode="user"></my-video-comment-list-admin-owner>
+
diff --git a/client/src/app/+my-account/my-account-comments-on-my-videos/comments-on-my-videos.component.ts b/client/src/app/+my-library/comments-on-my-videos/comments-on-my-videos.component.ts
similarity index 100%
rename from client/src/app/+my-account/my-account-comments-on-my-videos/comments-on-my-videos.component.ts
rename to client/src/app/+my-library/comments-on-my-videos/comments-on-my-videos.component.ts
diff --git a/client/src/app/+my-account/my-account-auto-tag-policies/automatic-tag.service.ts b/client/src/app/+my-library/my-auto-tag-policies/automatic-tag.service.ts
similarity index 100%
rename from client/src/app/+my-account/my-account-auto-tag-policies/automatic-tag.service.ts
rename to client/src/app/+my-library/my-auto-tag-policies/automatic-tag.service.ts
diff --git a/client/src/app/+my-account/my-account-auto-tag-policies/my-account-auto-tag-policies.component.html b/client/src/app/+my-library/my-auto-tag-policies/my-auto-tag-policies.component.html
similarity index 64%
rename from client/src/app/+my-account/my-account-auto-tag-policies/my-account-auto-tag-policies.component.html
rename to client/src/app/+my-library/my-auto-tag-policies/my-auto-tag-policies.component.html
index d1c6c07123..a0c1ba38bb 100644
--- a/client/src/app/+my-account/my-account-auto-tag-policies/my-account-auto-tag-policies.component.html
+++ b/client/src/app/+my-library/my-auto-tag-policies/my-auto-tag-policies.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="no" aria-hidden="true"></my-global-icon>
- <h1 i18n>Your automatic tag policies</h1>
- </div>
-</div>
-
<strong class="d-block mb-3" i18n>Automatically block comments:</strong>
@for (tag of tags; track tag; let i = $index) {
diff --git a/client/src/app/+my-account/my-account-auto-tag-policies/my-account-auto-tag-policies.component.ts b/client/src/app/+my-library/my-auto-tag-policies/my-auto-tag-policies.component.ts
similarity index 93%
rename from client/src/app/+my-account/my-account-auto-tag-policies/my-account-auto-tag-policies.component.ts
rename to client/src/app/+my-library/my-auto-tag-policies/my-auto-tag-policies.component.ts
index 13c04abd9c..6955cbf19c 100644
--- a/client/src/app/+my-account/my-account-auto-tag-policies/my-account-auto-tag-policies.component.ts
+++ b/client/src/app/+my-library/my-auto-tag-policies/my-auto-tag-policies.component.ts
@@ -8,7 +8,7 @@ import { forkJoin } from 'rxjs'
import { AutomaticTagService } from './automatic-tag.service'
@Component({
- templateUrl: './my-account-auto-tag-policies.component.html',
+ templateUrl: './my-auto-tag-policies.component.html',
standalone: true,
imports: [
GlobalIconComponent,
@@ -16,7 +16,7 @@ import { AutomaticTagService } from './automatic-tag.service'
PeertubeCheckboxComponent
]
})
-export class MyAccountAutoTagPoliciesComponent implements OnInit {
+export class MyAutoTagPoliciesComponent implements OnInit {
tags: { name: string, review: boolean, type: AutomaticTagAvailableType }[] = []
constructor (
diff --git a/client/src/app/+my-library/my-follows/my-followers.component.html b/client/src/app/+my-library/my-follows/my-followers.component.html
index 205c2473c8..90adb5d341 100644
--- a/client/src/app/+my-library/my-follows/my-followers.component.html
+++ b/client/src/app/+my-library/my-follows/my-followers.component.html
@@ -1,12 +1,6 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="follower" aria-hidden="true"></my-global-icon>
- <h1 i18n>My followers</h1>
- <span *ngIf="pagination.totalItems" [title]="getTotalTitle()" class="pt-badge badge-secondary"> {{ pagination.totalItems }}</span>
- </div>
-</div>
+<div class="followers-header d-flex justify-content-between align-items-end gap-2 flex-wrap">
+ <span class="total-items" *ngIf="pagination.totalItems"> {{ getTotalTitle() }}</span>
-<div class="followers-header">
<my-advanced-input-filter [filters]="inputFilters" (search)="onSearch($event)"></my-advanced-input-filter>
</div>
diff --git a/client/src/app/+my-library/my-follows/my-followers.component.scss b/client/src/app/+my-library/my-follows/my-followers.component.scss
index 2caa4cc483..69a5c2a7bf 100644
--- a/client/src/app/+my-library/my-follows/my-followers.component.scss
+++ b/client/src/app/+my-library/my-follows/my-followers.component.scss
@@ -1,6 +1,7 @@
@use '_variables' as *;
@use '_mixins' as *;
@use '_actor' as *;
+@use '_form-mixins' as *;
.followers-header {
margin-bottom: 30px;
diff --git a/client/src/app/+my-library/my-follows/my-followers.component.ts b/client/src/app/+my-library/my-follows/my-followers.component.ts
index 4c1d4741e8..30ffce1c08 100644
--- a/client/src/app/+my-library/my-follows/my-followers.component.ts
+++ b/client/src/app/+my-library/my-follows/my-followers.component.ts
@@ -68,6 +68,8 @@ export class MyFollowersComponent implements OnInit {
onSearch (search: string) {
this.search = search
+ this.pagination.currentPage = 1
+
this.loadFollowers(false)
}
@@ -77,7 +79,7 @@ export class MyFollowersComponent implements OnInit {
getTotalTitle () {
return formatICU(
- $localize`You have ${this.pagination.totalItems} {total, plural, =1 {follower} other {followers}}`,
+ $localize`${this.pagination.totalItems} {total, plural, =1 {follower} other {followers}}`,
{ total: this.pagination.totalItems }
)
}
diff --git a/client/src/app/+my-library/my-follows/my-subscriptions.component.html b/client/src/app/+my-library/my-follows/my-subscriptions.component.html
index 547eb8c734..def2a4a239 100644
--- a/client/src/app/+my-library/my-follows/my-subscriptions.component.html
+++ b/client/src/app/+my-library/my-follows/my-subscriptions.component.html
@@ -1,12 +1,6 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="subscriptions" aria-hidden="true"></my-global-icon>
- <h1 i18n>My subscriptions</h1>
- <span *ngIf="pagination.totalItems" [title]="getTotalTitle()" class="pt-badge badge-secondary"> {{ pagination.totalItems }}</span>
- </div>
-</div>
+<div class="mb-4 d-flex justify-content-between align-items-end gap-2 flex-wrap">
+ <span class="total-items" *ngIf="pagination.totalItems"> {{ getTotalTitle() }}</span>
-<div class="mb-3">
<my-advanced-input-filter (search)="onSearch($event)"></my-advanced-input-filter>
</div>
diff --git a/client/src/app/+my-library/my-follows/my-subscriptions.component.scss b/client/src/app/+my-library/my-follows/my-subscriptions.component.scss
index ffb55abae4..10575cb906 100644
--- a/client/src/app/+my-library/my-follows/my-subscriptions.component.scss
+++ b/client/src/app/+my-library/my-follows/my-subscriptions.component.scss
@@ -1,6 +1,7 @@
@use '_variables' as *;
@use '_mixins' as *;
@use '_actor' as *;
+@use '_form-mixins' as *;
input[type=text] {
@include peertube-input-text(300px);
diff --git a/client/src/app/+my-library/my-follows/my-subscriptions.component.ts b/client/src/app/+my-library/my-follows/my-subscriptions.component.ts
index 4136c19c48..1b31705184 100644
--- a/client/src/app/+my-library/my-follows/my-subscriptions.component.ts
+++ b/client/src/app/+my-library/my-follows/my-subscriptions.component.ts
@@ -55,12 +55,14 @@ export class MySubscriptionsComponent {
onSearch (search: string) {
this.search = search
+ this.pagination.currentPage = 1
+
this.loadSubscriptions(false)
}
getTotalTitle () {
return formatICU(
- $localize`You have ${this.pagination.totalItems} {total, plural, =1 {subscription} other {subscriptions}}`,
+ $localize`${this.pagination.totalItems} {total, plural, =1 {subscription} other {subscriptions}}`,
{ total: this.pagination.totalItems }
)
}
diff --git a/client/src/app/+my-library/my-history/my-history.component.html b/client/src/app/+my-library/my-history/my-history.component.html
index e41a2ba2ab..440224bccf 100644
--- a/client/src/app/+my-library/my-history/my-history.component.html
+++ b/client/src/app/+my-library/my-history/my-history.component.html
@@ -1,11 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="history" aria-hidden="true"></my-global-icon>
- <h1 i18n>My watch history</h1>
- <span *ngIf="pagination.totalItems" [title]="getTotalTitle()" class="pt-badge badge-secondary">{{ pagination.totalItems }}</span>
- </div>
-</div>
-
<div class="top-buttons">
<div class="search-wrapper">
<my-advanced-input-filter [emitOnInit]="false" (search)="onSearch($event)"></my-advanced-input-filter>
@@ -16,10 +8,7 @@
<label for="track-watch-history" i18n>Track watch history</label>
</div>
- <button class="delete-history" (click)="clearAllHistory()" i18n>
- <my-global-icon iconName="delete" aria-hidden="true"></my-global-icon>
- Clear all history
- </button>
+ <my-button icon="delete" (click)="clearAllHistory()" i18n>Clear all history</my-button>
</div>
<my-videos-selection
diff --git a/client/src/app/+my-library/my-history/my-history.component.scss b/client/src/app/+my-library/my-history/my-history.component.scss
index 4546c6f63a..8bff859db1 100644
--- a/client/src/app/+my-library/my-history/my-history.component.scss
+++ b/client/src/app/+my-library/my-history/my-history.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
.no-history {
display: flex;
@@ -32,17 +33,13 @@
label {
margin: 0 0 0 5px;
- color: var(--greyForegroundColor);
+ color: pvar(--fg-400);
font-weight: $font-semibold;
}
}
.delete-history {
grid-column: 4;
-
- @include peertube-button;
- @include grey-button;
- @include button-with-icon;
}
}
diff --git a/client/src/app/+my-library/my-history/my-history.component.ts b/client/src/app/+my-library/my-history/my-history.component.ts
index 13a45c48a3..b46510de61 100644
--- a/client/src/app/+my-library/my-history/my-history.component.ts
+++ b/client/src/app/+my-library/my-history/my-history.component.ts
@@ -1,24 +1,26 @@
-import { tap } from 'rxjs/operators'
+import { NgIf } from '@angular/common'
import { Component, OnInit, ViewChild } from '@angular/core'
-import { AuthService, ComponentPagination, ConfirmService, DisableForReuseHook, Notifier, User, UserService } from '@app/core'
-import { formatICU, immutableAssign } from '@app/helpers'
-import { DeleteButtonComponent } from '../../shared/shared-main/buttons/delete-button.component'
-import { PeerTubeTemplateDirective } from '../../shared/shared-main/common/peertube-template.directive'
import { FormsModule } from '@angular/forms'
-import { InputSwitchComponent } from '../../shared/shared-forms/input-switch.component'
-import { AdvancedInputFilterComponent } from '../../shared/shared-forms/advanced-input-filter.component'
-import { NgIf } from '@angular/common'
-import { GlobalIconComponent } from '../../shared/shared-icons/global-icon.component'
-import { Video } from '@app/shared/shared-main/video/video.model'
+import { AuthService, ComponentPagination, ConfirmService, DisableForReuseHook, Notifier, User, UserService } from '@app/core'
+import { immutableAssign } from '@app/helpers'
+import { ButtonComponent } from '@app/shared/shared-main/buttons/button.component'
import { UserHistoryService } from '@app/shared/shared-main/users/user-history.service'
+import { Video } from '@app/shared/shared-main/video/video.model'
import { MiniatureDisplayOptions } from '@app/shared/shared-video-miniature/video-miniature.component'
import { VideosSelectionComponent } from '@app/shared/shared-video-miniature/videos-selection.component'
+import { tap } from 'rxjs/operators'
+import { AdvancedInputFilterComponent } from '../../shared/shared-forms/advanced-input-filter.component'
+import { InputSwitchComponent } from '../../shared/shared-forms/input-switch.component'
+import { GlobalIconComponent } from '../../shared/shared-icons/global-icon.component'
+import { DeleteButtonComponent } from '../../shared/shared-main/buttons/delete-button.component'
+import { PeerTubeTemplateDirective } from '../../shared/shared-main/common/peertube-template.directive'
@Component({
templateUrl: './my-history.component.html',
styleUrls: [ './my-history.component.scss' ],
standalone: true,
imports: [
+ ButtonComponent,
GlobalIconComponent,
NgIf,
AdvancedInputFilterComponent,
@@ -162,11 +164,4 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook {
return $localize`You don't have any video in your watch history yet.`
}
-
- getTotalTitle () {
- return formatICU(
- $localize`Your history contains ${this.pagination.totalItems} {total, plural, =1 {video} other {videos}}`,
- { total: this.pagination.totalItems }
- )
- }
}
diff --git a/client/src/app/+my-library/my-library.component.html b/client/src/app/+my-library/my-library.component.html
index a810798763..c7c8ec8e6e 100644
--- a/client/src/app/+my-library/my-library.component.html
+++ b/client/src/app/+my-library/my-library.component.html
@@ -1,9 +1,12 @@
<div class="root">
- <a i18n class="visually-hidden-focusable skip-to-content-sub-menu" href="#my-library-content" (click)="$event.preventDefault(); myLibraryContent.focus()">Skip the sub menu</a>
- <my-top-menu-dropdown [menuEntries]="menuEntries"></my-top-menu-dropdown>
+ <div class="margin-content">
+ <a i18n class="visually-hidden-focusable skip-to-content-sub-menu" href="#my-library-content-content" (click)="$event.preventDefault(); myLibraryContent.focus()">Skip the sub menu</a>
- <div #myLibraryContent tabindex="-1" id="my-library-content" class="margin-content pb-5 outline-0" [ngClass]="{ 'sub-menu-offset-content': !isBroadcastMessageDisplayed }">
+ <my-horizontal-menu i18n-h1 h1="My library" [menuEntries]="menuEntries"></my-horizontal-menu>
+ </div>
+
+ <div #myLibraryContent tabindex="-1" id="my-library-content" class="margin-content pb-5 outline-0">
<router-outlet></router-outlet>
</div>
</div>
diff --git a/client/src/app/+my-library/my-library.component.scss b/client/src/app/+my-library/my-library.component.scss
deleted file mode 100644
index d50db5e28c..0000000000
--- a/client/src/app/+my-library/my-library.component.scss
+++ /dev/null
@@ -1,13 +0,0 @@
-@use '_variables' as *;
-@use '_mixins' as *;
-
-.root {
- flex-direction: column;
- width: 100%;
-
- @include sub-menu-h1;
-
- > my-top-menu-dropdown:nth-child(1) {
- flex-grow: 1;
- }
-}
diff --git a/client/src/app/+my-library/my-library.component.ts b/client/src/app/+my-library/my-library.component.ts
index a11182d945..eef432c8e8 100644
--- a/client/src/app/+my-library/my-library.component.ts
+++ b/client/src/app/+my-library/my-library.component.ts
@@ -1,86 +1,35 @@
-import { NgClass } from '@angular/common'
import { Component, OnInit } from '@angular/core'
import { RouterOutlet } from '@angular/router'
-import { AuthService, AuthUser, ScreenService, ServerService } from '@app/core'
-import { HTMLServerConfig } from '@peertube/peertube-models'
-import { TopMenuDropdownComponent, TopMenuDropdownParam } from '../shared/shared-main/menu/top-menu-dropdown.component'
+import { HorizontalMenuComponent, HorizontalMenuEntry } from '@app/shared/shared-main/menu/horizontal-menu.component'
@Component({
templateUrl: './my-library.component.html',
- styleUrls: [ './my-library.component.scss' ],
standalone: true,
- imports: [ TopMenuDropdownComponent, NgClass, RouterOutlet ]
+ imports: [ RouterOutlet, HorizontalMenuComponent ]
})
export class MyLibraryComponent implements OnInit {
- menuEntries: TopMenuDropdownParam[] = []
- user: AuthUser
-
- private serverConfig: HTMLServerConfig
-
- constructor (
- private serverService: ServerService,
- private authService: AuthService,
- private screenService: ScreenService
- ) { }
-
- get isBroadcastMessageDisplayed () {
- return this.screenService.isBroadcastMessageDisplayed
- }
+ menuEntries: HorizontalMenuEntry[] = []
ngOnInit (): void {
- this.serverConfig = this.serverService.getHTMLConfig()
-
- this.user = this.authService.getUser()
this.buildMenu()
}
- isVideoImportEnabled () {
- const importConfig = this.serverConfig.import.videos
-
- return importConfig.http.enabled || importConfig.torrent.enabled
- }
-
private buildMenu () {
this.menuEntries = [
- {
- label: $localize`Channels`,
- routerLink: '/my-library/video-channels'
- }
- ]
-
- if (this.user.canSeeVideosLink) {
- this.menuEntries.push({
- label: $localize`Videos`,
- routerLink: '/my-library/videos'
- })
- }
-
- this.menuEntries = this.menuEntries.concat([
{
label: $localize`Playlists`,
routerLink: '/my-library/video-playlists'
},
{
- label: $localize`Follows`,
- children: [
- {
- label: $localize`Subscriptions`,
- iconName: 'subscriptions',
- routerLink: '/my-library/subscriptions'
- },
- {
- label: $localize`Followers`,
- iconName: 'follower',
- routerLink: '/my-library/followers'
- }
- ]
+ label: $localize`Subscriptions`,
+ routerLink: '/my-library/subscriptions'
},
{
label: $localize`History`,
routerLink: '/my-library/history/videos'
}
- ])
+ ]
}
}
diff --git a/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.html b/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.html
index abbde552c8..4baa954f58 100644
--- a/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.html
+++ b/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.html
@@ -19,12 +19,12 @@
<div class="modal-footer inputs">
<div class="inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="dismiss()" (key.enter)="dismiss()"
>
<input
- type="submit" i18n-value value="Accept" class="peertube-button orange-button"
+ type="submit" i18n-value value="Accept" class="peertube-button primary-button"
(click)="close()"
>
</div>
diff --git a/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.scss b/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.scss
index 27d5998d35..11e98f44ee 100644
--- a/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.scss
+++ b/client/src/app/+my-library/my-ownership/my-accept-ownership/my-accept-ownership.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
.peertube-select-container {
@include peertube-select-container(350px);
diff --git a/client/src/app/+my-library/my-ownership/my-ownership.component.html b/client/src/app/+my-library/my-ownership/my-ownership.component.html
index e151415a6b..75902c2699 100644
--- a/client/src/app/+my-library/my-ownership/my-ownership.component.html
+++ b/client/src/app/+my-library/my-ownership/my-ownership.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="download" aria-hidden="true"></my-global-icon>
- <h1 i18n>My ownership changes</h1>
- </div>
-</div>
-
<p-table
[value]="videoChangeOwnerships" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage"
[first]="pagination.start" [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
diff --git a/client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.html b/client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.html
index e271fb9278..01bd0a141d 100644
--- a/client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.html
+++ b/client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.html
@@ -1,12 +1,5 @@
<my-alert *ngIf="error" type="danger">{{ error }}</my-alert>
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="refresh" aria-hidden="true"></my-global-icon>
- <ng-container i18n>My synchronizations</ng-container>
- </div>
-</div>
-
<div *ngIf="!syncEnabled()">
<p class="muted" i18n>⚠️ The instance doesn't allow channel synchronization</p>
</div>
@@ -46,8 +39,8 @@
<tr>
<td class="action-cell">
<my-action-dropdown
- container="body"
- [actions]="videoChannelSyncActions" [entry]="videoChannelSync"
+ container="body" [actions]="videoChannelSyncActions" [entry]="videoChannelSync"
+ buttonSize="small"
></my-action-dropdown>
</td>
@@ -81,4 +74,14 @@
<td>{{ videoChannelSync.lastSyncAt | date: 'short' }}</td>
</tr>
</ng-template>
+
+ <ng-template pTemplate="emptymessage">
+ <tr>
+ <td myAutoColspan>
+ <div class="no-results">
+ <ng-container i18n>You don't have channel synchronisation configured.</ng-container>
+ </div>
+ </td>
+ </tr>
+ </ng-template>
</p-table>
diff --git a/client/src/app/+my-library/my-video-channel-syncs/video-channel-sync-edit/video-channel-sync-edit.component.html b/client/src/app/+my-library/my-video-channel-syncs/video-channel-sync-edit/video-channel-sync-edit.component.html
index 77a06f31ad..e9f06ee734 100644
--- a/client/src/app/+my-library/my-video-channel-syncs/video-channel-sync-edit/video-channel-sync-edit.component.html
+++ b/client/src/app/+my-library/my-video-channel-syncs/video-channel-sync-edit/video-channel-sync-edit.component.html
@@ -52,7 +52,7 @@
</div>
</div>
- <input type="submit" class="peertube-button orange-button" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
+ <input type="submit" class="peertube-button primary-button" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
</form>
</div>
</div>
diff --git a/client/src/app/+my-library/my-video-channel-syncs/video-channel-sync-edit/video-channel-sync-edit.component.scss b/client/src/app/+my-library/my-video-channel-syncs/video-channel-sync-edit/video-channel-sync-edit.component.scss
index 9e382abe8e..96abdbb46f 100644
--- a/client/src/app/+my-library/my-video-channel-syncs/video-channel-sync-edit/video-channel-sync-edit.component.scss
+++ b/client/src/app/+my-library/my-video-channel-syncs/video-channel-sync-edit/video-channel-sync-edit.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
$form-base-input-width: 480px;
diff --git a/client/src/app/+my-library/my-video-imports/my-video-imports.component.html b/client/src/app/+my-library/my-video-imports/my-video-imports.component.html
index 2d7e603b70..82fd1529ce 100644
--- a/client/src/app/+my-library/my-video-imports/my-video-imports.component.html
+++ b/client/src/app/+my-library/my-video-imports/my-video-imports.component.html
@@ -1,17 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="cloud-download" aria-hidden="true"></my-global-icon>
- <h1 i18n>My imports</h1>
- </div>
-
- <div>
- <a routerLink="/my-library/video-channel-syncs" class="peertube-button-link peertube-icon-link grey-button">
- <my-global-icon iconName="repeat" aria-hidden="true"></my-global-icon>
- <ng-container i18n>My synchronizations</ng-container>
- </a>
- </div>
-</div>
-
<div class="mb-4 d-flex justify-content-between">
<my-advanced-input-filter (search)="onSearch($event)"></my-advanced-input-filter>
</div>
diff --git a/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.component.html b/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.component.html
index bbd8a1a24a..221a70902d 100644
--- a/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.component.html
+++ b/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.component.html
@@ -72,7 +72,7 @@
<div *ngIf="formErrors['videoChannelId']" class="form-error" role="alert">{{ formErrors['videoChannelId'] }}</div>
</div>
- <input type="submit" class="peertube-button orange-button" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
+ <input type="submit" class="peertube-button primary-button" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
</form>
</div>
</div>
diff --git a/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.component.scss b/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.component.scss
index d31e0b427f..71b6107a27 100644
--- a/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.component.scss
+++ b/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
input[type=text] {
@include peertube-input-text(340px);
diff --git a/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.html b/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.html
index df4687ce97..f4cddcf01f 100644
--- a/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.html
+++ b/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.html
@@ -7,10 +7,8 @@
></my-video-playlist-miniature>
<div class="playlist-buttons">
- <button (click)="showShareModal()" class="action-button share-button">
- <my-global-icon iconName="share" aria-hidden="true"></my-global-icon>
- <span class="icon-text" i18n>Share</span>
- </button>
+
+ <my-button class="me-3" (click)="showShareModal()" i18n icon="share">Share</my-button>
<my-action-dropdown
*ngIf="isRegularPlaylist(playlist)"
diff --git a/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.scss b/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.scss
index 295f2015d7..dbf1b6df73 100644
--- a/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.scss
+++ b/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.scss
@@ -9,7 +9,6 @@
.playlist-info {
grid-column: 1;
- background-color: pvar(--submenuBackgroundColor);
margin-top: -$sub-menu-margin-bottom;
padding: 15px;
@@ -17,25 +16,12 @@
display: flex;
flex-direction: column;
- @include margin-left(calc(#{pvar(--horizontalMarginContent)} * -1));
-
- /* fix ellipsis dots background color */
- ::ng-deep .miniature-name::after {
- background-color: pvar(--submenuBackgroundColor) !important;
- }
+ @include margin-left(calc(#{pvar(--x-margin-content)} * -1));
}
.playlist-buttons {
display: flex;
margin: 30px 0 10px;
-
- .share-button {
- @include peertube-button;
- @include button-with-icon(17px, 3px, -1px);
- @include grey-button;
- @include apply-svg-color(pvar(--actionButtonColor));
- @include margin-right(10px);
- }
}
// Thanks Angular CDK <3 https://material.angular.io/cdk/drag-drop/examples
@@ -84,7 +70,7 @@ my-video-playlist-miniature {
}
.playlist-info {
- width: calc(100% + (2 * var(--horizontalMarginContent)));
+ width: calc(100% + (2 * pvar(--x-margin-content)));
padding-top: 20px;
margin-bottom: 10px;
}
diff --git a/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.ts b/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.ts
index c6f8760a30..e67e4ad700 100644
--- a/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.ts
+++ b/client/src/app/+my-library/my-video-playlists/my-video-playlist-elements.component.ts
@@ -1,19 +1,20 @@
-import { Subject, Subscription } from 'rxjs'
-import { CdkDragDrop, CdkDropList, CdkDrag } from '@angular/cdk/drag-drop'
+import { CdkDrag, CdkDragDrop, CdkDropList } from '@angular/cdk/drag-drop'
+import { NgFor, NgIf } from '@angular/common'
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { ComponentPagination, ConfirmService, HooksService, Notifier, ScreenService } from '@app/core'
+import { ButtonComponent } from '@app/shared/shared-main/buttons/button.component'
+import { VideoShareComponent } from '@app/shared/shared-share-modal/video-share.component'
+import { VideoPlaylistElement } from '@app/shared/shared-video-playlist/video-playlist-element.model'
+import { VideoPlaylist } from '@app/shared/shared-video-playlist/video-playlist.model'
+import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-playlist.service'
import { VideoPlaylistType } from '@peertube/peertube-models'
-import { VideoPlaylistElementMiniatureComponent } from '../../shared/shared-video-playlist/video-playlist-element-miniature.component'
-import { InfiniteScrollerDirective } from '../../shared/shared-main/common/infinite-scroller.directive'
-import { ActionDropdownComponent, DropdownAction } from '../../shared/shared-main/buttons/action-dropdown.component'
+import { Subject, Subscription } from 'rxjs'
import { GlobalIconComponent } from '../../shared/shared-icons/global-icon.component'
+import { ActionDropdownComponent, DropdownAction } from '../../shared/shared-main/buttons/action-dropdown.component'
+import { InfiniteScrollerDirective } from '../../shared/shared-main/common/infinite-scroller.directive'
+import { VideoPlaylistElementMiniatureComponent } from '../../shared/shared-video-playlist/video-playlist-element-miniature.component'
import { VideoPlaylistMiniatureComponent } from '../../shared/shared-video-playlist/video-playlist-miniature.component'
-import { NgIf, NgFor } from '@angular/common'
-import { VideoPlaylist } from '@app/shared/shared-video-playlist/video-playlist.model'
-import { VideoPlaylistElement } from '@app/shared/shared-video-playlist/video-playlist-element.model'
-import { VideoShareComponent } from '@app/shared/shared-share-modal/video-share.component'
-import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-playlist.service'
@Component({
templateUrl: './my-video-playlist-elements.component.html',
@@ -21,6 +22,7 @@ import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-pl
standalone: true,
imports: [
NgIf,
+ ButtonComponent,
VideoPlaylistMiniatureComponent,
GlobalIconComponent,
ActionDropdownComponent,
diff --git a/client/src/app/+my-library/my-video-playlists/my-video-playlists.component.html b/client/src/app/+my-library/my-video-playlists/my-video-playlists.component.html
index fd326e03ce..bb62475012 100644
--- a/client/src/app/+my-library/my-video-playlists/my-video-playlists.component.html
+++ b/client/src/app/+my-library/my-video-playlists/my-video-playlists.component.html
@@ -1,16 +1,10 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="playlists" aria-hidden="true"></my-global-icon>
- <h1 i18n>My playlists</h1>
- <span *ngIf="pagination.totalItems" [title]="getTotalTitle()" class="pt-badge badge-secondary">{{ pagination.totalItems }}</span>
- </div>
-</div>
-
<my-channels-setup-message></my-channels-setup-message>
-<div class="video-playlists-header d-flex justify-content-between gap-2">
+<div class="video-playlists-header d-flex justify-content-between align-items-end gap-2 flex-wrap">
<my-advanced-input-filter (search)="onSearch($event)"></my-advanced-input-filter>
+ <span class="total-items" *ngIf="pagination.totalItems"> {{ getTotalTitle() }}</span>
+
<a class="peertube-create-button" routerLink="create">
<my-global-icon iconName="add" aria-hidden="true"></my-global-icon>
<ng-container i18n>Create playlist</ng-container>
diff --git a/client/src/app/+my-library/my-video-playlists/my-video-playlists.component.scss b/client/src/app/+my-library/my-video-playlists/my-video-playlists.component.scss
index b8cd353594..bcfa0ea228 100644
--- a/client/src/app/+my-library/my-video-playlists/my-video-playlists.component.scss
+++ b/client/src/app/+my-library/my-video-playlists/my-video-playlists.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
input[type=text] {
@include peertube-input-text(300px);
@@ -46,15 +47,6 @@ my-delete-button {
}
@include on-mobile-main-col {
- .video-playlists-header {
- flex-direction: column;
-
- input[type=text] {
- width: 100% !important;
- margin-bottom: 12px;
- }
- }
-
.action-button {
@include margin-left(0);
}
diff --git a/client/src/app/+my-library/my-video-playlists/my-video-playlists.component.ts b/client/src/app/+my-library/my-video-playlists/my-video-playlists.component.ts
index 57e04d2738..1870b81be4 100644
--- a/client/src/app/+my-library/my-video-playlists/my-video-playlists.component.ts
+++ b/client/src/app/+my-library/my-video-playlists/my-video-playlists.component.ts
@@ -87,12 +87,14 @@ export class MyVideoPlaylistsComponent {
onSearch (search: string) {
this.search = search
+ this.pagination.currentPage = 1
+
this.loadVideoPlaylists(true)
}
getTotalTitle () {
return formatICU(
- $localize`You have ${this.pagination.totalItems} {total, plural, =1 {playlist} other {playlists}}`,
+ $localize`${this.pagination.totalItems} {total, plural, =1 {playlist} other {playlists}}`,
{ total: this.pagination.totalItems }
)
}
diff --git a/client/src/app/+my-library/my-video-space.component.html b/client/src/app/+my-library/my-video-space.component.html
new file mode 100644
index 0000000000..edd7a6cc0d
--- /dev/null
+++ b/client/src/app/+my-library/my-video-space.component.html
@@ -0,0 +1,12 @@
+<div class="root">
+
+ <div class="margin-content">
+ <a i18n class="visually-hidden-focusable skip-to-content-sub-menu" href="#my-video-space-content" (click)="$event.preventDefault(); myVideoSpaceContent.focus()">Skip the sub menu</a>
+
+ <my-horizontal-menu i18n-h1 h1="My video space" [menuEntries]="menuEntries"></my-horizontal-menu>
+ </div>
+
+ <div #myVideoSpaceContent tabindex="-1" id="my-video-space-content" class="margin-content pb-5 outline-0">
+ <router-outlet></router-outlet>
+ </div>
+</div>
diff --git a/client/src/app/+my-library/my-video-space.component.ts b/client/src/app/+my-library/my-video-space.component.ts
new file mode 100644
index 0000000000..478543d470
--- /dev/null
+++ b/client/src/app/+my-library/my-video-space.component.ts
@@ -0,0 +1,90 @@
+import { Component, OnInit } from '@angular/core'
+import { RouterOutlet } from '@angular/router'
+import { ServerService } from '@app/core'
+import { HorizontalMenuComponent, HorizontalMenuEntry } from '@app/shared/shared-main/menu/horizontal-menu.component'
+import { HTMLServerConfig } from '@peertube/peertube-models'
+
+@Component({
+ templateUrl: './my-video-space.component.html',
+ standalone: true,
+ imports: [ RouterOutlet, HorizontalMenuComponent ]
+})
+export class MyVideoSpaceComponent implements OnInit {
+ menuEntries: HorizontalMenuEntry[] = []
+
+ private serverConfig: HTMLServerConfig
+
+ constructor (
+ private serverService: ServerService
+ ) { }
+
+ ngOnInit (): void {
+ this.serverConfig = this.serverService.getHTMLConfig()
+
+ this.buildMenu()
+ }
+
+ isVideoImportEnabled () {
+ const importConfig = this.serverConfig.import.videos
+
+ return importConfig.http.enabled || importConfig.torrent.enabled
+ }
+
+ private buildMenu () {
+ this.menuEntries = [
+ {
+ label: $localize`Channels`,
+ routerLink: '/my-library/video-channels',
+ children: [
+ {
+ label: $localize`Manage`,
+ routerLink:'/my-library/video-channels'
+ },
+ {
+ label: $localize`Followers`,
+ routerLink: '/my-library/followers'
+ },
+ {
+ label: $localize`Synchronizations`,
+ routerLink: '/my-library/video-channel-syncs'
+ }
+ ]
+ },
+
+ {
+ label: $localize`Videos`,
+ routerLink: '/my-library/videos',
+ children: [
+ {
+ label: $localize`Manage`,
+ routerLink: '/my-library/videos'
+ },
+
+ {
+ label: $localize`Imports`,
+ routerLink: '/my-library/video-imports',
+ isDisplayed: () => this.isVideoImportEnabled()
+ },
+
+ {
+ label: $localize`Ownership changes`,
+ routerLink: '/my-library/ownership'
+ },
+
+ {
+ label: $localize`Comments`,
+ routerLink: '/my-library/comments-on-my-videos'
+ },
+ {
+ label: $localize`Watched words`,
+ routerLink: '/my-library/watched-words/list'
+ },
+ {
+ label: $localize`Auto tag policies`,
+ routerLink: '/my-library/auto-tag-policies'
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/client/src/app/+my-library/my-videos/modals/video-change-ownership.component.html b/client/src/app/+my-library/my-videos/modals/video-change-ownership.component.html
index 0c800f2d1b..32d81f67f7 100644
--- a/client/src/app/+my-library/my-videos/modals/video-change-ownership.component.html
+++ b/client/src/app/+my-library/my-videos/modals/video-change-ownership.component.html
@@ -25,12 +25,12 @@
<div class="modal-footer">
<div class="inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="dismiss()" (key.enter)="dismiss()"
>
<input
- type="submit" i18n-value value="Submit" class="peertube-button orange-button"
+ type="submit" i18n-value value="Submit" class="peertube-button primary-button"
[disabled]="!form.valid" (click)="close()"
/>
</div>
diff --git a/client/src/app/+my-library/my-videos/my-videos.component.html b/client/src/app/+my-library/my-videos/my-videos.component.html
index a39f88e1c8..dc114950a2 100644
--- a/client/src/app/+my-library/my-videos/my-videos.component.html
+++ b/client/src/app/+my-library/my-videos/my-videos.component.html
@@ -1,27 +1,9 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="videos" aria-hidden="true"></my-global-icon>
- <h1 i18n>My videos</h1>
- <span *ngIf="pagination.totalItems" [title]="getTotalTitle()" class="pt-badge badge-secondary"> {{ pagination.totalItems }}</span>
- </div>
-
- <div>
- <a routerLink="/my-library/video-imports" class="peertube-button-link grey-button peertube-button-icon me-2">
- <my-global-icon iconName="cloud-download" aria-hidden="true"></my-global-icon>
- <ng-container i18n>My imports</ng-container>
- </a>
-
- <a routerLink="/my-library/ownership" class="peertube-button-link grey-button peertube-button-icon">
- <my-global-icon iconName="users" aria-hidden="true"></my-global-icon>
- <ng-container i18n>Ownership changes</ng-container>
- </a>
- </div>
-</div>
-
-<div class="videos-header d-flex justify-content-between gap-2">
+<div class="videos-header d-flex justify-content-between align-items-end gap-2 flex-wrap">
<my-advanced-input-filter [emitOnInit]="false" [filters]="inputFilters" (search)="onSearch($event)"></my-advanced-input-filter>
- <div class="peertube-select-container peertube-select-button">
+ <span class="total-items" *ngIf="pagination.totalItems"> {{ getTotalTitle() }}</span>
+
+ <div class="peertube-select-container">
<select [(ngModel)]="sort" (ngModelChange)="onChangeSortColumn()" class="form-control" i18n-ariaLabel aria-label="Sort by">
<option value="-publishedAt" i18n>Last published first</option>
<option value="-createdAt" i18n>Last created first</option>
@@ -45,10 +27,7 @@
#videosSelection
>
<ng-template ptTemplate="globalButtons">
- <button class="action-button action-button-delete-selection" (click)="deleteSelectedVideos()">
- <my-global-icon iconName="delete" aria-hidden="true"></my-global-icon>
- <ng-container i18n>Delete</ng-container>
- </button>
+ <my-delete-button class="delete-selection" (click)="deleteSelectedVideos()"></my-delete-button>
</ng-template>
<ng-template ptTemplate="rowButtons" let-video>
diff --git a/client/src/app/+my-library/my-videos/my-videos.component.scss b/client/src/app/+my-library/my-videos/my-videos.component.scss
index 9a2af6ac9d..d7ea666e71 100644
--- a/client/src/app/+my-library/my-videos/my-videos.component.scss
+++ b/client/src/app/+my-library/my-videos/my-videos.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
input[type=text] {
@include peertube-input-text(300px);
@@ -7,19 +8,6 @@ input[type=text] {
.peertube-select-container {
@include peertube-select-container(auto);
- @include margin-left(0.5rem);
-}
-
-.action-button-delete-selection {
- display: inline-block;
-
- @include peertube-button;
- @include orange-button;
- @include button-with-icon(21px);
-
- my-global-icon {
- @include apply-svg-color(#fff);
- }
}
.action-button {
@@ -34,15 +22,6 @@ my-edit-button {
}
@include on-small-main-col {
- h1 {
- flex-direction: column;
-
- > span,
- .button-link {
- margin-bottom: 10px;
- }
- }
-
.action-button {
margin-top: 10px;
@@ -51,18 +30,6 @@ my-edit-button {
}
@include on-mobile-main-col {
- .videos-header {
- flex-direction: column;
-
- input[type=text] {
- width: 100%;
- margin-bottom: 12px;
- }
- .peertube-select-container {
- @include margin-left(0);
- }
- }
-
.action-button {
@include margin-left(0);
}
diff --git a/client/src/app/+my-library/my-videos/my-videos.component.ts b/client/src/app/+my-library/my-videos/my-videos.component.ts
index 4b28da7cf8..6337d4d673 100644
--- a/client/src/app/+my-library/my-videos/my-videos.component.ts
+++ b/client/src/app/+my-library/my-videos/my-videos.component.ts
@@ -6,6 +6,7 @@ import { AuthService, ComponentPagination, ConfirmService, Notifier, ScreenServi
import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook'
import { formatICU, immutableAssign } from '@app/helpers'
import { DropdownAction } from '@app/shared/shared-main/buttons/action-dropdown.component'
+import { DeleteButtonComponent } from '@app/shared/shared-main/buttons/delete-button.component'
import { Video } from '@app/shared/shared-main/video/video.model'
import { VideoService } from '@app/shared/shared-main/video/video.service'
import { LiveStreamInformationComponent } from '@app/shared/shared-video-live/live-stream-information.component'
@@ -18,8 +19,8 @@ import { concat, Observable } from 'rxjs'
import { tap, toArray } from 'rxjs/operators'
import { AdvancedInputFilter, AdvancedInputFilterComponent } from '../../shared/shared-forms/advanced-input-filter.component'
import { GlobalIconComponent } from '../../shared/shared-icons/global-icon.component'
-import { PeerTubeTemplateDirective } from '../../shared/shared-main/common/peertube-template.directive'
import { EditButtonComponent } from '../../shared/shared-main/buttons/edit-button.component'
+import { PeerTubeTemplateDirective } from '../../shared/shared-main/common/peertube-template.directive'
import {
VideoActionsDisplayType,
VideoActionsDropdownComponent
@@ -32,6 +33,7 @@ import { VideoChangeOwnershipComponent } from './modals/video-change-ownership.c
standalone: true,
imports: [
GlobalIconComponent,
+ DeleteButtonComponent,
NgIf,
RouterLink,
AdvancedInputFilterComponent,
@@ -64,7 +66,8 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook {
privacyText: true,
state: true,
blacklistInfo: true,
- forceChannelInBy: true
+ forceChannelInBy: true,
+ nsfw: true
}
videoDropdownDisplayOptions: VideoActionsDisplayType = {
playlist: true,
@@ -246,7 +249,7 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook {
getTotalTitle () {
return formatICU(
- $localize`You have ${this.pagination.totalItems} {total, plural, =1 {video} other {videos}}`,
+ $localize`${this.pagination.totalItems} {total, plural, =1 {video} other {videos}}`,
{ total: this.pagination.totalItems }
)
}
diff --git a/client/src/app/+my-account/my-account-watched-words-list/my-account-watched-words-list.component.html b/client/src/app/+my-library/my-watched-words-list/my-watched-words-list.component.html
similarity index 66%
rename from client/src/app/+my-account/my-account-watched-words-list/my-account-watched-words-list.component.html
rename to client/src/app/+my-library/my-watched-words-list/my-watched-words-list.component.html
index 0f01ea5659..46bc8b53b1 100644
--- a/client/src/app/+my-account/my-account-watched-words-list/my-account-watched-words-list.component.html
+++ b/client/src/app/+my-library/my-watched-words-list/my-watched-words-list.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="no" aria-hidden="true"></my-global-icon>
- <h1 i18n>Your watched words lists</h1>
- </div>
-</div>
-
<em class="d-block" i18n>Comments that contain any of the watched words are automatically tagged with the name of the list.</em>
<em class="d-block mb-3" i18n>These automatic tags can be used to filter comments or <a routerLink="/my-account/auto-tag-policies">automatically block</a> them.</em>
diff --git a/client/src/app/+my-account/my-account-watched-words-list/my-account-watched-words-list.component.ts b/client/src/app/+my-library/my-watched-words-list/my-watched-words-list.component.ts
similarity index 72%
rename from client/src/app/+my-account/my-account-watched-words-list/my-account-watched-words-list.component.ts
rename to client/src/app/+my-library/my-watched-words-list/my-watched-words-list.component.ts
index 3f4de4f0b1..4d46f21ade 100644
--- a/client/src/app/+my-account/my-account-watched-words-list/my-account-watched-words-list.component.ts
+++ b/client/src/app/+my-library/my-watched-words-list/my-watched-words-list.component.ts
@@ -1,19 +1,17 @@
-import { NgIf } from '@angular/common'
import { Component } from '@angular/core'
import { RouterLink } from '@angular/router'
import { GlobalIconComponent } from '@app/shared/shared-icons/global-icon.component'
import { WatchedWordsListAdminOwnerComponent } from '@app/shared/standalone-watched-words/watched-words-list-admin-owner.component'
@Component({
- templateUrl: './my-account-watched-words-list.component.html',
+ templateUrl: './my-watched-words-list.component.html',
standalone: true,
imports: [
GlobalIconComponent,
WatchedWordsListAdminOwnerComponent,
- NgIf,
RouterLink
]
})
-export class MyAccountWatchedWordsListComponent {
+export class MyWatchedWordsListComponent {
}
diff --git a/client/src/app/+my-library/routes.ts b/client/src/app/+my-library/routes.ts
index 7d1d875632..5c8d3781a7 100644
--- a/client/src/app/+my-library/routes.ts
+++ b/client/src/app/+my-library/routes.ts
@@ -1,5 +1,17 @@
-import { Routes } from '@angular/router'
+import { Route, Routes, UrlSegment } from '@angular/router'
+import { userResolver } from '@app/core/routing/user.resolver'
+import { AbuseService } from '@app/shared/shared-moderation/abuse.service'
+import { BlocklistService } from '@app/shared/shared-moderation/blocklist.service'
+import { VideoBlockService } from '@app/shared/shared-moderation/video-block.service'
+import { UserSubscriptionService } from '@app/shared/shared-user-subscription/user-subscription.service'
+import { VideoCommentService } from '@app/shared/shared-video-comment/video-comment.service'
+import { LiveVideoService } from '@app/shared/shared-video-live/live-video.service'
+import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-playlist.service'
+import { WatchedWordsListService } from '@app/shared/standalone-watched-words/watched-words-list.service'
import { LoginGuard } from '../core'
+import { CommentsOnMyVideosComponent } from './comments-on-my-videos/comments-on-my-videos.component'
+import { AutomaticTagService } from './my-auto-tag-policies/automatic-tag.service'
+import { MyAutoTagPoliciesComponent } from './my-auto-tag-policies/my-auto-tag-policies.component'
import { MyFollowersComponent } from './my-follows/my-followers.component'
import { MySubscriptionsComponent } from './my-follows/my-subscriptions.component'
import { MyHistoryComponent } from './my-history/my-history.component'
@@ -12,163 +24,252 @@ import { MyVideoPlaylistCreateComponent } from './my-video-playlists/my-video-pl
import { MyVideoPlaylistElementsComponent } from './my-video-playlists/my-video-playlist-elements.component'
import { MyVideoPlaylistUpdateComponent } from './my-video-playlists/my-video-playlist-update.component'
import { MyVideoPlaylistsComponent } from './my-video-playlists/my-video-playlists.component'
+import { MyVideoSpaceComponent } from './my-video-space.component'
import { MyVideosComponent } from './my-videos/my-videos.component'
-import { BlocklistService } from '@app/shared/shared-moderation/blocklist.service'
-import { VideoBlockService } from '@app/shared/shared-moderation/video-block.service'
-import { UserSubscriptionService } from '@app/shared/shared-user-subscription/user-subscription.service'
-import { LiveVideoService } from '@app/shared/shared-video-live/live-video.service'
-import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-playlist.service'
-import { AbuseService } from '@app/shared/shared-moderation/abuse.service'
-import { userResolver } from '@app/core/routing/user.resolver'
+import { MyWatchedWordsListComponent } from './my-watched-words-list/my-watched-words-list.component'
+import { BulkService } from '@app/shared/shared-moderation/bulk.service'
+
+const commonConfig = {
+ path: '',
+ providers: [
+ VideoPlaylistService,
+ BlocklistService,
+ VideoBlockService,
+ AbuseService,
+ LiveVideoService,
+ UserSubscriptionService,
+ AutomaticTagService,
+ WatchedWordsListService,
+ BulkService,
+ VideoCommentService
+ ],
+ resolve: {
+ user: userResolver
+ },
+ canActivateChild: [ LoginGuard ]
+}
+
+const videoSpaceRoutes = [
+ // ---------------------------------------------------------------------------
+ // Channels
+ // ---------------------------------------------------------------------------
-export default [
{
path: '',
- component: MyLibraryComponent,
- providers: [
- VideoPlaylistService,
- BlocklistService,
- VideoBlockService,
- AbuseService,
- LiveVideoService,
- UserSubscriptionService
- ],
- resolve: {
- user: userResolver
- },
- canActivateChild: [ LoginGuard ],
- children: [
- {
- path: '',
- redirectTo: 'video-channels',
- pathMatch: 'full'
- },
+ redirectTo: 'video-channels',
+ pathMatch: 'full'
+ },
- {
- path: 'video-channels',
- loadChildren: () => import('./+my-video-channels/routes')
- },
+ {
+ path: 'video-channels',
+ loadChildren: () => import('./+my-video-channels/routes')
+ },
- {
- path: 'video-playlists',
- component: MyVideoPlaylistsComponent,
- data: {
- meta: {
- title: $localize`My playlists`
- }
- }
- },
- {
- path: 'video-playlists/create',
- component: MyVideoPlaylistCreateComponent,
- data: {
- meta: {
- title: $localize`Create a new playlist`
- }
- }
- },
- {
- path: 'video-playlists/:videoPlaylistId',
- component: MyVideoPlaylistElementsComponent,
- data: {
- meta: {
- title: $localize`Playlist elements`
- }
- }
- },
- {
- path: 'video-playlists/update/:videoPlaylistId',
- component: MyVideoPlaylistUpdateComponent,
- data: {
- meta: {
- title: $localize`Update playlist`
- }
- }
- },
+ {
+ path: 'followers',
+ component: MyFollowersComponent,
+ data: {
+ meta: {
+ title: $localize`My followers`
+ }
+ }
+ },
- {
- path: 'videos',
- component: MyVideosComponent,
- data: {
- meta: {
- title: $localize`My videos`
- },
- reuse: {
- enabled: true,
- key: 'my-videos-list'
- }
- }
- },
- {
- path: 'video-imports',
- component: MyVideoImportsComponent,
- data: {
- meta: {
- title: $localize`My video imports`
- }
- }
- },
- {
- path: 'subscriptions',
- component: MySubscriptionsComponent,
- data: {
- meta: {
- title: $localize`My subscriptions`
- }
- }
- },
- {
- path: 'followers',
- component: MyFollowersComponent,
- data: {
- meta: {
- title: $localize`My followers`
- }
- }
- },
- {
- path: 'ownership',
- component: MyOwnershipComponent,
- data: {
- meta: {
- title: $localize`Ownership changes`
- }
- }
- },
+ {
+ path: 'video-channel-syncs',
+ component: MyVideoChannelSyncsComponent,
+ data: {
+ meta: {
+ title: $localize`My synchronizations`
+ }
+ }
+ },
+
+ {
+ path: 'video-channel-syncs/create',
+ component: VideoChannelSyncEditComponent,
+ data: {
+ meta: {
+ title: $localize`Create new synchronization`
+ }
+ }
+ },
+
+ // ---------------------------------------------------------------------------
+ // Videos
+ // ---------------------------------------------------------------------------
- {
- path: 'history/videos',
- component: MyHistoryComponent,
- data: {
- meta: {
- title: $localize`My video history`
- },
- reuse: {
- enabled: true,
- key: 'my-videos-history-list'
- }
- }
+ {
+ path: 'videos/comments',
+ redirectTo: 'comments-on-my-videos',
+ pathMatch: 'full'
+ },
+
+ {
+ path: 'comments-on-my-videos',
+ component: CommentsOnMyVideosComponent,
+ data: {
+ meta: {
+ title: $localize`Comments on your videos`
+ }
+ }
+ },
+
+ {
+ path: 'watched-words/list',
+ component: MyWatchedWordsListComponent,
+ data: {
+ meta: {
+ title: $localize`Your watched words`
+ }
+ }
+ },
+
+ {
+ path: 'auto-tag-policies',
+ component: MyAutoTagPoliciesComponent,
+ data: {
+ meta: {
+ title: $localize`Your automatic tag policies`
+ }
+ }
+ },
+
+ {
+ path: 'videos',
+ component: MyVideosComponent,
+ data: {
+ meta: {
+ title: $localize`My videos`
},
+ reuse: {
+ enabled: true,
+ key: 'my-videos-list'
+ }
+ }
+ },
+ {
+ path: 'video-imports',
+ component: MyVideoImportsComponent,
+ data: {
+ meta: {
+ title: $localize`My video imports`
+ }
+ }
+ },
+ {
+ path: 'ownership',
+ component: MyOwnershipComponent,
+ data: {
+ meta: {
+ title: $localize`Ownership changes`
+ }
+ }
+ }
+] satisfies Routes
+
+const libraryRoutes = [
+
+ // ---------------------------------------------------------------------------
+ // Playlists
+ // ---------------------------------------------------------------------------
+
+ {
+ path: 'video-playlists',
+ component: MyVideoPlaylistsComponent,
+ data: {
+ meta: {
+ title: $localize`My playlists`
+ }
+ }
+ },
+ {
+ path: 'video-playlists/create',
+ component: MyVideoPlaylistCreateComponent,
+ data: {
+ meta: {
+ title: $localize`Create a new playlist`
+ }
+ }
+ },
+ {
+ path: 'video-playlists/:videoPlaylistId',
+ component: MyVideoPlaylistElementsComponent,
+ data: {
+ meta: {
+ title: $localize`Playlist elements`
+ }
+ }
+ },
+ {
+ path: 'video-playlists/update/:videoPlaylistId',
+ component: MyVideoPlaylistUpdateComponent,
+ data: {
+ meta: {
+ title: $localize`Update playlist`
+ }
+ }
+ },
+
+ // ---------------------------------------------------------------------------
+ // My subscriptions/history
+ // ---------------------------------------------------------------------------
+
+ {
+ path: 'subscriptions',
+ component: MySubscriptionsComponent,
+ data: {
+ meta: {
+ title: $localize`My subscriptions`
+ }
+ }
+ },
- {
- path: 'video-channel-syncs',
- component: MyVideoChannelSyncsComponent,
- data: {
- meta: {
- title: $localize`My synchronizations`
- }
- }
+ {
+ path: 'history/videos',
+ component: MyHistoryComponent,
+ data: {
+ meta: {
+ title: $localize`My video history`
},
+ reuse: {
+ enabled: true,
+ key: 'my-videos-history-list'
+ }
+ }
+ }
+]
+
+function isVideoSpaceRoute (segments: UrlSegment[]) {
+ if (segments.length === 0) return false
+
+ const rootPath = segments[0].path
- {
- path: 'video-channel-syncs/create',
- component: VideoChannelSyncEditComponent,
- data: {
- meta: {
- title: $localize`Create new synchronization`
- }
- }
+ return videoSpaceRoutes.some(r => r.path === rootPath || r.path.startsWith(`${rootPath}/`))
+}
+
+export default [
+ {
+ ...commonConfig,
+
+ component: MyVideoSpaceComponent,
+ canMatch: [
+ (_route: Route, segments: UrlSegment[]) => {
+ return isVideoSpaceRoute(segments)
}
- ]
+ ],
+
+ children: videoSpaceRoutes
+ },
+ {
+ ...commonConfig,
+
+ component: MyLibraryComponent,
+ canMatch: [
+ (_route: Route, segments: UrlSegment[]) => {
+ return !isVideoSpaceRoute(segments)
+ }
+ ],
+ children: libraryRoutes
}
] satisfies Routes
diff --git a/client/src/app/+reset-password/reset-password.component.html b/client/src/app/+reset-password/reset-password.component.html
index 04c9909293..8144f997b3 100644
--- a/client/src/app/+reset-password/reset-password.component.html
+++ b/client/src/app/+reset-password/reset-password.component.html
@@ -21,7 +21,7 @@
</div>
<input
- class="peertube-button orange-button" type="submit" i18n-value value="Reset my password"
+ class="peertube-button primary-button" type="submit" i18n-value value="Reset my password"
[disabled]="!form.valid || !isConfirmedPasswordValid()"
>
</form>
diff --git a/client/src/app/+search/search-filters.component.html b/client/src/app/+search/search-filters.component.html
index 5fc25e267c..f54c845f46 100644
--- a/client/src/app/+search/search-filters.component.html
+++ b/client/src/app/+search/search-filters.component.html
@@ -230,6 +230,9 @@
Reset
</button>
- <input type="submit" i18n-value value="Filter" i18n-ariaLabel aria-label="Filter the results and automatically close the filters panel">
+ <input
+ class="peertube-button primary-button" type="submit" i18n-value value="Filter"
+ i18n-ariaLabel aria-label="Filter the results and automatically close the filters panel"
+ >
</div>
</form>
diff --git a/client/src/app/+search/search-filters.component.scss b/client/src/app/+search/search-filters.component.scss
index 0b589a7f36..fd66898e63 100644
--- a/client/src/app/+search/search-filters.component.scss
+++ b/client/src/app/+search/search-filters.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
form {
margin-top: 40px;
@@ -25,11 +26,6 @@ input[type=text] {
@include peertube-input-text(100%);
}
-input[type=submit] {
- @include peertube-button-link;
- @include orange-button;
-}
-
.submit-button {
text-align: end;
}
diff --git a/client/src/app/+search/search.component.html b/client/src/app/+search/search.component.html
index 7c05fd1853..e0623bf9cf 100644
--- a/client/src/app/+search/search.component.html
+++ b/client/src/app/+search/search.component.html
@@ -11,10 +11,10 @@
</div>
<button
- class="results-filter-button button-unstyle ms-auto" (click)="isSearchFilterCollapsed = !isSearchFilterCollapsed"
+ class="filter-button peertube-button tertiary-button ms-auto" (click)="isSearchFilterCollapsed = !isSearchFilterCollapsed"
[attr.aria-expanded]="!isSearchFilterCollapsed" aria-controls="search-results-filter" [title]="getFilterButtonTitle()"
>
- <span class="icon icon-filter"></span>
+ <my-global-icon iconName="filter"></my-global-icon>
<ng-container i18n>
Filters
diff --git a/client/src/app/+search/search.component.scss b/client/src/app/+search/search.component.scss
index 3a097cbb5e..47b7b43e93 100644
--- a/client/src/app/+search/search.component.scss
+++ b/client/src/app/+search/search.component.scss
@@ -38,22 +38,14 @@
font-weight: $font-semibold;
}
}
-
- .results-filter-button {
- cursor: pointer;
-
- .icon.icon-filter {
- position: relative;
- top: -1px;
- background-image: url('../../assets/images/feather/filter.svg');
-
- @include icon(20px);
- @include margin-right(5px);
- }
- }
}
}
+.filter-button my-global-icon {
+ @include global-icon-size(20px);
+ @include margin-right(0.5rem);
+}
+
.entry {
display: flex;
margin-bottom: 40px;
@@ -74,7 +66,7 @@
.video-channel-names {
display: flex;
align-items: baseline;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
width: fit-content;
flex-wrap: wrap;
@@ -83,12 +75,10 @@
.video-channel-display-name {
font-weight: $font-semibold;
- font-size: $video-miniature-row-name-font-size;
}
.video-channel-name {
- font-size: $video-miniature-row-info-font-size;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
}
// Use the same breakpoints as in video-miniature
@@ -134,10 +124,10 @@
}
.video-channel-display-name {
- font-size: $video-miniature-row-mobile-name-font-size;
+ font-size: $miniature-fs-mobile-big;
}
.video-channel-name {
- font-size: $video-miniature-row-mobile-info-font-size;
+ font-size: $miniature-fs-mobile-medium;
}
}
diff --git a/client/src/app/+search/search.component.ts b/client/src/app/+search/search.component.ts
index ad1ef1f386..fa9dc81949 100644
--- a/client/src/app/+search/search.component.ts
+++ b/client/src/app/+search/search.component.ts
@@ -21,6 +21,7 @@ import { SubscribeButtonComponent } from '../shared/shared-user-subscription/sub
import { MiniatureDisplayOptions, VideoMiniatureComponent } from '../shared/shared-video-miniature/video-miniature.component'
import { VideoPlaylistMiniatureComponent } from '../shared/shared-video-playlist/video-playlist-miniature.component'
import { SearchFiltersComponent } from './search-filters.component'
+import { GlobalIconComponent } from '@app/shared/shared-icons/global-icon.component'
@Component({
selector: 'my-search',
@@ -40,7 +41,8 @@ import { SearchFiltersComponent } from './search-filters.component'
VideoMiniatureComponent,
VideoPlaylistMiniatureComponent,
NumberFormatterPipe,
- AlertComponent
+ AlertComponent,
+ GlobalIconComponent
]
})
export class SearchComponent implements OnInit, OnDestroy {
@@ -60,7 +62,7 @@ export class SearchComponent implements OnInit, OnDestroy {
date: true,
views: true,
by: true,
- avatar: false,
+ avatar: true,
privacyLabel: false,
privacyText: false,
state: false,
diff --git a/client/src/app/+signup/+register/custom-stepper.component.scss b/client/src/app/+signup/+register/custom-stepper.component.scss
index 9781575f5a..b545ec9828 100644
--- a/client/src/app/+signup/+register/custom-stepper.component.scss
+++ b/client/src/app/+signup/+register/custom-stepper.component.scss
@@ -5,10 +5,12 @@
$index-block-height: 40px;
header {
- margin-bottom: 30px;
- padding-bottom: 25px;
width: 100%;
- background-color: pvar(--mainColorVeryLight);
+ background-color: pvar(--primary-150);
+ border-radius: 5px;
+
+ @include rfs(2rem, margin-bottom);
+ @include rfs(2rem, padding);
}
.header-steps {
@@ -28,7 +30,7 @@ header {
width: $index-block-height;
height: $index-block-height;
border-radius: $index-block-height;
- border: 1px solid pvar(--mainColor);
+ border: 1px solid pvar(--primary);
margin-bottom: 10px;
font-size: 24px;
position: relative;
@@ -39,7 +41,7 @@ header {
width: $size;
height: $size;
border-radius: $size;
- background-color: pvar(--mainBackgroundColor);
+ background-color: pvar(--bg);
position: absolute;
bottom: 0;
right: 0;
@@ -47,7 +49,7 @@ header {
justify-content: center;
align-items: center;
// Better than border color for aliasing
- box-shadow: 0 0 0 1px var(--mainColor);
+ box-shadow: 0 0 0 1px pvar(--primary);
overflow: hidden;
my-global-icon {
@@ -55,7 +57,7 @@ header {
width: 12px;
height: 12px;
- @include apply-svg-color(pvar(--mainColor));
+ @include apply-svg-color(pvar(--primary));
}
}
}
@@ -66,7 +68,6 @@ header {
}
.step-info {
- color: pvar(--mainColor);
display: flex;
flex-direction: column;
align-items: center;
@@ -76,12 +77,12 @@ header {
&.active,
&.completed {
.step-index {
- background-color: pvar(--mainColor);
- color: pvar(--mainBackgroundColor);
+ background-color: pvar(--primary);
+ color: pvar(--on-primary);
}
.step-label {
- color: pvar(--mainColor);
+ color: pvar(--fg);
}
}
@@ -94,7 +95,7 @@ header {
flex: auto;
margin: math.div($index-block-height, 2) 10px 0 10px;
height: 2px;
- background-color: pvar(--mainColor);
+ background-color: pvar(--primary);
opacity: 0.3;
}
diff --git a/client/src/app/+signup/+register/register.component.html b/client/src/app/+signup/+register/register.component.html
index 987708c986..468ea25eb9 100644
--- a/client/src/app/+signup/+register/register.component.html
+++ b/client/src/app/+signup/+register/register.component.html
@@ -1,16 +1,10 @@
-<div>
+<div class="margin-content">
- <div class="margin-content signup-disabled" *ngIf="signupDisabled">
+ <div class="signup-disabled" *ngIf="signupDisabled">
<my-alert type="warning" i18n>Signup is not enabled on this instance.</my-alert>
</div>
<ng-container *ngIf="!signupDisabled">
- <h1 class="title-page-v2">
- <strong class="underline-orange">{{ instanceName }}</strong>
- >
- <my-signup-label [requiresApproval]="requiresApproval"></my-signup-label>
- </h1>
-
<div class="register-content">
<my-custom-stepper linear>
@@ -26,11 +20,11 @@
<my-register-step-about [serverStats]="serverStats" [requiresApproval]="requiresApproval" [videoUploadDisabled]="videoUploadDisabled"></my-register-step-about>
<div class="step-buttons">
- <a i18n class="skip-step underline-orange" routerLink="/login">
+ <a i18n class="skip-step link-primary fw-normal" routerLink="/login">
<strong>I already have an account</strong>, I log in
</a>
- <button cdkStepperNext>
+ <button class="peertube-button-big primary-button" cdkStepperNext>
<my-signup-label [requiresApproval]="requiresApproval"></my-signup-label>
</button>
</div>
@@ -56,8 +50,8 @@
></my-register-step-terms>
<div class="step-buttons">
- <button cdkStepperPrevious>{{ defaultPreviousStepButtonLabel }}</button>
- <button cdkStepperNext [disabled]="!formStepTerms || !formStepTerms.valid">{{ defaultNextStepButtonLabel }}</button>
+ <button class="peertube-button-big secondary-button" cdkStepperPrevious>{{ defaultPreviousStepButtonLabel }}</button>
+ <button class="peertube-button-big primary-button" cdkStepperNext [disabled]="!formStepTerms || !formStepTerms.valid">{{ defaultNextStepButtonLabel }}</button>
</div>
</cdk-step>
@@ -73,8 +67,8 @@
></my-register-step-user>
<div class="step-buttons">
- <button cdkStepperPrevious>{{ defaultPreviousStepButtonLabel }}</button>
- <button cdkStepperNext [disabled]="!formStepUser || !formStepUser.valid" (click)="videoUploadDisabled && signup()">{{ stepUserButtonLabel }}</button>
+ <button class="peertube-button-big secondary-button" cdkStepperPrevious>{{ defaultPreviousStepButtonLabel }}</button>
+ <button class="peertube-button-big primary-button" cdkStepperNext [disabled]="!formStepUser || !formStepUser.valid" (click)="videoUploadDisabled && signup()">{{ stepUserButtonLabel }}</button>
</div>
</cdk-step>
@@ -90,17 +84,17 @@
></my-register-step-channel>
<div class="step-buttons">
- <button cdkStepperPrevious>{{ defaultPreviousStepButtonLabel }}</button>
+ <button class="peertube-button-big secondary-button" cdkStepperPrevious>{{ defaultPreviousStepButtonLabel }}</button>
<div class="skip-step">
- <button class="underline-orange button-unstyle" (click)="skipChannelCreation()">
+ <button class="link-primary button-unstyle" (click)="skipChannelCreation()">
<strong i18n>I don't want to create a channel</strong>
</button>
<div class="skip-step-description" i18n>You will be able to create a channel later</div>
</div>
- <button cdkStepperNext [disabled]="!formStepChannel || !formStepChannel.valid || hasSameChannelAndAccountNames()" (click)="signup()">
+ <button class="peertube-button-big primary-button" cdkStepperNext [disabled]="!formStepChannel || !formStepChannel.valid || hasSameChannelAndAccountNames()" (click)="signup()">
<my-signup-label [requiresApproval]="requiresApproval"></my-signup-label>
</button>
</div>
@@ -122,7 +116,7 @@
></my-signup-success-before-email>
<div *ngIf="signupError" class="step-buttons">
- <button cdkStepperPrevious>{{ defaultPreviousStepButtonLabel }}</button>
+ <button class="peertube-button-big secondary-button" cdkStepperPrevious>{{ defaultPreviousStepButtonLabel }}</button>
</div>
</cdk-step>
</my-custom-stepper>
diff --git a/client/src/app/+signup/+register/register.component.scss b/client/src/app/+signup/+register/register.component.scss
index 2bf149762a..f7053d870a 100644
--- a/client/src/app/+signup/+register/register.component.scss
+++ b/client/src/app/+signup/+register/register.component.scss
@@ -9,12 +9,6 @@ my-signup-step-title strong {
padding-top: 30vh;
}
-.title-page-v2 {
- background-color: pvar(--mainColorVeryLight);
- margin: 0;
- padding-bottom: 10px;
-}
-
my-instance-about-accordion {
display: block;
margin-bottom: 30px;
@@ -36,26 +30,6 @@ my-instance-about-accordion {
font-size: 14px;
}
- .underline-orange {
- color: pvar(--mainForegroundColor);
-
- &:hover {
- opacity: 0.8;
- }
- }
-
- > button {
- @include peertube-button-big;
-
- &[cdkStepperNext] {
- @include orange-button;
- }
-
- &[cdkStepperPrevious] {
- @include grey-button;
- }
- }
-
> button,
.skip-step {
margin-top: 20px;
diff --git a/client/src/app/+signup/+register/register.component.ts b/client/src/app/+signup/+register/register.component.ts
index 11ffefae8b..9ffdcb21b0 100644
--- a/client/src/app/+signup/+register/register.component.ts
+++ b/client/src/app/+signup/+register/register.component.ts
@@ -7,7 +7,7 @@ import { AuthService, ServerService } from '@app/core'
import { HooksService } from '@app/core/plugins/hooks.service'
import { InstanceAboutAccordionComponent } from '@app/shared/shared-instance/instance-about-accordion.component'
import { AlertComponent } from '@app/shared/shared-main/common/alert.component'
-import { ServerConfig, ServerStats, UserRegister } from '@peertube/peertube-models'
+import { PeerTubeProblemDocument, ServerConfig, ServerStats, UserRegister } from '@peertube/peertube-models'
import { LoaderComponent } from '../../shared/shared-main/common/loader.component'
import { SignupLabelComponent } from '../../shared/shared-main/users/signup-label.component'
import { SignupStepTitleComponent } from '../shared/signup-step-title.component'
@@ -213,7 +213,7 @@ export class RegisterComponent implements OnInit {
},
error: err => {
- this.signupError = err.message
+ this.signupError = (err.body as PeerTubeProblemDocument)?.detail || err.message
}
})
}
diff --git a/client/src/app/+signup/+register/steps/register-step-about.component.html b/client/src/app/+signup/+register/steps/register-step-about.component.html
index 61bad8c137..1cc8f532e3 100644
--- a/client/src/app/+signup/+register/steps/register-step-about.component.html
+++ b/client/src/app/+signup/+register/steps/register-step-about.component.html
@@ -31,7 +31,7 @@
<p i18n>You can already follow {{ instanceName }} using your favorite tool.</p>
</div>
-<div class="callout callout-orange callout-light">
+<div class="callout callout-primary callout-light">
<div class="mascot-container" style="min-width: 140px">
<img class="mascot" width="140px" height="160px" src="/client/assets/images/mascot/happy.svg" alt="mascot"/>
</div>
@@ -40,8 +40,8 @@
<h4 i18>This website is a GAFAM alternative</h4>
<p i18n>
- {{ instanceName }} has been created using <a class="link-orange" target="_blank" rel="noopener noreferrer" href="https://joinpeertube.org">PeerTube</a>, a video creation platform developed by Framasoft.
- <a class="link-orange" target="_blank" rel="noopener noreferrer" href="https://framasoft.org">Framasoft</a> is a french non-profit organization that offers alternatives to Big Tech's digital tools
+ {{ instanceName }} has been created using <a class="link-primary" target="_blank" rel="noopener noreferrer" href="https://joinpeertube.org">PeerTube</a>, a video creation platform developed by Framasoft.
+ <a class="link-primary" target="_blank" rel="noopener noreferrer" href="https://framasoft.org">Framasoft</a> is a french non-profit organization that offers alternatives to Big Tech's digital tools
</p>
</div>
</div>
diff --git a/client/src/app/+signup/+register/steps/register-step-terms.component.html b/client/src/app/+signup/+register/steps/register-step-terms.component.html
index 1a862f9778..f661099ccd 100644
--- a/client/src/app/+signup/+register/steps/register-step-terms.component.html
+++ b/client/src/app/+signup/+register/steps/register-step-terms.component.html
@@ -16,8 +16,8 @@
<ng-template ptTemplate="label">
<ng-container i18n>
I am at least {{ minimumAge }} years old and agree
- to the <a class="link-orange" (click)="onTermsClick($event)" href='#'>Terms</a>
- <ng-container *ngIf="hasCodeOfConduct"> and to the <a class="link-orange" (click)="onCodeOfConductClick($event)" href='#'>Code of Conduct</a></ng-container>
+ to the <a class="link-primary" (click)="onTermsClick($event)" href='#'>Terms</a>
+ <ng-container *ngIf="hasCodeOfConduct"> and to the <a class="link-primary" (click)="onCodeOfConductClick($event)" href='#'>Code of Conduct</a></ng-container>
of {{ instanceName }}
</ng-container>
</ng-template>
diff --git a/client/src/app/+signup/+register/steps/step.component.scss b/client/src/app/+signup/+register/steps/step.component.scss
index 35ef20d97f..f12be66936 100644
--- a/client/src/app/+signup/+register/steps/step.component.scss
+++ b/client/src/app/+signup/+register/steps/step.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
input:not([type=submit]) {
@include peertube-input-text(100%);
@@ -11,11 +12,6 @@ input:not([type=submit]) {
}
}
-input[type=submit],
-button {
- @include peertube-button;
-}
-
label {
font-size: 18px;
margin-bottom: 5px;
diff --git a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.html b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.html
index 7038468f6e..c4d8688d27 100644
--- a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.html
+++ b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.html
@@ -13,7 +13,7 @@
<div *ngIf="formErrors['verify-email-email']" class="form-error" role="alert">{{ formErrors['verify-email-email'] }}</div>
</div>
- <input class="peertube-button orange-button" type="submit" i18n-value value="Send verification email" [disabled]="!form.valid">
+ <input class="peertube-button primary-button" type="submit" i18n-value value="Send verification email" [disabled]="!form.valid">
</form>
<ng-template #emailVerificationNotRequired>
diff --git a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.scss b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.scss
index 55be9cf26f..4898d34f17 100644
--- a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.scss
+++ b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
input[type=email] {
@include peertube-input-text(340px);
diff --git a/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.html b/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.html
index eb7e19a041..ec8d79291f 100644
--- a/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.html
+++ b/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.html
@@ -12,7 +12,7 @@
<my-alert type="danger" *ngIf="failed">
<span i18n>An error occurred.</span>
- <a i18n class="ms-1 link-orange" routerLink="/verify-account/ask-send-email">
+ <a i18n class="ms-1 link-primary" routerLink="/verify-account/ask-send-email">
Request a new verification email
</a>
</my-alert>
diff --git a/client/src/app/+signup/shared/signup-mascot.component.scss b/client/src/app/+signup/shared/signup-mascot.component.scss
index 67ab484476..f3b3c35dfa 100644
--- a/client/src/app/+signup/shared/signup-mascot.component.scss
+++ b/client/src/app/+signup/shared/signup-mascot.component.scss
@@ -7,5 +7,7 @@
}
div ::ng-deep svg {
- color: pvar(--mainColor);
+ color: pvar(--primary);
+ width: inherit;
+ height: inherit;
}
diff --git a/client/src/app/+signup/shared/signup-step-title.component.scss b/client/src/app/+signup/shared/signup-step-title.component.scss
index 1e0cb24400..b9815af3ed 100644
--- a/client/src/app/+signup/shared/signup-step-title.component.scss
+++ b/client/src/app/+signup/shared/signup-step-title.component.scss
@@ -18,6 +18,6 @@
height: 6px;
width: 60px;
border-radius: 4px;
- background-color: pvar(--mainColor);
+ background-color: pvar(--primary);
margin: 5px auto 0;
}
diff --git a/client/src/app/+signup/shared/signup-success-after-email.component.html b/client/src/app/+signup/shared/signup-success-after-email.component.html
index f7c845ee55..851624c865 100644
--- a/client/src/app/+signup/shared/signup-success-after-email.component.html
+++ b/client/src/app/+signup/shared/signup-success-after-email.component.html
@@ -15,7 +15,7 @@
<p i18n>Your email has been verified and your account has been created!</p>
<p i18n>
- If you need help using PeerTube, you can have a look at the <a class="link-orange" href="https://docs.joinpeertube.org/use/setup-account" target="_blank" rel="noopener noreferrer">documentation</a>.
+ If you need help using PeerTube, you can have a look at the <a class="link-primary" href="https://docs.joinpeertube.org/use/setup-account" target="_blank" rel="noopener noreferrer">documentation</a>.
</p>
</ng-container>
</my-alert>
diff --git a/client/src/app/+signup/shared/signup-success-before-email.component.html b/client/src/app/+signup/shared/signup-success-before-email.component.html
index 578924b98e..2983a32912 100644
--- a/client/src/app/+signup/shared/signup-success-before-email.component.html
+++ b/client/src/app/+signup/shared/signup-success-before-email.component.html
@@ -29,7 +29,7 @@
</p>
<p *ngIf="!requiresApproval" i18n>
- If you need help using PeerTube, you can have a look at the <a class="link-orange" href="https://docs.joinpeertube.org/use/setup-account" target="_blank" rel="noopener noreferrer">documentation</a>.
+ If you need help using PeerTube, you can have a look at the <a class="link-primary" href="https://docs.joinpeertube.org/use/setup-account" target="_blank" rel="noopener noreferrer">documentation</a>.
</p>
</ng-container>
</my-alert>
diff --git a/client/src/app/+stats/video/video-stats.component.html b/client/src/app/+stats/video/video-stats.component.html
index fbfd5f1f74..9fcfb7ef93 100644
--- a/client/src/app/+stats/video/video-stats.component.html
+++ b/client/src/app/+stats/video/video-stats.component.html
@@ -1,5 +1,9 @@
<div class="margin-content">
- <h1 class="title-page" i18n>{{ video.name }}</h1>
+ <h1 class="title-page">
+ <my-global-icon iconName="stats"></my-global-icon>
+
+ <ng-container i18n>{{ video.name }} statistics</ng-container>
+ </h1>
<div class="stats-embed">
<div class="global-stats">
diff --git a/client/src/app/+stats/video/video-stats.component.scss b/client/src/app/+stats/video/video-stats.component.scss
index f0ac3735fd..5ddd7a9206 100644
--- a/client/src/app/+stats/video/video-stats.component.scss
+++ b/client/src/app/+stats/video/video-stats.component.scss
@@ -39,14 +39,15 @@
height: fit-content;
min-height: 100px;
min-width: 200px;
- background-color: pvar(--submenuBackgroundColor);
+ background-color: pvar(--bg-secondary-400);
margin-bottom: 15px;
@include margin-right(15px);
.label,
.more-info {
- font-size: 14px;
+ font-size: 1rem;
+ font-weight: $font-semibold;
}
.value {
diff --git a/client/src/app/+stats/video/video-stats.component.ts b/client/src/app/+stats/video/video-stats.component.ts
index 06d184447a..17da3966ef 100644
--- a/client/src/app/+stats/video/video-stats.component.ts
+++ b/client/src/app/+stats/video/video-stats.component.ts
@@ -27,6 +27,7 @@ import { NgFor, NgIf } from '@angular/common'
import { NumberFormatterPipe } from '@app/shared/shared-main/common/number-formatter.pipe'
import { VideoDetails } from '@app/shared/shared-main/video/video-details.model'
import { LiveVideoService } from '@app/shared/shared-video-live/live-video.service'
+import { GlobalIconComponent } from '@app/shared/shared-icons/global-icon.component'
type ActiveGraphId = VideoStatsTimeserieMetric | 'retention' | 'countries' | 'regions'
@@ -45,9 +46,9 @@ type ChartBuilderResult = {
type Card = { label: string, value: string | number, moreInfo?: string, help?: string }
-ChartJSDefaults.backgroundColor = getComputedStyle(document.body).getPropertyValue('--mainBackgroundColor')
-ChartJSDefaults.borderColor = getComputedStyle(document.body).getPropertyValue('--greySecondaryBackgroundColor')
-ChartJSDefaults.color = getComputedStyle(document.body).getPropertyValue('--mainForegroundColor')
+ChartJSDefaults.backgroundColor = getComputedStyle(document.body).getPropertyValue('--bg')
+ChartJSDefaults.borderColor = getComputedStyle(document.body).getPropertyValue('--bg-secondary-500')
+ChartJSDefaults.color = getComputedStyle(document.body).getPropertyValue('--fg')
@Component({
templateUrl: './video-stats.component.html',
@@ -69,7 +70,8 @@ ChartJSDefaults.color = getComputedStyle(document.body).getPropertyValue('--main
NgbNavContent,
ChartModule,
ButtonComponent,
- NgbNavOutlet
+ NgbNavOutlet,
+ GlobalIconComponent
]
})
export class VideoStatsComponent implements OnInit {
@@ -583,7 +585,7 @@ export class VideoStatsComponent implements OnInit {
}
private buildChartColor () {
- return getComputedStyle(document.body).getPropertyValue('--mainColorLighter')
+ return getComputedStyle(document.body).getPropertyValue('--border-primary')
}
private formatXTick (options: {
diff --git a/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.html b/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.html
index dd0b10d665..3398c76ecd 100644
--- a/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.html
+++ b/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.html
@@ -1,8 +1,4 @@
<div class="margin-content">
- <h1 i18n class="title-page" *ngIf="pagination.totalItems">
- Created {pagination.totalItems, plural, =1 {1 playlist} other {{{ pagination.totalItems }} playlists}}
- </h1>
-
<div i18n class="no-results" *ngIf="pagination.totalItems === 0">This channel does not have playlists.</div>
<div class="playlists" myInfiniteScroller (nearOfBottom)="onNearOfBottom()" [dataObservable]="onDataSubject.asObservable()">
diff --git a/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.scss b/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.scss
index 2a9dde0314..23f9ec2d35 100644
--- a/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.scss
+++ b/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.scss
@@ -19,15 +19,10 @@
}
@media screen and (max-width: $mobile-view) {
- .title-page {
- display: block;
- text-align: center;
- }
-
.playlists {
justify-content: left;
- @include margin-left(pvar(--horizontalMarginContent) !important);
- @include margin-right(pvar(--horizontalMarginContent) !important);
+ @include margin-left(pvar(--x-margin-content) !important);
+ @include margin-right(pvar(--x-margin-content) !important);
}
}
diff --git a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.html b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.html
index 4e8f4bba25..f0659928a3 100644
--- a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.html
+++ b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.html
@@ -1,11 +1,10 @@
+<h1 class="visually-hidden" i18n>Videos</h1>
+
<my-videos-list
#videosList
*ngIf="videoChannel"
- [title]="title"
- displayTitle="false"
-
[getVideosObservableFunction]="getVideosObservableFunction"
[getSyndicationItemsFunction]="getSyndicationItemsFunction"
diff --git a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts
index 5ac6ca246e..391c5fa5b0 100644
--- a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts
+++ b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts
@@ -22,7 +22,6 @@ export class VideoChannelVideosComponent implements OnInit, AfterViewInit, OnDes
getVideosObservableFunction = this.getVideosObservable.bind(this)
getSyndicationItemsFunction = this.getSyndicationItems.bind(this)
- title = $localize`Videos`
defaultSort = '-publishedAt' as VideoSortField
displayOptions: MiniatureDisplayOptions = {
diff --git a/client/src/app/+video-channels/video-channels.component.html b/client/src/app/+video-channels/video-channels.component.html
index b74ec7b0e9..639cbc7066 100644
--- a/client/src/app/+video-channels/video-channels.component.html
+++ b/client/src/app/+video-channels/video-channels.component.html
@@ -1,18 +1,20 @@
<div class="root" *ngIf="videoChannel">
- <div class="banner" *ngIf="videoChannel.bannerUrl">
- <img [src]="videoChannel.bannerUrl" alt="Channel banner">
+ <div class="margin-content">
+ <div class="banner" *ngIf="videoChannel.bannerUrl">
+ <img [src]="videoChannel.bannerUrl" alt="Channel banner">
+ </div>
</div>
- <div class="channel-info">
+ <div class="margin-content channel-info">
<ng-template #buttonsTemplate>
- <a *ngIf="isManageable()" [routerLink]="[ '/manage/update', videoChannel.nameWithHost ]" class="peertube-button-link orange-button" i18n>
+ <a *ngIf="isManageable()" [routerLink]="[ '/manage/update', videoChannel.nameWithHost ]" class="peertube-button-link primary-button" i18n>
Manage channel
</a>
<my-subscribe-button *ngIf="!isOwner()" #subscribeButton [videoChannels]="[videoChannel]"></my-subscribe-button>
- <button *ngIf="videoChannel.support" (click)="showSupportModal()" class="support-button peertube-button orange-button-inverted">
+ <button *ngIf="videoChannel.support" (click)="showSupportModal()" class="support-button peertube-button tertiary-button">
<my-global-icon iconName="support" aria-hidden="true"></my-global-icon>
<span class="icon-text" i18n>Support</span>
</button>
@@ -30,7 +32,7 @@
<div class="actor-info">
<h4>
- <a [routerLink]="getAccountUrl()" title="View account" i18n-title>{{ ownerAccount.displayName }}</a>
+ <a class="text-decoration-none" [routerLink]="getAccountUrl()" title="View account" i18n-title>{{ ownerAccount.displayName }}</a>
</h4>
<div class="actor-handle">&#64;{{ videoChannel.ownerBy }}</div>
@@ -43,11 +45,11 @@
<div class="description-html" [innerHTML]="ownerDescriptionHTML"></div>
</div>
- <a class="view-account short" [routerLink]="getAccountUrl()" i18n>
+ <a class="view-account peertube-button-link primary-button short mt-3" [routerLink]="getAccountUrl()" i18n>
View account
</a>
- <a class="view-account complete" [routerLink]="getAccountUrl()" i18n>
+ <a class="view-account link-primary complete" [routerLink]="getAccountUrl()" i18n>
View owner account
</a>
</div>
@@ -94,7 +96,7 @@
<div class="description-html" [innerHTML]="channelDescriptionHTML"></div>
</div>
- <button *ngIf="hasShowMoreDescription()" class="show-more button-unstyle"
+ <button *ngIf="hasShowMoreDescription()" class="show-more peertube-button-like-link"
(click)="channelDescriptionExpanded = !channelDescriptionExpanded"
title="Show the complete description" i18n-title i18n
>
@@ -110,16 +112,12 @@
</div>
</div>
- <div class="bottom-owner">
+ <div class="margin-content bottom-owner">
<ng-template *ngTemplateOutlet="ownerTemplate"></ng-template>
</div>
- <div class="links">
- <ng-template #linkTemplate let-item="item">
- <a [routerLink]="item.routerLink" routerLinkActive="active" class="sub-menu-entry">{{ item.label }}</a>
- </ng-template>
-
- <my-list-overflow [items]="links" [itemTemplate]="linkTemplate"></my-list-overflow>
+ <div class="margin-content mb-3">
+ <my-horizontal-menu [menuEntries]="links"></my-horizontal-menu>
</div>
<router-outlet></router-outlet>
diff --git a/client/src/app/+video-channels/video-channels.component.scss b/client/src/app/+video-channels/video-channels.component.scss
index f8b0b1cd2f..81d687d8e2 100644
--- a/client/src/app/+video-channels/video-channels.component.scss
+++ b/client/src/app/+video-channels/video-channels.component.scss
@@ -2,26 +2,21 @@
@use '_mixins' as *;
@use '_account-channel-page' as *;
@use '_miniature' as *;
+@use '_button-mixins' as *;
-.root {
- --myGlobalTopPadding: 60px;
- --myChannelImgMargin: 30px;
- --myFontSize: 16px;
- --myGreyChannelFontSize: 16px;
- --myGreyOwnerFontSize: 14px;
-}
-
-.section-label {
- @include section-label-responsive;
-}
+$owner-block-bg: pvar(--bg-secondary-350);
-.links {
- @include grid-videos-miniature-margins;
+.root {
+ --co-channel-img-margin: 30px;
+ --co-font-size: 16px;
+ --co-channel-handle-font-size: 16px;
+ --co-owner-handle-font-size: 14px;
}
.actor-info {
min-width: 1px;
width: 100%;
+ align-items: flex-start;
> h4,
> .actor-handle {
@@ -34,27 +29,18 @@
grid-template-columns: 1fr auto;
grid-template-rows: auto auto;
- background-color: pvar(--channelBackgroundColor);
- padding-top: var(--myGlobalTopPadding);
- font-size: var(--myFontSize);
+ font-size: var(--co-font-size);
- // Use the same margin as the videos grid
- @include grid-videos-miniature-margins(false, 15px);
@include margin-bottom(3rem);
}
.channel-avatar-row {
- @include avatar-row-responsive(var(--myChannelImgMargin), var(--myGreyChannelFontSize));
-}
-
-.support-button {
- @include button-with-icon(21px, 0, -1px);
+ @include avatar-row-responsive(var(--co-channel-img-margin), var(--co-channel-handle-font-size));
}
.channel-description {
grid-column: 1;
word-break: break-word;
- padding-bottom: var(--myGlobalTopPadding);
}
.show-more {
@@ -97,10 +83,11 @@
}
.owner-block {
- background-color: pvar(--mainBackgroundColor);
+ background-color: $owner-block-bg;
padding: 30px;
width: 300px;
- font-size: var(--myFontSize);
+ font-size: var(--co-font-size);
+ border-radius: 5px;
.avatar-row {
display: flex;
@@ -115,13 +102,13 @@
margin: 0;
a {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
}
}
.actor-handle {
- font-size: var(--myGreyOwnerFontSize);
- color: pvar(--greyForegroundColor);
+ font-size: var(--co-owner-handle-font-size);
+ color: pvar(--fg-300);
}
}
@@ -129,17 +116,10 @@
max-height: 140px;
word-break: break-word;
- @include fade-text(120px, pvar(--mainBackgroundColor));
+ @include fade-text(120px, $owner-block-bg);
}
}
-.view-account.short {
- margin-top: 30px;
-
- @include peertube-button-link;
- @include orange-button-inverted;
-}
-
.view-account.complete {
display: none;
}
@@ -163,8 +143,7 @@ my-copy-button {
@media screen and (max-width: 1100px) {
.root {
- --myGlobalTopPadding: 45px;
- --myChannelImgMargin: 15px;
+ --co-channel-img-margin: 15px;
}
.channel-info {
@@ -176,7 +155,7 @@ my-copy-button {
.channel-description:not(.expanded) {
max-height: 70px;
- @include fade-text(30px, pvar(--channelBackgroundColor));
+ @include fade-text(30px, pvar(--bg));
}
.show-more {
@@ -199,16 +178,14 @@ my-copy-button {
.bottom-owner {
display: block;
- width: 100%;
border-bottom: 2px solid $separator-border-color;
- padding: var(--myGlobalTopPadding) 45px;
margin-bottom: 60px;
}
.owner-block {
display: grid;
width: 100%;
- padding: 0;
+ padding: 1rem;
.avatar-row {
grid-column: 1;
@@ -220,7 +197,7 @@ my-copy-button {
grid-column: 2;
max-height: 70px;
- @include fade-text(30px, pvar(--mainBackgroundColor));
+ @include fade-text(30px, $owner-block-bg);
}
.view-account {
@@ -232,7 +209,6 @@ my-copy-button {
display: block;
text-align: end;
margin-top: 10px;
- color: pvar(--mainColor);
}
.view-account.short {
@@ -242,10 +218,9 @@ my-copy-button {
@media screen and (max-width: $mobile-view) {
.root {
- --myGlobalTopPadding: 15px;
- --myFontSize: 14px;
- --myGreyChannelFontSize: 13px;
- --myGreyOwnerFontSize: 13px;
+ --co-font-size: 14px;
+ --co-channel-handle-font-size: 13px;
+ --co-owner-handle-font-size: 13px;
}
.links {
diff --git a/client/src/app/+video-channels/video-channels.component.ts b/client/src/app/+video-channels/video-channels.component.ts
index 4738d46500..d12c9a95b1 100644
--- a/client/src/app/+video-channels/video-channels.component.ts
+++ b/client/src/app/+video-channels/video-channels.component.ts
@@ -1,10 +1,11 @@
import { DatePipe, NgClass, NgIf, NgTemplateOutlet } from '@angular/common'
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'
-import { ActivatedRoute, RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router'
+import { ActivatedRoute, RouterLink, RouterOutlet } from '@angular/router'
import { AuthService, Hotkey, HotkeysService, MarkdownService, MetaService, RestExtractor, ScreenService } from '@app/core'
import { Account } from '@app/shared/shared-main/account/account.model'
import { VideoChannel } from '@app/shared/shared-main/channel/video-channel.model'
import { VideoChannelService } from '@app/shared/shared-main/channel/video-channel.service'
+import { HorizontalMenuComponent, HorizontalMenuEntry } from '@app/shared/shared-main/menu/horizontal-menu.component'
import { VideoService } from '@app/shared/shared-main/video/video.service'
import { BlocklistService } from '@app/shared/shared-moderation/blocklist.service'
import { SupportModalComponent } from '@app/shared/shared-support-modal/support-modal.component'
@@ -15,7 +16,6 @@ import { catchError, distinctUntilChanged, map, switchMap } from 'rxjs/operators
import { ActorAvatarComponent } from '../shared/shared-actor-image/actor-avatar.component'
import { GlobalIconComponent } from '../shared/shared-icons/global-icon.component'
import { CopyButtonComponent } from '../shared/shared-main/buttons/copy-button.component'
-import { ListOverflowComponent, ListOverflowItem } from '../shared/shared-main/menu/list-overflow.component'
import { AccountBlockBadgesComponent } from '../shared/shared-moderation/account-block-badges.component'
@Component({
@@ -32,8 +32,7 @@ import { AccountBlockBadgesComponent } from '../shared/shared-moderation/account
CopyButtonComponent,
NgTemplateOutlet,
NgClass,
- RouterLinkActive,
- ListOverflowComponent,
+ HorizontalMenuComponent,
RouterOutlet,
SupportModalComponent,
DatePipe
@@ -46,7 +45,7 @@ export class VideoChannelsComponent implements OnInit, OnDestroy {
videoChannel: VideoChannel
ownerAccount: Account
hotkeys: Hotkey[]
- links: ListOverflowItem[] = []
+ links: HorizontalMenuEntry[] = []
isChannelManageable = false
channelVideosCount: number
diff --git a/client/src/app/+video-studio/edit/video-studio-edit.component.html b/client/src/app/+video-studio/edit/video-studio-edit.component.html
index 9c2cb1920b..aa6a4535aa 100644
--- a/client/src/app/+video-studio/edit/video-studio-edit.component.html
+++ b/client/src/app/+video-studio/edit/video-studio-edit.component.html
@@ -1,27 +1,31 @@
<div class="margin-content">
- <h1 class="title-page" i18n>Studio for {{ video.name }}</h1>
+ <h1 class="title-page">
+ <my-global-icon iconName="film"></my-global-icon>
+
+ <ng-container i18n>Studio for {{ video.name }}</ng-container>
+ </h1>
<div class="grid-container">
<form [formGroup]="form">
<div class="section cut" formGroupName="cut">
- <h2 i18n>CUT VIDEO</h2>
+ <h2 class="section-label" i18n>CUT VIDEO</h2>
<div i18n class="description">Set a new start/end.</div>
<div class="form-group">
<label i18n for="cutStart">New start</label>
- <my-timestamp-input inputName="cutStart" [disableBorder]="false" [maxTimestamp]="video.duration" formControlName="start"></my-timestamp-input>
+ <my-timestamp-input inputName="cutStart" enableBorder="true" [maxTimestamp]="video.duration" formControlName="start"></my-timestamp-input>
</div>
<div class="form-group">
<label i18n for="cutEnd">New end</label>
- <my-timestamp-input inputName="cutEnd" [disableBorder]="false" [maxTimestamp]="video.duration" formControlName="end"></my-timestamp-input>
+ <my-timestamp-input inputName="cutEnd" enableBorder="true" [maxTimestamp]="video.duration" formControlName="end"></my-timestamp-input>
</div>
</div>
<div class="section" formGroupName="add-intro">
- <h2 i18n>ADD INTRO</h2>
+ <h2 class="section-label" i18n>ADD INTRO</h2>
<div i18n class="description">Concatenate a file at the beginning of the video.</div>
@@ -35,7 +39,7 @@
</div>
<div class="section" formGroupName="add-outro">
- <h2 i18n>ADD OUTRO</h2>
+ <h2 class="section-label" i18n>ADD OUTRO</h2>
<div i18n class="description">Concatenate a file at the end of the video.</div>
@@ -49,7 +53,7 @@
</div>
<div class="section" formGroupName="add-watermark">
- <h2 i18n>ADD WATERMARK</h2>
+ <h2 class="section-label" i18n>ADD WATERMARK</h2>
<div i18n class="description">Add a watermark image to the video.</div>
@@ -63,7 +67,7 @@
</div>
<my-button
- theme="orange" i18n-label label="Run video edition" icon="circle-tick"
+ theme="primary" i18n-label label="Run video edition" icon="circle-tick"
(click)="runEdition()" (keydown.enter)="runEdition()"
[disabled]="!form.valid || isRunningEdition || noEdition()"
></my-button>
diff --git a/client/src/app/+video-studio/edit/video-studio-edit.component.scss b/client/src/app/+video-studio/edit/video-studio-edit.component.scss
index d64d891561..70da409d7a 100644
--- a/client/src/app/+video-studio/edit/video-studio-edit.component.scss
+++ b/client/src/app/+video-studio/edit/video-studio-edit.component.scss
@@ -3,7 +3,7 @@
my-timestamp-input {
display: block;
- width: 85px;
+ width: 100px;
}
.grid-container {
@@ -52,18 +52,12 @@ my-timestamp-input {
}
}
-h1 {
- font-size: 20px;
-}
-
h2 {
font-weight: $font-bold;
font-size: 16px;
- color: pvar(--mainColor);
- background-color: pvar(--mainBackgroundColor);
padding: 0 5px;
width: fit-content;
- margin: -8px 0 0;
+ margin-top: 0.5rem;
}
.section {
@@ -71,7 +65,8 @@ h2 {
min-width: $min-width;
margin-bottom: 50px;
- border: 1px solid $separator-border-color;
+ border: 1px solid transparent;
+ background: pvar(--bg-secondary-400);
border-radius: 5px;
width: fit-content;
@@ -83,7 +78,7 @@ h2 {
}
.description {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
margin-top: 5px;
margin-bottom: 15px;
}
diff --git a/client/src/app/+video-studio/edit/video-studio-edit.component.ts b/client/src/app/+video-studio/edit/video-studio-edit.component.ts
index 587f69e3c8..55c3449407 100644
--- a/client/src/app/+video-studio/edit/video-studio-edit.component.ts
+++ b/client/src/app/+video-studio/edit/video-studio-edit.component.ts
@@ -15,6 +15,7 @@ import { ReactiveFileComponent } from '../../shared/shared-forms/reactive-file.c
import { TimestampInputComponent } from '../../shared/shared-forms/timestamp-input.component'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { VideoDetails } from '@app/shared/shared-main/video/video-details.model'
+import { GlobalIconComponent } from '@app/shared/shared-icons/global-icon.component'
@Component({
selector: 'my-video-studio-edit',
@@ -29,7 +30,8 @@ import { VideoDetails } from '@app/shared/shared-main/video/video-details.model'
ButtonComponent,
EmbedComponent,
NgIf,
- NgFor
+ NgFor,
+ GlobalIconComponent
]
})
export class VideoStudioEditComponent extends FormReactive implements OnInit {
diff --git a/client/src/app/+videos/+video-edit/shared/caption/video-caption-add-modal.component.html b/client/src/app/+videos/+video-edit/shared/caption/video-caption-add-modal.component.html
index 067ab83437..3345027b6c 100644
--- a/client/src/app/+videos/+video-edit/shared/caption/video-caption-add-modal.component.html
+++ b/client/src/app/+videos/+video-edit/shared/caption/video-caption-add-modal.component.html
@@ -36,12 +36,12 @@
<div class="modal-footer inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
<input
- type="submit" i18n-value value="Add this caption" class="peertube-button orange-button"
+ type="submit" i18n-value value="Add this caption" class="peertube-button primary-button"
[disabled]="!form.valid" (click)="addCaption()"
>
</div>
diff --git a/client/src/app/+videos/+video-edit/shared/caption/video-caption-edit-modal-content.component.html b/client/src/app/+videos/+video-edit/shared/caption/video-caption-edit-modal-content.component.html
index f472b505b4..f0577f452c 100644
--- a/client/src/app/+videos/+video-edit/shared/caption/video-caption-edit-modal-content.component.html
+++ b/client/src/app/+videos/+video-edit/shared/caption/video-caption-edit-modal-content.component.html
@@ -52,7 +52,7 @@
<my-timestamp-input
class="me-1"
- inputName="segmentStart" [disableBorder]="false" [maxTimestamp]="publishedVideo.duration * 1000" mask="99:99:99.999"
+ inputName="segmentStart" enableBorder="true" [maxTimestamp]="publishedVideo.duration * 1000" mask="99:99:99.999"
[(ngModel)]="segment.startMs" [parser]="timestampParser" [formatter]="timestampFormatter"
></my-timestamp-input>
@@ -67,7 +67,7 @@
<my-timestamp-input
class="me-1"
- inputName="segmentEnd" [disableBorder]="false" [maxTimestamp]="publishedVideo.duration * 1000" mask="99:99:99.999"
+ inputName="segmentEnd" enableBorder="true" [maxTimestamp]="publishedVideo.duration * 1000" mask="99:99:99.999"
[(ngModel)]="segment.endMs" [parser]="timestampParser" [formatter]="timestampFormatter"
></my-timestamp-input>
@@ -121,12 +121,12 @@
<div class="modal-footer inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
<input
- type="button" i18n-value value="Edit this caption" class="peertube-button orange-button"
+ type="button" i18n-value value="Edit this caption" class="peertube-button primary-button"
[disabled]="rawEdition && !form.valid" (click)="updateCaption()"
>
</div>
diff --git a/client/src/app/+videos/+video-edit/shared/caption/video-caption-edit-modal-content.component.scss b/client/src/app/+videos/+video-edit/shared/caption/video-caption-edit-modal-content.component.scss
index 4ed446c520..5c0afaaba8 100644
--- a/client/src/app/+videos/+video-edit/shared/caption/video-caption-edit-modal-content.component.scss
+++ b/client/src/app/+videos/+video-edit/shared/caption/video-caption-edit-modal-content.component.scss
@@ -18,11 +18,11 @@
&.active,
&:hover {
- background: pvar(--mainBackgroundHoverColor);
+ background: pvar(--bg-secondary-300);
}
}
my-timestamp-input {
- width: 100px;
+ width: 115px;
display: inline-block;
}
diff --git a/client/src/app/+videos/+video-edit/shared/thumbnail-manager/thumbnail-manager.component.html b/client/src/app/+videos/+video-edit/shared/thumbnail-manager/thumbnail-manager.component.html
index 8eb68bb5ce..5d9dce6d49 100644
--- a/client/src/app/+videos/+video-edit/shared/thumbnail-manager/thumbnail-manager.component.html
+++ b/client/src/app/+videos/+video-edit/shared/thumbnail-manager/thumbnail-manager.component.html
@@ -15,20 +15,20 @@
<div class="mt-2">
@if (selectingFromVideo) {
- <button i18n type="button" class="peertube-button orange-button me-2" (click)="selectFrame()">Use this frame</button>
+ <button i18n type="button" class="peertube-button primary-button me-2" (click)="selectFrame()">Use this frame</button>
- <button i18n type="button" i18n class="peertube-button grey-button" (click)="resetSelectFromVideo()">Cancel</button>
+ <button i18n type="button" i18n class="peertube-button secondary-button" (click)="resetSelectFromVideo()">Cancel</button>
}
@else {
<my-reactive-file
class="d-inline-block"
inputName="uploadNewThumbnail" inputLabel="Select from your device" [extensions]="videoImageExtensions"
[maxFileSize]="maxVideoImageSize" placement="right" (fileChanged)="onFileChanged($event)"
- [buttonTooltip]="getReactiveFileButtonTooltip()">
+ [buttonTooltip]="getReactiveFileButtonTooltip()" theme="primary">
</my-reactive-file>
@if (canSelectFromVideo()) {
- <button i18n type="button" class="peertube-button grey-button ms-2" (click)="selectFromVideo()">Select from video</button>
+ <button i18n type="button" class="peertube-button secondary-button ms-2" (click)="selectFromVideo()">Select from video</button>
}
}
diff --git a/client/src/app/+videos/+video-edit/shared/thumbnail-manager/thumbnail-manager.component.scss b/client/src/app/+videos/+video-edit/shared/thumbnail-manager/thumbnail-manager.component.scss
index 690e8d9dda..782fa8cb33 100644
--- a/client/src/app/+videos/+video-edit/shared/thumbnail-manager/thumbnail-manager.component.scss
+++ b/client/src/app/+videos/+video-edit/shared/thumbnail-manager/thumbnail-manager.component.scss
@@ -16,7 +16,7 @@
&.no-image {
border: 2px solid #808080;
- background-color: pvar(--mainBackgroundColor);
+ background-color: pvar(--bg);
}
}
}
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.html b/client/src/app/+videos/+video-edit/shared/video-edit.component.html
index f9d3106a00..4c48df2654 100644
--- a/client/src/app/+videos/+video-edit/shared/video-edit.component.html
+++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.html
@@ -125,6 +125,7 @@
<p-calendar
id="schedulePublicationAt" formControlName="schedulePublicationAt" [dateFormat]="calendarDateFormat"
[firstDayOfWeek]="0" [minDate]="minScheduledDate" [showTime]="true" [hideOnDateTimeSelect]="true"
+ baseZIndex="20000"
>
</p-calendar>
@@ -243,7 +244,7 @@
<my-alert type="primary" i18n>
Chapters can also be set in the video description.
- Check the format <a href="https://docs.joinpeertube.org/use/create-upload-video#chapters" target="_blank">in the PeerTube documentation</a>
+ Check the format <a href="https://docs.joinpeertube.org/use/create-upload-video#chapters" target="_blank" class="alert-link">in the PeerTube documentation</a>
</my-alert>
<ng-container *ngFor="let chapterControl of getChaptersFormArray().controls; let i = index">
@@ -261,7 +262,7 @@
<div class="position">{{ i + 1 }}</div>
<my-timestamp-input
- class="d-block" [disableBorder]="false" [inputName]="'timecode[' + i + ']'"
+ class="d-block" enableBorder="true" [inputName]="'timecode[' + i + ']'"
[maxTimestamp]="publishedVideo?.duration" formControlName="timecode"
></my-timestamp-input>
@@ -434,6 +435,7 @@
<p-calendar
inputId="originallyPublishedAt" formControlName="originallyPublishedAt" [dateFormat]="calendarDateFormat" [firstDayOfWeek]="0"
[showTime]="true" [hideOnDateTimeSelect]="true" [monthNavigator]="true" [yearNavigator]="true" [yearRange]="myYearRange"
+ baseZIndex="20000"
>
</p-calendar>
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.scss b/client/src/app/+videos/+video-edit/shared/video-edit.component.scss
index a8ece799fe..0d4744ce40 100644
--- a/client/src/app/+videos/+video-edit/shared/video-edit.component.scss
+++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
.peertube-select-container {
@include peertube-select-container(auto);
@@ -11,7 +12,7 @@ my-peertube-checkbox {
}
my-timestamp-input {
- width: 85px;
+ width: 100px;
}
.nav-tabs {
@@ -36,7 +37,7 @@ my-timestamp-input {
flex-wrap: wrap;
a.caption-entry-label {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
@include disable-default-a-behaviour;
@@ -68,7 +69,7 @@ my-timestamp-input {
.message-submit {
display: inline-block;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
@include margin-right(25px);
}
@@ -97,11 +98,6 @@ p-calendar {
grid-gap: 30px;
}
-.button-file {
- @include peertube-button-file(max-content);
- @include orange-button;
-}
-
.hide-chapter-label {
height: 0;
opacity: 0;
@@ -114,7 +110,7 @@ p-calendar {
column-gap: 1rem;
.position {
- height: 31px;
+ height: 38px;
min-width: 16px;
display: flex;
align-items: center;
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.html b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.html
index 4c3c54ec46..95be942e2f 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.html
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.html
@@ -29,6 +29,7 @@
</div>
<input
+ class="peertube-button primary-button"
[disabled]="firstStepPermanentLive !== true && firstStepPermanentLive !== false"
type="button" i18n-value value="Go Live" (click)="goLive()"
/>
@@ -57,7 +58,7 @@
<div class="submit-container">
<my-button
- theme="orange" i18n-label label="Update" icon="circle-tick"
+ theme="primary" i18n-label label="Update" icon="circle-tick"
(click)="updateSecondStep()" [disabled]="!form.valid || isUpdatingVideo === true"
></my-button>
</div>
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.html b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.html
index 051f545c52..284494fce6 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.html
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.html
@@ -2,7 +2,7 @@
<div class="first-step-block">
<my-global-icon class="upload-icon" iconName="upload" aria-hidden="true"></my-global-icon>
- <div class="button-file form-control" [ngbTooltip]="'(extensions: .torrent)'">
+ <div class="button-file primary-button form-control" [ngbTooltip]="'(extensions: .torrent)'">
<span i18n>Select the torrent to import</span>
<input
aria-label="Select the torrent to import" i18n-aria-label
@@ -37,7 +37,7 @@
</div>
<input
- type="button" i18n-value value="Import"
+ type="button" i18n-value value="Import" class="peertube-button primary-button"
[disabled]="!isMagnetUrlValid() || isImportingVideo" (click)="importVideo()"
/>
</div>
@@ -64,7 +64,7 @@
<div class="submit-container">
<my-button
- theme="orange" i18n-label label="Update" icon="circle-tick" (click)="updateSecondStep()"
+ theme="primary" i18n-label label="Update" icon="circle-tick" (click)="updateSecondStep()"
[disabled]="!form.valid || isUpdatingVideo === true"
></my-button>
</div>
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.scss b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.scss
index 97299ef32c..f814787f98 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.scss
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.scss
@@ -3,7 +3,7 @@
.first-step-block {
.torrent-or-magnet {
- @include divider($color: pvar(--inputPlaceholderColor), $background: pvar(--submenuBackgroundColor));
+ @include divider($color: pvar(--secondary-icon-color), $background: pvar(--bg-secondary-400));
&[data-content] {
margin: 1.5rem 0;
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.html b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.html
index 0bc7647e25..4a61d79fc5 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.html
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.html
@@ -33,7 +33,7 @@
</div>
<input
- type="button" i18n-value value="Import"
+ type="button" i18n-value value="Import" class="peertube-button primary-button"
[disabled]="!isTargetUrlValid() || isImportingVideo" (click)="importVideo()"
/>
</div>
@@ -62,7 +62,7 @@
<div class="submit-container">
<my-button
- theme="orange" i18n-label label="Update" icon="circle-tick" (click)="updateSecondStep()"
+ theme="primary" i18n-label label="Update" icon="circle-tick" (click)="updateSecondStep()"
[disabled]="!form.valid || isUpdatingVideo === true"
></my-button>
</div>
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-send.scss b/client/src/app/+videos/+video-edit/video-add-components/video-send.scss
index 0ef44885b9..440e6be3ec 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-send.scss
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-send.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
$width-size: 275px;
@@ -12,6 +13,8 @@ $width-size: 275px;
}
.first-step-block {
+ --input-bg: #{pvar(--bg-secondary-500)};
+
display: flex;
flex-direction: column;
align-items: center;
@@ -19,8 +22,7 @@ $width-size: 275px;
.upload-icon {
width: 90px;
margin-bottom: 25px;
-
- @include apply-svg-color(pvar(--inputBorderColor));
+ color: pvar(--fg-300);
}
.peertube-select-container {
@@ -49,16 +51,7 @@ $width-size: 275px;
@include peertube-input-text($width-size);
}
- input[type=button] {
- width: $width-size;
- margin-top: 30px;
-
- @include peertube-button;
- @include orange-button;
- }
-
.button-file {
- @include peertube-button-file(max-content);
- @include orange-button;
+ width: max-content;
}
}
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html
index a21ef6c842..443b575c1f 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html
@@ -2,7 +2,7 @@
<div class="first-step-block">
<my-global-icon class="upload-icon" iconName="upload" aria-hidden="true"></my-global-icon>
- <div class="button-file form-control" [ngbTooltip]="'(extensions: ' + getVideoExtensions() + ')'">
+ <div class="button-file primary-button form-control" [ngbTooltip]="'(extensions: ' + getVideoExtensions() + ')'">
<span i18n>Select the file to upload</span>
<input
aria-label="Select the file to upload"
@@ -42,7 +42,7 @@
</div>
<div class="form-group upload-audio-button">
- <my-button theme="orange" [label]="getAudioUploadLabel()" icon="upload" (click)="uploadAudio()"></my-button>
+ <my-button theme="primary" [label]="getAudioUploadLabel()" icon="upload" (click)="uploadAudio()"></my-button>
</div>
</ng-container>
</div>
@@ -71,7 +71,7 @@
<div i18n *ngIf="videoUploaded === false" class="message-submit">Publish will be available when upload is finished</div>
<my-button
- theme="orange" i18n-label label="Publish" icon="circle-tick"
+ theme="primary" i18n-label label="Publish" icon="circle-tick"
(click)="updateSecondStep()" (keydown.enter)="updateSecondStep()" [disabled]="isPublishingButtonDisabled()"
></my-button>
</div>
diff --git a/client/src/app/+videos/+video-edit/video-add.component.html b/client/src/app/+videos/+video-edit/video-add.component.html
index 3869f048fa..c0b5f22731 100644
--- a/client/src/app/+videos/+video-edit/video-add.component.html
+++ b/client/src/app/+videos/+video-edit/video-add.component.html
@@ -1,98 +1,101 @@
<ng-template #AlertButtons>
@if (isContactFormEnabled) {
- <a i18n routerLink="/about/contact" class="peertube-button-link orange-button mt-2">Contact us</a>
+ <a i18n routerLink="/about/contact" class="peertube-button-link primary-button mt-2">Contact us</a>
} @else {
- <a i18n routerLink="/about/instance" class="peertube-button-link orange-button mt-2">Read instance rules for help</a>
+ <a i18n routerLink="/about/instance" class="peertube-button-link primary-button mt-2">Read instance rules for help</a>
}
</ng-template>
-<ng-container *ngIf="user.isUploadDisabled()">
- <my-alert class="upload-message upload-disabled" type="warning">
- <div>{{ uploadMessages?.noQuota }}</div>
- <ng-template [ngTemplateOutlet]="AlertButtons"></ng-template>
- </my-alert>
+@if (user.hasUploadDisabled()) {
+ <div class="margin-content">
+ <my-alert class="upload-message upload-disabled" type="warning">
+ <div>{{ uploadMessages?.noQuota }}</div>
+ <ng-template [ngTemplateOutlet]="AlertButtons"></ng-template>
+ </my-alert>
- <div class="upload-image">
- <img src="/client/assets/images/mascot/defeated.svg" alt="defeated mascot">
+ <div class="upload-image">
+ <img src="/client/assets/images/mascot/defeated.svg" alt="defeated mascot">
+ </div>
</div>
-</ng-container>
-
-<ng-container *ngIf="!user.isUploadDisabled()">
- <my-alert rounded="false" *ngIf="user.isAutoBlocked(serverConfig)" class="upload-message auto-blocked" type="warning">
- <div>{{ uploadMessages?.autoBlock }}</div>
- <ng-template [ngTemplateOutlet]="AlertButtons" *ngIf="!hasNoQuotaLeft && !hasNoQuotaLeftDaily"></ng-template>
- </my-alert>
-
- <my-alert rounded="false" *ngIf="hasNoQuotaLeftDaily" class="upload-message quota-daily-left" type="warning">
- <div>{{ uploadMessages?.quotaLeftDaily }}</div>
- <ng-template [ngTemplateOutlet]="AlertButtons" *ngIf="!hasNoQuotaLeft"></ng-template>
- </my-alert>
-
- <my-alert rounded="false" *ngIf="hasNoQuotaLeft" class="upload-message quota-left" type="warning">
- <div>{{ uploadMessages?.quotaLeft }}</div>
- <ng-template [ngTemplateOutlet]="AlertButtons"></ng-template>
- </my-alert>
-
- <my-alert rounded="false" *ngIf="isRootUser()" class="upload-message root-user root-user root-user" type="warning">
- <ng-container i18n>We recommend you to not use the <strong>root</strong> user to publish your videos, since it's the super-admin account of your instance.</ng-container>
-
- <br />
-
- <ng-container i18n>Instead, <a class="text-decoration-underline alert-link" routerLink="/admin/users">create a dedicated account</a> to upload your videos.</ng-container>
- </my-alert>
-</ng-container>
-
-<div *ngIf="!user.isUploadDisabled()" class="margin-content">
- <my-user-quota *ngIf="!isInSecondStep() || secondStepType === 'go-live'"></my-user-quota>
-
- <div class="title-page" *ngIf="isInSecondStep()">
- <ng-container *ngIf="secondStepType === 'import-url' || secondStepType === 'import-torrent'" i18n>Import {{ videoName }}</ng-container>
- <ng-container *ngIf="secondStepType === 'upload'" i18n>Upload {{ videoName }}</ng-container>
+} @else {
+ <div class="margin-content">
+ <my-alert *ngIf="user.isAutoBlocked(serverConfig)" class="upload-message auto-blocked" type="warning">
+ <div>{{ uploadMessages?.autoBlock }}</div>
+ <ng-template [ngTemplateOutlet]="AlertButtons" *ngIf="!hasNoQuotaLeft && !hasNoQuotaLeftDaily"></ng-template>
+ </my-alert>
+
+ <my-alert *ngIf="hasNoQuotaLeftDaily" class="upload-message quota-daily-left" type="warning">
+ <div>{{ uploadMessages?.quotaLeftDaily }}</div>
+ <ng-template [ngTemplateOutlet]="AlertButtons" *ngIf="!hasNoQuotaLeft"></ng-template>
+ </my-alert>
+
+ <my-alert *ngIf="hasNoQuotaLeft" class="upload-message quota-left" type="warning">
+ <div>{{ uploadMessages?.quotaLeft }}</div>
+ <ng-template [ngTemplateOutlet]="AlertButtons"></ng-template>
+ </my-alert>
+
+ <my-alert *ngIf="isRootUser()" class="upload-message root-user root-user root-user" type="warning">
+ <ng-container i18n>We recommend you to not use the <strong>root</strong> user to publish your videos, since it's the super-admin account of your instance.</ng-container>
+
+ <br />
+
+ <ng-container i18n>Instead, <a class="text-decoration-underline alert-link" routerLink="/admin/overview/users">create a dedicated account</a> to upload your videos.</ng-container>
+ </my-alert>
+
+ <my-channels-setup-message></my-channels-setup-message>
+
+ <my-user-quota *ngIf="!isInSecondStep() || secondStepType === 'go-live'"></my-user-quota>
+
+ <div class="title-page" *ngIf="isInSecondStep()">
+ @if (secondStepType === 'import-url' || secondStepType === 'import-torrent') {
+ <ng-container i18n>Import {{ videoName }}</ng-container>
+ } @else if (secondStepType === 'upload') {
+ <ng-container i18n>Upload {{ videoName }}</ng-container>
+ }
+ </div>
+
+ <div ngbNav #nav="ngbNav" class="nav-tabs video-add-nav" [activeId]="activeNav" (activeIdChange)="onNavChange($event)" [ngClass]="{ 'hide-nav': !!secondStepType }">
+ <ng-container ngbNavItem="upload">
+ <a ngbNavLink>
+ <span i18n>Upload a file</span>
+ </a>
+
+ <ng-template ngbNavContent>
+ <my-video-upload #videoUpload (firstStepDone)="onFirstStepDone('upload', $event)" (firstStepError)="onError()"></my-video-upload>
+ </ng-template>
+ </ng-container>
+
+ <ng-container ngbNavItem="import-url" *ngIf="isVideoImportHttpEnabled()">
+ <a ngbNavLink>
+ <span i18n>Import with URL</span>
+ </a>
+
+ <ng-template ngbNavContent>
+ <my-video-import-url #videoImportUrl (firstStepDone)="onFirstStepDone('import-url', $event)" (firstStepError)="onError()"></my-video-import-url>
+ </ng-template>
+ </ng-container>
+
+ <ng-container ngbNavItem="import-torrent" *ngIf="isVideoImportTorrentEnabled()">
+ <a ngbNavLink>
+ <span i18n>Import with torrent</span>
+ </a>
+
+ <ng-template ngbNavContent>
+ <my-video-import-torrent #videoImportTorrent (firstStepDone)="onFirstStepDone('import-torrent', $event)" (firstStepError)="onError()"></my-video-import-torrent>
+ </ng-template>
+ </ng-container>
+
+ <ng-container ngbNavItem="go-live" *ngIf="isVideoLiveEnabled()">
+ <a ngbNavLink>
+ <span i18n>Go live</span>
+ </a>
+
+ <ng-template ngbNavContent>
+ <my-video-go-live #videoGoLive (firstStepDone)="onFirstStepDone('go-live', $event)" (firstStepError)="onError()"></my-video-go-live>
+ </ng-template>
+ </ng-container>
+ </div>
+
+ <div class="nav-content" [ngbNavOutlet]="nav"></div>
</div>
-
- <my-channels-setup-message></my-channels-setup-message>
-
- <div ngbNav #nav="ngbNav" class="nav-tabs video-add-nav" [activeId]="activeNav" (activeIdChange)="onNavChange($event)" [ngClass]="{ 'hide-nav': !!secondStepType }">
- <ng-container ngbNavItem="upload">
- <a ngbNavLink>
- <span i18n>Upload a file</span>
- </a>
-
- <ng-template ngbNavContent>
- <my-video-upload #videoUpload (firstStepDone)="onFirstStepDone('upload', $event)" (firstStepError)="onError()"></my-video-upload>
- </ng-template>
- </ng-container>
-
- <ng-container ngbNavItem="import-url" *ngIf="isVideoImportHttpEnabled()">
- <a ngbNavLink>
- <span i18n>Import with URL</span>
- </a>
-
- <ng-template ngbNavContent>
- <my-video-import-url #videoImportUrl (firstStepDone)="onFirstStepDone('import-url', $event)" (firstStepError)="onError()"></my-video-import-url>
- </ng-template>
- </ng-container>
-
- <ng-container ngbNavItem="import-torrent" *ngIf="isVideoImportTorrentEnabled()">
- <a ngbNavLink>
- <span i18n>Import with torrent</span>
- </a>
-
- <ng-template ngbNavContent>
- <my-video-import-torrent #videoImportTorrent (firstStepDone)="onFirstStepDone('import-torrent', $event)" (firstStepError)="onError()"></my-video-import-torrent>
- </ng-template>
- </ng-container>
-
- <ng-container ngbNavItem="go-live" *ngIf="isVideoLiveEnabled()">
- <a ngbNavLink>
- <span i18n>Go live</span>
- </a>
-
- <ng-template ngbNavContent>
- <my-video-go-live #videoGoLive (firstStepDone)="onFirstStepDone('go-live', $event)" (firstStepError)="onError()"></my-video-go-live>
- </ng-template>
- </ng-container>
- </div>
-
- <div [ngbNavOutlet]="nav"></div>
-</div>
+}
diff --git a/client/src/app/+videos/+video-edit/video-add.component.scss b/client/src/app/+videos/+video-edit/video-add.component.scss
index 5e5f97fc92..d49e626b6d 100644
--- a/client/src/app/+videos/+video-edit/video-add.component.scss
+++ b/client/src/app/+videos/+video-edit/video-add.component.scss
@@ -2,9 +2,9 @@
@use '_mixins' as *;
@use 'nav' as *;
-$border-width: 3px;
+$border-width: 0;
$border-type: solid;
-$border-color: #EAEAEA;
+$border-color: #fff;
$nav-link-height: 40px;
.upload-message {
@@ -37,25 +37,21 @@ $nav-link-height: 40px;
}
}
-.margin-content {
- padding-top: 20px;
-}
-
-::ng-deep .video-add-nav {
+:host ::ng-deep .video-add-nav {
@include peertube-nav-tabs($border-width, $border-type, $border-color, $nav-link-height);
a.nav-link {
&.active {
- background-color: pvar(--submenuBackgroundColor) !important;
+ background-color: pvar(--bg-secondary-400) !important;
}
}
}
-::ng-deep .upload-video-container {
+:host ::ng-deep .upload-video-container {
border: $border-width $border-type $border-color;
border-top: transparent;
- background-color: pvar(--submenuBackgroundColor);
+ background-color: pvar(--bg-secondary-400);
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
width: 100%;
@@ -66,7 +62,7 @@ $nav-link-height: 40px;
padding-top: 20px;
&.dragover {
- border: 3px dashed pvar(--mainColor);
+ border: 3px dashed pvar(--primary);
}
}
@@ -80,7 +76,7 @@ $nav-link-height: 40px;
/* Hide active tab style to not have a moving tab effect */
a.nav-link.active {
border-color: transparent;
- background-color: pvar(--mainBackgroundColor) !important;
+ background-color: pvar(--bg) !important;
}
}
}
@@ -89,9 +85,3 @@ $nav-link-height: 40px;
@media screen and (max-width: $small-view) {
@include nav-scroll();
}
-
-@media screen and (max-width: #{$small-view + $menu-width}) {
- :host-context(.main-col:not(.expanded)) {
- @include nav-scroll();
- }
-}
diff --git a/client/src/app/+videos/+video-edit/video-update.component.html b/client/src/app/+videos/+video-edit/video-update.component.html
index b04147deee..9c7cd3fe01 100644
--- a/client/src/app/+videos/+video-edit/video-update.component.html
+++ b/client/src/app/+videos/+video-edit/video-update.component.html
@@ -1,8 +1,5 @@
<div class="margin-content">
- <div class="title-page">
- <span class="me-1" i18n>Update</span>
- <a [routerLink]="getVideoUrl()">{{ videoDetails?.name }}</a>
- </div>
+ <h1 class="title-page" i18n>Update {{ videoDetails?.name }}</h1>
<my-upload-progress
[isUploading]="isReplacingVideoFile" [uploadPercents]="videoUploadPercents" [error]="uploadError" [uploaded]="updateDone"
@@ -44,7 +41,7 @@
<div class="submit-container">
<my-button
- theme="orange" i18n-label label="Update" icon="circle-tick" (click)="update()" (keydown.enter)="update()"
+ theme="primary" i18n-label label="Update" icon="circle-tick" (click)="update()" (keydown.enter)="update()"
[disabled]="!form.valid || isUpdatingVideo === true"
></my-button>
</div>
diff --git a/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.html b/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.html
index 2382ae620a..d996e012bb 100644
--- a/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.html
+++ b/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.html
@@ -6,7 +6,7 @@
></my-video-rate>
<button
- *ngIf="video.support" (click)="showSupportModal()" (keyup.enter)="showSupportModal()" class="action-button action-button-support"
+ *ngIf="video.support" (click)="showSupportModal()" (keyup.enter)="showSupportModal()" class="action-button support-button"
[attr.aria-label]="tooltipSupport" [ngbTooltip]="tooltipSupport" placement="bottom auto"
>
<my-global-icon iconName="support" aria-hidden="true"></my-global-icon>
diff --git a/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.scss b/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.scss
index b518b1b254..a2b797180b 100644
--- a/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.scss
+++ b/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_button-mixins' as *;
.video-actions {
height: 40px; // Align with the title
@@ -9,59 +10,31 @@
margin: 0 auto;
max-width: initial;
- .action-button:not(:first-child),
- .action-dropdown,
- my-video-actions-dropdown {
- @include margin-left(5px);
- }
-
::ng-deep.action-button {
font-size: 100%;
- font-weight: $font-semibold;
display: inline-block;
- padding: 4px 10px;
white-space: nowrap;
- background-color: transparent !important;
- color: pvar(--actionButtonColor);
text-transform: uppercase;
@include peertube-button;
@include button-with-icon(21px, 0, -1px);
+ & { // Override some peertube-button properties
+ padding: 4px 13px;
+ background-color: transparent !important;
+ color: pvar(--fg-300);
+ }
+
&::after {
display: none;
}
&:hover {
- opacity: 0.9;
- }
-
- &.action-button-support {
- color: pvar(--supportButtonColor);
-
- my-global-icon {
- @include apply-svg-color(pvar(--supportButtonColor));
- }
- }
-
- &.action-button-support {
- my-global-icon {
- ::ng-deep path:first-child {
- fill: pvar(--supportButtonHeartColor) !important;
- }
- }
- }
-
- &.action-button-save,
- &.action-button-download {
- my-global-icon {
- top: 0 !important;
- right: -1px;
- }
+ opacity: 0.7;
}
.icon-text {
- @include margin-left(3px);
+ @include margin-right(0 !important);
}
}
}
@@ -91,12 +64,12 @@
background-color: #909090;
&.liked {
- background-color: pvar(--activatedActionButtonColor);
+ background-color: pvar(--fg-400);
}
}
}
-@media screen and (max-width: 450px) {
+@media screen and (max-width: $small-view) {
.action-button .icon-text {
display: none !important;
}
diff --git a/client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.scss b/client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.scss
index f4f696f33c..b43ad6a6cd 100644
--- a/client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.scss
+++ b/client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.scss
@@ -3,13 +3,11 @@
.action-button-like,
.action-button-dislike {
- filter: brightness(120%);
-
.count {
margin: 0 5px;
}
}
.activated {
- color: pvar(--activatedActionButtonColor) !important;
+ color: pvar(--fg) !important;
}
diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.html b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.html
index 1021c5e417..80ccd23ed7 100644
--- a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.html
+++ b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.html
@@ -46,13 +46,15 @@
</div>
<div class="comment-buttons">
- <button *ngIf="isAddButtonDisplayed()" class="peertube-button tertiary-button cancel-button" (click)="cancelCommentReply()" type="button" i18n>
- Cancel
- </button>
+ @if (isAddButtonDisplayed()) {
+ <button class="peertube-button tertiary-button cancel-button me-2" (click)="cancelCommentReply()" type="button" i18n>
+ Cancel
+ </button>
- <button *ngIf="isAddButtonDisplayed()" class="peertube-button orange-button" [disabled]="!form.valid || addingComment">
- {{ addingCommentButtonValue }}
- </button>
+ <button class="peertube-button primary-button" [disabled]="!form.valid || addingComment">
+ {{ addingCommentButtonValue }}
+ </button>
+ }
</div>
</form>
@@ -75,11 +77,11 @@
<div class="modal-footer inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="hideModals()" (key.enter)="hideModals()"
>
- <my-login-link i18n-label label="Login to comment" className="peertube-button-link orange-button"></my-login-link>
+ <my-login-link i18n-label label="Login to comment" className="peertube-button-link primary-button"></my-login-link>
</div>
</ng-template>
diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.scss b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.scss
index 3f715fd677..d59fc6498a 100644
--- a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.scss
+++ b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.scss
@@ -1,5 +1,7 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_button-mixins' as *;
+@use '_form-mixins' as *;
$markdown-icon-height: 18px;
$markdown-icon-width: 30px;
@@ -26,7 +28,6 @@ form {
min-height: calc(#{$peertube-textarea-height} - 15px * 2);
@include peertube-textarea(100%, $peertube-textarea-height);
- @include button-focus(pvar(--mainColorLightest));
@include padding-right($markdown-icon-width + 15px !important);
@media screen and (max-width: 600px) {
@@ -52,24 +53,17 @@ form {
::ng-deep .help-tooltip-button {
my-global-icon {
+ color: pvar(--input-placeholder);
height: $markdown-icon-height;
width: $markdown-icon-width;
svg {
- color: pvar(--inputBorderColor);
- fill: pvar(--inputBorderColor);
border-radius: 3px;
}
}
- &:focus,
- &:active,
- &:hover {
- my-global-icon svg {
- background-color: pvar(--inputBorderColor);
- color: pvar(--mainBackgroundColor);
- fill: pvar(--mainBackgroundColor);
- }
+ &:focus my-global-icon {
+ color: pvar(--input-fg);
}
}
}
diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.scss b/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.scss
index fe19706282..3175dc2b59 100644
--- a/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.scss
+++ b/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.scss
@@ -32,8 +32,8 @@
.highlighted-comment {
display: inline-block;
- background-color: pvar(--greySecondaryBackgroundColor);
- color: pvar(--mainForegroundColor);
+ background-color: pvar(--bg-secondary-400);
+ color: pvar(--fg);
padding: 0 5px;
font-size: 13px;
margin-bottom: 5px;
@@ -48,7 +48,8 @@
.video-author {
height: 20px;
- background-color: #888888;
+ background-color: pvar(--bg-secondary-400);
+ color: pvar(--fg);
border-radius: 12px;
margin-bottom: 2px;
max-width: 100%;
@@ -56,7 +57,6 @@
flex-direction: row;
align-items: center;
display: inline-flex;
- color: #fff !important;
@include padding-right(6px);
@include padding-left(6px);
@@ -68,7 +68,7 @@
font-size: 90%;
a {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
@include disable-default-a-behaviour;
@@ -78,13 +78,13 @@
}
.comment-account-fid {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
}
}
.comment-date {
font-size: 90%;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
text-decoration: none;
@include margin-left(5px);
@@ -101,7 +101,7 @@
::ng-deep a {
&:not(.linkified-url) {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
font-weight: $font-semibold;
@@ -116,7 +116,7 @@
}
&.comment-html-deleted {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
margin-bottom: 1rem;
}
}
@@ -127,7 +127,7 @@
::ng-deep .dropdown-toggle,
.comment-action-reply {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
cursor: pointer;
@include margin-right(10px);
@@ -136,7 +136,7 @@
&:active,
&:focus,
&:focus-visible {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
}
}
diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.html b/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.html
index b2cbd01f63..1eea9f3fd0 100644
--- a/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.html
+++ b/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.html
@@ -1,15 +1,16 @@
<div>
<div class="title-block">
- <h2 class="title-page">
+ <h2>
{totalNotDeletedComments, plural, =0 {Comments} =1 {1 Comment} other {{{totalNotDeletedComments}} Comments}}
</h2>
<my-feed [syndicationItems]="syndicationItems"></my-feed>
- <div ngbDropdown class="d-inline-block ms-4 dropdown-root">
- <button class="btn btn-sm btn-outline-secondary" id="dropdown-sort-comments" ngbDropdownToggle i18n>
+ <div ngbDropdown class="d-inline-block ms-auto dropdown-root">
+ <button class="peertube-button tertiary-button" id="dropdown-sort-comments" ngbDropdownToggle i18n>
SORT BY
</button>
+
<div ngbDropdownMenu aria-labelledby="dropdown-sort-comments">
<button (click)="handleSortChange('-createdAt')" ngbDropdownItem i18n>Most recent first (default)</button>
<button (click)="handleSortChange('-totalReplies')" ngbDropdownItem i18n>Most replies first</button>
diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.scss b/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.scss
index a76eee96e7..bea6d42346 100644
--- a/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.scss
+++ b/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.scss
@@ -16,16 +16,19 @@
}
.title-block {
- .title-page {
- @include margin-right(0);
+ > h2 {
+ display: inline-block;
+ margin-bottom: 1.5rem;
+
+ @include font-size(1.25rem);
}
my-feed {
display: inline-block;
transition: ease-in .2s opacity;
width: 12px;
- position: relative;
- top: -3px;
+ height: 12px;
+ line-height: 12px;
@include margin-left(5px);
}
diff --git a/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.html b/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.html
index 93c4ba7a72..eef543b9ff 100644
--- a/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.html
+++ b/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.html
@@ -7,10 +7,10 @@
</ng-container>
</span>
- <a i18n i18n-title title="Get more information" target="_blank" rel="noopener noreferrer" href="/about/peertube#privacy">More information</a>
+ <a class="link-primary" i18n i18n-title title="Get more information" target="_blank" rel="noopener noreferrer" href="/about/peertube#privacy">More information</a>
</div>
- <button i18n class="ms-2 peertube-button orange-button" (click)="acceptedPrivacyConcern()">
+ <button i18n class="ms-2 peertube-button primary-button" (click)="acceptedPrivacyConcern()">
OK
</button>
</div>
diff --git a/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.scss b/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.scss
index bd4fb5d520..24031ae022 100644
--- a/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.scss
+++ b/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.scss
@@ -5,10 +5,11 @@
position: fixed;
bottom: 0;
- width: calc(100% - #{$menu-width});
+ width: calc(100% - #{$menu-width} - (#{pvar(--x-margin-content)} * 2));
z-index: z(privacymsg);
padding: 5px 15px;
+ border-radius: 5px 5px 0 0;
display: flex;
flex-wrap: nowrap;
@@ -16,27 +17,8 @@
justify-content: space-between;
background-color: rgba(0, 0, 0, 0.9);
color: #fff;
-}
-
-// If the view is expanded
-:host-context(.expanded) {
- .privacy-concerns {
- width: 100%;
- }
-}
-
-// Avoid higher z-index when overlay on touchscreens
-:host-context(.menu-open) {
- .privacy-concerns {
- z-index: z(overlay) - 1;
- }
-}
-// Or if we are in the small view
-@media screen and (max-width: $small-view) {
- .privacy-concerns {
- width: 100%;
- }
+ @include margin-left(pvar(--x-margin-content));
}
.privacy-concerns-text {
@@ -44,23 +26,21 @@
}
a {
- color: pvar(--mainColor);
- transition: color 0.3s;
-
- @include disable-default-a-behaviour;
+ color: #fff;
+}
- &:hover {
- color: pvar(--mainBackgroundColor);
+:host-context(.main-col.expanded) {
+ .privacy-concerns {
+ width: calc(100% - #{$menu-collapsed-width} - (#{pvar(--x-margin-content)} * 2));
}
}
-@media screen and (max-width: 1300px) {
+// Or if we are in the small view
+@media screen and (max-width: $mobile-view) {
.privacy-concerns {
- font-size: 12px;
- padding: 2px 5px;
- }
+ width: 100% !important;
+ border-radius: 0 !important;
- .privacy-concerns-text {
- margin: 0;
+ @include margin-left(0 !important);
}
}
diff --git a/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts b/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts
index 0ee4b10bcd..bc3c52af2a 100644
--- a/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts
+++ b/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts
@@ -13,7 +13,7 @@ import { NgIf } from '@angular/common'
imports: [ NgIf ]
})
export class PrivacyConcernsComponent implements OnInit {
- private static LOCAL_STORAGE_PRIVACY_CONCERN_KEY = 'video-watch-privacy-concern'
+ private static LS_PRIVACY_CONCERN_KEY = 'video-watch-privacy-concern'
@Input() video: Video
@@ -34,7 +34,7 @@ export class PrivacyConcernsComponent implements OnInit {
}
acceptedPrivacyConcern () {
- peertubeLocalStorage.setItem(PrivacyConcernsComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY, 'true')
+ peertubeLocalStorage.setItem(PrivacyConcernsComponent.LS_PRIVACY_CONCERN_KEY, 'true')
this.display = false
}
@@ -46,6 +46,6 @@ export class PrivacyConcernsComponent implements OnInit {
}
private alreadyAccepted () {
- return peertubeLocalStorage.getItem(PrivacyConcernsComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY) === 'true'
+ return peertubeLocalStorage.getItem(PrivacyConcernsComponent.LS_PRIVACY_CONCERN_KEY) === 'true'
}
}
diff --git a/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.scss b/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.scss
index 1e120e6630..01967e0a7a 100644
--- a/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.scss
+++ b/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.scss
@@ -10,14 +10,14 @@
.attribute-label {
min-width: 142px;
display: inline-block;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
font-weight: $font-bold;
@include padding-right(5px);
}
a.attribute-value {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
@include disable-default-a-behaviour;
diff --git a/client/src/app/+videos/+video-watch/shared/metadata/video-description.component.scss b/client/src/app/+videos/+video-watch/shared/metadata/video-description.component.scss
index 081fa0cfb9..aa51dd4ea0 100644
--- a/client/src/app/+videos/+video-watch/shared/metadata/video-description.component.scss
+++ b/client/src/app/+videos/+video-watch/shared/metadata/video-description.component.scss
@@ -29,7 +29,7 @@
.video-info-description-more {
cursor: pointer;
font-weight: $font-semibold;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
margin-top: 1rem;
@include font-size(14px);
diff --git a/client/src/app/+videos/+video-watch/shared/player-widgets/player-widget.component.scss b/client/src/app/+videos/+video-watch/shared/player-widgets/player-widget.component.scss
index 13163d4ee6..a4e7654918 100644
--- a/client/src/app/+videos/+video-watch/shared/player-widgets/player-widget.component.scss
+++ b/client/src/app/+videos/+video-watch/shared/player-widgets/player-widget.component.scss
@@ -7,12 +7,12 @@
width: 25vw;
max-width: 470px;
height: 66vh;
- background-color: pvar(--mainBackgroundColor);
+ background-color: pvar(--bg);
overflow-y: auto;
border-bottom: 1px solid $separator-border-color;
.widget-header {
- background-color: pvar(--submenuBackgroundColor);
+ background-color: pvar(--bg-secondary-400);
padding: 1rem 2rem;
}
diff --git a/client/src/app/+videos/+video-watch/shared/player-widgets/video-transcription.component.scss b/client/src/app/+videos/+video-watch/shared/player-widgets/video-transcription.component.scss
index c3122dc010..e1fcbc43d8 100644
--- a/client/src/app/+videos/+video-watch/shared/player-widgets/video-transcription.component.scss
+++ b/client/src/app/+videos/+video-watch/shared/player-widgets/video-transcription.component.scss
@@ -1,10 +1,11 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
.segment {
&.active,
&:hover {
- background: pvar(--mainBackgroundHoverColor);
+ background: pvar(--bg-secondary-300);
}
}
diff --git a/client/src/app/+videos/+video-watch/shared/player-widgets/video-watch-playlist.component.scss b/client/src/app/+videos/+video-watch/shared/player-widgets/video-watch-playlist.component.scss
index 24c9fb5c06..1e1336ffca 100644
--- a/client/src/app/+videos/+video-watch/shared/player-widgets/video-watch-playlist.component.scss
+++ b/client/src/app/+videos/+video-watch/shared/player-widgets/video-watch-playlist.component.scss
@@ -5,7 +5,7 @@
.playlist {
.playlist-by-index {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
display: flex;
.playlist-by {
diff --git a/client/src/app/+videos/+video-watch/shared/recommendations/recommended-videos.component.html b/client/src/app/+videos/+video-watch/shared/recommendations/recommended-videos.component.html
index 834412645f..82c63809bf 100644
--- a/client/src/app/+videos/+video-watch/shared/recommendations/recommended-videos.component.html
+++ b/client/src/app/+videos/+video-watch/shared/recommendations/recommended-videos.component.html
@@ -1,7 +1,7 @@
<div class="other-videos" [ngClass]="{ 'display-as-row': displayAsRow }">
@if (videos.length !== 0) {
<div class="title-page-container">
- <h2 i18n class="title-page">Other videos</h2>
+ <h2 i18n>Other videos</h2>
<div
*ngIf="!playlist" class="title-page-autoplay"
diff --git a/client/src/app/+videos/+video-watch/shared/recommendations/recommended-videos.component.scss b/client/src/app/+videos/+video-watch/shared/recommendations/recommended-videos.component.scss
index 998d03864f..b41229ebca 100644
--- a/client/src/app/+videos/+video-watch/shared/recommendations/recommended-videos.component.scss
+++ b/client/src/app/+videos/+video-watch/shared/recommendations/recommended-videos.component.scss
@@ -8,9 +8,10 @@
margin-bottom: 25px;
flex-wrap: wrap-reverse;
- .title-page {
- margin-bottom: unset;
+ > h2 {
+ margin-bottom: 0;
margin-top: 0;
+ font-size: 1.25rem;
@include margin-right(.5rem !important);
}
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 d692cc1c03..4fd54c14e8 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.html
+++ b/client/src/app/+videos/+video-watch/video-watch.component.html
@@ -1,38 +1,40 @@
<div class="root" [ngClass]="{ 'theater-enabled': theaterEnabled }" [hidden]="!playlist && !video">
- <!-- We need the video container for videojs so we just hide it -->
- <div id="video-wrapper">
- <div *ngIf="remoteServerDown" class="remote-server-down">
- <ng-container i18n>Sorry, but this video did not load because the remote instance did not respond.</ng-container>
+ <div class="margin-content player-margin-content">
+ <!-- We need the video container for videojs so we just hide it -->
+ <div id="video-wrapper">
+ <div *ngIf="remoteServerDown" class="remote-server-down">
+ <ng-container i18n>Sorry, but this video did not load because the remote instance did not respond.</ng-container>
- <br />
+ <br />
- <ng-container i18n>Please try refreshing the page, or try again later.</ng-container>
- </div>
+ <ng-container i18n>Please try refreshing the page, or try again later.</ng-container>
+ </div>
- <div id="videojs-wrapper">
- <video #playerElement class="video-js vjs-peertube-skin" playsinline="true"></video>
- </div>
+ <div id="videojs-wrapper">
+ <video #playerElement class="video-js vjs-peertube-skin" playsinline="true"></video>
+ </div>
- <div class="player-widget-component">
- <my-video-watch-playlist
- #videoWatchPlaylist [playlist]="playlist"
- [hidden]="transcriptionWidgetOpened"
- (noVideoFound)="onPlaylistNoVideoFound()" (videoFound)="onPlaylistVideoFound($event)"
- ></my-video-watch-playlist>
-
- @if (transcriptionWidgetOpened) {
- <my-video-transcription
- [video]="video" [captions]="videoCaptions" [currentTime]="getCurrentTime()"
- (segmentClicked)="handleTimestampClicked($event)" (closeTranscription)="transcriptionWidgetOpened = false"
- ></my-video-transcription>
- }
+ <div class="player-widget-component">
+ <my-video-watch-playlist
+ #videoWatchPlaylist [playlist]="playlist"
+ [hidden]="transcriptionWidgetOpened"
+ (noVideoFound)="onPlaylistNoVideoFound()" (videoFound)="onPlaylistVideoFound($event)"
+ ></my-video-watch-playlist>
+
+ @if (transcriptionWidgetOpened) {
+ <my-video-transcription
+ [video]="video" [captions]="videoCaptions" [currentTime]="getCurrentTime()"
+ (segmentClicked)="handleTimestampClicked($event)" (closeTranscription)="transcriptionWidgetOpened = false"
+ ></my-video-transcription>
+ }
+ </div>
+
+ <my-plugin-placeholder pluginId="player-next"></my-plugin-placeholder>
</div>
- <my-plugin-placeholder pluginId="player-next"></my-plugin-placeholder>
+ <my-video-alert [video]="video" [user]="user" [noPlaylistVideoFound]="noPlaylistVideoFound"></my-video-alert>
</div>
- <my-video-alert [video]="video" [user]="user" [noPlaylistVideoFound]="noPlaylistVideoFound"></my-video-alert>
-
<!-- Video information -->
<div *ngIf="video" class="margin-content video-bottom">
<div class="video-info">
@@ -105,7 +107,7 @@
<my-video-attributes [video]="video"></my-video-attributes>
<my-video-comments
- class="border-top"
+ class="border-top pt-3"
[video]="video"
[videoPassword]="videoPassword"
[user]="user"
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 61cd4206db..fc3b7538d9 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.scss
+++ b/client/src/app/+videos/+video-watch/video-watch.component.scss
@@ -5,7 +5,7 @@
@use '_miniature' as *;
$video-default-height: 66vh;
-$video-max-height: calc(100vh - #{$header-height} - #{$theater-bottom-space});
+$video-max-height: calc(100vh - #{pvar(--header-height)} - #{$theater-bottom-space});
@mixin player-widget-below-player {
width: 100% !important;
@@ -40,7 +40,7 @@ $video-max-height: calc(100vh - #{$header-height} - #{$theater-bottom-space});
}
::ng-deep .video-js {
- --player-height: #{$video-max-height};
+ --co-player-height: #{$video-max-height};
}
.player-widget-component ::ng-deep .widget-root {
@@ -53,6 +53,7 @@ $video-max-height: calc(100vh - #{$header-height} - #{$theater-bottom-space});
background-color: #000;
display: flex;
justify-content: center;
+ border-radius:5px;
#videojs-wrapper {
display: flex;
@@ -62,16 +63,16 @@ $video-max-height: calc(100vh - #{$header-height} - #{$theater-bottom-space});
}
::ng-deep .video-js {
- --player-height: #{$video-default-height};
- --player-portrait-mode: 0;
+ --co-player-height: #{$video-default-height};
+ --co-player-portrait-mode: 0;
// Default player ratio, redefined by the player to automatically adapt player size
- --player-ratio: #{math.div(16, 9)};
+ --co-player-ratio: #{math.div(16, 9)};
width: 100%;
- height: var(--player-height);
+ height: var(--co-player-height);
// Can be recalculated by the player depending on video ratio
- max-width: calc(var(--player-height) * var(--player-ratio));
+ max-width: calc(var(--co-player-height) * var(--co-player-ratio));
// VideoJS create an inner video player
video {
@@ -159,7 +160,7 @@ $video-max-height: calc(100vh - #{$header-height} - #{$theater-bottom-space});
font-weight: $font-semibold;
a {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
@include disable-default-a-behaviour;
@include peertube-word-wrap;
@@ -253,10 +254,10 @@ my-video-comments {
.remote-server-down,
::ng-deep .video-js {
- --player-portrait-mode: 1;
- --player-height: calc(100vw / var(--player-ratio)) !important;
+ --co-player-portrait-mode: 1;
+ --co-player-height: calc(100vw / var(--co-player-ratio)) !important;
- max-height: calc(100vh - #{$header-height} - #{$player-portrait-bottom-space});
+ max-height: calc(100vh - #{pvar(--header-height)} - #{$player-portrait-bottom-space});
}
}
@@ -275,7 +276,11 @@ my-video-comments {
}
}
-@media screen and (max-width: 450px) {
+@media screen and (max-width: $mobile-view) {
+ .margin-content.player-margin-content {
+ margin: 0 !important;
+ }
+
.video-info-name {
font-size: 18px;
}
diff --git a/client/src/app/+videos/routes.ts b/client/src/app/+videos/routes.ts
index 66a4a649bd..d1bf29b72d 100644
--- a/client/src/app/+videos/routes.ts
+++ b/client/src/app/+videos/routes.ts
@@ -1,13 +1,14 @@
-import { UrlSegment } from '@angular/router'
-import { LoginGuard } from '@app/core'
-import { OverviewService, VideosListCommonPageComponent } from './video-list'
-import { VideoOverviewComponent } from './video-list/overview/video-overview.component'
-import { VideoUserSubscriptionsComponent } from './video-list/video-user-subscriptions.component'
+import { inject } from '@angular/core'
+import { Routes } from '@angular/router'
+import { LoginGuard, RedirectService } from '@app/core'
+import { AbuseService } from '@app/shared/shared-moderation/abuse.service'
import { BlocklistService } from '@app/shared/shared-moderation/blocklist.service'
import { VideoBlockService } from '@app/shared/shared-moderation/video-block.service'
import { UserSubscriptionService } from '@app/shared/shared-user-subscription/user-subscription.service'
import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-playlist.service'
-import { AbuseService } from '@app/shared/shared-moderation/abuse.service'
+import { OverviewService, VideosListAllComponent } from './video-list'
+import { VideoOverviewComponent } from './video-list/overview/video-overview.component'
+import { VideoUserSubscriptionsComponent } from './video-list/video-user-subscriptions.component'
export default [
{
@@ -27,30 +28,44 @@ export default [
data: {
meta: {
title: $localize`Discover videos`
+ },
+ reuse: {
+ enabled: true,
+ key: 'videos-discover'
}
}
},
+ // ---------------------------------------------------------------------------
+ // Old URL redirections
+ // ---------------------------------------------------------------------------
{
- // Old URL redirection
path: 'most-liked',
- redirectTo: 'trending?sort=most-liked'
+ redirectTo: 'browse?scope=federated&sort=-likes'
},
{
- matcher: (url: UrlSegment[]) => {
- if (url.length === 1 && [ 'recently-added', 'trending', 'local' ].includes(url[0].path)) {
- return {
- consumed: url,
- posParams: {
- page: new UrlSegment(url[0].path, {})
- }
- }
- }
+ path: 'trending',
+ redirectTo: () => {
+ const redirectService = inject(RedirectService)
- return null
- },
+ return 'browse?scope=federated&sort=-' + redirectService.getDefaultTrendingSort()
+ }
+ },
+ {
+ path: 'recently-added',
+ redirectTo: 'browse?scope=federated&sort=-publishedAt'
+ },
+ {
+ path: 'local',
+ redirectTo: 'browse?scope=local&sort=-publishedAt'
+ },
+
+ // ---------------------------------------------------------------------------
+
+ {
+ path: 'browse',
- component: VideosListCommonPageComponent,
+ component: VideosListAllComponent,
data: {
reuse: {
enabled: true,
@@ -75,4 +90,4 @@ export default [
}
]
}
-]
+] satisfies Routes
diff --git a/client/src/app/+videos/video-list/index.ts b/client/src/app/+videos/video-list/index.ts
index 3492f43f45..1ca0d61c5f 100644
--- a/client/src/app/+videos/video-list/index.ts
+++ b/client/src/app/+videos/video-list/index.ts
@@ -1,2 +1,2 @@
export * from './overview'
-export * from './videos-list-common-page.component'
+export * from './videos-list-all.component'
diff --git a/client/src/app/+videos/video-list/overview/video-overview.component.html b/client/src/app/+videos/video-list/overview/video-overview.component.html
index b38516af82..6c07fecf01 100644
--- a/client/src/app/+videos/video-list/overview/video-overview.component.html
+++ b/client/src/app/+videos/video-list/overview/video-overview.component.html
@@ -1,52 +1,43 @@
<h1 class="visually-hidden" i18n>Discover</h1>
-<div class="margin-content">
- <div class="no-results" i18n *ngIf="notResults">No results.</div>
+@if (notResults) {
+ <div class="margin-content no-results" i18n>No results.</div>
+} @else {
+ <div class="margin-content quick-access mt-3">
+ <div #quickAccessContent class="quick-access-links" [ngClass]="{ 'see-all-quick-links': seeAllQuickLinks }">
+ <span class="me-2 fg-100">Quick access:</span>
+
+ @for (quickAccess of quickAccessLinks; track quickAccess.label) {
+ <a class="me-2" [routerLink]="quickAccess.routerLink" [queryParams]="quickAccess.queryParams">{{ quickAccess.label }}</a>
+ }
+ </div>
+
+ <button *ngIf="!seeAllQuickLinks && quickAccessOverflow" type="button" class="peertube-button tertiary-button" (click)="seeAllQuickLinks = true" i18n>More</button>
+ </div>
<div
- myInfiniteScroller (nearOfBottom)="onNearOfBottom()" [dataObservable]="onDataSubject.asObservable()"
+ class="margin-content videos-margin-content"
+ myInfiniteScroller (nearOfBottom)="onNearOfBottom()"
+ [dataObservable]="onDataSubject.asObservable()" setAngularState="true" [parentDisabled]="disabled"
>
- <ng-container *ngFor="let overview of overviews">
+ <div class="section videos" *ngFor="let object of objects">
- <div class="section videos" *ngFor="let object of overview.categories">
+ <div class="section-header d-flex flex-wrap justify-content-between align-items-start mb-3">
<h1 class="section-title">
- <a class="link-orange" routerLink="/search" [queryParams]="{ categoryOneOf: [ object.category.id ] }">{{ object.category.label }}</a>
- </h1>
+ <my-actor-avatar *ngIf="object.channel" size="40px" actorType="channel" [actor]="object.channel"></my-actor-avatar>
- <div class="video-wrapper" *ngFor="let video of buildVideos(object.videos)">
- <my-video-miniature [video]="video" [user]="userMiniature" [displayVideoActions]="true">
- </my-video-miniature>
- </div>
- </div>
+ <a class="text-fg border-highlight text-decoration-none" routerLink="/search" [queryParams]="object.queryParams">{{ object.label }}</a>
- <div class="section videos" *ngFor="let object of overview.tags">
- <h2 class="section-title">
- <a class="link-orange" routerLink="/search" [queryParams]="{ tagsOneOf: [ object.tag ] }">#{{ object.tag }}</a>
- </h2>
+ <span class="fg-100 fs-7 mx-2">·</span>
+ <span i18n class="fg-100 fs-7">{{ object.type }}</span>
+ </h1>
- <div class="video-wrapper" *ngFor="let video of buildVideos(object.videos)">
- <my-video-miniature [video]="video" [user]="userMiniature" [displayVideoActions]="true">
- </my-video-miniature>
- </div>
+ <my-button class="ms-2 d-none-mw" theme="primary" [routerLink]="object.routerLink" [queryParams]="object.queryParams">{{ object.buttonLabel }}</my-button>
</div>
- <div class="section channel videos" *ngFor="let object of overview.channels">
- <div class="section-title">
- <a class="link-orange" [routerLink]="[ '/c', buildVideoChannelBy(object) ]">
- <my-actor-avatar [actor]="buildVideoChannel(object)" actorType="channel" size="28"></my-actor-avatar>
-
- <h2 class="section-title">{{ object.channel.displayName }}</h2>
- </a>
- </div>
-
- <div class="video-wrapper" *ngFor="let video of buildVideos(object.videos)">
- <my-video-miniature [video]="video" [user]="userMiniature" [displayVideoActions]="true">
- </my-video-miniature>
- </div>
+ <div class="video-wrapper" *ngFor="let video of object.videos">
+ <my-video-miniature [video]="video" [user]="userMiniature" [displayVideoActions]="true"></my-video-miniature>
</div>
-
- </ng-container>
-
+ </div>
</div>
-
-</div>
+}
diff --git a/client/src/app/+videos/video-list/overview/video-overview.component.scss b/client/src/app/+videos/video-list/overview/video-overview.component.scss
index 6b78f310f0..3700a00761 100644
--- a/client/src/app/+videos/video-list/overview/video-overview.component.scss
+++ b/client/src/app/+videos/video-list/overview/video-overview.component.scss
@@ -2,53 +2,72 @@
@use '_mixins' as *;
@use '_miniature' as *;
-.section-title {
+.section-header {
// make the element span a full grid row within .videos grid
grid-column: 1 / -1;
}
-.margin-content {
- @include grid-videos-miniature-layout-with-margins;
+.section-title,
+.section-header {
+ display: flex;
+ align-items: center
}
-.section {
- &:first-child {
- padding-top: 15px;
-
- .section-title {
- border-top: 0 !important;
- }
- }
+.section-title {
+ @include font-size(1.5rem);
+ @include margin-bottom(2rem);
+}
- .section-title {
- @include font-size(1.5rem);
- @include padding-top(1.25rem);
- @include margin-bottom(2rem);
+.margin-content.videos-margin-content {
+ @include grid-videos-miniature-layout-with-margins($rows-limit: 2);
+}
- &:not(h2) {
- border-top: 1px solid $separator-border-color;
- }
+.quick-access {
+ display: flex;
+ align-items: center;
+ justify-content: start;
+ white-space: nowrap;
+}
- a > h2 {
- margin-bottom: 0;
- display: inline-block;
- font-weight: $font-bold;
- }
+.quick-access-links {
- my-actor-avatar {
- display: inline-block;
- vertical-align: text-top;
+ a {
+ color: pvar(--fg-300);
+ text-decoration: underline;
- @include margin-right(8px);
+ &:hover {
+ opacity: 0.8;
}
}
+ &:not(.see-all-quick-links) {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+}
+
+.see-all-quick-links {
+ white-space: normal;
+ display: flex;
+ flex-wrap: wrap;
+}
+
+.section {
+ @include rfs(2.5rem, margin-top);
+
@media screen and (max-width: $mobile-view) {
max-height: initial;
overflow: initial;
.section-title {
- @include margin-left(10px);
+ @include margin-left(pvar(--x-margin-content));
}
}
}
+
+my-actor-avatar {
+ width: 40px;
+ height: 40px;
+
+ @include margin-right(10px);
+}
diff --git a/client/src/app/+videos/video-list/overview/video-overview.component.ts b/client/src/app/+videos/video-list/overview/video-overview.component.ts
index f5bf7dba05..512b10772b 100644
--- a/client/src/app/+videos/video-list/overview/video-overview.component.ts
+++ b/client/src/app/+videos/video-list/overview/video-overview.component.ts
@@ -1,35 +1,63 @@
-import { Subject, Subscription, switchMap } from 'rxjs'
-import { Component, OnDestroy, OnInit } from '@angular/core'
-import { Notifier, ScreenService, User, UserService } from '@app/core'
-import { Video } from '@app/shared/shared-main/video/video.model'
-import { OverviewService } from './overview.service'
-import { VideosOverview } from './videos-overview.model'
-import { ActorAvatarComponent } from '../../../shared/shared-actor-image/actor-avatar.component'
-import { VideoMiniatureComponent } from '../../../shared/shared-video-miniature/video-miniature.component'
+import { CommonModule } from '@angular/common'
+import { AfterViewChecked, ChangeDetectorRef, Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core'
import { RouterLink } from '@angular/router'
+import { DisableForReuseHook, Notifier, User, UserService } from '@app/core'
+import { ActorAvatarComponent, ActorAvatarInput } from '@app/shared/shared-actor-image/actor-avatar.component'
+import { ButtonComponent } from '@app/shared/shared-main/buttons/button.component'
+import { Video } from '@app/shared/shared-main/video/video.model'
+import { Subject, Subscription, switchMap } from 'rxjs'
import { InfiniteScrollerDirective } from '../../../shared/shared-main/common/infinite-scroller.directive'
-import { NgIf, NgFor } from '@angular/common'
+import { VideoMiniatureComponent } from '../../../shared/shared-video-miniature/video-miniature.component'
+import { OverviewService } from './overview.service'
@Component({
selector: 'my-video-overview',
templateUrl: './video-overview.component.html',
styleUrls: [ './video-overview.component.scss' ],
standalone: true,
- imports: [ NgIf, InfiniteScrollerDirective, NgFor, RouterLink, VideoMiniatureComponent, ActorAvatarComponent ]
+ imports: [
+ InfiniteScrollerDirective,
+ RouterLink,
+ VideoMiniatureComponent,
+ ButtonComponent,
+ CommonModule,
+ ActorAvatarComponent
+ ]
})
-export class VideoOverviewComponent implements OnInit, OnDestroy {
+export class VideoOverviewComponent implements OnInit, OnDestroy, AfterViewChecked, DisableForReuseHook {
+ @ViewChild('quickAccessContent') quickAccessContent: ElementRef
+
onDataSubject = new Subject<any>()
- overviews: VideosOverview[] = []
notResults = false
userMiniature: User
+ objects: {
+ label: string
+
+ type: string
+ buttonLabel: string
+ videos: Video[]
+
+ channel?: ActorAvatarInput
+
+ queryParams: Record<string, any>
+ routerLink: string[]
+ }[] = []
+
+ quickAccessLinks: typeof this.objects = []
+ seeAllQuickLinks = false
+ quickAccessOverflow = false
+
+ disabled = false
+
private loaded = false
private currentPage = 1
private maxPage = 20
private lastWasEmpty = false
private isLoading = false
+ private checkQuickAccessOverflow = false
private userSub: Subscription
@@ -37,7 +65,7 @@ export class VideoOverviewComponent implements OnInit, OnDestroy {
private notifier: Notifier,
private userService: UserService,
private overviewService: OverviewService,
- private screenService: ScreenService
+ private cd: ChangeDetectorRef
) { }
ngOnInit () {
@@ -51,7 +79,7 @@ export class VideoOverviewComponent implements OnInit, OnDestroy {
.subscribe(user => {
this.userMiniature = user
- this.overviews = []
+ this.objects = []
this.loadMoreResults()
})
}
@@ -60,24 +88,30 @@ export class VideoOverviewComponent implements OnInit, OnDestroy {
if (this.userSub) this.userSub.unsubscribe()
}
- buildVideoChannelBy (object: { videos: Video[] }) {
- return object.videos[0].byVideoChannel
- }
+ ngAfterViewChecked () {
+ if (this.quickAccessOverflow) return
+ if (!this.checkQuickAccessOverflow) return
+
+ this.checkQuickAccessOverflow = false
- buildVideoChannel (object: { videos: Video[] }) {
- return object.videos[0].channel
+ const el = this.quickAccessContent.nativeElement as HTMLElement
+ this.quickAccessOverflow = el.scrollWidth > el.clientWidth
+ this.cd.detectChanges()
}
- buildVideos (videos: Video[]) {
- const numberOfVideos = this.screenService.getNumberOfAvailableMiniatures()
+ disableForReuse () {
+ this.disabled = true
+ }
- return videos.slice(0, numberOfVideos * 2)
+ enabledForReuse () {
+ this.disabled = false
}
onNearOfBottom () {
if (this.currentPage >= this.maxPage) return
if (this.lastWasEmpty) return
if (this.isLoading) return
+ if (this.disabled) return
this.currentPage++
this.loadMoreResults()
@@ -101,7 +135,42 @@ export class VideoOverviewComponent implements OnInit, OnDestroy {
this.loaded = true
this.onDataSubject.next(overview)
- this.overviews.push(overview)
+ for (const value of overview.categories) {
+ this.objects.push({
+ buttonLabel: $localize`Browse "${value.category.label}" videos`,
+ label: value.category.label,
+ routerLink: [ '/search' ],
+ queryParams: { categoryOneOf: [ value.category.id ] },
+ videos: value.videos,
+ type: $localize`category`
+ })
+ }
+
+ for (const value of overview.tags) {
+ this.objects.push({
+ buttonLabel: $localize`Browse "#${value.tag}" videos`,
+ label: `#${value.tag}`,
+ routerLink: [ '/search' ],
+ queryParams: { tagsOneOf: [ value.tag ] },
+ videos: value.videos,
+ type: $localize`tag`
+ })
+ }
+
+ for (const value of overview.channels) {
+ this.objects.push({
+ buttonLabel: $localize`View the channel`,
+ label: value.videos[0].byVideoChannel,
+ routerLink: [ '/c', value.videos[0].byVideoChannel ],
+ queryParams: {},
+ videos: value.videos,
+ channel: value.channel,
+ type: $localize`channel`
+ })
+ }
+
+ this.quickAccessLinks = this.objects.map(o => o)
+ this.checkQuickAccessOverflow = true
},
error: err => {
diff --git a/client/src/app/+videos/video-list/overview/videos-overview.model.ts b/client/src/app/+videos/video-list/overview/videos-overview.model.ts
index c7939ec4e1..240f956f13 100644
--- a/client/src/app/+videos/video-list/overview/videos-overview.model.ts
+++ b/client/src/app/+videos/video-list/overview/videos-overview.model.ts
@@ -16,5 +16,4 @@ export class VideosOverview implements VideosOverviewServer {
tag: string
videos: Video[]
}[]
- [key: string]: any
}
diff --git a/client/src/app/+videos/video-list/video-user-subscriptions.component.html b/client/src/app/+videos/video-list/video-user-subscriptions.component.html
index 90eceaf9be..dcd3a0890a 100644
--- a/client/src/app/+videos/video-list/video-user-subscriptions.component.html
+++ b/client/src/app/+videos/video-list/video-user-subscriptions.component.html
@@ -1,9 +1,9 @@
+<h1 class="visually-hidden" i18n>Videos from your subscriptions</h1>
+
<my-videos-list
[getVideosObservableFunction]="getVideosObservableFunction"
[getSyndicationItemsFunction]="getSyndicationItemsFunction"
- [title]="titlePage"
-
[defaultSort]="defaultSort"
displayFilters="false"
diff --git a/client/src/app/+videos/video-list/video-user-subscriptions.component.ts b/client/src/app/+videos/video-list/video-user-subscriptions.component.ts
index 604af7c257..ce22a32cdd 100644
--- a/client/src/app/+videos/video-list/video-user-subscriptions.component.ts
+++ b/client/src/app/+videos/video-list/video-user-subscriptions.component.ts
@@ -24,13 +24,11 @@ export class VideoUserSubscriptionsComponent implements DisableForReuseHook {
actions = [
{
routerLink: '/my-library/subscriptions',
- label: $localize`Subscriptions`,
+ label: $localize`Manage`,
iconName: 'cog' as 'cog'
}
]
- titlePage = $localize`Videos from your subscriptions`
-
disabled = false
private feedToken: string
diff --git a/client/src/app/+videos/video-list/videos-list-common-page.component.html b/client/src/app/+videos/video-list/videos-list-all.component.html
similarity index 80%
rename from client/src/app/+videos/video-list/videos-list-common-page.component.html
rename to client/src/app/+videos/video-list/videos-list-all.component.html
index f5139dcb53..1510a68adc 100644
--- a/client/src/app/+videos/video-list/videos-list-common-page.component.html
+++ b/client/src/app/+videos/video-list/videos-list-all.component.html
@@ -1,10 +1,8 @@
+<h1 class="visually-hidden" i18n>Browse videos</h1>
+
<my-videos-list
[getVideosObservableFunction]="getVideosObservableFunction"
[getSyndicationItemsFunction]="getSyndicationItemsFunction"
- [baseRouteBuilderFunction]="baseRouteBuilderFunction"
-
- [title]="title"
- [titleTooltip]="titleTooltip"
[defaultSort]="defaultSort"
[defaultScope]="defaultScope"
diff --git a/client/src/app/+videos/video-list/videos-list-common-page.component.ts b/client/src/app/+videos/video-list/videos-list-all.component.ts
similarity index 52%
rename from client/src/app/+videos/video-list/videos-list-common-page.component.ts
rename to client/src/app/+videos/video-list/videos-list-all.component.ts
index 671e87c2e0..d047014315 100644
--- a/client/src/app/+videos/video-list/videos-list-common-page.component.ts
+++ b/client/src/app/+videos/video-list/videos-list-all.component.ts
@@ -1,30 +1,23 @@
import { Component, OnDestroy, OnInit } from '@angular/core'
-import { ActivatedRoute, ActivatedRouteSnapshot } from '@angular/router'
-import { ComponentPaginationLight, DisableForReuseHook, MetaService, RedirectService, ServerService } from '@app/core'
+import { ActivatedRoute } from '@angular/router'
+import { ComponentPaginationLight, DisableForReuseHook, MetaService, ServerService } from '@app/core'
import { HooksService } from '@app/core/plugins/hooks.service'
import { VideoService } from '@app/shared/shared-main/video/video.service'
import { VideoFilterScope, VideoFilters } from '@app/shared/shared-video-miniature/video-filters.model'
-import { ClientFilterHookName, VideoSortField } from '@peertube/peertube-models'
+import { VideoSortField } from '@peertube/peertube-models'
import { Subscription } from 'rxjs'
import { VideosListComponent } from '../../shared/shared-video-miniature/videos-list.component'
-export type VideosListCommonPageRouteData = {
- sort: VideoSortField
-
- scope: VideoFilterScope
- hookParams: ClientFilterHookName
- hookResult: ClientFilterHookName
-}
-
@Component({
- templateUrl: './videos-list-common-page.component.html',
+ templateUrl: './videos-list-all.component.html',
standalone: true,
- imports: [ VideosListComponent ]
+ imports: [
+ VideosListComponent
+ ]
})
-export class VideosListCommonPageComponent implements OnInit, OnDestroy, DisableForReuseHook {
+export class VideosListAllComponent implements OnInit, OnDestroy, DisableForReuseHook {
getVideosObservableFunction = this.getVideosObservable.bind(this)
getSyndicationItemsFunction = this.getSyndicationItems.bind(this)
- baseRouteBuilderFunction = this.baseRouteBuilder.bind(this)
title: string
titleTooltip: string
@@ -34,16 +27,12 @@ export class VideosListCommonPageComponent implements OnInit, OnDestroy, Disable
defaultSort: VideoSortField
defaultScope: VideoFilterScope
- hookParams: ClientFilterHookName
- hookResult: ClientFilterHookName
-
loadUserVideoPreferences = true
displayFilters = true
disabled = false
- private trendingDays: number
private routeSub: Subscription
constructor (
@@ -51,17 +40,15 @@ export class VideosListCommonPageComponent implements OnInit, OnDestroy, Disable
private route: ActivatedRoute,
private videoService: VideoService,
private hooks: HooksService,
- private meta: MetaService,
- private redirectService: RedirectService
+ private meta: MetaService
) {
}
ngOnInit () {
- this.trendingDays = this.server.getHTMLConfig().trending.videos.intervalDays
+ this.defaultSort = '-publishedAt'
+ this.defaultScope = 'federated'
- this.routeSub = this.route.params.subscribe(params => {
- this.update(params['page'])
- })
+ this.routeSub = this.route.params.subscribe(() => this.update())
}
ngOnDestroy () {
@@ -80,8 +67,8 @@ export class VideosListCommonPageComponent implements OnInit, OnDestroy, Disable
this.videoService.getVideos.bind(this.videoService),
params,
'common',
- this.hookParams,
- this.hookResult
+ 'filter:api.browse-videos.videos.list.params',
+ 'filter:api.browse-videos.videos.list.result'
)
}
@@ -96,18 +83,6 @@ export class VideosListCommonPageComponent implements OnInit, OnDestroy, Disable
this.updateGroupByDate(filters.sort)
}
- baseRouteBuilder (filters: VideoFilters) {
- const sanitizedSort = this.getSanitizedSort(filters.sort)
-
- let suffix: string
-
- if (filters.scope === 'local') suffix = 'local'
- else if (sanitizedSort === 'publishedAt') suffix = 'recently-added'
- else suffix = 'trending'
-
- return [ '/videos', suffix ]
- }
-
disableForReuse () {
this.disabled = true
}
@@ -116,80 +91,19 @@ export class VideosListCommonPageComponent implements OnInit, OnDestroy, Disable
this.disabled = false
}
- update (page: string) {
- const data = this.getData(page)
-
- this.hookParams = data.hookParams
- this.hookResult = data.hookResult
-
- this.defaultSort = data.sort
- this.defaultScope = data.scope
-
+ update () {
this.buildTitle()
this.updateGroupByDate(this.defaultSort)
this.meta.setTitle(this.title)
}
- private getData (page: string) {
- if (page === 'trending') return this.generateTrendingData(this.route.snapshot)
-
- if (page === 'local') return this.generateLocalData()
-
- return this.generateRecentlyAddedData()
- }
-
- private generateRecentlyAddedData (): VideosListCommonPageRouteData {
- return {
- sort: '-publishedAt',
- scope: 'federated',
- hookParams: 'filter:api.recently-added-videos.videos.list.params',
- hookResult: 'filter:api.recently-added-videos.videos.list.result'
- }
- }
-
- private generateLocalData (): VideosListCommonPageRouteData {
- return {
- sort: '-publishedAt' as VideoSortField,
- scope: 'local',
- hookParams: 'filter:api.local-videos.videos.list.params',
- hookResult: 'filter:api.local-videos.videos.list.result'
- }
- }
-
- private generateTrendingData (route: ActivatedRouteSnapshot): VideosListCommonPageRouteData {
- const sort = route.queryParams['sort'] ?? this.parseTrendingAlgorithm(this.redirectService.getDefaultTrendingAlgorithm())
-
- return {
- sort,
- scope: 'federated',
- hookParams: 'filter:api.trending-videos.videos.list.params',
- hookResult: 'filter:api.trending-videos.videos.list.result'
- }
- }
-
- private parseTrendingAlgorithm (algorithm: string): VideoSortField {
- switch (algorithm) {
- case 'most-viewed':
- return '-trending'
-
- case 'most-liked':
- return '-likes'
-
- // We'll automatically apply "best" sort if using "hot" sort with a logged user
- case 'best':
- return '-hot'
-
- default:
- return '-' + algorithm as VideoSortField
- }
- }
-
private updateGroupByDate (sort: VideoSortField) {
this.groupByDate = sort === '-publishedAt' || sort === 'publishedAt'
}
private buildTitle (scope: VideoFilterScope = this.defaultScope, sort: VideoSortField = this.defaultSort) {
+ const trendingDays = this.server.getHTMLConfig().trending.videos.intervalDays
const sanitizedSort = this.getSanitizedSort(sort)
if (scope === 'local') {
@@ -223,12 +137,12 @@ export class VideosListCommonPageComponent implements OnInit, OnDestroy, Disable
}
if (sanitizedSort === 'trending') {
- if (this.trendingDays === 1) {
+ if (trendingDays === 1) {
this.titleTooltip = $localize`Videos with the most views during the last 24 hours`
return
}
- this.titleTooltip = $localize`Videos with the most views during the last ${this.trendingDays} days`
+ this.titleTooltip = $localize`Videos with the most views during the last ${trendingDays} days`
}
return
diff --git a/client/src/app/app.component.html b/client/src/app/app.component.html
index 1279f19b07..16cc6a90c8 100644
--- a/client/src/app/app.component.html
+++ b/client/src/app/app.component.html
@@ -9,34 +9,17 @@
[ngClass]="{ 'user-logged-in': isUserLoggedIn(), 'user-not-logged-in': !isUserLoggedIn(), 'hotkeys-modal-opened': hotkeysModalOpened }"
>
<header class="root-header">
-
- <div class="top-left-block">
- <button
- class="border-0 p-0" [title]="getToggleTitle()" (click)="menu.toggleMenu()" (keyup.enter)="menu.toggleMenu()"
- [ariaExpanded]="menu.isMenuDisplayed" aria-controls="left-menu"
- >
- <span class="icon icon-menu"></span>
- </button>
-
- <a class="peertube-title c-hand" [routerLink]="getDefaultRoute()" [queryParams]="getDefaultRouteQuery()">
- <span class="icon icon-logo"></span>
- <span class="instance-name">{{ instanceName }}</span>
- </a>
- </div>
-
- <div class="root-header-right">
- <my-header class="w-100 d-flex justify-content-end"></my-header>
- </div>
+ <my-header class="w-100"></my-header>
</header>
<div class="sub-header-container">
- <my-menu id="left-menu" role="navigation" aria-label="Main menu" i18n-ariaLabel [hidden]="!menu.isMenuDisplayed"></my-menu>
+ <my-menu id="left-menu" role="navigation" aria-label="Main menu" i18n-ariaLabel></my-menu>
- <main #mainContent tabindex="-1" id="content" class="main-col" [ngClass]="{ expanded: menu.isMenuDisplayed === false }">
+ <main #mainContent tabindex="-1" id="content" class="main-col" [ngClass]="{ expanded: menu.isCollapsed() }">
<div class="main-row">
- <div *ngIf="broadcastMessage" class="broadcast-message alert" [ngClass]="broadcastMessage.class">
+ <div *ngIf="broadcastMessage" class="broadcast-message alert margin-content" [ngClass]="broadcastMessage.class">
<div [innerHTML]="broadcastMessage.message"></div>
<button
@@ -53,7 +36,7 @@
</div>
</div>
-<ngx-loading-bar [includeSpinner]="false" [color]="'var(--mainColor)'"></ngx-loading-bar>
+<ngx-loading-bar [includeSpinner]="false" color="var(--primary)"></ngx-loading-bar>
<my-confirm></my-confirm>
diff --git a/client/src/app/app.component.scss b/client/src/app/app.component.scss
index 735917bcc8..f6f5f7ac96 100644
--- a/client/src/app/app.component.scss
+++ b/client/src/app/app.component.scss
@@ -7,7 +7,7 @@
display: block;
z-index: z(modal);
width: 100%;
- background: pvar(--mainBackgroundColor);
+ background: pvar(--bg);
padding: 1rem;
text-align: center;
text-decoration: underline;
@@ -22,93 +22,27 @@
}
.main-row {
- min-height: calc(100vh - #{$header-height} - #{$footer-height} - #{$footer-margin});
+ min-height: calc(100vh - #{pvar(--header-height)} - #{$footer-height} - #{$footer-margin});
}
.sub-header-container {
- margin-top: $header-height;
- background-color: pvar(--mainBackgroundColor);
+ margin-top: pvar(--header-height);
+ background-color: pvar(--bg);
width: 100%;
}
.root-header {
- height: $header-height;
+ height: pvar(--header-height);
position: fixed;
top: 0;
width: 100%;
- background-color: pvar(--mainBackgroundColor);
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
- display: flex;
-}
-
-.top-left-block {
- z-index: 1;
- height: $header-height;
- display: flex;
- align-items: center;
- min-width: 0;
-
- .icon {
- @include icon(24px);
- }
-
- .icon-menu {
- mask-image: url('../assets/images/misc/menu.svg');
- -webkit-mask-image: url('../assets/images/misc/menu.svg');
-
- background-color: pvar(--mainForegroundColor);
- margin: 0 18px 0 20px;
-
- @media screen and (max-width: $mobile-view) {
- margin: 0 10px;
- }
- }
-}
-
-.root-header-right {
- height: $header-height;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- white-space: nowrap;
- flex: 1;
-}
-
-.peertube-title {
- font-size: 20px;
- font-weight: $font-bold;
- color: inherit !important;
- display: flex;
- align-items: center;
- overflow: hidden;
- padding: 0 0 0 10px;
-
- @include disable-default-a-behaviour;
-
- .instance-name {
- width: 100%;
-
- @include ellipsis;
-
- @media screen and (max-width: $mobile-view) {
- display: none;
- }
- }
-
- .icon.icon-logo {
- display: inline-block;
- width: 23px;
- height: 24px;
-
- @include margin-right(0.5rem);
- }
+ background: pvar(--bg);
}
.broadcast-message {
min-height: 50px;
text-align: center;
- margin-bottom: 0;
- border-radius: 0;
+ margin-bottom: 2rem;
display: grid;
grid-template-columns: 1fr 30px;
column-gap: 10px;
@@ -120,7 +54,7 @@
margin: auto;
> my-global-icon {
- width: 20px;
+ @include global-icon-size(20px);
}
}
}
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts
index 52f9d420c2..06b5dde076 100644
--- a/client/src/app/app.component.ts
+++ b/client/src/app/app.component.ts
@@ -1,22 +1,19 @@
-import { delay, forkJoin } from 'rxjs'
-import { filter, first, map } from 'rxjs/operators'
-import { DOCUMENT, getLocaleDirection, PlatformLocation, NgIf, NgClass } from '@angular/common'
+import { DOCUMENT, getLocaleDirection, NgClass, NgIf, PlatformLocation } from '@angular/common'
import { AfterViewInit, Component, Inject, LOCALE_ID, OnInit, ViewChild } from '@angular/core'
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'
import { Event, GuardsCheckStart, RouteConfigLoadEnd, RouteConfigLoadStart, Router, RouterLink, RouterOutlet } from '@angular/router'
import {
AuthService,
+ Hotkey,
+ HotkeysService,
MarkdownService,
PeerTubeRouterService,
- RedirectService,
ScreenService,
ScrollService,
ServerService,
ThemeService,
User,
- UserLocalStorageService,
- Hotkey,
- HotkeysService
+ UserLocalStorageService
} from '@app/core'
import { HooksService } from '@app/core/plugins/hooks.service'
import { PluginService } from '@app/core/plugins/plugin.service'
@@ -25,21 +22,24 @@ import { AdminWelcomeModalComponent } from '@app/modal/admin-welcome-modal.compo
import { CustomModalComponent } from '@app/modal/custom-modal.component'
import { InstanceConfigWarningModalComponent } from '@app/modal/instance-config-warning-modal.component'
import { NgbConfig, NgbModal } from '@ng-bootstrap/ng-bootstrap'
-import { LoadingBarService, LoadingBarModule } from '@ngx-loading-bar/core'
+import { LoadingBarModule, LoadingBarService } from '@ngx-loading-bar/core'
import { getShortLocale } from '@peertube/peertube-core-utils'
import { BroadcastMessageLevel, HTMLServerConfig, UserRole } from '@peertube/peertube-models'
import { logger } from '@root-helpers/logger'
import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
-import { MenuService } from './core/menu/menu.service'
-import { POP_STATE_MODAL_DISMISS } from './helpers'
import { SharedModule } from 'primeng/api'
import { ToastModule } from 'primeng/toast'
-import { ConfirmComponent } from './modal/confirm.component'
-import { GlobalIconComponent, GlobalIconName } from './shared/shared-icons/global-icon.component'
-import { MenuComponent } from './menu/menu.component'
+import { delay, forkJoin } from 'rxjs'
+import { filter, first, map } from 'rxjs/operators'
+import { MenuService } from './core/menu/menu.service'
import { HeaderComponent } from './header/header.component'
+import { POP_STATE_MODAL_DISMISS } from './helpers'
import { HotkeysCheatSheetComponent } from './hotkeys/hotkeys-cheat-sheet.component'
+import { MenuComponent } from './menu/menu.component'
+import { ConfirmComponent } from './modal/confirm.component'
+import { GlobalIconComponent, GlobalIconName } from './shared/shared-icons/global-icon.component'
import { InstanceService } from './shared/shared-main/instance/instance.service'
+import { ButtonComponent } from './shared/shared-main/buttons/button.component'
@Component({
selector: 'my-app',
@@ -62,11 +62,12 @@ import { InstanceService } from './shared/shared-main/instance/instance.service'
AccountSetupWarningModalComponent,
AdminWelcomeModalComponent,
InstanceConfigWarningModalComponent,
- CustomModalComponent
+ CustomModalComponent,
+ ButtonComponent
]
})
export class AppComponent implements OnInit, AfterViewInit {
- private static BROADCAST_MESSAGE_KEY = 'app-broadcast-message-dismissed'
+ private static LS_BROADCAST_MESSAGE = 'app-broadcast-message-dismissed'
@ViewChild('accountSetupWarningModal') accountSetupWarningModal: AccountSetupWarningModalComponent
@ViewChild('adminWelcomeModal') adminWelcomeModal: AdminWelcomeModalComponent
@@ -89,7 +90,6 @@ export class AppComponent implements OnInit, AfterViewInit {
private pluginService: PluginService,
private instanceService: InstanceService,
private domSanitizer: DomSanitizer,
- private redirectService: RedirectService,
private screenService: ScreenService,
private hotkeysService: HotkeysService,
private themeService: ThemeService,
@@ -106,10 +106,6 @@ export class AppComponent implements OnInit, AfterViewInit {
this.ngbConfig.animation = false
}
- get instanceName () {
- return this.serverConfig.instance.name
- }
-
ngOnInit () {
document.getElementById('incompatible-browser').className += ' browser-ok'
@@ -160,28 +156,12 @@ export class AppComponent implements OnInit, AfterViewInit {
// ---------------------------------------------------------------------------
- getDefaultRoute () {
- return this.redirectService.getDefaultRoute().split('?')[0]
- }
-
- getDefaultRouteQuery () {
- return this.router.parseUrl(this.redirectService.getDefaultRoute()).queryParams
- }
-
- // ---------------------------------------------------------------------------
-
- getToggleTitle () {
- if (this.menu.isDisplayed()) return $localize`Close the left menu`
-
- return $localize`Open the left menu`
- }
-
isUserLoggedIn () {
return this.authService.isLoggedIn()
}
hideBroadcastMessage () {
- peertubeLocalStorage.setItem(AppComponent.BROADCAST_MESSAGE_KEY, this.serverConfig.broadcastMessage.message)
+ peertubeLocalStorage.setItem(AppComponent.LS_BROADCAST_MESSAGE, this.serverConfig.broadcastMessage.message)
this.broadcastMessage = null
this.screenService.isBroadcastMessageDisplayed = false
@@ -216,7 +196,7 @@ export class AppComponent implements OnInit, AfterViewInit {
eventsObs.pipe(
filter((e: Event): e is GuardsCheckStart => e instanceof GuardsCheckStart),
filter(() => this.screenService.isInSmallView() || this.screenService.isInTouchScreen())
- ).subscribe(() => this.menu.setMenuDisplay(false)) // User clicked on a link in the menu, change the page
+ ).subscribe(() => this.menu.setMenuCollapsed(true)) // User clicked on a link in the menu, change the page
// Handle lazy loaded module
eventsObs.pipe(
@@ -236,7 +216,7 @@ export class AppComponent implements OnInit, AfterViewInit {
if (messageConfig.enabled) {
// Already dismissed this message?
- if (messageConfig.dismissable && localStorage.getItem(AppComponent.BROADCAST_MESSAGE_KEY) === messageConfig.message) {
+ if (messageConfig.dismissable && localStorage.getItem(AppComponent.LS_BROADCAST_MESSAGE) === messageConfig.message) {
return
}
diff --git a/client/src/app/app.routes.ts b/client/src/app/app.routes.ts
index 90d67e3772..cd49a658c0 100644
--- a/client/src/app/app.routes.ts
+++ b/client/src/app/app.routes.ts
@@ -1,25 +1,18 @@
import { Routes, UrlMatchResult, UrlSegment } from '@angular/router'
-import { MenuGuards } from '@app/core/routing/menu-guard.service'
import { POSSIBLE_LOCALES } from '@peertube/peertube-core-utils'
import { MetaGuard } from './core'
import { EmptyComponent } from './empty.component'
import { HomepageRedirectComponent } from './homepage-redirect.component'
import { USER_USERNAME_REGEX_CHARACTERS } from './shared/form-validators/user-validators'
import { ActorRedirectGuard } from './shared/shared-main/router/actor-redirect-guard.service'
+import { VideosParentComponent } from './videos-parent.component'
const routes: Routes = [
{
path: 'admin',
- canActivate: [ MenuGuards.close() ],
- canDeactivate: [ MenuGuards.open() ],
loadChildren: () => import('./+admin/routes'),
canActivateChild: [ MetaGuard ]
},
- {
- path: 'home',
- loadChildren: () => import('./+home/routes'),
- canActivateChild: [ MetaGuard ]
- },
{
path: 'my-account',
loadChildren: () => import('./+my-account/routes'),
@@ -55,11 +48,19 @@ const routes: Routes = [
loadChildren: () => import('./+video-channels/routes'),
canActivateChild: [ MetaGuard ]
},
+
{
- path: 'manage',
- loadChildren: () => import('./+manage/routes'),
- canActivateChild: [ MetaGuard ]
+ path: 'manage/create',
+ redirectTo: '/my-library/video-channels/create',
+ pathMatch: 'full'
},
+
+ {
+ path: 'manage/update/:channel',
+ pathMatch: 'full',
+ redirectTo: '/my-library/video-channels/update/:channel'
+ },
+
{
path: 'p',
loadChildren: () => import('./shared/shared-plugin-pages/routes'),
@@ -131,11 +132,33 @@ const routes: Routes = [
preload: 5000
}
},
+
+ // /home and other /videos routes
{
- path: 'videos',
- loadChildren: () => import('./+videos/routes'),
- canActivateChild: [ MetaGuard ]
+ matcher: (url): UrlMatchResult => {
+ if (url.length < 1) return null
+
+ const matchResult = url[0].path === 'home' || url[0].path === 'videos'
+ if (!matchResult) return null
+
+ // So the children can detect the appropriate route
+ return { consumed: [] }
+ },
+ component: VideosParentComponent,
+ children: [
+ {
+ path: 'home',
+ loadChildren: () => import('./+home/routes'),
+ canActivateChild: [ MetaGuard ]
+ },
+ {
+ path: 'videos',
+ loadChildren: () => import('./+videos/routes'),
+ canActivateChild: [ MetaGuard ]
+ }
+ ]
},
+
{
path: 'video-playlists/watch',
redirectTo: 'videos/watch/playlist'
diff --git a/client/src/app/core/auth/auth-user.model.ts b/client/src/app/core/auth/auth-user.model.ts
index a1e23bfbb8..690d818a2a 100644
--- a/client/src/app/core/auth/auth-user.model.ts
+++ b/client/src/app/core/auth/auth-user.model.ts
@@ -1,14 +1,11 @@
-import { Observable, of } from 'rxjs'
-import { map } from 'rxjs/operators'
import { User } from '@app/core/users/user.model'
import { hasUserRight } from '@peertube/peertube-core-utils'
import {
- MyUser as ServerMyUserModel,
MyUserSpecialPlaylist,
+ MyUser as ServerMyUserModel,
User as ServerUserModel,
UserRightType,
- UserRole,
- UserVideoQuota
+ UserRole
} from '@peertube/peertube-models'
import { OAuthUserTokens } from '@root-helpers/users'
@@ -16,8 +13,6 @@ export class AuthUser extends User implements ServerMyUserModel {
oauthTokens: OAuthUserTokens
specialPlaylists: MyUserSpecialPlaylist[]
- canSeeVideosLink = true
-
constructor (userHash: Partial<ServerMyUserModel>, hashTokens: Partial<OAuthUserTokens>) {
super(userHash)
@@ -54,26 +49,4 @@ export class AuthUser extends User implements ServerMyUserModel {
// I'm a moderator: I can only manage users
return user.role.id === UserRole.USER
}
-
- computeCanSeeVideosLink (quotaObservable: Observable<UserVideoQuota>): Observable<boolean> {
- if (!this.isUploadDisabled()) {
- this.canSeeVideosLink = true
- return of(this.canSeeVideosLink)
- }
-
- // Check if the user has videos
- return quotaObservable.pipe(
- map(({ videoQuotaUsed }) => {
- if (videoQuotaUsed !== 0) {
- // User already uploaded videos, so it can see the link
- this.canSeeVideosLink = true
- } else {
- // No videos, no upload so the user don't need to see the videos link
- this.canSeeVideosLink = false
- }
-
- return this.canSeeVideosLink
- })
- )
- }
}
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts
index 1685e298ee..40682ffff0 100644
--- a/client/src/app/core/auth/auth.service.ts
+++ b/client/src/app/core/auth/auth.service.ts
@@ -27,7 +27,7 @@ export class AuthService {
private static BASE_TOKEN_URL = environment.apiUrl + '/api/v1/users/token'
private static BASE_REVOKE_TOKEN_URL = environment.apiUrl + '/api/v1/users/revoke-token'
private static BASE_USER_INFORMATION_URL = environment.apiUrl + '/api/v1/users/me'
- private static LOCAL_STORAGE_OAUTH_CLIENT_KEYS = {
+ private static LS_OAUTH_CLIENT_KEYS = {
CLIENT_ID: 'client_id',
CLIENT_SECRET: 'client_secret'
}
@@ -37,8 +37,8 @@ export class AuthService {
tokensRefreshed = new ReplaySubject<void>(1)
loggedInHotkeys: Hotkey[]
- private clientId: string = peertubeLocalStorage.getItem(AuthService.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_ID)
- private clientSecret: string = peertubeLocalStorage.getItem(AuthService.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_SECRET)
+ private clientId: string = peertubeLocalStorage.getItem(AuthService.LS_OAUTH_CLIENT_KEYS.CLIENT_ID)
+ private clientSecret: string = peertubeLocalStorage.getItem(AuthService.LS_OAUTH_CLIENT_KEYS.CLIENT_SECRET)
private loginChanged: Subject<AuthStatus>
private user: AuthUser = null
private refreshingTokenObservable: Observable<void>
@@ -89,8 +89,8 @@ export class AuthService {
this.clientId = res.client_id
this.clientSecret = res.client_secret
- peertubeLocalStorage.setItem(AuthService.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_ID, this.clientId)
- peertubeLocalStorage.setItem(AuthService.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_SECRET, this.clientSecret)
+ peertubeLocalStorage.setItem(AuthService.LS_OAUTH_CLIENT_KEYS.CLIENT_ID, this.clientId)
+ peertubeLocalStorage.setItem(AuthService.LS_OAUTH_CLIENT_KEYS.CLIENT_SECRET, this.clientSecret)
logger.info('Client credentials loaded.')
},
diff --git a/client/src/app/core/menu/menu.service.ts b/client/src/app/core/menu/menu.service.ts
index 51d4bc578f..cf1633d007 100644
--- a/client/src/app/core/menu/menu.service.ts
+++ b/client/src/app/core/menu/menu.service.ts
@@ -1,165 +1,58 @@
+import { Injectable } from '@angular/core'
import { fromEvent } from 'rxjs'
import { debounceTime } from 'rxjs/operators'
-import { Injectable } from '@angular/core'
-import { GlobalIconName } from '@app/shared/shared-icons/global-icon.component'
-import { HTMLServerConfig } from '@peertube/peertube-models'
-import { ScreenService } from '../wrappers'
-
-export type MenuLink = {
- icon: GlobalIconName
- iconClass?: string
-
- label: string
- // Used by the left menu for example
- shortLabel: string
-
- path: string
-}
-
-export type MenuSection = {
- key: string
- title: string
- links: MenuLink[]
-}
+import { LocalStorageService, ScreenService } from '../wrappers'
@Injectable()
export class MenuService {
- isMenuDisplayed = true
- isMenuChangedByUser = false
- menuWidth = 240 // should be kept equal to $menu-width
+ private static LS_MENU_COLLAPSED = 'menu-collapsed'
+
+ private menuCollapsed = false
+ private menuChangedByUser = false
constructor (
- private screenService: ScreenService
+ private screenService: ScreenService,
+ private localStorageService: LocalStorageService
) {
// Do not display menu on small or touch screens
if (this.screenService.isInSmallView() || this.screenService.isInTouchScreen()) {
- this.setMenuDisplay(false)
+ this.setMenuCollapsed(true)
+ } else {
+ this.setMenuCollapsed(this.localStorageService.getItem(MenuService.LS_MENU_COLLAPSED) === 'true')
+ this.menuChangedByUser = this.menuCollapsed
}
this.handleWindowResize()
}
toggleMenu () {
- this.setMenuDisplay(!this.isMenuDisplayed)
- this.isMenuChangedByUser = true
- }
+ this.setMenuCollapsed(!this.menuCollapsed)
+ this.menuChangedByUser = true
- isDisplayed () {
- return this.isMenuDisplayed
+ this.localStorageService.setItem(MenuService.LS_MENU_COLLAPSED, this.menuCollapsed + '')
}
- setMenuDisplay (display: boolean) {
- this.isMenuDisplayed = display
+ isCollapsed () {
+ return this.menuCollapsed
+ }
- if (!this.screenService.isInTouchScreen()) return
+ setMenuCollapsed (collapsed: boolean) {
+ this.menuCollapsed = collapsed
- // On touch screens, lock body scroll and display content overlay when memu is opened
- if (this.isMenuDisplayed) {
+ if (this.menuCollapsed) {
+ document.body.classList.remove('menu-open')
+ } else {
document.body.classList.add('menu-open')
- this.screenService.onFingerSwipe('left', () => this.setMenuDisplay(false))
- return
}
-
- document.body.classList.remove('menu-open')
}
onResize () {
- this.isMenuDisplayed = window.innerWidth >= 800 && !this.isMenuChangedByUser
- }
-
- buildLibraryLinks (userCanSeeVideosLink: boolean): MenuSection {
- let links: MenuLink[] = []
-
- if (userCanSeeVideosLink) {
- links.push({
- path: '/my-library/video-channels',
- icon: 'channel' as GlobalIconName,
- iconClass: 'channel-icon',
- shortLabel: $localize`Channels`,
- label: $localize`My channels`
- })
-
- links.push({
- path: '/my-library/videos',
- icon: 'videos' as GlobalIconName,
- shortLabel: $localize`Videos`,
- label: $localize`My videos`
- })
- }
-
- links = links.concat([
- {
- path: '/my-library/video-playlists',
- icon: 'playlists' as GlobalIconName,
- shortLabel: $localize`Playlists`,
- label: $localize`My playlists`
- },
- {
- path: '/videos/subscriptions',
- icon: 'subscriptions' as GlobalIconName,
- shortLabel: $localize`Subscriptions`,
- label: $localize`My subscriptions`
- },
- {
- path: '/my-library/history/videos',
- icon: 'history' as GlobalIconName,
- shortLabel: $localize`History`,
- label: $localize`My history`
- }
- ])
-
- return {
- key: 'in-my-library',
- title: $localize`In my library`,
- links
+ if (this.screenService.isInSmallView() && !this.menuChangedByUser) {
+ this.setMenuCollapsed(true)
}
}
- buildCommonLinks (config: HTMLServerConfig): MenuSection {
- let links: MenuLink[] = []
-
- if (config.homepage.enabled) {
- links.push({
- icon: 'home' as 'home',
- label: $localize`Home`,
- shortLabel: $localize`Home`,
- path: '/home'
- })
- }
-
- links = links.concat([
- {
- icon: 'globe' as 'globe',
- label: $localize`Discover videos`,
- shortLabel: $localize`Discover`,
- path: '/videos/overview'
- },
- {
- icon: 'trending' as 'trending',
- label: $localize`Trending videos`,
- shortLabel: $localize`Trending`,
- path: '/videos/trending'
- },
- {
- icon: 'add' as 'add',
- label: $localize`Recently added videos`,
- shortLabel: $localize`Recently added`,
- path: '/videos/recently-added'
- },
- {
- icon: 'local' as 'local',
- label: $localize`Local videos`,
- shortLabel: $localize`Local videos`,
- path: '/videos/local'
- }
- ])
-
- return {
- key: 'on-instance',
- title: $localize`ON ${config.instance.name}`,
- links
- }
- }
+ // ---------------------------------------------------------------------------
private handleWindowResize () {
// On touch screens, do not handle window resize event since opened menu is handled with a content overlay
diff --git a/client/src/app/core/routing/index.ts b/client/src/app/core/routing/index.ts
index 7443d5c78e..bb5bda5775 100644
--- a/client/src/app/core/routing/index.ts
+++ b/client/src/app/core/routing/index.ts
@@ -2,7 +2,6 @@ export * from './can-deactivate-guard.service'
export * from './custom-reuse-strategy'
export * from './disable-for-reuse-hook'
export * from './login-guard.service'
-export * from './menu-guard.service'
export * from './meta-guard.service'
export * from './peertube-router.service'
export * from './meta.service'
diff --git a/client/src/app/core/routing/menu-guard.service.ts b/client/src/app/core/routing/menu-guard.service.ts
deleted file mode 100644
index 3b3723b5a4..0000000000
--- a/client/src/app/core/routing/menu-guard.service.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-import { Injectable } from '@angular/core'
-import { MenuService } from '../menu'
-import { ScreenService } from '../wrappers'
-
-abstract class MenuGuard {
- canDeactivate = this.canActivate.bind(this)
-
- constructor (protected menu: MenuService, protected screen: ScreenService, protected display: boolean) {
-
- }
-
- canActivate (): boolean {
- // small screens already have the site-wide onResize from screenService
- // > medium screens have enough space to fit the administrative menus
- if (!this.screen.isInMobileView() && this.screen.isInMediumView()) {
- this.menu.setMenuDisplay(this.display)
- }
-
- return true
- }
-}
-
-@Injectable()
-export class OpenMenuGuard extends MenuGuard {
- constructor (menu: MenuService, screen: ScreenService) {
- super(menu, screen, true)
- }
-}
-
-@Injectable()
-export class OpenMenuAlwaysGuard extends MenuGuard {
- constructor (menu: MenuService, screen: ScreenService) {
- super(menu, screen, true)
- }
-
- canActivate (): boolean {
- this.menu.setMenuDisplay(this.display)
-
- return true
- }
-}
-
-@Injectable()
-export class CloseMenuGuard extends MenuGuard {
- constructor (menu: MenuService, screen: ScreenService) {
- super(menu, screen, false)
- }
-}
-
-@Injectable()
-export class CloseMenuAlwaysGuard extends MenuGuard {
- constructor (menu: MenuService, screen: ScreenService) {
- super(menu, screen, false)
- }
-
- canActivate (): boolean {
- this.menu.setMenuDisplay(this.display)
- return true
- }
-}
-
-@Injectable()
-export class MenuGuards {
- public static guards = [
- OpenMenuGuard,
- OpenMenuAlwaysGuard,
- CloseMenuGuard,
- CloseMenuAlwaysGuard
- ]
-
- static open (always?: boolean) {
- return always
- ? OpenMenuAlwaysGuard
- : OpenMenuGuard
- }
-
- static close (always?: boolean) {
- return always
- ? CloseMenuAlwaysGuard
- : CloseMenuGuard
- }
-}
diff --git a/client/src/app/core/routing/redirect.service.ts b/client/src/app/core/routing/redirect.service.ts
index a278d147f0..23f77c6fd6 100644
--- a/client/src/app/core/routing/redirect.service.ts
+++ b/client/src/app/core/routing/redirect.service.ts
@@ -1,11 +1,12 @@
-import debug from 'debug'
import { Injectable } from '@angular/core'
import { NavigationCancel, NavigationEnd, Router } from '@angular/router'
+import { VideoSortField } from '@peertube/peertube-models'
import { logger } from '@root-helpers/logger'
-import { ServerService } from '../server'
-import { SessionStorageService } from '../wrappers/storage.service'
import { PluginsManager } from '@root-helpers/plugins-manager'
+import debug from 'debug'
import { environment } from 'src/environments/environment'
+import { ServerService } from '../server'
+import { SessionStorageService } from '../wrappers/storage.service'
const debugLogger = debug('peertube:router:RedirectService')
@@ -14,7 +15,7 @@ export class RedirectService {
private static SESSION_STORAGE_LATEST_SESSION_URL_KEY = 'redirect-latest-session-url'
// Default route could change according to the instance configuration
- static INIT_DEFAULT_ROUTE = '/videos/trending'
+ static INIT_DEFAULT_ROUTE = '/videos/browse'
static INIT_DEFAULT_TRENDING_ALGORITHM = 'most-viewed'
private previousUrl: string
@@ -69,8 +70,23 @@ export class RedirectService {
return this.defaultRoute
}
- getDefaultTrendingAlgorithm () {
- return this.defaultTrendingAlgorithm
+ getDefaultTrendingSort () {
+ const algorithm = this.defaultTrendingAlgorithm
+
+ switch (algorithm) {
+ case 'most-viewed':
+ return '-trending'
+
+ case 'most-liked':
+ return '-likes'
+
+ // We'll automatically apply "best" sort if using "hot" sort with a logged user
+ case 'best':
+ return '-hot'
+
+ default:
+ return '-' + algorithm as VideoSortField
+ }
}
redirectToLatestSessionRoute () {
diff --git a/client/src/app/core/theme/theme.service.ts b/client/src/app/core/theme/theme.service.ts
index 22eb5ddd3f..0f7ab27800 100644
--- a/client/src/app/core/theme/theme.service.ts
+++ b/client/src/app/core/theme/theme.service.ts
@@ -1,8 +1,11 @@
import { Injectable } from '@angular/core'
+import { sortBy } from '@peertube/peertube-core-utils'
+import { HTMLServerConfig, ServerConfig, ServerConfigTheme } from '@peertube/peertube-models'
import { logger } from '@root-helpers/logger'
import { capitalizeFirstLetter } from '@root-helpers/string'
import { UserLocalStorageKeys } from '@root-helpers/users'
-import { HTMLServerConfig, ServerConfigTheme } from '@peertube/peertube-models'
+import { getLuminance, parse, toHSLA } from 'color-bits'
+import debug from 'debug'
import { environment } from '../../../environments/environment'
import { AuthService } from '../auth'
import { PluginService } from '../plugins/plugin.service'
@@ -10,13 +13,17 @@ import { ServerService } from '../server'
import { UserService } from '../users/user.service'
import { LocalStorageService } from '../wrappers/storage.service'
+const debugLogger = debug('peertube:theme')
+
@Injectable()
export class ThemeService {
-
+ private oldInjectedProperties: string[] = []
private oldThemeName: string
+
+ private internalThemes: string[] = []
private themes: ServerConfigTheme[] = []
- private themeFromLocalStorage: ServerConfigTheme
+ private themeFromLocalStorage: Pick<ServerConfigTheme, 'name' | 'version'>
private themeDOMLinksFromLocalStorage: HTMLLinkElement[] = []
private serverConfig: HTMLServerConfig
@@ -30,10 +37,12 @@ export class ThemeService {
) {}
initialize () {
+ this.serverConfig = this.server.getHTMLConfig()
+ this.internalThemes = this.serverConfig.theme.builtIn.map(t => t.name)
+
// Try to load from local storage first, so we don't have to wait network requests
this.loadAndSetFromLocalStorage()
- this.serverConfig = this.server.getHTMLConfig()
const themes = this.serverConfig.theme.registered
this.removeThemeFromLocalStorageIfNeeded(themes)
@@ -42,17 +51,30 @@ export class ThemeService {
this.listenUserTheme()
}
- getDefaultThemeLabel () {
- if (this.hasDarkTheme()) {
- return $localize`Light/Orange or Dark`
+ getDefaultThemeItem () {
+ return {
+ label: $localize`Light (Beige) or Dark (Brown)`,
+ id: 'default',
+ description: $localize`PeerTube selects the appropriate theme depending on web browser preferences`
}
-
- return $localize`Light/Orange`
}
buildAvailableThemes () {
- return this.serverConfig.theme.registered
- .map(t => ({ id: t.name, label: capitalizeFirstLetter(t.name) }))
+ return [
+ ...this.serverConfig.theme.builtIn.map(t => {
+ if (t.name === 'peertube-core-dark-brown') {
+ return { id: t.name, label: $localize`Dark (Brown)` }
+ }
+
+ if (t.name === 'peertube-core-light-beige') {
+ return { id: t.name, label: $localize`Light (Beige)` }
+ }
+
+ return { id: t.name, label: capitalizeFirstLetter(t.name) }
+ }),
+
+ ...this.serverConfig.theme.registered.map(t => ({ id: t.name, label: capitalizeFirstLetter(t.name) }))
+ ]
}
private injectThemes (themes: ServerConfigTheme[], fromLocalStorage = false) {
@@ -96,14 +118,14 @@ export class ThemeService {
if (instanceTheme !== 'default') return instanceTheme
// Default to dark theme if available and wanted by the user
- if (this.hasDarkTheme() && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
- return 'dark'
+ if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
+ return 'peertube-core-dark-brown' satisfies ServerConfig['theme']['builtIn'][0]['name']
}
return instanceTheme
}
- private loadTheme (name: string) {
+ private loadThemeStyle (name: string) {
const links = document.getElementsByTagName('link')
for (let i = 0; i < links.length; i++) {
const link = links[i]
@@ -111,19 +133,27 @@ export class ThemeService {
link.disabled = link.getAttribute('title') !== name
}
}
+
+ document.body.dataset.ptTheme = name
}
private updateCurrentTheme () {
- if (this.oldThemeName) this.removeThemePlugins(this.oldThemeName)
-
const currentTheme = this.getCurrentTheme()
+ if (this.oldThemeName === currentTheme) return
+
+ if (this.oldThemeName) this.removeThemePlugins(this.oldThemeName)
logger.info(`Enabling ${currentTheme} theme.`)
- this.loadTheme(currentTheme)
+ this.loadThemeStyle(currentTheme)
const theme = this.getTheme(currentTheme)
- if (theme) {
+
+ if (this.internalThemes.includes(currentTheme)) {
+ logger.info(`Enabling internal theme ${currentTheme}`)
+
+ this.localStorageService.setItem(UserLocalStorageKeys.LAST_ACTIVE_THEME, JSON.stringify({ name: currentTheme }), false)
+ } else if (theme) {
logger.info(`Adding scripts of theme ${currentTheme}`)
this.pluginService.addPlugin(theme, true)
@@ -135,9 +165,119 @@ export class ThemeService {
this.localStorageService.removeItem(UserLocalStorageKeys.LAST_ACTIVE_THEME, false)
}
+ setTimeout(() => this.injectColorPalette(), 0)
+
this.oldThemeName = currentTheme
}
+ private injectColorPalette () {
+ const rootStyle = document.body.style
+ const computedStyle = getComputedStyle(document.body)
+
+ // FIXME: Remove previously injected properties
+ for (const property of this.oldInjectedProperties) {
+ rootStyle.removeProperty(property)
+ }
+
+ this.oldInjectedProperties = []
+
+ const toProcess: { prefix: string, invertIfDark: boolean, fallbacks?: Record<string, string> }[] = [
+ { prefix: 'primary', invertIfDark: true },
+ { prefix: 'bg-secondary', invertIfDark: true },
+ { prefix: 'fg', invertIfDark: true, fallbacks: { '--fg-300': '--greyForegroundColor' } }
+ ]
+
+ const darkTheme = this.isDarkTheme(computedStyle)
+ if (darkTheme) {
+ debugLogger('Detected dark theme')
+ }
+
+ for (const { prefix, invertIfDark, fallbacks = {} } of toProcess) {
+ const mainColor = computedStyle.getPropertyValue('--' + prefix)
+
+ const darkInverter = invertIfDark && darkTheme
+ ? -1
+ : 1
+
+ if (!mainColor) {
+ console.error(`Cannot create palette of nonexistent "--${prefix}" CSS body variable`)
+ continue
+ }
+
+ const mainColorHSL = toHSLA(parse(mainColor))
+
+ // Inject in alphabetical order for easy debug
+ const toInject: { id: number, key: string, value: string }[] = [
+ { id: 500, key: `--${prefix}-500`, value: this.toHSLStr(mainColorHSL) }
+ ]
+
+ for (const j of [ -1, 1 ]) {
+ let lastColorHSL = { ...mainColorHSL }
+
+ for (let i = 1; i <= 9; i++) {
+ const suffix = 500 + (50 * i * j)
+ const key = `--${prefix}-${suffix}`
+
+ const existingValue = computedStyle.getPropertyValue(key)
+ if (!existingValue || existingValue === '0') {
+ const newLuminance = this.buildNewLuminance(lastColorHSL, j, darkInverter)
+ const newColorHSL = { ...lastColorHSL, l: newLuminance }
+
+ const newColorStr = this.toHSLStr(newColorHSL)
+
+ const value = fallbacks[key]
+ ? `var(${fallbacks[key]}, ${newColorStr})`
+ : newColorStr
+
+ toInject.push({ id: suffix, key, value })
+
+ lastColorHSL = newColorHSL
+
+ debugLogger(`Injected theme palette ${key} -> ${value}`)
+ } else {
+ lastColorHSL = toHSLA(parse(existingValue))
+ }
+ }
+ }
+
+ for (const { key, value } of sortBy(toInject, 'id')) {
+ rootStyle.setProperty(key, value)
+ this.oldInjectedProperties.push(key)
+ }
+ }
+
+ document.body.dataset.bsTheme = darkTheme
+ ? 'dark'
+ : ''
+ }
+
+ private buildNewLuminance (base: { l: number }, factor: number, darkInverter: number) {
+ return Math.max(Math.min(100, Math.round(base.l + (factor * 5 * -1 * darkInverter))), 0)
+ }
+
+ private toHSLStr (c: { h: number, s: number, l: number, a: number }) {
+ return `hsl(${Math.round(c.h)} ${Math.round(c.s)}% ${Math.round(c.l)}% / ${Math.round(c.a)})`
+ }
+
+ private isDarkTheme (computedStyle: CSSStyleDeclaration) {
+ const deprecatedFG = computedStyle.getPropertyValue('--mainForegroundColor')
+ const deprecatedBG = computedStyle.getPropertyValue('--mainBackgroundColor')
+
+ if (computedStyle.getPropertyValue('--is-dark') === '1') {
+ return true
+ } else if (deprecatedFG && deprecatedBG) {
+ try {
+ if (getLuminance(parse(deprecatedBG)) < getLuminance(parse(deprecatedFG))) {
+ return true
+ }
+ } catch (err) {
+ console.error('Cannot parse deprecated CSS variables', err)
+ }
+ }
+
+ return false
+ }
+
private listenUserTheme () {
// We don't need them anymore
this.themeFromLocalStorage = undefined
@@ -163,7 +303,10 @@ export class ThemeService {
const lastActiveTheme = JSON.parse(lastActiveThemeString)
this.themeFromLocalStorage = lastActiveTheme
- this.injectThemes([ lastActiveTheme ], true)
+ if (!this.internalThemes.includes(this.themeFromLocalStorage.name)) {
+ this.injectThemes([ lastActiveTheme ], true)
+ }
+
this.updateCurrentTheme()
} catch (err) {
logger.error('Cannot parse last active theme.', err)
@@ -205,8 +348,4 @@ export class ThemeService {
private getTheme (name: string) {
return this.themes.find(t => t.name === name)
}
-
- private hasDarkTheme () {
- return this.serverConfig.theme.registered.some(t => t.name === 'dark')
- }
}
diff --git a/client/src/app/core/users/user.model.ts b/client/src/app/core/users/user.model.ts
index f075ece2b3..f98e051066 100644
--- a/client/src/app/core/users/user.model.ts
+++ b/client/src/app/core/users/user.model.ts
@@ -102,7 +102,7 @@ export class User implements UserServerModel {
else this.account.resetAvatar()
}
- isUploadDisabled () {
+ hasUploadDisabled () {
return this.videoQuota === 0 || this.videoQuotaDaily === 0
}
diff --git a/client/src/app/core/wrappers/screen.service.ts b/client/src/app/core/wrappers/screen.service.ts
index deea7f73bd..92c54d5887 100644
--- a/client/src/app/core/wrappers/screen.service.ts
+++ b/client/src/app/core/wrappers/screen.service.ts
@@ -12,12 +12,7 @@ export class ScreenService {
this.refreshWindowInnerWidth()
}
- isInSmallView (marginLeft = 0) {
- if (marginLeft > 0) {
- const contentWidth = this.getWindowInnerWidth() - marginLeft
- return contentWidth < 800
- }
-
+ isInSmallView () {
return this.getWindowInnerWidth() < 800
}
@@ -33,19 +28,6 @@ export class ScreenService {
return !!('ontouchstart' in window || (navigator as any).msMaxTouchPoints)
}
- getNumberOfAvailableMiniatures () {
- const screenWidth = this.getWindowInnerWidth()
-
- let numberOfVideos = 1
-
- if (screenWidth > 1850) numberOfVideos = 5
- else if (screenWidth > 1410) numberOfVideos = 4
- else if (screenWidth > 1120) numberOfVideos = 3
- else if (screenWidth > 890) numberOfVideos = 2
-
- return numberOfVideos
- }
-
// Cache window inner width, because it's an expensive call
getWindowInnerWidth () {
if (this.cacheWindowInnerWidthExpired()) this.refreshWindowInnerWidth()
diff --git a/client/src/app/header/header.component.html b/client/src/app/header/header.component.html
index 4e327769da..770ee8fb19 100644
--- a/client/src/app/header/header.component.html
+++ b/client/src/app/header/header.component.html
@@ -1,6 +1,85 @@
-<my-search-typeahead class="w-100 d-flex justify-content-center"></my-search-typeahead>
+<div class="root" [hidden]="!loaded || (loggedIn && !user.account)">
+ <a class="peertube-title" [routerLink]="getDefaultRoute()" [queryParams]="getDefaultRouteQuery()">
-<a class="peertube-button-link orange-button publish-button" routerLink="/videos/upload">
- <my-global-icon iconName="upload" aria-hidden="true"></my-global-icon>
- <span i18n class="publish-button-label">Publish</span>
-</a>
+ <span class="icon-logo"></span>
+ <span class="instance-name">{{ instanceName }}</span>
+ </a>
+
+ <my-search-typeahead></my-search-typeahead>
+
+ <div class="d-flex align-items-center buttons-container">
+ @if (!loggedIn) {
+ <my-button theme="tertiary" rounded="true" class="margin-button" icon="cog" (click)="openQuickSettings()"></my-button>
+
+ <a *ngIf="isRegistrationAllowed()" routerLink="/signup" class="peertube-button-link secondary-button w-100 ellipsis margin-button">
+ <my-signup-label [requiresApproval]="requiresApproval"></my-signup-label>
+ </a>
+
+ <my-login-link class="login-label" className="peertube-button-link primary-button w-100 ellipsis"></my-login-link>
+ <my-login-link class="login-icon" className="peertube-button-link primary-button icon-only w-100 ellipsis" icon="true" label=""></my-login-link>
+ } @else {
+ <my-notification-dropdown class="margin-button"></my-notification-dropdown>
+
+ <my-button theme="tertiary" rounded="true" class="margin-button" icon="cog" ptRouterLink="/my-account"></my-button>
+
+ <div
+ class="logged-in-container" ngbDropdown #dropdown="ngbDropdown" placement="bottom-left auto"
+ container="body"
+ >
+ <button class="tertiary-button" ngbDropdownToggle>
+ <my-actor-avatar [actor]="user.account" actorType="account" size="34" responseSize="true"></my-actor-avatar>
+
+ <div class="logged-in-info text-start ms-2">
+ <div class="display-name ellipsis">{{ user.account?.displayName }}</div>
+
+ <div class="username ellipsis fs-8">&#64;{{ user.username }}</div>
+ </div>
+ </button>
+
+ <div ngbDropdownMenu>
+ <a
+ *ngIf="user.account" ngbDropdownItem class="dropdown-item" [routerLink]="[ '/a', user.account.nameWithHost ]"
+ #profile
+ >
+ <my-global-icon iconName="user" aria-hidden="true"></my-global-icon> <ng-container i18n>Public profile</ng-container>
+ </a>
+
+ <div class="dropdown-divider"></div>
+
+ <a
+ *ngIf="user.account" ngbDropdownItem class="dropdown-item" routerLink="/my-account"
+ #manageAccount
+ >
+ <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon> <ng-container i18n>Manage my account</ng-container>
+ </a>
+
+ <div class="dropdown-divider"></div>
+
+ <button
+ myPluginSelector pluginSelectorId="menu-user-dropdown-language-item"
+ ngbDropdownItem class="dropdown-item" (click)="openLanguageChooser()"
+ >
+ <my-global-icon iconName="language" aria-hidden="true"></my-global-icon>
+ <span i18n>Interface:</span>
+ <span class="ms-auto ps-2 muted">{{ currentInterfaceLanguage }}</span>
+ </button>
+
+ <button *ngIf="!isInMobileView" ngbDropdownItem class="dropdown-item" (click)="openHotkeysCheatSheet()">
+ <my-global-icon iconName="keyboard" aria-hidden="true"></my-global-icon>
+ <ng-container i18n>Keyboard shortcuts</ng-container>
+ </button>
+
+ <button ngbDropdownItem (click)="logout($event)" class="dropdown-item">
+ <my-global-icon iconName="sign-out" aria-hidden="true"></my-global-icon>
+ <ng-container i18n>Log out</ng-container>
+ </button>
+ </div>
+ </div>
+ }
+ </div>
+
+ <my-button theme="tertiary" rounded="true" class="menu-button margin-button" icon="menu" (click)="toggleMenu()"></my-button>
+</div>
+
+<my-language-chooser #languageChooserModal></my-language-chooser>
+<my-quick-settings #quickSettingsModal></my-quick-settings>
diff --git a/client/src/app/header/header.component.scss b/client/src/app/header/header.component.scss
index f2b5d0d4cd..0d934c6504 100644
--- a/client/src/app/header/header.component.scss
+++ b/client/src/app/header/header.component.scss
@@ -1,22 +1,215 @@
+@use 'sass:math';
@use '_variables' as *;
@use '_mixins' as *;
+@use '_button-mixins' as *;
-.publish-button {
- @include button-with-icon(21px, 3px, -1px);
- @include margin-right(25px);
+.root {
+ --co-logo-size: 34px;
+ --co-root-padding: 1.5rem;
- @media screen and (max-width: $mobile-view) {
- padding-right: 10px;
- padding-left: 10px;
+ background-color: pvar(--bg);
- @include margin-right(10px);
+ padding: var(--co-root-padding);
+ width: 100%;
- .icon.icon-upload {
- @include margin-right(0);
+ display: flex;
+ align-items: center;
+}
+
+.peertube-title {
+ flex-shrink: 1;
+ min-width: var(--co-logo-size);
+ flex-grow: 1;
+ font-size: 24px;
+ font-weight: $font-bold;
+ color: inherit !important;
+ display: flex;
+ align-items: center;
+
+ @include padding-left(18px);
+ @include margin-right(0.5rem);
+ @include disable-default-a-behaviour;
+}
+
+.instance-name {
+ width: 100%;
+
+ @include ellipsis;
+ @include margin-left(10px);
+}
+
+.icon-logo {
+ display: inline-block;
+ width: var(--co-logo-size);
+ height: var(--co-logo-size);
+ min-width: var(--co-logo-size);
+ max-width: var(--co-logo-size);
+
+ background-repeat: no-repeat;
+ background-size: contain;
+}
+
+my-search-typeahead {
+ max-width: 270px;
+
+ @include margin-right(1.5rem);
+}
+
+.margin-button {
+ @include margin-right(0.75rem);
+}
+
+.menu-button {
+ display: none;
+ justify-self: end;
+}
+
+.dropdown {
+ z-index: #{z('header') + 1} !important;
+}
+
+.dropdown-item {
+ cursor: pointer;
+ display: flex;
+ align-items: center;
+
+ @include dropdown-with-icon-item;
+
+ &:hover {
+ .hover-display-toggle {
+ display: none;
+ }
+
+ .hover-display-toggle[hidden] {
+ display: inherit !important;
}
+ }
+}
+
+.logged-in-container {
+ border-radius: 25px;
+ transition: all .1s ease-in-out;
+ cursor: pointer;
+ max-width: 250px;
+ height: 100%;
+
+ .display-name {
+ font-weight: $font-bold;
+ color: pvar(--fg);
+ }
+
+ .username {
+ color: pvar(--fg-300);
+ }
+
+ > .dropdown-toggle {
+ display: flex;
+ align-items: center;
+ border-radius: 6px;
+
+ &::after {
+ // Disable bootstrap toggle
+ border: 0;
+ }
+ }
+}
+
+my-actor-avatar {
+ width: 34px;
+ height: 34px;
+}
- .publish-button-label {
+.login-icon {
+ display: none;
+}
+
+@media screen and (max-width: $menu-overlay-view) {
+ .peertube-title {
+ @include padding-left(0);
+ }
+
+ .icon-logo {
+ @include margin-left(0);
+ }
+}
+
+@media screen and (max-width: $small-view) {
+ .root {
+ --co-root-padding: 1rem;
+ }
+
+ my-search-typeahead {
+ @include margin-right(0.5rem);
+ }
+
+ .margin-button[theme=tertiary] {
+ @include margin-right(5px);
+ }
+
+ my-actor-avatar {
+ width: 24px;
+ height: 24px;
+ }
+
+ .dropdown-toggle {
+ @include peertube-button;
+ @include rounded-icon-button;
+
+ &::after {
display: none;
}
}
+
+ .logged-in-info {
+ display: none;
+ }
+
+ .login-icon {
+ display: inline-block;
+ }
+
+ .login-label {
+ display: none;
+ }
+}
+
+@media screen and (max-width: $mobile-view) {
+ .root {
+ --co-logo-size: 48px;
+
+ display: grid;
+ grid-template-columns: auto minmax(0, 1fr) auto;
+ row-gap: 0.5rem;
+ justify-content: space-between;
+
+ > * {
+ grid-row: 1;
+ }
+ }
+
+ .buttons-container {
+ margin: 0 auto;
+ }
+
+ .menu-button {
+ display: block;
+ position: relative;
+ right: -10px;
+ }
+
+ my-search-typeahead {
+ grid-row: 2 !important;
+ grid-column: 1 / 4;
+ max-width: 100%;
+
+ @include margin-right(0);
+ }
+
+ .peertube-title {
+ @include margin-right(5px)
+ }
+
+ .instance-name {
+ display: none;
+ }
}
diff --git a/client/src/app/header/header.component.ts b/client/src/app/header/header.component.ts
index 4a6bc71cab..28e7e17710 100644
--- a/client/src/app/header/header.component.ts
+++ b/client/src/app/header/header.component.ts
@@ -1,6 +1,29 @@
-import { Component } from '@angular/core'
+import { CommonModule } from '@angular/common'
+import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'
+import { Router, RouterLink } from '@angular/router'
+import {
+ AuthService,
+ AuthStatus,
+ AuthUser,
+ HotkeysService,
+ MenuService,
+ RedirectService,
+ ScreenService,
+ ServerService
+} from '@app/core'
+import { NotificationDropdownComponent } from '@app/header/notification-dropdown.component'
+import { LanguageChooserComponent } from '@app/menu/language-chooser.component'
+import { QuickSettingsModalComponent } from '@app/menu/quick-settings-modal.component'
+import { ActorAvatarComponent } from '@app/shared/shared-actor-image/actor-avatar.component'
+import { InputSwitchComponent } from '@app/shared/shared-forms/input-switch.component'
+import { PeertubeModalService } from '@app/shared/shared-main/peertube-modal/peertube-modal.service'
+import { LoginLinkComponent } from '@app/shared/shared-main/users/login-link.component'
+import { SignupLabelComponent } from '@app/shared/shared-main/users/signup-label.component'
+import { NgbDropdown, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'
+import { ServerConfig } from '@peertube/peertube-models'
+import { Subscription } from 'rxjs'
import { GlobalIconComponent } from '../shared/shared-icons/global-icon.component'
-import { RouterLink } from '@angular/router'
+import { ButtonComponent } from '../shared/shared-main/buttons/button.component'
import { SearchTypeaheadComponent } from './search-typeahead.component'
@Component({
@@ -8,7 +31,156 @@ import { SearchTypeaheadComponent } from './search-typeahead.component'
templateUrl: './header.component.html',
styleUrls: [ './header.component.scss' ],
standalone: true,
- imports: [ SearchTypeaheadComponent, RouterLink, GlobalIconComponent ]
+ imports: [
+ CommonModule,
+ NotificationDropdownComponent,
+ ActorAvatarComponent,
+ InputSwitchComponent,
+ SignupLabelComponent,
+ LoginLinkComponent,
+ LanguageChooserComponent,
+ QuickSettingsModalComponent,
+ GlobalIconComponent,
+ RouterLink,
+ NgbDropdownModule,
+ SearchTypeaheadComponent,
+ RouterLink,
+ GlobalIconComponent,
+ ButtonComponent
+ ]
})
-export class HeaderComponent {}
+export class HeaderComponent implements OnInit, OnDestroy {
+ @ViewChild('languageChooserModal', { static: true }) languageChooserModal: LanguageChooserComponent
+ @ViewChild('quickSettingsModal', { static: true }) quickSettingsModal: QuickSettingsModalComponent
+ @ViewChild('dropdown') dropdown: NgbDropdown
+
+ user: AuthUser
+ loggedIn: boolean
+
+ hotkeysHelpVisible = false
+
+ currentInterfaceLanguage: string
+
+ loaded = false
+
+ private serverConfig: ServerConfig
+
+ private quickSettingsModalSub: Subscription
+ private hotkeysSub: Subscription
+ private authSub: Subscription
+
+ constructor (
+ private authService: AuthService,
+ private serverService: ServerService,
+ private redirectService: RedirectService,
+ private hotkeysService: HotkeysService,
+ private screenService: ScreenService,
+ private modalService: PeertubeModalService,
+ private router: Router,
+ private menu: MenuService
+ ) { }
+
+ get language () {
+ return this.languageChooserModal.getCurrentLanguage()
+ }
+
+ get requiresApproval () {
+ return this.serverConfig.signup.requiresApproval
+ }
+
+ get instanceName () {
+ return this.serverService.getHTMLConfig().instance.name
+ }
+
+ isInMobileView () {
+ return this.screenService.isInMobileView()
+ }
+
+ isInSmallView () {
+ return this.screenService.isInSmallView()
+ }
+
+ ngOnInit () {
+ this.currentInterfaceLanguage = this.languageChooserModal.getCurrentLanguage()
+
+ this.loggedIn = this.authService.isLoggedIn()
+ this.updateUserState()
+
+ this.authSub = this.authService.loginChangedSource.subscribe(status => {
+ if (status === AuthStatus.LoggedIn) {
+ this.loggedIn = true
+ } else if (status === AuthStatus.LoggedOut) {
+ this.loggedIn = false
+ }
+
+ this.updateUserState()
+ })
+
+ this.hotkeysSub = this.hotkeysService.cheatSheetToggle
+ .subscribe(isOpen => this.hotkeysHelpVisible = isOpen)
+
+ this.serverService.getConfig()
+ .subscribe(config => this.serverConfig = config)
+
+ this.quickSettingsModalSub = this.modalService.openQuickSettingsSubject
+ .subscribe(() => this.openQuickSettings())
+
+ this.loaded = true
+ }
+
+ ngOnDestroy () {
+ if (this.quickSettingsModalSub) this.quickSettingsModalSub.unsubscribe()
+ if (this.hotkeysSub) this.hotkeysSub.unsubscribe()
+ if (this.authSub) this.authSub.unsubscribe()
+ }
+
+ // ---------------------------------------------------------------------------
+
+ getDefaultRoute () {
+ return this.redirectService.getDefaultRoute().split('?')[0]
+ }
+
+ getDefaultRouteQuery () {
+ return this.router.parseUrl(this.redirectService.getDefaultRoute()).queryParams
+ }
+
+ // ---------------------------------------------------------------------------
+
+ isRegistrationAllowed () {
+ if (!this.serverConfig) return false
+
+ return this.serverConfig.signup.allowed &&
+ this.serverConfig.signup.allowedForCurrentIP
+ }
+
+ logout (event: Event) {
+ event.preventDefault()
+
+ this.authService.logout()
+ // Redirect to home page
+ this.redirectService.redirectToHomepage()
+ }
+
+ openLanguageChooser () {
+ this.languageChooserModal.show()
+ }
+
+ openQuickSettings () {
+ this.quickSettingsModal.show()
+ }
+
+ openHotkeysCheatSheet () {
+ this.hotkeysService.cheatSheetToggle.next(!this.hotkeysHelpVisible)
+ }
+
+ toggleMenu () {
+ this.menu.toggleMenu()
+ }
+
+ private updateUserState () {
+ this.user = this.loggedIn
+ ? this.authService.getUser()
+ : undefined
+ }
+}
diff --git a/client/src/app/menu/notification-dropdown.component.html b/client/src/app/header/notification-dropdown.component.html
similarity index 59%
rename from client/src/app/menu/notification-dropdown.component.html
rename to client/src/app/header/notification-dropdown.component.html
index edc6ef19dd..50b6cbb250 100644
--- a/client/src/app/menu/notification-dropdown.component.html
+++ b/client/src/app/header/notification-dropdown.component.html
@@ -3,27 +3,36 @@
<div *ngIf="unreadNotifications >= 100" class="unread-notifications">99+</div>
</ng-template>
+<ng-template #notificationIcon>
+ @if (unreadNotifications) {
+ <my-global-icon iconName="opened-bell"></my-global-icon>
+ } @else {
+ <my-global-icon iconName="bell"></my-global-icon>
+ }
+</ng-template>
+
@if (isInMobileView) {
- <div i18n-title title="View your notifications" class="notification-inbox-link">
+ <a
+ i18n-title title="View your notifications"
+ class="peertube-button tertiary-button rounded-icon-button notification-inbox-link"
+ routerLink="/my-account/notifications" routerLinkActive="active" #link (click)="onNavigate(link)"
+ >
<ng-container *ngTemplateOutlet="notificationNumber"></ng-container>
- <a routerLink="/my-account/notifications" routerLinkActive="active" #link (click)="onNavigate(link)">
- <my-global-icon iconName="bell"></my-global-icon>
- </a>
- </div>
+ <ng-container *ngTemplateOutlet="notificationIcon"></ng-container>
+ </a>
} @else {
<div
ngbDropdown autoClose="outside" placement="bottom" container="body" dropdownClass="dropdown-notifications"
#dropdown="ngbDropdown" (shown)="onDropdownShown()" (hidden)="onDropdownHidden()"
>
<button
- i18n-title title="View your notifications"
- class="border-0 text-start disable-dropdown-caret" [ngClass]="{ 'notification-inbox-dropdown': true, 'shown': opened, 'hidden': isInMobileView }"
+ i18n-title title="View your notifications" class="peertube-button tertiary-button rounded-icon-button disable-dropdown-caret notification-inbox-dropdown"
+ [ngClass]="{ 'shown': opened, 'hidden': isInMobileView }"
ngbDropdownToggle
>
<ng-container *ngTemplateOutlet="notificationNumber"></ng-container>
-
- <my-global-icon iconName="bell"></my-global-icon>
+ <ng-container *ngTemplateOutlet="notificationIcon"></ng-container>
</button>
<div ngbDropdownMenu>
@@ -34,13 +43,14 @@
<div>
<button
*ngIf="unreadNotifications"
- i18n-title title="Mark all as read" class="me-2"
+ i18n-title title="Mark all as read" class="me-2 peertube-button tertiary-button rounded-icon-button"
(click)="markAllAsRead()"
>
<my-global-icon iconName="tick"></my-global-icon>
</button>
<a
+ class="peertube-button-link tertiary-button rounded-icon-button"
i18n-title title="Update your notification preferences"
routerLink="/my-account/settings" fragment="notifications"
#settingsNotifications (click)="onNavigate(settingsNotifications)"
@@ -59,10 +69,11 @@
[markAllAsReadSubject]="markAllAsReadSubject" (notificationsLoaded)="onNotificationLoaded()"
></my-user-notifications>
- <a *ngIf="loaded" class="all-notifications" routerLink="/my-account/notifications" #notifications (click)="onNavigate(notifications)">
- <my-global-icon class="me-1" iconName="bell" aria-hidden="true"></my-global-icon>
- <span i18n>See all your notifications</span>
- </a>
+ <div class="all-notifications">
+ <a *ngIf="loaded" class="text-decoration-underline" routerLink="/my-account/notifications" #notifications (click)="onNavigate(notifications)" i18n>
+ View all
+ </a>
+ </div>
</div>
</div>
diff --git a/client/src/app/header/notification-dropdown.component.scss b/client/src/app/header/notification-dropdown.component.scss
new file mode 100644
index 0000000000..abef09f618
--- /dev/null
+++ b/client/src/app/header/notification-dropdown.component.scss
@@ -0,0 +1,99 @@
+@use '_variables' as *;
+@use '_mixins' as *;
+
+.content {
+ scrollbar-color: auto;
+}
+
+.notification-inbox-dropdown.hidden {
+ display: none;
+}
+
+::ng-deep {
+ .dropdown-notifications {
+ max-width: none;
+ top: -6px !important;
+ left: 7px !important;
+
+ .dropdown-menu {
+ padding: 0;
+ font-size: 14px;
+ font-family: $main-fonts;
+ width: 400px;
+
+ .loader {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ padding: 5px 0;
+ }
+
+ .content {
+ max-height: 150px;
+ transition: max-height 0.15s ease-out;
+ display: flex;
+ height: 500px;
+ flex-direction: column;
+
+ &.loaded {
+ max-height: 500px;
+ }
+
+ > my-user-notifications:nth-child(2) {
+ overflow-y: auto;
+ flex-grow: 1;
+ }
+ }
+
+ .notifications-header {
+ display: flex;
+ justify-content: space-between;
+
+ border-bottom: 1px solid $separator-border-color-on-secondary;
+ align-items: center;
+ padding: 0 12px;
+ font-size: 14px;
+ line-height: normal;
+ font-weight: bold;
+ text-transform: uppercase;
+ min-height: 50px;
+ }
+
+ .all-notifications {
+ border-top: 1px solid $separator-border-color-on-secondary;
+ margin-top: -1px; // To not have 2 borders with the last notification
+ text-align: center;
+ padding: 0.75rem 0;
+ }
+ }
+ }
+}
+
+.notification-inbox-dropdown,
+.notification-inbox-link {
+ cursor: pointer;
+ position: relative;
+ display: inline-block;
+
+ .unread-notifications {
+ // Use margin left and not start here on purpose
+ margin-left: 20px;
+ }
+
+ .unread-notifications {
+ position: absolute;
+ top: 6px;
+ left: 0;
+
+ background-color: pvar(--primary);
+ color: pvar(--on-primary);
+ font-weight: $font-bold;
+ font-size: 10px;
+
+ border-radius: 16px;
+
+ line-height: 16px;
+ padding: 0 3px;
+ }
+}
diff --git a/client/src/app/menu/notification-dropdown.component.ts b/client/src/app/header/notification-dropdown.component.ts
similarity index 100%
rename from client/src/app/menu/notification-dropdown.component.ts
rename to client/src/app/header/notification-dropdown.component.ts
diff --git a/client/src/app/header/search-typeahead.component.html b/client/src/app/header/search-typeahead.component.html
index 1b5c28d66d..b9fe8c4b5d 100644
--- a/client/src/app/header/search-typeahead.component.html
+++ b/client/src/app/header/search-typeahead.component.html
@@ -1,4 +1,8 @@
-<div class="d-inline-flex position-relative" id="typeahead-container">
+<div class="position-relative" id="typeahead-container">
+ <button class="button-unstyle search-button" title="Search" i18n-title (click)="doSearch()">
+ <my-global-icon iconName="search"></my-global-icon>
+ </button>
+
<input
type="search" id="search-video" name="search-video" #searchVideo
i18n-ariaLabel aria-label="Search videos, playlists, channels…" i18n-placeholder placeholder="Search videos, playlists, channels…"
@@ -6,10 +10,6 @@
autocomplete="off" aria-describedby="typeahead-input-help"
>
- <button class="border-0 search-button" title="Search" i18n-title (click)="doSearch()">
- <my-global-icon iconName="search"></my-global-icon>
- </button>
-
<div class="position-absolute jump-to-suggestions">
<ul [hidden]="!search || !areSuggestionsOpened" role="listbox" class="p-0 m-0">
@@ -28,7 +28,7 @@
<!-- suggestion help, not shown until one of the suggestions is selected and specific to that suggestion -->
<div *ngIf="showSearchGlobalHelp()" id="typeahead-suggestion-help" class="overflow-hidden">
<div class="d-flex justify-content-between">
- <div class="small-title mb-2" i18n>GLOBAL SEARCH</div>
+ <div class="section-label mb-2" i18n>GLOBAL SEARCH</div>
<span *ngIf="serverConfig" class="muted" i18n>using {{ serverConfig.search.searchIndex.url }}</span>
</div>
@@ -39,7 +39,7 @@
<!-- search instructions, when search input is empty -->
<div [hidden]="this.search" id="typeahead-input-help" class="overflow-hidden">
<span class="muted" i18n>Your query will be matched against video names or descriptions, channel names.</span>
- <div class="mt-3 mb-2 small-title" i18n>ADVANCED SEARCH</div>
+ <div class="mt-3 mb-2 section-label" i18n>ADVANCED SEARCH</div>
<ul>
<li>
diff --git a/client/src/app/header/search-typeahead.component.scss b/client/src/app/header/search-typeahead.component.scss
index 5fc711813b..7c2fdc3457 100644
--- a/client/src/app/header/search-typeahead.component.scss
+++ b/client/src/app/header/search-typeahead.component.scss
@@ -1,35 +1,39 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
#search-video {
text-overflow: ellipsis;
- @include peertube-input-text($search-input-width, 14px);
- @include padding-left(10px);
- @include padding-right(40px); // For the search icon
+ @include peertube-input-text(100%);
+
+ & {
+ padding-inline-start: 42px; // For the search icon
+ padding-inline-end: 20px; // For the search icon
+ }
&::placeholder {
- color: pvar(--inputPlaceholderColor);
+ color: pvar(--input-placeholder);
}
}
.search-button {
- display: inline-flex;
- align-self: center;
position: absolute;
+ top: 0;
+ bottom: 0;
- @include right(5px);
+ @include left(18px);
&:hover {
opacity: 0.8;
}
my-global-icon {
- @include icon(18px);
+ height: 18px;
+ width: 18px;
- & {
- display: inline-flex;
- }
+ position: relative;
+ top: -2px;
}
}
@@ -43,8 +47,8 @@
#typeahead-suggestion-help,
#typeahead-input-help,
.suggestion {
- border: 1px solid pvar(--mainBackgroundColor);
- background: pvar(--mainBackgroundColor);
+ border: 1px solid pvar(--bg);
+ background: pvar(--bg-secondary-400);
transition: .3s ease;
transition-property: box-shadow;
cursor: pointer;
@@ -80,30 +84,6 @@
#typeahead-container {
font-size: 14px;
- margin: 0 10px;
-
- input {
- border: 1px solid pvar(--mainBackgroundColor) !important;
- box-shadow: rgba(0, 0, 0, 0.1) 0 1px 20px 0;
- flex-grow: 1;
- transition: box-shadow .3s ease, width .2s ease;
- }
-
- @media screen and (max-width: $small-view) {
- input {
- width: 200px;
- }
- }
-
- @media screen and (max-width: $mobile-view) {
- input {
- width: 150px;
- }
- }
-
- span {
- right: 10px;
- }
> div:last-child {
// we have to switch the display and not the opacity,
@@ -136,10 +116,6 @@
}
}
-.small-title {
- @include in-content-small-title;
-}
-
my-suggestion {
width: 100%;
}
diff --git a/client/src/app/header/suggestion.component.html b/client/src/app/header/suggestion.component.html
index 3972839103..812b72d857 100644
--- a/client/src/app/header/suggestion.component.html
+++ b/client/src/app/header/suggestion.component.html
@@ -1,12 +1,12 @@
<a
- tabindex="-1" class="d-flex flex-auto align-center p-2" [class.focus-visible]="active"
+ tabindex="-1" class="d-flex flex-auto align-items-center p-2" [class.focus-visible]="active"
[title]="getTitle()"
[attr.aria-describedby]="describedby"
>
<my-global-icon class="me-2" iconName="search"></my-global-icon>
<div
- class="flex-auto overflow-hidden no-wrap d-flex align-center"
+ class="flex-auto overflow-hidden no-wrap d-flex align-items-center"
[attr.aria-label]="result.text"
>
{{ result.text }}
diff --git a/client/src/app/header/suggestion.component.scss b/client/src/app/header/suggestion.component.scss
index d6bd1017e3..a9f39129e7 100644
--- a/client/src/app/header/suggestion.component.scss
+++ b/client/src/app/header/suggestion.component.scss
@@ -8,24 +8,22 @@ a {
&,
&:hover {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
&.focus-visible {
- background-color: pvar(--mainHoverColor);
- color: pvar(--mainBackgroundColor);
+ background-color: pvar(--primary);
+ color: pvar(--on-primary);
}
}
}
.result-type {
- background-color: pvar(--mainBackgroundColor);
- color: pvar(--mainForegroundColor);
+ background-color: pvar(--bg);
+ color: pvar(--fg-400);
}
my-global-icon {
- width: 17px;
- position: relative;
- top: -1px;
+ color: pvar(--on-primary);
- @include apply-svg-color(pvar(--mainForegroundColor));
+ @include global-icon-size(17px);
}
diff --git a/client/src/app/hotkeys/hotkeys-cheat-sheet.component.scss b/client/src/app/hotkeys/hotkeys-cheat-sheet.component.scss
index bdfd4a30b9..69ed3a612a 100644
--- a/client/src/app/hotkeys/hotkeys-cheat-sheet.component.scss
+++ b/client/src/app/hotkeys/hotkeys-cheat-sheet.component.scss
@@ -10,9 +10,9 @@
height: 100%;
top: 0;
left: 0;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
font-size: 1em;
- background-color: pvar(--mainBackgroundColor);
+ background-color: pvar(--bg);
}
.cfp-hotkeys-container.fade {
@@ -43,7 +43,7 @@
margin: auto;
width: fit-content;
list-style: none;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
}
.cfp-hotkeys-keys,
@@ -57,9 +57,9 @@
> span {
display: inline-block;
- color: pvar(--mainBackgroundColor);
- background-color: pvar(--mainForegroundColor);
- border: 1px solid pvar(--mainForegroundColor);
+ color: pvar(--bg);
+ background-color: pvar(--fg);
+ border: 1px solid pvar(--fg);
border-radius: 5px;
text-align: center;
box-shadow: inset 0 1px 0 #666, 0 1px 0 #bbb;
diff --git a/client/src/app/menu/home-menu.component.html b/client/src/app/menu/home-menu.component.html
new file mode 100644
index 0000000000..9233c8d90c
--- /dev/null
+++ b/client/src/app/menu/home-menu.component.html
@@ -0,0 +1,3 @@
+<div class="margin-content">
+ <my-horizontal-menu [menuEntries]="menuEntries"></my-horizontal-menu>
+</div>
diff --git a/client/src/app/menu/home-menu.component.ts b/client/src/app/menu/home-menu.component.ts
new file mode 100644
index 0000000000..fd7cfff58e
--- /dev/null
+++ b/client/src/app/menu/home-menu.component.ts
@@ -0,0 +1,37 @@
+import { Component, OnInit } from '@angular/core'
+import { AuthService, ServerService } from '@app/core'
+import { HorizontalMenuComponent, HorizontalMenuEntry } from '@app/shared/shared-main/menu/horizontal-menu.component'
+
+@Component({
+ selector: 'my-home-menu',
+ templateUrl: './home-menu.component.html',
+ standalone: true,
+ imports: [ HorizontalMenuComponent ]
+})
+export class HomeMenuComponent implements OnInit {
+ menuEntries: HorizontalMenuEntry[] = []
+
+ constructor (
+ private server: ServerService,
+ private authService: AuthService
+ ) {
+
+ }
+
+ ngOnInit () {
+ const config = this.server.getHTMLConfig()
+ this.menuEntries = []
+
+ if (config.homepage.enabled) {
+ this.menuEntries.push({ label: $localize`Home`, routerLink: '/home' })
+ }
+
+ this.menuEntries.push({ label: $localize`Discover`, routerLink: '/videos/overview' })
+
+ if (this.authService.isLoggedIn()) {
+ this.menuEntries.push({ label: $localize`Subscriptions`, routerLink: '/videos/subscriptions' })
+ }
+
+ this.menuEntries.push({ label: $localize`Browse videos`, routerLink: '/videos/browse' })
+ }
+}
diff --git a/client/src/app/menu/language-chooser.component.html b/client/src/app/menu/language-chooser.component.html
index ec4ac389ec..6a40795070 100644
--- a/client/src/app/menu/language-chooser.component.html
+++ b/client/src/app/menu/language-chooser.component.html
@@ -7,7 +7,7 @@
</div>
- <a i18n class="help-to-translate" target="_blank" rel="noreferrer noopener" href="https://github.com/Chocobozzz/PeerTube/blob/develop/support/doc/translation.md">
+ <a i18n class="peertube-button-link primary-button rounded-0" target="_blank" rel="noreferrer noopener" href="https://github.com/Chocobozzz/PeerTube/blob/develop/support/doc/translation.md">
Help to translate PeerTube!
</a>
diff --git a/client/src/app/menu/language-chooser.component.scss b/client/src/app/menu/language-chooser.component.scss
index 1bd06ac9db..447f6b2502 100644
--- a/client/src/app/menu/language-chooser.component.scss
+++ b/client/src/app/menu/language-chooser.component.scss
@@ -1,18 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
-.help-to-translate {
- border-radius: 0;
-
- @include peertube-button-link;
- @include orange-button;
-
- &:focus-visible,
- &:focus {
- box-shadow: none;
- }
-}
-
.modal-body {
text-align: center;
diff --git a/client/src/app/menu/menu.component.html b/client/src/app/menu/menu.component.html
index b16fdad204..196fe05cd5 100644
--- a/client/src/app/menu/menu.component.html
+++ b/client/src/app/menu/menu.component.html
@@ -1,206 +1,87 @@
-<div class="menu-wrapper">
- <nav [ngClass]="{ 'is-logged-in': isLoggedIn }">
- <div class="top-menu">
- <div *ngIf="isLoggedIn" class="logged-in-block">
- <div>
- <div
- class="logged-in-more" ngbDropdown #dropdown="ngbDropdown" placement="bottom-left auto"
- container="body" (openChange)="onDropdownOpenChange($event)"
- >
- <button class="border-0 text-start" ngbDropdownToggle>
- <my-actor-avatar [actor]="user.account" actorType="account" size="34"></my-actor-avatar>
+<ng-template #moreInfoButton>
+ <my-button i18n class="mt-2 d-block" theme="secondary" icon="help" i18n-ariaLabel aria-label="More info" i18n ptRouterLink="/about" ptRouterLinkActive="active">
+ @if (!collapsed) {
+ More info
+ }
+ </my-button>
+</ng-template>
- <div class="logged-in-info">
- <div class="logged-in-display-name">{{ user.account?.displayName }}</div>
+<div class="menu-container" [ngClass]="{ collapsed: collapsed, 'logged-in': loggedIn }">
- <div class="logged-in-username">&#64;{{ user.username }}</div>
- </div>
+ <div class="main-menu-wrapper">
+ <div class="main-menu-scrollbar">
- <div class="dropdown-toggle-indicator">
- <span class="chevron-down"></span>
- </div>
- </button>
-
- <div ngbDropdownMenu>
- <a
- *ngIf="user.account" ngbDropdownItem ngbDropdownToggle class="dropdown-item" [routerLink]="[ '/a', user.account.nameWithHost ]"
- #profile (click)="onActiveLinkScrollToAnchor(profile)"
- >
- <my-global-icon iconName="go" aria-hidden="true"></my-global-icon> <ng-container i18n>Public profile</ng-container>
- </a>
-
- <div class="dropdown-divider"></div>
-
- <button
- myPluginSelector pluginSelectorId="menu-user-dropdown-language-item"
- ngbDropdownItem class="dropdown-item" (click)="openLanguageChooser()"
- >
- <my-global-icon iconName="language" aria-hidden="true"></my-global-icon>
- <span i18n>Interface:</span>
- <span class="ms-auto muted">{{ currentInterfaceLanguage }}</span>
- </button>
-
- <a ngbDropdownItem class="dropdown-item" routerLink="/my-account/settings" fragment="video-languages-subtitles"
- #settingsLanguagesSubtitles (click)="onActiveLinkScrollToAnchor(settingsLanguagesSubtitles)">
- <my-global-icon iconName="video-lang" aria-hidden="true"></my-global-icon>
- <span i18n>Videos:</span>
- <span class="ms-auto muted">{{ videoLanguages.join(', ') }}</span>
- </a>
-
- <a ngbDropdownItem class="dropdown-item settings-sensitive" routerLink="/my-account/settings"
- fragment="video-sensitive-content-policy" #settingsSensitiveContentPolicy
- (click)="onActiveLinkScrollToAnchor(settingsSensitiveContentPolicy)"
- >
- <my-global-icon class="hover-display-toggle" [hidden]="user.nsfwPolicy === 'display'" iconName="eye-open" aria-hidden="true"></my-global-icon>
- <my-global-icon class="hover-display-toggle" [hidden]="user.nsfwPolicy !== 'display'" iconName="eye-close" aria-hidden="true"></my-global-icon>
- <span i18n>Sensitive:</span>
- <span class="ms-auto muted">{{ nsfwPolicy }}</span>
- </a>
-
- <button class="dropdown-item" (mousedown)="$event.stopPropagation(); toggleUseP2P()" [ariaPressed]="user.p2pEnabled" ngbDropdownItem>
- <my-global-icon iconName="p2p" aria-hidden="true"></my-global-icon>
- <ng-container i18n>Help share videos</ng-container>
-
- <my-input-switch inputName="p2p-enabled" class="ms-auto" [preventUpdate]="true" [checked]="user.p2pEnabled"></my-input-switch>
- </button>
+ <div class="main-menu">
+ <div class="mobile-controls">
+ <span class="icon-logo"></span>
- <div class="dropdown-divider"></div>
-
- <button *ngIf="!isInMobileView" ngbDropdownItem class="dropdown-item" (click)="openHotkeysCheatSheet()">
- <my-global-icon iconName="command" aria-hidden="true"></my-global-icon>
- <ng-container i18n>Keyboard shortcuts</ng-container>
- </button>
-
- <button ngbDropdownItem (click)="logout($event)" class="dropdown-item">
- <my-global-icon iconName="sign-out" aria-hidden="true"></my-global-icon>
- <ng-container i18n>Log out</ng-container>
- </button>
- </div>
- </div>
+ <my-button rounded="true" icon="cross" theme="tertiary" (click)="toggleMenu()"></my-button>
+ </div>
- @defer (when isLoggedIn) {
- <my-notification-dropdown (navigate)="onActiveLinkScrollToAnchor($event)"></my-notification-dropdown>
+ <div class="toggle-menu-container">
+ @if (collapsed) {
+ <button type="button" class="button-unstyle toggle-menu" i18n-title title="Display the lateral bar" (click)="toggleMenu()">
+ <my-global-icon class="transform-rotate-180" iconName="chevron-left"></my-global-icon>
+ </button>
+ } @else {
+ <button type="button" class="button-unstyle toggle-menu" i18n-title title= "Hide the lateral bar" (click)="toggleMenu()">
+ <my-global-icon iconName="chevron-left"></my-global-icon>
+ </button>
}
</div>
- <ul class="logged-in-menu">
- <li>
- <a class="menu-link" routerLink="/my-account" routerLinkActive="active" #settingsLink (click)="onActiveLinkScrollToAnchor(settingsLink)">
- <my-global-icon iconName="user" aria-hidden="true"></my-global-icon>
- <ng-container i18n>My account</ng-container>
- </a>
- </li>
-
- <li>
- <a class="menu-link" routerLink="/my-library" routerLinkActive="active" #libraryLink (click)="onActiveLinkScrollToAnchor(libraryLink)">
- <my-global-icon class="channel-icon" iconName="channel" aria-hidden="true"></my-global-icon>
- <ng-container i18n>My library</ng-container>
- </a>
- </li>
-
- <li>
- <a class="menu-link" *ngIf="userHasAdminAccess" [routerLink]="getFirstAdminRouteAvailable()" routerLinkActive="active">
- <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon>
- <ng-container i18n>Administration</ng-container>
- </a>
- </li>
- </ul>
- </div>
-
- <ul *ngIf="!isLoggedIn" class="login-buttons-block">
- <li>
- <my-login-link className="peertube-button-link orange-button w-100 text-truncate"></my-login-link>
- </li>
+ <div *ngIf="!loggedIn" class="about about-top">
+ <div i18n [ngClass]="{ 'visually-hidden': collapsed }" class="block-title me-2">{{ instanceName }}</div>
- <li *ngIf="isRegistrationAllowed()" class="mt-2">
- <a routerLink="/signup" class="create-account-button peertube-button-link text-truncate d-block">
- <my-signup-label [requiresApproval]="requiresApproval"></my-signup-label>
- </a>
- </li>
- </ul>
+ <div [ngClass]="{ 'visually-hidden': collapsed }" class="description">{{ shortDescription }}</div>
- <ng-container *ngFor="let menuSection of menuSections" >
- <ul [ngClass]="[ menuSection.key, 'menu-block' ]">
- <li i18n class="block-container">
- <span class="block-title">{{ menuSection.title }}</span>
+ <ng-container *ngTemplateOutlet="moreInfoButton"></ng-container>
+ </div>
- <ul class="mt-3">
- <li *ngFor="let link of menuSection.links">
- <a class="menu-link ps-0" [routerLink]="link.path" routerLinkActive="active">
- <my-global-icon *ngIf="link.icon" [iconName]="link.icon" [ngClass]="link.iconClass" aria-hidden="true"></my-global-icon>
- <ng-container>{{ link.shortLabel }}</ng-container>
- </a>
+ <nav>
+ <ng-container *ngFor="let menuSection of menuSections" >
+ <ul class="ul-unstyle" [ngClass]="[ menuSection.key, 'menu-block' ]">
+ <li i18n>
+ <div class="block-title ellipsis" [ngClass]="{ 'visually-hidden': collapsed }">{{ menuSection.title }}</div>
+
+ <ul class="ul-unstyle">
+ <li *ngFor="let link of menuSection.links">
+ @if (link.isPrimaryButton === true) {
+ <my-button class="d-block menu-button" theme="primary" [icon]="link.icon" [ariaLabel]="link.label" [ptRouterLink]="link.path">
+ @if (!collapsed) {
+ {{ link.label }}
+ }
+ </my-button>
+ } @else {
+ <a class="menu-link ellipsis" [routerLink]="link.path" routerLinkActive="active">
+ <my-global-icon *ngIf="link.icon" [iconName]="link.icon" [ngClass]="link.iconClass" aria-hidden="true"></my-global-icon>
+ <span [ngClass]="{ 'visually-hidden': collapsed }">{{ link.label }}</span>
+ </a>
+ }
+ </li>
+ </ul>
</li>
</ul>
- </li>
- </ul>
- </ng-container>
- </div>
-
- <div class="footer">
- <ul class="footer-block">
- <li>
- <button *ngIf="!isLoggedIn" class="menu-link button-unstyle" (click)="openQuickSettings()">
- <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon>
- <ng-container i18n>My settings</ng-container>
- </button>
- </li>
-
- <li>
- <a class="menu-link" routerLink="/about" routerLinkActive="active">
- <my-global-icon iconName="help" aria-hidden="true"></my-global-icon>
- <ng-container i18n>About</ng-container>
- </a>
- </li>
- </ul>
-
- <div class="footer-bottom">
-
- <div class="footer-links">
- <button *ngIf="isLoggedIn === false" (click)="openLanguageChooser()" class="button-unstyle" i18n>Interface: {{ currentInterfaceLanguage }}</button>
-
- <ul class="d-flex flex-wrap">
- <li>
- <a i18n routerLink="/about/instance">Contact</a>
- </li>
+ </ng-container>
+ </nav>
- <li>
- <a i18n href="https://joinpeertube.org/help" i18n-title title="Get help using PeerTube" target="_blank" rel="noopener noreferrer">Help</a>
- </li>
+ <div *ngIf="loggedIn" class="about">
+ <div [ngClass]="{ 'visually-hidden': collapsed }" class="block-title">{{ instanceName }}</div>
- <li>
- <a i18n href="https://joinpeertube.org/faq" i18n-title title="FAQ (Frequently Asked Questions) - about PeerTube" target="_blank" rel="noopener noreferrer">FAQ</a>
- </li>
-
- <li>
- <a i18n routerLink="/about/instance" fragment="statistics">Stats</a>
- </li>
-
- <li>
- <a i18n href="https://docs.joinpeertube.org/api-rest-reference.html" i18n-title title="API documentation" target="_blank" rel="noopener noreferrer">API</a>
- </li>
-
- <li>
- <button (click)="openHotkeysCheatSheet()" class="button-unstyle" i18n>Keyboard shortcuts</button>
- </li>
- </ul>
+ <ng-container *ngTemplateOutlet="moreInfoButton"></ng-container>
</div>
-
- <ul class="d-flex footer-copyleft" i18n-title title="powered by PeerTube - CopyLeft 2015-2024">
- <li>
- <a href="https://joinpeertube.org" class="me-1" target="_blank" rel="noopener noreferrer" i18n>powered by PeerTube</a>
- </li>
-
- <li>
- <a href="https://github.com/Chocobozzz/PeerTube/blob/develop/LICENSE" target="_blank" rel="noopener noreferrer">
- <span aria-label="copyleft" class="d-inline-block" style="transform: rotateY(180deg)">&copy;</span> 2015-2024
- </a>
- </li>
- </ul>
</div>
</div>
- </nav>
+ </div>
+
+ <div *ngIf="!collapsed" class="mt-3 mx-4">
+ <div class="fs-8" i18n>
+ Platform powered by <a class="" href="https://joinpeertube.org" target="_blank" rel="noopener noreferrer">PeerTube</a>
+ </div>
+
+ <a class="d-block fs-8" href="https://joinpeertube.org/instances" target="_blank" rel="noopener noreferrer" i18n>Discover more platforms</a>
+ </div>
</div>
-<my-language-chooser #languageChooserModal></my-language-chooser>
-<my-quick-settings #quickSettingsModal></my-quick-settings>
+<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->
+<div class="menu-overlay" [ngClass]="{ 'menu-collapsed': collapsed }" (click)="toggleMenu()"></div>
diff --git a/client/src/app/menu/menu.component.scss b/client/src/app/menu/menu.component.scss
index 37d325e529..4f6097fea6 100644
--- a/client/src/app/menu/menu.component.scss
+++ b/client/src/app/menu/menu.component.scss
@@ -1,402 +1,287 @@
@use 'sass:math';
@use '_variables' as *;
@use '_mixins' as *;
+@use '_button-mixins' as *;
-$menu-link-icon-size: 22px;
-$menu-link-icon-margin-right: 18px;
-$footer-links-base-opacity: .8;
+.menu-container {
+ --co-menu-x-padding: 1.5rem;
-ul {
- margin: 0;
- padding: 0;
+ z-index: z(menu);
+ width: calc(#{$menu-width} - 2rem);
+ position: fixed;
+ height: calc(100vh - #{pvar(--header-height)});
- li {
- list-style: none;
- }
-}
+ @include margin-left(pvar(--menu-margin-left));
+
+ &.collapsed {
+ --co-menu-x-padding: 0.25rem;
-.footer-bottom {
- li {
width: auto;
- display: inline-flex;
+
+ @include margin-left(0);
}
}
-.menu-link {
- display: flex;
- align-items: center;
+.toggle-menu {
+ color: pvar-fallback(--menu-fg, --fg-200);
+ width: 24px;
+ height: 24px;
+ border-radius: 100%;
+ background-color: pvar-fallback(--menu-bg, --bg-secondary-500);
- color: pvar(--menuForegroundColor);
- cursor: pointer;
- white-space: normal;
- word-break: break-word;
- transition: background-color .1s ease-in-out;
- line-height: $line-height-normal;
- width: 100%;
+ @include button-with-icon(20px, 0, 0, 1px);
- @include disable-default-a-behaviour;
- @include padding-left($menu-lateral-padding);
- @include padding-right(20px);
-
- &.active {
- background-color: rgba(255, 255, 255, 0.15);
+ my-global-icon {
+ margin: auto;
}
- &:hover,
- &:focus-visible {
- background-color: rgba(255, 255, 255, 0.1);
+ &:hover {
+ opacity: 0.8;
}
+}
- my-global-icon {
- display: flex;
- width: $menu-link-icon-size;
- height: $menu-link-icon-size;
+.menu-container:not(.collapsed) .toggle-menu {
+ position: absolute;
+ top: 22px;
- @include apply-svg-color(#808080);
- @include margin-right($menu-link-icon-margin-right);
- }
+ @include right(24px);
}
-.menu-wrapper {
- position: fixed;
- height: calc(100vh - #{$header-height});
- padding: 0;
- width: $menu-width;
- z-index: z(menu);
- scrollbar-color: pvar(--actionButtonColor) pvar(--menuBackgroundColor);
+.collapsed .toggle-menu my-global-icon {
+ right: -1px;
+ top: 0;
}
-nav {
- background-color: pvar(--menuBackgroundColor);
- color: pvar(--menuForegroundColor);
-
- display: flex;
- flex-direction: column;
- height: 100%;
+.main-menu-wrapper {
+ // For the scrollbar
+ overflow: hidden;
width: 100%;
- margin: 0;
- padding: 0;
+ height: 100%;
+ max-height: calc(100% - 50px); // Space for links below the menu
+}
- @include ellipsis;
+.main-menu-scrollbar {
+ overflow-y: auto;
+ scrollbar-color: transparent transparent;
+ scrollbar-width: thin;
+ max-height: 100%;
&:focus,
&:hover {
- overflow-y: auto;
+ scrollbar-color: auto;
}
@media not all and (hover: hover) and (pointer: fine) {
- overflow-y: auto;
- }
-
- &.is-logged-in {
- .panel-block {
- margin-bottom: 20px;
- }
-
- .block-title {
- margin-bottom: 15px;
- }
+ border-radius: 0;
+ scrollbar-color: auto;
}
}
-.top-menu {
- flex-grow: 1;
- width: $menu-width;
+.main-menu {
+ position: relative;
+ padding-top: 1.5rem;
+ padding-bottom: 1.5rem;
+ border-radius: 14px;
+ background-color: pvar-fallback(--menu-bg, --bg-secondary-400);
}
-.logged-in-block {
- margin-bottom: 20px;
- background-color: rgba(255, 255, 255, 0.15);
-
- > div:first-child {
- height: 80px;
- display: flex;
- align-items: center;
- justify-content: left;
- }
+.menu-link,
+.menu-button,
+.block-title,
+.about .description,
+.about my-button {
+ @include padding-left(var(--co-menu-x-padding));
+ @include padding-right(var(--co-menu-x-padding));
}
-my-notification-dropdown {
- @include margin-left(auto);
- @include margin-right(15px);
+.menu-block:not(:last-child),
+.logged-in .menu-block,
+.collapsed .toggle-menu-container,
+.about-top {
+ &::after {
+ content: '';
+ display: block;
+ height: 2px;
+ margin: 1rem var(--co-menu-x-padding);
+ background: pvar(--bg-secondary-500);
+ }
}
-.logged-in-more {
- flex: 1;
- min-width: 1px;
- border-radius: 25px;
- transition: all .1s ease-in-out;
- cursor: pointer;
- line-height: 1;
-
- @include margin-left(13px);
-
- @mixin display-hints($is-mobile: false) {
- background-color: rgba(255, 255, 255, 0.15);
-
- @if $is-mobile {
- .dropdown-toggle-indicator {
- display: inherit !important;
- }
+.collapsed {
+ .menu-block,
+ .toggle-menu-container,
+ .about {
+ &::after {
+ width: 28px;
+ margin: 1rem auto;
}
}
+}
- &.show {
- background-color: rgba(255, 255, 255, 0.2);
- box-shadow: inset 0 3px 5px rgba(0, 0, 0, .325);
+.collapsed {
+ .main-menu-wrapper {
+ max-height: 100%;
}
- &:hover {
- @include display-hints;
- }
+ .main-menu {
+ border-start-start-radius: 0;
+ border-end-start-radius: 0;
- /* smartphones and touchscreens */
- @media (hover: none) and (pointer: coarse) {
- @include display-hints($is-mobile: true);
+ padding-top: 1rem;
+ padding-bottom: 1rem;
}
- > .dropdown-toggle {
- display: flex;
- align-items: center;
- width: 100%;
- padding: 5px 7px;
-
- &::after {
- // Disable bootstrap toggle
- border: 0;
- }
+ .toggle-menu-container {
+ text-align: center;
}
- .dropdown-toggle-indicator {
- position: relative;
- display: none;
- width: 17px;
-
- span {
- position: absolute;
- top: -8px;
- color: #808080;
- }
+ .menu-link {
+ justify-content: center;
}
}
-my-actor-avatar {
- @include margin-right(10px);
-}
-
-.logged-in-info {
- flex-shrink: 1;
- min-width: 1px;
-}
+.block-title {
+ font-weight: $font-bold;
+ color: pvar-fallback(--menu-fg, --fg-350);
+ font-size: 14px;
+ margin-bottom: 0.5rem;
+ max-width: 180px;
-.logged-in-display-name,
-.logged-in-username {
@include ellipsis;
}
-.logged-in-display-name {
- font-weight: $font-semibold;
- color: pvar(--menuForegroundColor);
-
- @include disable-default-a-behaviour;
-}
-
-.logged-in-username {
- font-size: 13px;
- color: #C6C6C6;
- margin-top: 3px;
-}
-
-.logged-in-menu {
+.menu-link {
display: flex;
- flex-direction: column;
- align-items: flex-start;
- border-top: 1px solid var(--greyForegroundColor);
- line-height: $line-height-normal;
-
- a {
- $icon-size: 13px;
- $additional-margin: math.div($menu-link-icon-size - $icon-size, 2);
-
- font-size: 14px;
- width: 100%;
- min-height: 35px;
-
- my-global-icon {
- width: $icon-size;
- height: $icon-size;
-
- // Keep aligned with other icons
- @include margin-left($additional-margin);
- }
-
- &.active,
- &:hover,
- &:focus-visible {
- my-global-icon {
- @include apply-svg-color(var(--menuForegroundColor));
- }
- }
-
- &.active {
- $border-left-width: 4px;
-
- font-weight: $font-semibold;
- border-left: $border-left-width solid var(--mainColor);
-
- my-global-icon {
- @include margin-left($additional-margin - $border-left-width);
- }
- }
- }
-
- li {
- width: 100%;
- }
-}
+ align-items: center;
-.login-buttons-block {
- margin: 30px 25px 35px;
-}
+ color: pvar-fallback(--menu-fg, --fg-400);
+ white-space: normal;
+ word-break: break-word;
+ transition: background-color .1s ease-in-out;
+ width: 100%;
+ padding-top: 0.5rem;
+ padding-bottom: 0.5rem;
-.create-account-button {
- color: #fff;
- background-color: rgba(255, 255, 255, 0.25);
+ @include disable-default-a-behaviour;
- &:hover {
- background-color: rgba(255, 255, 255, 0.28);
+ &:hover,
+ &:focus-visible {
+ background-color: pvar-fallback(--menu-fg, --bg-secondary-450);
}
-}
-
-.menu-block,
-.footer-block {
- margin-bottom: 15px;
- .block-container {
- @include margin-left(26px);
- @include margin-right(15px);
- @include ellipsis;
+ &.active {
+ background-color: pvar-fallback(--menu-fg, --bg-secondary-500);
}
- .block-title {
- text-transform: uppercase;
- font-weight: $font-bold;
- font-size: 13px;
- }
+ my-global-icon {
+ width: 22px;
+ height: 22px;
+ line-height: 22px;
+ position: relative;
+ top: -1px;
+ color: pvar-fallback(--menu-fg, --secondary-icon-color);
- a,
- button {
- min-height: 40px;
+ + *:not(.visually-hidden) {
+ @include margin-left(12px);
+ }
}
}
-.footer {
- padding-bottom: 15px;
-}
-
-.footer-bottom {
- padding: 0 $menu-lateral-padding;
+.menu-button {
+ margin-top: 0.5rem;
}
-.footer-links {
- a,
- button {
- color: pvar(--menuForegroundColor);
- opacity: $footer-links-base-opacity;
- white-space: nowrap;
- font-size: 0.75rem;
- line-height: 1.4rem;
- font-weight: $font-semibold;
-
- @include margin-right(8px);
- @include disable-default-a-behaviour;
-
- &:hover {
- opacity: $footer-links-base-opacity + .2;
- }
+.about {
+ .description {
+ font-size: 14px;
+ color: pvar-fallback(--menu-fg, --fg-200)
}
}
-.footer-copyleft a {
- color: pvar(--menuForegroundColor);
- opacity: $footer-links-base-opacity - .2;
- font-size: 0.85rem;
-
- @include disable-default-a-behaviour;
-
- &:hover {
- opacity: $footer-links-base-opacity;
- }
+my-button[theme=secondary] ::ng-deep my-global-icon {
+ color: pvar(--secondary-icon-color) !important;
}
-.dropdown {
- z-index: #{z('menu') + 1} !important;
+.menu-overlay {
+ background-color: #000;
+ width: 100vw;
+ height: 100vh;
+ opacity: 0.75;
+ content: '';
+ display: none;
+ position: fixed;
+ z-index: z(overlay);
}
-.dropdown-menu {
- width: calc(100% + 40px);
+.mobile-controls {
+ display: none;
+ padding: 0 calc(var(--co-menu-x-padding) - 1rem) 2rem var(--co-menu-x-padding);
+ align-items: center;
+ justify-content: space-between;
- // Prevent weird display issue on firefox when global style is not loaded yet
- &:not(.show) {
- display: none;
+ .icon-logo {
+ display: inline-block;
+ width: 48px;
+ height: 48px;
+ min-width: 48px;
+ max-width: 48px;
+
+ background-repeat: no-repeat;
+ background-size: contain;
}
}
-.dropdown-item {
- cursor: pointer;
- display: flex;
- align-items: center;
+@media screen and (max-width: $menu-overlay-view) {
+ // On small screen use a menu overlay
- @include dropdown-with-icon-item;
+ .menu-container {
+ &:not(.collapsed) {
+ --menu-margin-left: 0;
- &:hover {
- .hover-display-toggle {
- display: none;
- }
+ border-radius: 0;
+ background-color: pvar-fallback(--menu-bg, --bg-secondary-400);
+ overflow: auto;
- .hover-display-toggle[hidden] {
- display: inherit !important;
+ .main-menu-wrapper {
+ height: auto;
+ max-height: unset;
+ }
}
}
-}
-.more-settings {
- text-transform: uppercase;
- font-size: 80%;
- color: #6c757d;
+ .menu-overlay:not(.menu-collapsed) {
+ display: block;
+ }
}
@media screen and (max-width: $mobile-view) {
- .menu-wrapper {
- width: 100% !important;
+ .menu-container {
+ height: 100vh;
+ margin-top: calc(#{pvar(--header-height)} * -1);
+ z-index: z(root-header) + 1;
+
+ &.collapsed {
+ display: none;
+ }
- nav {
- overflow-y: auto;
+ &:not(.collapsed) {
+ width: 100vw !important;
}
}
- .top-menu,
- .footer {
- width: 100% !important;
+ .main-menu {
+ padding-top: 0.75rem;
}
- .dropdown-menu {
- width: calc(100vw - 30px);
+ .menu-overlay {
+ display: none !important;
}
-}
-
-my-global-icon {
- position: relative;
- top: -1px;
-
- .playlist-icon {
- height: 24px;
- width: 24px;
- @include margin-right(16px);
+ .mobile-controls {
+ display: flex;
}
- &.channel-icon {
- top: -2px;
+ .toggle-menu-container {
+ display: none;
}
}
diff --git a/client/src/app/menu/menu.component.ts b/client/src/app/menu/menu.component.ts
index 6a436782ef..83bd83800a 100644
--- a/client/src/app/menu/menu.component.ts
+++ b/client/src/app/menu/menu.component.ts
@@ -1,34 +1,40 @@
-import { CommonModule, ViewportScroller } from '@angular/common'
-import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'
-import { Router, RouterLink, RouterLinkActive } from '@angular/router'
+import { CommonModule } from '@angular/common'
+import { Component, OnDestroy, OnInit } from '@angular/core'
+import { RouterLink, RouterLinkActive } from '@angular/router'
import {
AuthService,
AuthStatus,
AuthUser,
HooksService,
- HotkeysService,
- MenuSection,
MenuService,
RedirectService,
- ScreenService,
ServerService,
UserService
} from '@app/core'
-import { scrollToTop } from '@app/helpers'
-import { ActorAvatarComponent } from '@app/shared/shared-actor-image/actor-avatar.component'
-import { InputSwitchComponent } from '@app/shared/shared-forms/input-switch.component'
-import { GlobalIconComponent } from '@app/shared/shared-icons/global-icon.component'
-import { PeertubeModalService } from '@app/shared/shared-main/peertube-modal/peertube-modal.service'
-import { LoginLinkComponent } from '@app/shared/shared-main/users/login-link.component'
-import { SignupLabelComponent } from '@app/shared/shared-main/users/signup-label.component'
-import { NgbDropdown, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'
-import { HTMLServerConfig, ServerConfig, UserRight, UserRightType, VideoConstant } from '@peertube/peertube-models'
+import { GlobalIconComponent, GlobalIconName } from '@app/shared/shared-icons/global-icon.component'
+import { ButtonComponent } from '@app/shared/shared-main/buttons/button.component'
+import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'
+import { ServerConfig, UserRight } from '@peertube/peertube-models'
import debug from 'debug'
-import { forkJoin, Subscription } from 'rxjs'
-import { first, switchMap } from 'rxjs/operators'
-import { LanguageChooserComponent } from './language-chooser.component'
-import { NotificationDropdownComponent } from './notification-dropdown.component'
-import { QuickSettingsModalComponent } from './quick-settings-modal.component'
+import { of, Subscription } from 'rxjs'
+import { first, map, switchMap } from 'rxjs/operators'
+
+type MenuLink = {
+ icon: GlobalIconName
+ iconClass?: string
+
+ label: string
+
+ path: string
+
+ isPrimaryButton?: boolean // default false
+}
+
+type MenuSection = {
+ key: string
+ title: string
+ links: MenuLink[]
+}
const debugLogger = debug('peertube:menu:MenuComponent')
@@ -39,318 +45,235 @@ const debugLogger = debug('peertube:menu:MenuComponent')
standalone: true,
imports: [
CommonModule,
- NotificationDropdownComponent,
- ActorAvatarComponent,
- InputSwitchComponent,
- SignupLabelComponent,
- LoginLinkComponent,
- LanguageChooserComponent,
- QuickSettingsModalComponent,
GlobalIconComponent,
RouterLink,
RouterLinkActive,
- NgbDropdownModule
+ NgbDropdownModule,
+ ButtonComponent
]
})
export class MenuComponent implements OnInit, OnDestroy {
- @ViewChild('languageChooserModal', { static: true }) languageChooserModal: LanguageChooserComponent
- @ViewChild('quickSettingsModal', { static: true }) quickSettingsModal: QuickSettingsModalComponent
- @ViewChild('dropdown') dropdown: NgbDropdown
-
- user: AuthUser
- isLoggedIn: boolean
-
- userHasAdminAccess = false
- helpVisible = false
-
- videoLanguages: string[] = []
- nsfwPolicy: string
-
- currentInterfaceLanguage: string
-
menuSections: MenuSection[] = []
+ loggedIn: boolean
- private languages: VideoConstant<string>[] = []
+ private user: AuthUser
+ private canSeeVideoMakerBlock: boolean
- private htmlServerConfig: HTMLServerConfig
private serverConfig: ServerConfig
- private routesPerRight: { [role in UserRightType]?: string } = {
- [UserRight.MANAGE_USERS]: '/admin/users',
- [UserRight.MANAGE_SERVER_FOLLOW]: '/admin/friends',
- [UserRight.MANAGE_ABUSES]: '/admin/moderation/abuses',
- [UserRight.MANAGE_VIDEO_BLACKLIST]: '/admin/moderation/video-blocks',
- [UserRight.MANAGE_JOBS]: '/admin/jobs',
- [UserRight.MANAGE_CONFIGURATION]: '/admin/config'
- }
-
- private languagesSub: Subscription
- private modalSub: Subscription
- private hotkeysSub: Subscription
private authSub: Subscription
constructor (
- private viewportScroller: ViewportScroller,
private authService: AuthService,
private userService: UserService,
private serverService: ServerService,
- private redirectService: RedirectService,
- private hotkeysService: HotkeysService,
- private screenService: ScreenService,
- private menuService: MenuService,
- private modalService: PeertubeModalService,
- private router: Router,
- private hooks: HooksService
+ private hooks: HooksService,
+ private menu: MenuService,
+ private redirectService: RedirectService
) { }
- get isInMobileView () {
- return this.screenService.isInMobileView()
+ get shortDescription () {
+ return this.serverConfig.instance.shortDescription
}
- get language () {
- return this.languageChooserModal.getCurrentLanguage()
+ get instanceName () {
+ return this.serverConfig.instance.name
}
- get requiresApproval () {
- return this.serverConfig.signup.requiresApproval
+ get collapsed () {
+ return this.menu.isCollapsed()
}
- ngOnInit () {
- this.htmlServerConfig = this.serverService.getHTMLConfig()
- this.currentInterfaceLanguage = this.languageChooserModal.getCurrentLanguage()
+ get isOverlay () {
+ return this.menu.isCollapsed()
+ }
- this.isLoggedIn = this.authService.isLoggedIn()
- this.updateUserState()
- this.buildMenuSections()
+ ngOnInit () {
+ this.loggedIn = this.authService.isLoggedIn()
+ this.onUserStateChange()
this.authSub = this.authService.loginChangedSource.subscribe(status => {
- if (status === AuthStatus.LoggedIn) {
- this.isLoggedIn = true
- } else if (status === AuthStatus.LoggedOut) {
- this.isLoggedIn = false
- }
+ if (status === AuthStatus.LoggedIn) this.loggedIn = true
+ else if (status === AuthStatus.LoggedOut) this.loggedIn = false
- this.updateUserState()
- this.buildMenuSections()
- })
-
- this.hotkeysSub = this.hotkeysService.cheatSheetToggle
- .subscribe(isOpen => this.helpVisible = isOpen)
-
- this.languagesSub = forkJoin([
- this.serverService.getVideoLanguages(),
- this.authService.userInformationLoaded.pipe(first())
- ]).subscribe(([ languages ]) => {
- this.languages = languages
-
- this.buildUserLanguages()
+ this.onUserStateChange()
})
this.serverService.getConfig()
.subscribe(config => this.serverConfig = config)
-
- this.modalSub = this.modalService.openQuickSettingsSubject
- .subscribe(() => this.openQuickSettings())
}
ngOnDestroy () {
- if (this.modalSub) this.modalSub.unsubscribe()
- if (this.languagesSub) this.languagesSub.unsubscribe()
- if (this.hotkeysSub) this.hotkeysSub.unsubscribe()
if (this.authSub) this.authSub.unsubscribe()
}
- isRegistrationAllowed () {
- if (!this.serverConfig) return false
-
- return this.serverConfig.signup.allowed &&
- this.serverConfig.signup.allowedForCurrentIP
- }
-
- getFirstAdminRightAvailable () {
- const user = this.authService.getUser()
- if (!user) return undefined
-
- const adminRights = [
- UserRight.MANAGE_USERS,
- UserRight.MANAGE_SERVER_FOLLOW,
- UserRight.MANAGE_ABUSES,
- UserRight.MANAGE_VIDEO_BLACKLIST,
- UserRight.MANAGE_JOBS,
- UserRight.MANAGE_CONFIGURATION
- ]
-
- for (const adminRight of adminRights) {
- if (user.hasRight(adminRight)) {
- return adminRight
- }
- }
-
- return undefined
- }
-
- getFirstAdminRouteAvailable () {
- const right = this.getFirstAdminRightAvailable()
-
- return this.routesPerRight[right]
- }
-
- logout (event: Event) {
- event.preventDefault()
-
- this.authService.logout()
- // Redirect to home page
- this.redirectService.redirectToHomepage()
- }
-
- openLanguageChooser () {
- this.languageChooserModal.show()
- }
-
- openHotkeysCheatSheet () {
- this.hotkeysService.cheatSheetToggle.next(!this.helpVisible)
- }
+ // ---------------------------------------------------------------------------
- openQuickSettings () {
- this.quickSettingsModal.show()
+ toggleMenu () {
+ this.menu.toggleMenu()
}
- toggleUseP2P () {
- if (!this.user) return
- this.user.p2pEnabled = !this.user.p2pEnabled
+ // ---------------------------------------------------------------------------
- this.userService.updateMyProfile({ p2pEnabled: this.user.p2pEnabled })
- .subscribe(() => this.authService.refreshUserInformation())
- }
+ private async buildMenuSections () {
+ this.menuSections = []
- langForLocale (localeId: string) {
- if (localeId === '_unknown') return $localize`Unknown`
+ for (const section of [ this.buildQuickLinks(), this.buildLibraryLinks(), this.buildVideoMakerLinks(), this.buildAdminLinks() ]) {
+ if (section.links.length !== 0) {
+ this.menuSections.push(section)
+ }
+ }
- return this.languages.find(lang => lang.id === localeId).label
+ this.menuSections = await this.hooks.wrapObject(this.menuSections, 'common', 'filter:left-menu.links.create.result')
}
- onActiveLinkScrollToAnchor (link: HTMLAnchorElement) {
- const linkURL = link.getAttribute('href')
- const linkHash = link.getAttribute('fragment')
-
- // On same url without fragment restore top scroll position
- if (!linkHash && this.router.url.includes(linkURL)) {
- scrollToTop('smooth')
+ private buildQuickLinks (): MenuSection {
+ return {
+ key: 'quick-access',
+ title: $localize`Quick access`,
+ links: [
+ {
+ path: this.redirectService.getDefaultRoute(),
+ icon: 'home' as GlobalIconName,
+ label: $localize`Home`
+ },
+ {
+ path: '/videos/subscriptions',
+ icon: 'subscriptions' as GlobalIconName,
+ label: $localize`Subscriptions`
+ }
+ ]
}
+ }
- // On same url with fragment restore anchor scroll position
- if (linkHash && this.router.url === linkURL) {
- this.viewportScroller.scrollToAnchor(linkHash)
+ private buildLibraryLinks (): MenuSection {
+ let links: MenuLink[] = []
+
+ if (this.loggedIn) {
+ links = links.concat([
+ {
+ path: '/my-library/video-playlists',
+ icon: 'playlists' as GlobalIconName,
+ label: $localize`Playlists`
+ },
+ {
+ path: '/my-library/history/videos',
+ icon: 'history' as GlobalIconName,
+ label: $localize`History`
+ }
+ ])
}
- if (this.screenService.isInSmallView()) {
- this.menuService.toggleMenu()
+ return {
+ key: 'my-library',
+ title: $localize`My library`,
+ links
}
}
- // Lock menu scroll when menu scroll to avoid fleeing / detached dropdown
- onMenuScrollEvent () {
- document.querySelector('nav').scrollTo(0, 0)
- }
-
- onDropdownOpenChange (opened: boolean) {
- if (this.screenService.isInMobileView()) return
-
- // Close dropdown when window scroll to avoid dropdown quick jump for re-position
- const onWindowScroll = () => {
- this.dropdown?.close()
- window.removeEventListener('scroll', onWindowScroll)
+ private buildVideoMakerLinks (): MenuSection {
+ let links: MenuLink[] = []
+
+ if (this.loggedIn && this.canSeeVideoMakerBlock) {
+ links = links.concat([
+ {
+ path: '/my-library/video-channels',
+ icon: 'channel' as GlobalIconName,
+ iconClass: 'channel-icon',
+ label: $localize`Channels`
+ },
+
+ {
+ path: '/my-library/videos',
+ icon: 'videos' as GlobalIconName,
+ label: $localize`Videos`
+ },
+
+ {
+ path: '/videos/upload',
+ icon: 'upload' as GlobalIconName,
+ label: $localize`Publish`,
+ isPrimaryButton: true
+ }
+ ])
}
- if (opened) {
- window.addEventListener('scroll', onWindowScroll)
- document.querySelector('nav').scrollTo(0, 0) // Reset menu scroll to easy lock
- // eslint-disable-next-line @typescript-eslint/unbound-method
- document.querySelector('nav').addEventListener('scroll', this.onMenuScrollEvent)
- } else {
- // eslint-disable-next-line @typescript-eslint/unbound-method
- document.querySelector('nav').removeEventListener('scroll', this.onMenuScrollEvent)
+ return {
+ key: 'my-video-space',
+ title: $localize`My video space`,
+ links
}
}
- private async buildMenuSections () {
- const menuSections = []
+ private buildAdminLinks (): MenuSection {
+ const links: MenuLink[] = []
- if (this.isLoggedIn) {
- menuSections.push(
- this.menuService.buildLibraryLinks(this.user?.canSeeVideosLink)
- )
- }
-
- menuSections.push(
- this.menuService.buildCommonLinks(this.htmlServerConfig)
- )
+ if (this.loggedIn) {
+ if (this.user.hasRight(UserRight.SEE_ALL_VIDEOS)) {
+ links.push({
+ path: '/admin/overview',
+ icon: 'overview' as GlobalIconName,
+ label: $localize`Overview`
+ })
+ }
- this.menuSections = await this.hooks.wrapObject(menuSections, 'common', 'filter:left-menu.links.create.result')
- }
+ if (this.user.hasRight(UserRight.MANAGE_ABUSES)) {
+ links.push({
+ path: '/admin/moderation',
+ icon: 'moderation' as GlobalIconName,
+ label: $localize`Moderation`
+ })
+ }
- private buildUserLanguages () {
- if (!this.user) {
- this.videoLanguages = []
- return
+ if (this.user.hasRight(UserRight.MANAGE_CONFIGURATION)) {
+ links.push({
+ path: '/admin/settings',
+ icon: 'config' as GlobalIconName,
+ label: $localize`Settings`
+ })
+ }
}
- if (!this.user.videoLanguages) {
- this.videoLanguages = [ $localize`any language` ]
- return
+ return {
+ key: 'admin',
+ title: $localize`Administration`,
+ links
}
-
- this.videoLanguages = this.user.videoLanguages
- .map(locale => this.langForLocale(locale))
- .map(value => value === undefined ? '?' : value)
}
- private computeAdminAccess () {
- const right = this.getFirstAdminRightAvailable()
+ // ---------------------------------------------------------------------------
- this.userHasAdminAccess = right !== undefined
- }
+ private computeCanSeeVideoMakerBlock () {
+ if (!this.loggedIn) return of(false)
+ if (!this.user.hasUploadDisabled()) return of(true)
- private computeVideosLink () {
- if (!this.isLoggedIn) return
-
- this.authService.userInformationLoaded
+ return this.authService.userInformationLoaded
.pipe(
- switchMap(() => this.user.computeCanSeeVideosLink(this.userService.getMyVideoQuotaUsed()))
- ).subscribe(res => {
- if (res === true) debugLogger('User can see videos link.')
- else debugLogger('User cannot see videos link.')
- })
- }
-
- private computeNSFWPolicy () {
- if (!this.user) {
- this.nsfwPolicy = null
- return
- }
-
- switch (this.user.nsfwPolicy) {
- case 'do_not_list':
- this.nsfwPolicy = $localize`hide`
- break
-
- case 'blur':
- this.nsfwPolicy = $localize`blur`
- break
-
- case 'display':
- this.nsfwPolicy = $localize`display`
- break
- }
+ first(),
+ switchMap(() => this.userService.getMyVideoQuotaUsed()),
+ map(({ videoQuotaUsed }) => {
+ // User already uploaded videos, so it can see the link
+ if (videoQuotaUsed !== 0) return true
+
+ // No videos, no upload so the user don't need to see the videos link
+ return false
+ })
+ )
}
- private updateUserState () {
- this.user = this.isLoggedIn
+ private onUserStateChange () {
+ this.user = this.loggedIn
? this.authService.getUser()
: undefined
- this.computeAdminAccess()
- this.computeNSFWPolicy()
- this.computeVideosLink()
+ this.computeCanSeeVideoMakerBlock()
+ .subscribe(res => {
+ this.canSeeVideoMakerBlock = res
+
+ if (this.canSeeVideoMakerBlock) debugLogger('User can see videos link.')
+ else debugLogger('User cannot see videos link.')
+
+ this.buildMenuSections()
+ })
}
}
diff --git a/client/src/app/menu/notification-dropdown.component.scss b/client/src/app/menu/notification-dropdown.component.scss
deleted file mode 100644
index be2dd4ad72..0000000000
--- a/client/src/app/menu/notification-dropdown.component.scss
+++ /dev/null
@@ -1,177 +0,0 @@
-@use '_variables' as *;
-@use '_mixins' as *;
-
-.content {
- scrollbar-color: auto;
-}
-
-.notification-inbox-dropdown {
- padding: 10px;
-}
-
-.notification-inbox-link a {
- padding: 13px 10px;
-}
-
-.notification-inbox-dropdown,
-.notification-inbox-link a {
- transition: all .1s ease-in-out;
- border-radius: 25px;
- cursor: pointer;
-
- @include apply-svg-color(#808080);
-
- ::ng-deep svg {
- transition: color .1s ease-in-out;
- }
-
- &:hover,
- &:active {
- background-color: rgba(255, 255, 255, 0.15);
-
- @include apply-svg-color(#fff);
- }
-}
-
-.notification-inbox-dropdown.shown,
-.notification-inbox-link a.active {
- background-color: rgba(255, 255, 255, 0.28);
- box-shadow: inset 0 3px 5px rgba(0, 0, 0, .325);
-
- @include apply-svg-color(#fff);
-}
-
-.notification-inbox-dropdown.hidden {
- display: none;
-}
-
-::ng-deep {
- .dropdown-notifications {
- max-width: none;
- top: -6px !important;
- left: 7px !important;
-
- .dropdown-menu {
- padding: 0;
- font-size: 14px;
- font-family: $main-fonts;
- width: 400px;
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
-
- .loader {
- display: flex;
- align-items: center;
- justify-content: center;
-
- padding: 5px 0;
- }
-
- .content {
- max-height: 150px;
- transition: max-height 0.15s ease-out;
- display: flex;
- height: 500px;
- flex-direction: column;
-
- &.loaded {
- max-height: 500px;
- }
-
- > my-user-notifications:nth-child(2) {
- overflow-y: auto;
- flex-grow: 1;
- }
- }
-
- .notifications-header {
- display: flex;
- justify-content: space-between;
-
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
- align-items: center;
- padding: 0 12px;
- font-size: 14px;
- font-weight: bold;
- color: rgba(0, 0, 0, 0.5);
- text-transform: uppercase;
- min-height: 40px;
-
- a {
- @include disable-default-a-behaviour;
- }
-
- button {
- padding: 0;
- background: transparent;
-
- @include peertube-button;
- }
-
- a,
- button {
- color: rgba(20, 20, 20, 0.5);
-
- &:hover:not(:disabled) {
- color: rgba(20, 20, 20, 0.8);
- }
- }
-
- my-global-icon[iconName=cog] {
- width: 20px;
- }
-
- my-global-icon[iconName=tick] {
- width: 26px;
- }
- }
-
- .all-notifications {
- border-top: 1px solid rgba(0, 0, 0, 0.1);
- margin-top: -1px; // To not have 2 borders with the last notification
- text-align: center;
- font-weight: $font-semibold;
- color: pvar(--mainForegroundColor);
- padding: 0.75rem 0;
- text-decoration: underline !important;
-
- &:hover {
- opacity: 0.85;
- }
- }
- }
- }
-}
-
-.notification-inbox-dropdown,
-.notification-inbox-link {
- cursor: pointer;
- position: relative;
-
- .unread-notifications {
- @include margin-left(20px);
- }
-
- .unread-notifications {
- position: absolute;
- top: 6px;
- left: 0;
-
- display: flex;
- align-items: center;
- justify-content: center;
-
- background-color: pvar(--mainColor);
- color: #fff;
- font-size: 10px;
- font-weight: $font-semibold;
-
- border-radius: 15px;
- width: 15px;
- height: 15px;
-
- @media screen and (max-width: $mobile-view) {
- top: -4px;
- left: -2px;
- }
- }
-}
diff --git a/client/src/app/menu/quick-settings-modal.component.html b/client/src/app/menu/quick-settings-modal.component.html
index 3ae275b286..a9fe150adc 100644
--- a/client/src/app/menu/quick-settings-modal.component.html
+++ b/client/src/app/menu/quick-settings-modal.component.html
@@ -9,7 +9,7 @@
<div class="modal-body">
<my-alert i18n type="primary">These settings apply only to your session on this instance.</my-alert>
- <h5 i18n class="mt-4 mb-2">Videos</h5>
+ <h5 i18n class="section-label mt-4 mb-2">VIDEOS</h5>
<my-user-video-settings
*ngIf="!isUserLoggedIn()"
@@ -17,7 +17,7 @@
>
</my-user-video-settings>
- <h5 i18n class="mt-4 mb-2">Interface</h5>
+ <h5 i18n class="section-label mt-4 mb-2">INTERFACE</h5>
<my-user-interface-settings
*ngIf="!isUserLoggedIn()"
diff --git a/client/src/app/modal/account-setup-warning-modal.component.html b/client/src/app/modal/account-setup-warning-modal.component.html
index ce4e3bd1c2..8a2baa6f43 100644
--- a/client/src/app/modal/account-setup-warning-modal.component.html
+++ b/client/src/app/modal/account-setup-warning-modal.component.html
@@ -27,12 +27,12 @@
</my-peertube-checkbox>
<input
- type="button" role="button" i18n-value value="Close" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Close" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
<a i18n (click)="hide()" (key.enter)="hide()"
- class="peertube-button-link orange-button" routerLink="/my-account"
+ class="peertube-button-link primary-button" routerLink="/my-account"
rel="noopener noreferrer" ngbAutofocus>
Set up
</a>
diff --git a/client/src/app/modal/account-setup-warning-modal.component.ts b/client/src/app/modal/account-setup-warning-modal.component.ts
index 90bc6b75ee..d39f7465ac 100644
--- a/client/src/app/modal/account-setup-warning-modal.component.ts
+++ b/client/src/app/modal/account-setup-warning-modal.component.ts
@@ -24,7 +24,7 @@ export class AccountSetupWarningModalComponent {
user: User
- private LOCAL_STORAGE_KEYS = {
+ private LS_KEYS = {
NO_ACCOUNT_SETUP_WARNING_MODAL: 'no_account_setup_warning_modal'
}
@@ -49,7 +49,7 @@ export class AccountSetupWarningModalComponent {
shouldOpen (user: User) {
if (user.noAccountSetupWarningModal === true) return false
- if (peertubeLocalStorage.getItem(this.LOCAL_STORAGE_KEYS.NO_ACCOUNT_SETUP_WARNING_MODAL) === 'true') return false
+ if (peertubeLocalStorage.getItem(this.LS_KEYS.NO_ACCOUNT_SETUP_WARNING_MODAL) === 'true') return false
if (this.hasAccountAvatar(user) && this.hasAccountDescription(user)) return false
if (this.userService.hasSignupInThisSession()) return false
@@ -75,7 +75,7 @@ export class AccountSetupWarningModalComponent {
}
private doNotOpenAgain () {
- peertubeLocalStorage.setItem(this.LOCAL_STORAGE_KEYS.NO_ACCOUNT_SETUP_WARNING_MODAL, 'true')
+ peertubeLocalStorage.setItem(this.LS_KEYS.NO_ACCOUNT_SETUP_WARNING_MODAL, 'true')
this.userService.updateMyProfile({ noAccountSetupWarningModal: true })
.subscribe({
diff --git a/client/src/app/modal/admin-welcome-modal.component.html b/client/src/app/modal/admin-welcome-modal.component.html
index 9179d062ab..784a51f4d0 100644
--- a/client/src/app/modal/admin-welcome-modal.component.html
+++ b/client/src/app/modal/admin-welcome-modal.component.html
@@ -11,19 +11,19 @@
<div class="block-documentation">
<div class="columns">
<a class="link-block" href="https://docs.joinpeertube.org/maintain/tools" target="_blank" i18n-title title="Go to the CLI documentation">
- <h5 i18n class="underline-orange">CLI documentation</h5>
+ <h5 i18n class="link-primary">CLI documentation</h5>
<div i18n>Upload or import videos, parse logs, prune storage directories, reset user password...</div>
</a>
<a class="link-block" href="https://docs.joinpeertube.org/admin/following-instances" target="_blank" i18n-title title="Go to the admin documentation">
- <h5 i18n class="underline-orange">Admin documentation</h5>
+ <h5 i18n class="link-primary">Admin documentation</h5>
<div i18n>Managing users, following other instances, dealing with spammers...</div>
</a>
<a class="link-block" href="https://docs.joinpeertube.org/use/setup-account" target="_blank" i18n-title title="Go to the user documentation">
- <h5 i18n class="underline-orange">User documentation</h5>
+ <h5 i18n class="link-primary">User documentation</h5>
<div i18n>Setup your account, managing video playlists, discover third-party applications...</div>
</a>
@@ -72,12 +72,12 @@
<div class="modal-footer inputs">
<input
- type="button" role="button" i18n-value value="Remind me later" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Remind me later" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
<a i18n (click)="doNotOpenAgain(); hide()" (key.enter)="doNotOpenAgain(); hide()"
- class="peertube-button-link orange-button" href="/admin/config/edit-custom" target="_blank"
+ class="peertube-button-link primary-button" href="/admin/settings/config/edit-custom" target="_blank"
rel="noopener noreferrer" ngbAutofocus>
Configure my instance
</a>
diff --git a/client/src/app/modal/admin-welcome-modal.component.scss b/client/src/app/modal/admin-welcome-modal.component.scss
index c9b62658c8..2dd63902b1 100644
--- a/client/src/app/modal/admin-welcome-modal.component.scss
+++ b/client/src/app/modal/admin-welcome-modal.component.scss
@@ -46,7 +46,7 @@ li {
}
.link-block {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
padding: 10px;
transition: background-color 0.2s ease-in;
flex-basis: 33%;
diff --git a/client/src/app/modal/admin-welcome-modal.component.ts b/client/src/app/modal/admin-welcome-modal.component.ts
index e42bacf128..dbc4b1bc04 100644
--- a/client/src/app/modal/admin-welcome-modal.component.ts
+++ b/client/src/app/modal/admin-welcome-modal.component.ts
@@ -15,7 +15,7 @@ import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
export class AdminWelcomeModalComponent {
@ViewChild('modal', { static: true }) modal: ElementRef
- private LOCAL_STORAGE_KEYS = {
+ private LS_KEYS = {
NO_WELCOME_MODAL: 'no_welcome_modal'
}
@@ -27,7 +27,7 @@ export class AdminWelcomeModalComponent {
shouldOpen (user: User) {
if (user.noWelcomeModal === true) return false
- if (peertubeLocalStorage.getItem(this.LOCAL_STORAGE_KEYS.NO_WELCOME_MODAL) === 'true') return false
+ if (peertubeLocalStorage.getItem(this.LS_KEYS.NO_WELCOME_MODAL) === 'true') return false
return true
}
@@ -42,7 +42,7 @@ export class AdminWelcomeModalComponent {
}
doNotOpenAgain () {
- peertubeLocalStorage.setItem(this.LOCAL_STORAGE_KEYS.NO_WELCOME_MODAL, 'true')
+ peertubeLocalStorage.setItem(this.LS_KEYS.NO_WELCOME_MODAL, 'true')
this.userService.updateMyProfile({ noWelcomeModal: true })
.subscribe({
diff --git a/client/src/app/modal/confirm.component.html b/client/src/app/modal/confirm.component.html
index 50d79e2633..584f6eff04 100644
--- a/client/src/app/modal/confirm.component.html
+++ b/client/src/app/modal/confirm.component.html
@@ -31,13 +31,13 @@
<div class="modal-footer inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="dismiss()" (key.enter)="dismiss()"
>
<input
ngbAutofocus
- type="submit" [value]="confirmButtonText" class="peertube-button orange-button" [disabled]="isConfirmationDisabled()"
+ type="submit" [value]="confirmButtonText" class="peertube-button primary-button" [disabled]="isConfirmationDisabled()"
(click)="close()" (key.enter)="confirm()"
>
</div>
diff --git a/client/src/app/modal/confirm.component.scss b/client/src/app/modal/confirm.component.scss
index 0da8bf92a5..803c125f59 100644
--- a/client/src/app/modal/confirm.component.scss
+++ b/client/src/app/modal/confirm.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
.button {
padding: 0 13px;
diff --git a/client/src/app/modal/custom-modal.component.html b/client/src/app/modal/custom-modal.component.html
index 79fc8ea320..9d49a05701 100644
--- a/client/src/app/modal/custom-modal.component.html
+++ b/client/src/app/modal/custom-modal.component.html
@@ -11,12 +11,12 @@
<div *ngIf="hasCancel() || hasConfirm()" class="modal-footer inputs">
<input
- *ngIf="hasCancel()" type="button" role="button" value="{{cancel.value}}" class="peertube-button grey-button"
+ *ngIf="hasCancel()" type="button" role="button" value="{{cancel.value}}" class="peertube-button secondary-button"
(click)="onCancelClick()" (key.enter)="onCancelClick()"
>
<input
- *ngIf="hasConfirm()" type="button" role="button" value="{{confirm.value}}" class="peertube-button orange-button"
+ *ngIf="hasConfirm()" type="button" role="button" value="{{confirm.value}}" class="peertube-button primary-button"
(click)="onConfirmClick()" (key.enter)="onConfirmClick()"
>
</div>
diff --git a/client/src/app/modal/instance-config-warning-modal.component.html b/client/src/app/modal/instance-config-warning-modal.component.html
index 10ce1dda3d..1e32c88e51 100644
--- a/client/src/app/modal/instance-config-warning-modal.component.html
+++ b/client/src/app/modal/instance-config-warning-modal.component.html
@@ -37,12 +37,12 @@
</my-peertube-checkbox>
<input
- type="button" role="button" i18n-value value="Close" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Close" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
- <a i18n class="peertube-button-link orange-button" ngbAutofocus
- href="/admin/config/edit-custom" target="_blank" rel="noopener noreferrer">
+ <a i18n class="peertube-button-link primary-button" ngbAutofocus
+ href="/admin/settings/config/edit-custom" target="_blank" rel="noopener noreferrer">
Configure
</a>
</div>
diff --git a/client/src/app/modal/instance-config-warning-modal.component.ts b/client/src/app/modal/instance-config-warning-modal.component.ts
index dadd4a7bf3..db7d6bea10 100644
--- a/client/src/app/modal/instance-config-warning-modal.component.ts
+++ b/client/src/app/modal/instance-config-warning-modal.component.ts
@@ -22,7 +22,7 @@ export class InstanceConfigWarningModalComponent {
stopDisplayModal = false
about: About
- private LOCAL_STORAGE_KEYS = {
+ private LS_KEYS = {
NO_INSTANCE_CONFIG_WARNING_MODAL: 'no_instance_config_warning_modal'
}
@@ -35,7 +35,7 @@ export class InstanceConfigWarningModalComponent {
shouldOpenByUser (user: User) {
if (user.noInstanceConfigWarningModal === true) return false
- if (peertubeLocalStorage.getItem(this.LOCAL_STORAGE_KEYS.NO_INSTANCE_CONFIG_WARNING_MODAL) === 'true') return false
+ if (peertubeLocalStorage.getItem(this.LS_KEYS.NO_INSTANCE_CONFIG_WARNING_MODAL) === 'true') return false
return true
}
@@ -50,7 +50,7 @@ export class InstanceConfigWarningModalComponent {
}
show (about: About) {
- if (this.location.path().startsWith('/admin/config/edit-custom')) return
+ if (this.location.path().startsWith('/admin/settings/config/edit-custom')) return
this.about = about
@@ -66,7 +66,7 @@ export class InstanceConfigWarningModalComponent {
}
private doNotOpenAgain () {
- peertubeLocalStorage.setItem(this.LOCAL_STORAGE_KEYS.NO_INSTANCE_CONFIG_WARNING_MODAL, 'true')
+ peertubeLocalStorage.setItem(this.LS_KEYS.NO_INSTANCE_CONFIG_WARNING_MODAL, 'true')
this.userService.updateMyProfile({ noInstanceConfigWarningModal: true })
.subscribe({
diff --git a/client/src/app/shared/shared-abuse-list/abuse-details.component.html b/client/src/app/shared/shared-abuse-list/abuse-details.component.html
index 5a4e60fe7c..a53cbd0272 100644
--- a/client/src/app/shared/shared-abuse-list/abuse-details.component.html
+++ b/client/src/app/shared/shared-abuse-list/abuse-details.component.html
@@ -11,9 +11,7 @@
class="chip me-1"
>
<my-actor-avatar size="18" [actor]="abuse.reporterAccount" actorType="account"></my-actor-avatar>
- <div>
- <span class="muted">{{ abuse.reporterAccount.nameWithHost }}</span>
- </div>
+ <span class="muted">{{ abuse.reporterAccount.nameWithHost }}</span>
</a>
<a [routerLink]="[ '.' ]" [queryParams]="{ 'search': 'reporter:&quot;' + abuse.reporterAccount.displayName + '&quot;' }"
@@ -32,9 +30,7 @@
class="chip me-1"
>
<my-actor-avatar size="18" [actor]="abuse.flaggedAccount" actorType="account"></my-actor-avatar>
- <div>
- <span class="muted">{{ abuse.flaggedAccount ? abuse.flaggedAccount.nameWithHost : '' }}</span>
- </div>
+ <span class="muted">{{ abuse.flaggedAccount ? abuse.flaggedAccount.nameWithHost : '' }}</span>
</a>
<a *ngIf="isAdminView" [routerLink]="[ '.' ]" [queryParams]="{ 'search': 'reportee:&quot;' +abuse.flaggedAccount.displayName + '&quot;' }"
diff --git a/client/src/app/shared/shared-abuse-list/abuse-details.component.scss b/client/src/app/shared/shared-abuse-list/abuse-details.component.scss
index bd43ed459c..7be5b561c7 100644
--- a/client/src/app/shared/shared-abuse-list/abuse-details.component.scss
+++ b/client/src/app/shared/shared-abuse-list/abuse-details.component.scss
@@ -3,7 +3,7 @@
@use '_miniature' as *;
.comment-html {
- background-color: #ececec;
+ background-color: pvar(--bg-secondary-400);
padding: 10px;
}
@@ -17,5 +17,5 @@
}
my-global-icon[iconName=flag] {
- width: 15px;
+ @include global-icon-size(15px);
}
diff --git a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.html b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.html
index da7ea8bc6c..32fdda0234 100644
--- a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.html
+++ b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.html
@@ -17,7 +17,7 @@
<th scope="col" style="width: 40px;">
<span i18n class="visually-hidden">More information</span>
</th>
- <th scope="col" style="width: 150px;">
+ <th scope="col" style="width: 70px;">
<span i18n class="visually-hidden">Actions</span>
</th>
<th scope="col" *ngIf="isAdminView()" style="width: 20%;" pResizableColumn i18n>Reporter</th>
@@ -38,7 +38,7 @@
<td class="action-cell">
<my-action-dropdown
[ngClass]="{ 'show': expanded }" placement="bottom-right top-right left auto" container="body"
- i18n-label label="Actions" [actions]="abuseActions" [entry]="abuse"
+ [actions]="abuseActions" [entry]="abuse" buttonSize="small"
></my-action-dropdown>
</td>
@@ -133,7 +133,7 @@
<td class="abuse-messages">
<button
*ngIf="isLocalAbuse(abuse)" (click)="openAbuseMessagesModal(abuse)"
- class="peertube-button grey-button"
+ class="peertube-button secondary-button icon-only"
[ariaLabel]="getSendMessageButtonLabel(abuse)"
[title]="getSendMessageButtonLabel(abuse)"
>
diff --git a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.scss b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.scss
index 309e6e3ec7..5d62f1490a 100644
--- a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.scss
+++ b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.scss
@@ -5,7 +5,7 @@
.account-flagged-handle,
.video-owner {
font-size: 11px;
- color: var(--greyForegroundColor);
+ color: pvar(--fg-300);
}
.abuse-messages {
diff --git a/client/src/app/shared/shared-abuse-list/abuse-message-modal.component.html b/client/src/app/shared/shared-abuse-list/abuse-message-modal.component.html
index b40ca08f7e..ce973efd9f 100644
--- a/client/src/app/shared/shared-abuse-list/abuse-message-modal.component.html
+++ b/client/src/app/shared/shared-abuse-list/abuse-message-modal.component.html
@@ -43,7 +43,7 @@
</div>
<div class="form-group inputs">
- <input type="submit" i18n-value value="Add a message" class="peertube-button orange-button" [disabled]="!form.valid || sendingMessage">
+ <input type="submit" i18n-value value="Add a message" class="peertube-button primary-button" [disabled]="!form.valid || sendingMessage">
</div>
</form>
diff --git a/client/src/app/shared/shared-abuse-list/abuse-message-modal.component.scss b/client/src/app/shared/shared-abuse-list/abuse-message-modal.component.scss
index b0062d6849..ca7de17f19 100644
--- a/client/src/app/shared/shared-abuse-list/abuse-message-modal.component.scss
+++ b/client/src/app/shared/shared-abuse-list/abuse-message-modal.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
form {
margin: 20px 20px 0 0;
@@ -33,7 +34,7 @@ textarea {
max-width: 60%;
.author {
- color: var(--greyForegroundColor);
+ color: pvar(--fg-300);
font-size: 14px;
padding: 0 0 3px 10px;
}
@@ -41,23 +42,23 @@ textarea {
.bubble {
border-radius: 10px;
padding: 5px 10px;
- color: var(--mainForegroundColor);
- background-color: var(--greyBackgroundColor);
+ color: pvar(--fg);
+ background-color: pvar(--bg-secondary-400);
.date {
font-size: 13px;
- color: var(--greyForegroundColor);
+ color: pvar(--fg-300);
}
}
&.by-me {
.bubble {
- color: var(--mainBackgroundColor);
- background-color: var(--mainColorLighter);
+ color: pvar(--on-primary);
+ background-color: pvar(--primary-400);
.date {
- color: var(--mainBackgroundColor);
+ color: pvar(--on-primary);
}
}
}
diff --git a/client/src/app/shared/shared-abuse-list/moderation-comment-modal.component.html b/client/src/app/shared/shared-abuse-list/moderation-comment-modal.component.html
index b41664aac2..afcf77e13f 100644
--- a/client/src/app/shared/shared-abuse-list/moderation-comment-modal.component.html
+++ b/client/src/app/shared/shared-abuse-list/moderation-comment-modal.component.html
@@ -25,11 +25,11 @@
<div class="form-group inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
- <input type="submit" i18n-value value="Update this comment" class="peertube-button orange-button" [disabled]="!form.valid" />
+ <input type="submit" i18n-value value="Update this comment" class="peertube-button primary-button" [disabled]="!form.valid" />
</div>
</form>
</div>
diff --git a/client/src/app/shared/shared-abuse-list/moderation-comment-modal.component.scss b/client/src/app/shared/shared-abuse-list/moderation-comment-modal.component.scss
index 1765282c66..eb707f16af 100644
--- a/client/src/app/shared/shared-abuse-list/moderation-comment-modal.component.scss
+++ b/client/src/app/shared/shared-abuse-list/moderation-comment-modal.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
textarea {
@include peertube-textarea(100%, 100px);
diff --git a/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.html b/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.html
index 8126c72463..58986d0136 100644
--- a/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.html
+++ b/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.html
@@ -5,7 +5,7 @@
@if (editable) {
@if (hasAvatar()) {
<div ngbDropdown placement="right">
- <button type="button" class="actor-img-edit-button" i18n-arialLabel aria-label="Change your avatar" ngbDropdownToggle>
+ <button type="button" class="actor-img-edit-button button-file primary-button" i18n-arialLabel aria-label="Change your avatar" ngbDropdownToggle>
<my-global-icon iconName="edit"></my-global-icon>
</button>
@@ -23,7 +23,7 @@
</div>
</div>
} @else {
- <div class="actor-img-edit-button button-focus-within" [ngbTooltip]="avatarFormat" placement="right" container="body">
+ <div class="actor-img-edit-button button-file primary-button button-focus-within" [ngbTooltip]="avatarFormat" placement="right" container="body">
<my-global-icon iconName="upload"></my-global-icon>
<label class="visually-hidden" for="avatarfile" i18n>Upload a new avatar</label>
<input #avatarfileInput type="file" name="avatarfile" id="avatarfile" [accept]="avatarExtensions" (change)="onAvatarChange(avatarfileInput)"/>
diff --git a/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.scss b/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.scss
index 46b30d2c91..2abbf758dd 100644
--- a/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.scss
+++ b/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.scss
@@ -24,7 +24,7 @@
.actor-info-username {
position: relative;
font-size: 14px;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
}
.actor-info-followers {
@@ -32,7 +32,7 @@
}
.actor-img-edit-button {
- border-radius: 50%;
+ padding: 8px 20px;
position: absolute;
bottom: 5px;
@@ -40,7 +40,7 @@
}
.button-focus-within:focus-within {
- box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
+ box-shadow: $focus-box-shadow-form;
}
.dropdown-item {
diff --git a/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.html b/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.html
index fd7c9afd12..d4dd962e91 100644
--- a/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.html
+++ b/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.html
@@ -4,12 +4,12 @@
<img *ngIf="hasBanner()" [src]="preview || bannerUrl" alt="Banner" />
</div>
- <div *ngIf="!hasBanner()" class="actor-img-edit-button button-focus-within" [ngbTooltip]="bannerFormat" placement="right" container="body">
+ <div *ngIf="!hasBanner()" class="actor-img-edit-button button-file primary-button button-focus-within" [ngbTooltip]="bannerFormat" placement="right" container="body">
<ng-container *ngTemplateOutlet="uploadNewBanner"></ng-container>
</div>
<div *ngIf="hasBanner()" ngbDropdown placement="right">
- <button type="button" class="actor-img-edit-button" ngbDropdownToggle>
+ <button type="button" class="actor-img-edit-button button-file primary-button" ngbDropdownToggle>
<my-global-icon iconName="edit"></my-global-icon>
<label for="bannerMenu" i18n>Change your banner</label>
</button>
diff --git a/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.scss b/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.scss
index 8e5a05603a..fb29febfe5 100644
--- a/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.scss
+++ b/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.scss
@@ -6,7 +6,7 @@
}
.banner-placeholder {
- background-color: pvar(--greyBackgroundColor);
+ background-color: pvar(--bg-secondary-500);
}
.actor-img-edit-container {
@@ -35,7 +35,7 @@
}
.button-focus-within:focus-within {
- box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
+ box-shadow: $focus-box-shadow-form;
}
.dropdown-item {
diff --git a/client/src/app/shared/shared-actor-image-edit/actor-image-edit.scss b/client/src/app/shared/shared-actor-image-edit/actor-image-edit.scss
index 371e6ed2bf..1a271cc1b0 100644
--- a/client/src/app/shared/shared-actor-image-edit/actor-image-edit.scss
+++ b/client/src/app/shared/shared-actor-image-edit/actor-image-edit.scss
@@ -1,14 +1,15 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_button-mixins' as *;
.dropdown-file {
@include peertube-file;
}
.actor-img-edit-button {
- @include peertube-button-file(31px);
+ width: 31px;
+
@include button-with-icon(19px, 0);
- @include orange-button;
& {
display: flex;
diff --git a/client/src/app/shared/shared-actor-image/actor-avatar.component.scss b/client/src/app/shared/shared-actor-image/actor-avatar.component.scss
index 9eef525759..fc6f610fa1 100644
--- a/client/src/app/shared/shared-actor-image/actor-avatar.component.scss
+++ b/client/src/app/shared/shared-actor-image/actor-avatar.component.scss
@@ -3,10 +3,10 @@
.avatar {
// Defined in component
- width: var(--avatarSize);
- height: var(--avatarSize);
- min-width: var(--avatarSize);
- min-height: var(--avatarSize);
+ width: var(--co-avatar-size);
+ height: var(--co-avatar-size);
+ min-width: var(--co-avatar-size);
+ min-height: var(--co-avatar-size);
&.account {
object-fit: cover;
@@ -18,8 +18,8 @@
}
}
-a:hover {
- text-decoration: none;
+a {
+ @include disable-default-a-behaviour;
}
.initial {
@@ -28,7 +28,8 @@ a:hover {
display: flex;
align-items: center;
justify-content: center;
- font-size: var(--initialFontSize);
+ // Defined in component
+ font-size: var(--co-font-size);
&.blue {
background-color: #009FD4;
diff --git a/client/src/app/shared/shared-actor-image/actor-avatar.component.ts b/client/src/app/shared/shared-actor-image/actor-avatar.component.ts
index 02b8ded73a..3262a60286 100644
--- a/client/src/app/shared/shared-actor-image/actor-avatar.component.ts
+++ b/client/src/app/shared/shared-actor-image/actor-avatar.component.ts
@@ -69,7 +69,7 @@ export class ActorAvatarComponent implements OnInit, OnChanges {
private buildClasses () {
let avatarSize = '100%'
- let initialFontSize = '22px'
+ let fontSize = '22px'
this.classes = [ 'avatar' ]
@@ -77,11 +77,11 @@ export class ActorAvatarComponent implements OnInit, OnChanges {
avatarSize = `${this.size}px`
if (this.size <= 18) {
- initialFontSize = '13px'
+ fontSize = '13px'
} else if (this.size >= 100) {
- initialFontSize = '40px'
+ fontSize = '40px'
} else if (this.size >= 120) {
- initialFontSize = '46px'
+ fontSize = '46px'
}
}
@@ -98,8 +98,8 @@ export class ActorAvatarComponent implements OnInit, OnChanges {
}
const elStyle = (this.el.nativeElement as HTMLElement).style
- elStyle.setProperty('--avatarSize', avatarSize)
- elStyle.setProperty('--initialFontSize', initialFontSize)
+ elStyle.setProperty('--co-avatar-size', avatarSize)
+ elStyle.setProperty('--co-font-size', fontSize)
}
private buildDefaultAvatarUrl () {
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts
index 49acba7da7..41f3c2c686 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/button-markup.component.ts
@@ -32,8 +32,8 @@ export class ButtonMarkupComponent implements CustomMarkupComponent {
getClasses () {
const additionalClass = this.theme === 'primary'
- ? 'orange-button'
- : 'grey-button'
+ ? 'primary-button'
+ : 'secondary-button'
return [ 'peertube-button-link', additionalClass ]
}
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.scss b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.scss
index b2dbcac7b5..c8470e04ae 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.scss
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.scss
@@ -3,7 +3,7 @@
.channel {
padding: 20px;
- background-color: pvar(--channelBackgroundColor);
+ background-color: pvar(--bg-secondary-350);
margin-bottom: 30px;
width: fit-content;
}
@@ -20,7 +20,7 @@
column-gap: 15px;
a {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
@include peertube-word-wrap;
}
@@ -46,12 +46,12 @@
max-height: 60px;
grid-column: 2;
- @include fade-text(30px, pvar(--channelBackgroundColor));
+ @include fade-text(30px, pvar(--bg-secondary-350));
}
}
.video-label {
font-size: 12px;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
margin: 15px 0 5px;
}
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts
index 4ea73f1ccf..dd3f895b85 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts
@@ -31,7 +31,7 @@ export class PlaylistMiniatureMarkupComponent implements CustomMarkupComponent,
date: true,
views: true,
by: true,
- avatar: false,
+ avatar: true,
privacyLabel: false,
privacyText: false,
state: false,
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts
index cae23aa900..42bbdc7bba 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts
@@ -31,7 +31,7 @@ export class VideoMiniatureMarkupComponent implements CustomMarkupComponent, OnI
date: true,
views: true,
by: true,
- avatar: false,
+ avatar: true,
privacyLabel: false,
privacyText: false,
state: false,
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.scss b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.scss
index 6cd2179c46..5dc8d31c5d 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.scss
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.scss
@@ -3,5 +3,5 @@
@use '_miniature' as *;
.root {
- @include grid-videos-miniature-layout;
+ @include grid-videos-miniature-layout();
}
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts
index ec0ab8b19b..e0f54a85e6 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts
@@ -42,7 +42,7 @@ export class VideosListMarkupComponent implements CustomMarkupComponent, OnInit
date: false,
views: true,
by: true,
- avatar: false,
+ avatar: true,
privacyLabel: false,
privacyText: false,
state: false,
diff --git a/client/src/app/shared/shared-forms/advanced-input-filter.component.scss b/client/src/app/shared/shared-forms/advanced-input-filter.component.scss
index 966afefa0d..f7ce51b997 100644
--- a/client/src/app/shared/shared-forms/advanced-input-filter.component.scss
+++ b/client/src/app/shared/shared-forms/advanced-input-filter.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
.input-group {
width: fit-content;
@@ -15,6 +16,11 @@ input {
.input-group-text {
background-color: transparent;
+ transition: 0.3s ease-out;
+
+ &:hover {
+ background-color: pvar(--input-bg);
+ }
}
.form-control-clear my-global-icon {
diff --git a/client/src/app/shared/shared-forms/dynamic-form-field.component.scss b/client/src/app/shared/shared-forms/dynamic-form-field.component.scss
index 4d70204036..1022e5b576 100644
--- a/client/src/app/shared/shared-forms/dynamic-form-field.component.scss
+++ b/client/src/app/shared/shared-forms/dynamic-form-field.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
input:not([type=submit]) {
max-width: 340px;
diff --git a/client/src/app/shared/shared-forms/input-switch.component.scss b/client/src/app/shared/shared-forms/input-switch.component.scss
index 40457b53e3..946fa64e7c 100644
--- a/client/src/app/shared/shared-forms/input-switch.component.scss
+++ b/client/src/app/shared/shared-forms/input-switch.component.scss
@@ -12,7 +12,7 @@ input {
text-indent: -9999px;
width: 35px;
height: 20px;
- background: #cccccc;
+ background: pvar(--input-bg);
display: block;
border-radius: 100px;
position: relative;
@@ -25,7 +25,7 @@ input {
left: 3px;
width: 14px;
height: 14px;
- background: pvar(--mainBackgroundColor);
+ background: pvar(--fg-300);
border-radius: 50%;
transition: 0.3s ease-out;
}
@@ -36,15 +36,16 @@ input {
}
&:checked + label {
- background: pvar(--mainColor);
+ background: pvar(--primary);
&::after {
left: calc(100% - 3px);
transform: translateX(-100%);
+ background: pvar(--on-primary);
}
}
&:focus-visible + label {
- outline: 2px solid;
+ box-shadow: $focus-box-shadow-form;
}
}
diff --git a/client/src/app/shared/shared-forms/input-text.component.html b/client/src/app/shared/shared-forms/input-text.component.html
index dbffcc2505..7f1ef7449c 100644
--- a/client/src/app/shared/shared-forms/input-text.component.html
+++ b/client/src/app/shared/shared-forms/input-text.component.html
@@ -7,7 +7,7 @@
[attr.aria-label]="ariaLabel"
/>
- <button *ngIf="withToggle" (click)="toggle()" type="button" class="btn btn-outline-secondary" [title]="toggleTitle">
+ <button *ngIf="withToggle" (click)="toggle()" type="button" class="btn" [title]="toggleTitle">
<my-global-icon *ngIf="show" iconName="eye-open"></my-global-icon>
<my-global-icon *ngIf="!show" iconName="eye-close"></my-global-icon>
</button>
diff --git a/client/src/app/shared/shared-forms/input-text.component.scss b/client/src/app/shared/shared-forms/input-text.component.scss
index 8f1cadea4b..bc6db55c06 100644
--- a/client/src/app/shared/shared-forms/input-text.component.scss
+++ b/client/src/app/shared/shared-forms/input-text.component.scss
@@ -1,5 +1,7 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_button-mixins' as *;
+@use '_form-mixins' as *;
input {
@include peertube-input-text(auto);
@@ -7,15 +9,20 @@ input {
@include padding-right(15px !important);
}
-.btn {
- @include button-with-icon(18px);
+.btn,
+my-copy-button ::ng-deep .btn {
+ background-color: var(--bg-secondary-400);
+ border-left: 1px solid var(--bg);
- & {
- line-height: 18px;
- top: 0;
+ &:hover {
+ background-color: var(--bg-secondary-450);
}
}
+.btn {
+ @include button-with-icon(18px, 3px, 0);
+}
+
.copy-text {
font-size: 14px;
margin-left: 5px;
diff --git a/client/src/app/shared/shared-forms/markdown-textarea.component.scss b/client/src/app/shared/shared-forms/markdown-textarea.component.scss
index e765fb5c9e..7df93673b5 100644
--- a/client/src/app/shared/shared-forms/markdown-textarea.component.scss
+++ b/client/src/app/shared/shared-forms/markdown-textarea.component.scss
@@ -1,6 +1,7 @@
@use 'sass:math';
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
$nav-preview-tab-height: 30px;
$base-padding: 15px;
@@ -11,22 +12,25 @@ $input-border-radius: 3px;
flex-direction: column;
textarea {
- background-color: pvar(--markdownTextareaBackgroundColor);
+ @include peertube-textarea(100%, 150px);
- font-family: monospace;
- font-size: 13px;
- border-bottom: 0;
- border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
+ & {
+ color: pvar(--textarea-fg);
+ background-color: pvar(--textarea-bg);
- @include peertube-textarea(100%, 150px);
+ font-family: monospace;
+ font-size: 14px;
+ border-bottom: 0;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+ }
}
.nav-preview {
padding: 10px 0;
- border: 1px solid pvar(--inputBorderColor);
- border-top: 1px dashed pvar(--inputBorderColor);
+ border: 1px solid pvar(--input-border-color);
+ border-top: 1px dashed pvar(--input-border-color);
border-bottom-right-radius: $input-border-radius;
border-bottom-left-radius: $input-border-radius;
@@ -35,7 +39,7 @@ $input-border-radius: 3px;
flex-grow: 1;
border-bottom-left-radius: unset;
border-bottom-right-radius: unset;
- border-bottom: 2px solid pvar(--mainColor);
+ border-bottom: 2px solid pvar(--primary);
.maximize-button {
opacity: 0.6;
@@ -67,7 +71,7 @@ $input-border-radius: 3px;
overflow-y: auto;
word-wrap: break-word;
- border: 1px solid pvar(--inputBorderColor);
+ border: 1px solid pvar(--input-border-color);
border-top: 0;
border-bottom-left-radius: $input-border-radius;
@@ -77,26 +81,26 @@ $input-border-radius: 3px;
&.maximized {
z-index: #{z(root-header) - 1};
position: fixed;
- top: $header-height;
+ top: pvar(--header-height);
left: $menu-width;
max-height: none !important;
max-width: none !important;
width: calc(100% - #{$menu-width});
- height: calc(100vh - #{$header-height});
+ height: calc(100vh - #{pvar(--header-height)});
display: grid;
grid-template-rows: auto 1fr;
grid-template-columns: 1fr 1fr;
- background-color: pvar(--mainBackgroundColor);
+ background-color: pvar(--bg);
.nav-preview {
grid-row: 1;
grid-column: 1 / 3;
border: 0;
- border-bottom: 2px solid pvar(--mainColor);
+ border-bottom: 2px solid pvar(--primary);
padding: 20px 0;
width: 100% !important;
@@ -106,7 +110,7 @@ $input-border-radius: 3px;
grid-column: 1;
border: 0;
- border-right: 1px dashed pvar(--inputBorderColor);
+ border-right: 1px dashed pvar(--input-border-color);
resize: none;
}
@@ -120,7 +124,7 @@ $input-border-radius: 3px;
overflow-y: auto;
word-wrap: break-word;
- scrollbar-color: pvar(--actionButtonColor) pvar(--mainBackgroundColor);
+ scrollbar-color: pvar(--fg-300) pvar(--bg);
}
textarea,
@@ -146,7 +150,7 @@ $input-border-radius: 3px;
grid-row: 2;
grid-column: 1;
border: 0;
- border-bottom: 1px dashed pvar(--inputBorderColor);;
+ border-bottom: 1px dashed pvar(--input-border-color);;
}
::ng-deep .tab-content {
diff --git a/client/src/app/shared/shared-forms/peertube-checkbox.component.html b/client/src/app/shared/shared-forms/peertube-checkbox.component.html
index 1ea52896e6..9d3abb751c 100644
--- a/client/src/app/shared/shared-forms/peertube-checkbox.component.html
+++ b/client/src/app/shared/shared-forms/peertube-checkbox.component.html
@@ -1,5 +1,5 @@
<div class="root flex-column">
- <div class="d-flex">
+ <div class="d-flex align-items-center">
<label>
<input
type="checkbox"
@@ -31,10 +31,10 @@
</ng-template>
</my-help>
- <div *ngIf="recommended" class="recommended" i18n>Recommended</div>
+ <div *ngIf="recommended" class="ms-2 pt-badge badge-secondary" i18n>Recommended</div>
</div>
- <div class="ms-4 d-flex flex-column">
+ <div class="d-flex flex-column extra-container">
<div class="wrapper form-group-description" [id]="inputName + '-description'">
<ng-content select="description"></ng-content>
</div>
diff --git a/client/src/app/shared/shared-forms/peertube-checkbox.component.scss b/client/src/app/shared/shared-forms/peertube-checkbox.component.scss
index cc6447eaec..4ea83b0bd5 100644
--- a/client/src/app/shared/shared-forms/peertube-checkbox.component.scss
+++ b/client/src/app/shared/shared-forms/peertube-checkbox.component.scss
@@ -1,15 +1,17 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use 'form-mixins' as *;
.root {
display: flex;
label {
display: flex;
+ align-items: center;
font-size: $form-input-font-size;
input {
- @include peertube-checkbox(1px);
+ @include peertube-checkbox;
}
}
@@ -28,20 +30,8 @@
.wrapper:empty {
display: none;
}
+}
- .recommended {
- align-self: baseline;
- display: inline-block;
- padding: 4px 6px;
- cursor: default;
- border-radius: 3px;
- font-size: 12px;
- line-height: 12px;
- font-weight: 500;
- color: pvar(--inputPlaceholderColor);
- background-color: rgba(217, 225, 232, .1);
- border: 1px solid rgba(217, 225, 232, .5);
-
- @include margin-left(.5rem);
- }
+.pt-badge {
+ height: fit-content;
}
diff --git a/client/src/app/shared/shared-forms/preview-upload.component.html b/client/src/app/shared/shared-forms/preview-upload.component.html
index 8a10a11b03..8fa1e7e4ca 100644
--- a/client/src/app/shared/shared-forms/preview-upload.component.html
+++ b/client/src/app/shared/shared-forms/preview-upload.component.html
@@ -2,7 +2,7 @@
<div class="preview-container">
<my-reactive-file
[inputName]="inputName" [inputLabel]="inputLabel" [extensions]="videoImageExtensions" [maxFileSize]="maxVideoImageSize" placement="right"
- icon="edit" (fileChanged)="onFileChanged($event)" [buttonTooltip]="getReactiveFileButtonTooltip()"
+ icon="edit" (fileChanged)="onFileChanged($event)" [buttonTooltip]="getReactiveFileButtonTooltip()" theme="primary"
></my-reactive-file>
<img *ngIf="imageSrc" [ngStyle]="{ width: previewWidth, height: previewHeight }" [src]="imageSrc" class="preview" alt="Preview" i18n-alt />
diff --git a/client/src/app/shared/shared-forms/preview-upload.component.scss b/client/src/app/shared/shared-forms/preview-upload.component.scss
index b6cc2f007e..dea5f79216 100644
--- a/client/src/app/shared/shared-forms/preview-upload.component.scss
+++ b/client/src/app/shared/shared-forms/preview-upload.component.scss
@@ -22,7 +22,7 @@
&.no-image {
border: 2px solid #808080;
- background-color: pvar(--mainBackgroundColor);
+ background-color: pvar(--bg);
}
}
}
diff --git a/client/src/app/shared/shared-forms/reactive-file.component.scss b/client/src/app/shared/shared-forms/reactive-file.component.scss
index 2b6e376357..863039f905 100644
--- a/client/src/app/shared/shared-forms/reactive-file.component.scss
+++ b/client/src/app/shared/shared-forms/reactive-file.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_button-mixins' as *;
.root {
height: auto;
@@ -7,8 +8,6 @@
align-items: center;
.button-file {
- @include peertube-button-file(auto);
-
&.with-icon {
@include button-with-icon;
}
diff --git a/client/src/app/shared/shared-forms/reactive-file.component.ts b/client/src/app/shared/shared-forms/reactive-file.component.ts
index ce8f7810e5..c926abc4b9 100644
--- a/client/src/app/shared/shared-forms/reactive-file.component.ts
+++ b/client/src/app/shared/shared-forms/reactive-file.component.ts
@@ -62,8 +62,8 @@ export class ReactiveFileComponent implements OnInit, OnChanges, ControlValueAcc
buildClasses () {
this.classes = {
'with-icon': !!this.icon,
- 'orange-button': this.theme === 'primary',
- 'grey-button': this.theme === 'secondary'
+ 'primary-button': this.theme === 'primary',
+ 'secondary-button': this.theme === 'secondary'
}
}
diff --git a/client/src/app/shared/shared-forms/timestamp-input.component.html b/client/src/app/shared/shared-forms/timestamp-input.component.html
index 9080b2d66c..b097377a91 100644
--- a/client/src/app/shared/shared-forms/timestamp-input.component.html
+++ b/client/src/app/shared/shared-forms/timestamp-input.component.html
@@ -1,5 +1,5 @@
<p-inputMask
[disabled]="disabled" [(ngModel)]="timestampString" (onBlur)="onBlur()"
- [ngClass]="{ 'border-disabled': disableBorder }"
+ [ngClass]="{ 'with-border': enableBorder }"
[mask]="mask" slotChar="0" (ngModelChange)="onModelChange()" [inputId]="inputName"
></p-inputMask>
diff --git a/client/src/app/shared/shared-forms/timestamp-input.component.scss b/client/src/app/shared/shared-forms/timestamp-input.component.scss
index 3f4735c483..23f634a132 100644
--- a/client/src/app/shared/shared-forms/timestamp-input.component.scss
+++ b/client/src/app/shared/shared-forms/timestamp-input.component.scss
@@ -1,35 +1,26 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
p-inputmask {
+ &.with-border {
+ --input-border-color: #{pvar(--bg-secondary-500)};
+ }
+
::ng-deep input {
width: 100%;
text-align: center;
+ @include peertube-input-text(100%);
+
&:focus-within,
&:focus {
- box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
+ box-shadow: $focus-box-shadow-form;
}
&:disabled {
- background: pvar(--mainBackgroundColor);
+ background: pvar(--bg);
opacity: 0.5;
}
}
-
- &.border-disabled {
- ::ng-deep input {
- border: 0;
- }
- }
-
- &:not(.border-disabled) {
- ::ng-deep input {
- @include peertube-input-text(100%);
-
- & {
- padding: 3px 10px;
- }
- }
- }
}
diff --git a/client/src/app/shared/shared-forms/timestamp-input.component.ts b/client/src/app/shared/shared-forms/timestamp-input.component.ts
index 394163dec1..e77128dd5c 100644
--- a/client/src/app/shared/shared-forms/timestamp-input.component.ts
+++ b/client/src/app/shared/shared-forms/timestamp-input.component.ts
@@ -23,7 +23,7 @@ export class TimestampInputComponent implements ControlValueAccessor, OnInit {
@Input() timestamp: number
@Input({ transform: booleanAttribute }) disabled = false
- @Input({ transform: booleanAttribute }) disableBorder = true
+ @Input({ transform: booleanAttribute }) enableBorder = false
@Input() inputName: string
@Input() mask = '99:99:99'
diff --git a/client/src/app/shared/shared-icons/global-icon.component.scss b/client/src/app/shared/shared-icons/global-icon.component.scss
index 10180829fe..0cbe36dc0d 100644
--- a/client/src/app/shared/shared-icons/global-icon.component.scss
+++ b/client/src/app/shared/shared-icons/global-icon.component.scss
@@ -1,5 +1,6 @@
-::ng-deep {
+:host ::ng-deep {
svg {
+ vertical-align: bottom;
width: inherit;
height: inherit;
}
diff --git a/client/src/app/shared/shared-icons/global-icon.component.ts b/client/src/app/shared/shared-icons/global-icon.component.ts
index b9fa242f9c..8ff443f2bc 100644
--- a/client/src/app/shared/shared-icons/global-icon.component.ts
+++ b/client/src/app/shared/shared-icons/global-icon.component.ts
@@ -3,30 +3,35 @@ import { HooksService } from '@app/core/plugins/hooks.service'
const icons = {
// misc icons
- 'npm': require('../../../assets/images/misc/npm.svg'),
'markdown': require('../../../assets/images/misc/markdown.svg'),
'language': require('../../../assets/images/misc/language.svg'),
'video-lang': require('../../../assets/images/misc/video-lang.svg'),
'support': require('../../../assets/images/misc/support.svg'),
'peertube-x': require('../../../assets/images/misc/peertube-x.svg'),
'robot': require('../../../assets/images/misc/miscellaneous-services.svg'), // material ui
- 'videos': require('../../../assets/images/misc/video-library.svg'), // material ui
- 'history': require('../../../assets/images/misc/history.svg'), // material ui
- 'subscriptions': require('../../../assets/images/misc/subscriptions.svg'), // material ui
'playlist-add': require('../../../assets/images/misc/playlist-add.svg'), // material ui
'follower': require('../../../assets/images/misc/account-arrow-left.svg'), // material ui
'following': require('../../../assets/images/misc/account-arrow-right.svg'), // material ui
'tip': require('../../../assets/images/misc/tip.svg'), // material ui
'flame': require('../../../assets/images/misc/flame.svg'),
- 'local': require('../../../assets/images/misc/local.svg'),
// feather/lucide icons
- 'add': require('../../../assets/images/feather/plus-circle.svg'),
+ 'menu': require('../../../assets/images/feather/menu.svg'),
+ 'history': require('../../../assets/images/feather/history.svg'),
+ 'registry': require('../../../assets/images/feather/registry.svg'),
+ 'subscriptions': require('../../../assets/images/feather/subscriptions.svg'),
+ 'videos': require('../../../assets/images/feather/videos.svg'),
+ 'add': require('../../../assets/images/feather/plus.svg'),
'alert': require('../../../assets/images/feather/alert.svg'),
+ 'overview': require('../../../assets/images/feather/overview.svg'),
+ 'moderation': require('../../../assets/images/feather/moderation.svg'),
+ 'config': require('../../../assets/images/feather/config.svg'),
'award': require('../../../assets/images/feather/award.svg'),
'bell': require('../../../assets/images/feather/bell.svg'),
- 'channel': require('../../../assets/images/feather/tv.svg'),
+ 'opened-bell': require('../../../assets/images/feather/opened-bell.svg'),
+ 'channel': require('../../../assets/images/feather/channel.svg'),
'chevrons-up': require('../../../assets/images/feather/chevrons-up.svg'),
+ 'chevron-left': require('../../../assets/images/feather/chevron-left.svg'),
'circle-tick': require('../../../assets/images/feather/check-circle.svg'),
'clock-arrow-down': require('../../../assets/images/feather/clock-arrow-down.svg'),
'clock': require('../../../assets/images/feather/clock.svg'),
@@ -35,7 +40,7 @@ const icons = {
'codesandbox': require('../../../assets/images/feather/codesandbox.svg'),
'cog': require('../../../assets/images/feather/cog.svg'),
'columns': require('../../../assets/images/feather/columns.svg'),
- 'command': require('../../../assets/images/feather/command.svg'),
+ 'keyboard': require('../../../assets/images/feather/keyboard.svg'),
'copy': require('../../../assets/images/feather/copy.svg'),
'cross': require('../../../assets/images/feather/x.svg'),
'delete': require('../../../assets/images/feather/delete.svg'),
@@ -51,7 +56,6 @@ const icons = {
'flag': require('../../../assets/images/feather/flag.svg'),
'fullscreen': require('../../../assets/images/feather/maximize.svg'),
'globe': require('../../../assets/images/feather/globe.svg'),
- 'go': require('../../../assets/images/feather/arrow-up-right.svg'),
'help': require('../../../assets/images/feather/help.svg'),
'home': require('../../../assets/images/feather/home.svg'),
'like': require('../../../assets/images/feather/like.svg'),
@@ -64,7 +68,7 @@ const icons = {
'ownership-change': require('../../../assets/images/feather/share.svg'),
'p2p': require('../../../assets/images/feather/airplay.svg'),
'play': require('../../../assets/images/feather/play.svg'),
- 'playlists': require('../../../assets/images/feather/list.svg'),
+ 'playlists': require('../../../assets/images/feather/playlists.svg'),
'refresh': require('../../../assets/images/feather/refresh-cw.svg'),
'repeat': require('../../../assets/images/feather/repeat.svg'),
'search': require('../../../assets/images/feather/search.svg'),
@@ -94,7 +98,7 @@ export type GlobalIconName = keyof typeof icons
standalone: true
})
export class GlobalIconComponent implements OnInit {
- @Input() iconName: GlobalIconName
+ @Input({ required: true }) iconName: GlobalIconName
constructor (
private el: ElementRef,
diff --git a/client/src/app/shared/shared-instance/instance-about-accordion.component.scss b/client/src/app/shared/shared-instance/instance-about-accordion.component.scss
index 2bc2d52bd7..c11a9eb2ad 100644
--- a/client/src/app/shared/shared-instance/instance-about-accordion.component.scss
+++ b/client/src/app/shared/shared-instance/instance-about-accordion.component.scss
@@ -15,8 +15,7 @@
}
my-global-icon {
- line-height: 24px;
-
+ @include global-icon-size(24px);
@include margin-right(15px);
}
diff --git a/client/src/app/shared/shared-instance/instance-features-table.component.html b/client/src/app/shared/shared-instance/instance-features-table.component.html
index 4ea71ace42..611abd81f5 100644
--- a/client/src/app/shared/shared-instance/instance-features-table.component.html
+++ b/client/src/app/shared/shared-instance/instance-features-table.component.html
@@ -3,13 +3,13 @@
<table *ngIf="serverConfig">
<caption i18n>Features found on this instance</caption>
<tr>
- <th i18n class="label" scope="row">PeerTube version</th>
+ <th i18n class="t-label" scope="row">PeerTube version</th>
<td class="value">{{ getServerVersionAndCommit() }}</td>
</tr>
<tr>
- <th class="label" scope="row">
+ <th class="t-label" scope="row">
<div i18n>Default NSFW/sensitive videos policy</div>
<span i18n class="fs-7 fw-normal fst-italic">can be redefined by the users</span>
</th>
@@ -18,31 +18,31 @@
</tr>
<tr>
- <th i18n class="label" scope="row">User registration</th>
+ <th i18n class="t-label" scope="row">User registration</th>
<td class="value">{{ buildRegistrationLabel() }}</td>
</tr>
<tr>
- <th i18n class="label" colspan="2">Video uploads</th>
+ <th i18n class="t-label" colspan="2">Video uploads</th>
</tr>
<tr>
- <th i18n class="sub-label" scope="row">Transcoding in multiple resolutions</th>
+ <th i18n class="t-sub-label" scope="row">Transcoding in multiple resolutions</th>
<td>
<my-feature-boolean [value]="serverConfig.transcoding.enabledResolutions.length !== 0"></my-feature-boolean>
</td>
</tr>
<tr>
- <th i18n class="sub-label" scope="row">Automatic transcription</th>
+ <th i18n class="t-sub-label" scope="row">Automatic transcription</th>
<td>
<my-feature-boolean [value]="serverConfig.videoTranscription.enabled"></my-feature-boolean>
</td>
</tr>
<tr>
- <th i18n class="sub-label" scope="row">Video uploads</th>
+ <th i18n class="t-sub-label" scope="row">Video uploads</th>
<td>
<span i18n *ngIf="serverConfig.autoBlacklist.videos.ofUsers.enabled">Requires manual validation by moderators</span>
<span i18n *ngIf="!serverConfig.autoBlacklist.videos.ofUsers.enabled">Automatically published</span>
@@ -50,7 +50,7 @@
</tr>
<tr>
- <th i18n class="sub-label" scope="row">Video quota</th>
+ <th i18n class="t-sub-label" scope="row">Video quota</th>
<td class="value">
<ng-container *ngIf="initialUserVideoQuota !== -1">
@@ -70,90 +70,90 @@
</tr>
<tr>
- <th i18n class="label" colspan="2">Live streaming</th>
+ <th i18n class="t-label" colspan="2">Live streaming</th>
</tr>
<tr>
- <th i18n class="sub-label" scope="row">Live streaming enabled</th>
+ <th i18n class="t-sub-label" scope="row">Live streaming enabled</th>
<td>
<my-feature-boolean [value]="serverConfig.live.enabled"></my-feature-boolean>
</td>
</tr>
<tr *ngIf="serverConfig.live.enabled">
- <th i18n class="sub-label" scope="row">Transcode live video in multiple resolutions</th>
+ <th i18n class="t-sub-label" scope="row">Transcode live video in multiple resolutions</th>
<td>
<my-feature-boolean [value]="serverConfig.live.transcoding.enabled && serverConfig.live.transcoding.enabledResolutions.length > 1"></my-feature-boolean>
</td>
</tr>
<tr *ngIf="serverConfig.live.enabled">
- <th i18n class="sub-label" scope="row">Max parallel lives</th>
+ <th i18n class="t-sub-label" scope="row">Max parallel lives</th>
<td i18n>
{{ maxUserLives }} per user / {{ maxInstanceLives }} per instance
</td>
</tr>
<tr>
- <th i18n class="label" colspan="2">Video Import</th>
+ <th i18n class="t-label" colspan="2">Video Import</th>
</tr>
<tr>
- <th i18n class="sub-label" scope="row">HTTP import (YouTube, Vimeo, direct URL...)</th>
+ <th i18n class="t-sub-label" scope="row">HTTP import (YouTube, Vimeo, direct URL...)</th>
<td>
<my-feature-boolean [value]="serverConfig.import.videos.http.enabled"></my-feature-boolean>
</td>
</tr>
<tr>
- <th i18n class="sub-label" scope="row">Torrent import</th>
+ <th i18n class="t-sub-label" scope="row">Torrent import</th>
<td>
<my-feature-boolean [value]="serverConfig.import.videos.torrent.enabled"></my-feature-boolean>
</td>
</tr>
<tr>
- <th i18n class="sub-label" scope="row">Channel synchronization with other platforms (YouTube, Vimeo, ...)</th>
+ <th i18n class="t-sub-label" scope="row">Channel synchronization with other platforms (YouTube, Vimeo, ...)</th>
<td>
<my-feature-boolean [value]="serverConfig.import.videoChannelSynchronization.enabled"></my-feature-boolean>
</td>
</tr>
<tr>
- <th i18n class="label" colspan="2">User Import/Export</th>
+ <th i18n class="t-label" colspan="2">User Import/Export</th>
</tr>
<tr>
- <th i18n class="sub-label" scope="row">Users can export their data</th>
+ <th i18n class="t-sub-label" scope="row">Users can export their data</th>
<td>
<my-feature-boolean [value]="serverConfig.export.users.enabled"></my-feature-boolean>
</td>
</tr>
<tr>
- <th i18n class="sub-label" scope="row">Users can import their data</th>
+ <th i18n class="t-sub-label" scope="row">Users can import their data</th>
<td>
<my-feature-boolean [value]="serverConfig.import.users.enabled"></my-feature-boolean>
</td>
</tr>
<tr>
- <th i18n class="label" colspan="2">Search</th>
+ <th i18n class="t-label" colspan="2">Search</th>
</tr>
<tr>
- <th i18n class="sub-label" scope="row">Users can resolve distant content</th>
+ <th i18n class="t-sub-label" scope="row">Users can resolve distant content</th>
<td>
<my-feature-boolean [value]="serverConfig.search.remoteUri.users"></my-feature-boolean>
</td>
</tr>
<tr>
- <th i18n class="label" colspan="2">Plugins & Themes</th>
+ <th i18n class="t-label" colspan="2">Plugins & Themes</th>
</tr>
<tr>
- <th i18n class="sub-label" scope="row">Available themes</th>
+ <th i18n class="t-sub-label" scope="row">Available themes</th>
<td>
<span class="theme" *ngFor="let theme of serverConfig.theme.registered">
{{ theme.name }}
@@ -162,7 +162,7 @@
</tr>
<tr>
- <th i18n class="sub-label" scope="row">Plugins enabled</th>
+ <th i18n class="t-sub-label" scope="row">Plugins enabled</th>
<td>
<span class="plugin" *ngFor="let plugin of serverConfig.plugin.registered">
{{ plugin.name }}
diff --git a/client/src/app/shared/shared-instance/instance-features-table.component.scss b/client/src/app/shared/shared-instance/instance-features-table.component.scss
index d1ef506cd4..02f8c8ff19 100644
--- a/client/src/app/shared/shared-instance/instance-features-table.component.scss
+++ b/client/src/app/shared/shared-instance/instance-features-table.component.scss
@@ -3,16 +3,16 @@
table {
font-size: 14px;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
width: 100%;
- .label,
- .sub-label {
- &.label {
+ .t-label,
+ .t-sub-label {
+ &.t-label {
font-weight: $font-semibold;
}
- &.sub-label {
+ &.t-sub-label {
font-weight: $font-regular;
@include padding-left(30px);
@@ -34,7 +34,7 @@ table {
caption {
caption-side: top;
font-weight: $font-semibold;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
}
.plugin,
diff --git a/client/src/app/shared/shared-instance/instance-follow.service.ts b/client/src/app/shared/shared-instance/instance-follow.service.ts
index 78b31277c8..0f6d24ee42 100644
--- a/client/src/app/shared/shared-instance/instance-follow.service.ts
+++ b/client/src/app/shared/shared-instance/instance-follow.service.ts
@@ -22,7 +22,7 @@ export class InstanceFollowService {
getFollowing (options: {
pagination: RestPagination
- sort: SortMeta
+ sort?: SortMeta
search?: string
actorType?: ActivityPubActorType
state?: FollowState
diff --git a/client/src/app/shared/shared-main/buttons/action-dropdown.component.html b/client/src/app/shared/shared-main/buttons/action-dropdown.component.html
index f4c58f6c60..bc7a05ad34 100644
--- a/client/src/app/shared/shared-main/buttons/action-dropdown.component.html
+++ b/client/src/app/shared/shared-main/buttons/action-dropdown.component.html
@@ -1,12 +1,16 @@
<div class="dropdown-root" ngbDropdown [placement]="placement" [container]="container" *ngIf="areActionsDisplayed(actions, entry)">
<button
- class="action-button" [ngClass]="{ small: buttonSize === 'small', grey: theme === 'grey', orange: theme === 'orange', 'button-styled': buttonStyled }"
+ class="action-button peertube-button"
+ [ngClass]="{ 'icon-only': !label, 'peertube-button-small': buttonSize === 'small', 'secondary-button': buttonStyled && theme === 'secondary', 'primary-button': buttonStyled && theme === 'primary' }"
ngbDropdownToggle aria-label="Open actions" i18n-aria-label
>
- <my-global-icon *ngIf="!label && buttonDirection === 'horizontal'" class="more-icon" iconName="more-horizontal"></my-global-icon>
- <my-global-icon *ngIf="!label && buttonDirection === 'vertical'" class="more-icon" iconName="more-vertical"></my-global-icon>
-
- <span *ngIf="label" class="dropdown-toggle">{{ label }}</span>
+ @if (label) {
+ <span class="dropdown-toggle">{{ label }}</span>
+ } @else if (buttonDirection === 'horizontal') {
+ <my-global-icon class="more-icon" iconName="more-horizontal"></my-global-icon>
+ } @else if (buttonDirection === 'vertical') {
+ <my-global-icon class="more-icon" iconName="more-vertical"></my-global-icon>
+ }
</button>
<div ngbDropdownMenu class="dropdown-menu">
@@ -33,27 +37,30 @@
</div>
</ng-template>
- <a
- *ngIf="action.linkBuilder && !action.isHeader" [ngClass]="{ 'with-icon': !!action.iconName }"
- class="dropdown-item" [routerLink]="action.linkBuilder(entry)" [queryParams]="getQueryParams(action, entry)" [title]="action.title || ''"
- >
- <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container>
- </a>
-
- <span
- *ngIf="!action.linkBuilder && !action.isHeader" [ngClass]="{ 'with-icon': !!action.iconName }"
- class="custom-action dropdown-item" tabindex="0" role="button" [title]="action.title || ''" (click)="action.handler(entry)" (keyup.enter)="action.handler(entry)"
- >
- <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container>
- </span>
-
- <h6
- *ngIf="!action.linkBuilder && action.isHeader && areActionsDisplayed(actions, entry)" [ngClass]="{ 'with-icon': !!action.iconName }"
- class="dropdown-header" [title]="action.title || ''"
- >
- <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container>
- </h6>
-
+ @if (action.linkBuilder) {
+ @if (!action.isHeader) {
+ <a
+ [ngClass]="{ 'with-icon': !!action.iconName }"
+ class="dropdown-item" [routerLink]="action.linkBuilder(entry)" [queryParams]="getQueryParams(action, entry)" [title]="action.title || ''"
+ >
+ <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container>
+ </a>
+ }
+ } @else {
+ @if (!action.isHeader) {
+ <span
+ [ngClass]="{ 'with-icon': !!action.iconName }"
+ class="custom-action dropdown-item" tabindex="0" role="button" [title]="action.title || ''"
+ (click)="action.handler(entry)" (keyup.enter)="action.handler(entry)"
+ >
+ <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container>
+ </span>
+ } @else if (areActionsDisplayed(actions, entry)) {
+ <h6 [ngClass]="{ 'with-icon': !!action.iconName }" class="dropdown-header" [title]="action.title || ''">
+ <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container>
+ </h6>
+ }
+ }
</div>
</ng-container>
diff --git a/client/src/app/shared/shared-main/buttons/action-dropdown.component.scss b/client/src/app/shared/shared-main/buttons/action-dropdown.component.scss
index aaed9360ab..a74d8009f7 100644
--- a/client/src/app/shared/shared-main/buttons/action-dropdown.component.scss
+++ b/client/src/app/shared/shared-main/buttons/action-dropdown.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_button-mixins' as *;
.dropdown-divider:last-child {
display: none;
@@ -8,40 +9,12 @@
.action-button {
display: inline-block;
- @include peertube-button;
-
- &.button-styled {
-
- &.grey {
- @include grey-button;
- }
-
- &.orange {
- @include orange-button;
- }
-
- &:hover,
- &:active,
- &:focus {
- background-color: $grey-background-color;
- }
- }
-
&::after {
display: none;
}
- .more-icon {
- width: 21px;
-
- ::ng-deep {
- @include apply-svg-color(pvar(--actionButtonColor));
- }
- }
-
- &.small {
- font-size: 14px;
- padding: 0 10px;
+ &.icon-only {
+ @include button-with-icon(21px, 0, 0);
}
}
diff --git a/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts b/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts
index 4206288d64..5eaf90b5ef 100644
--- a/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts
+++ b/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts
@@ -24,7 +24,7 @@ export type DropdownAction<T> = {
}
export type DropdownButtonSize = 'normal' | 'small'
-export type DropdownTheme = 'orange' | 'grey'
+export type DropdownTheme = 'primary' | 'secondary'
export type DropdownDirection = 'horizontal' | 'vertical'
@Component({
@@ -59,7 +59,7 @@ export class ActionDropdownComponent<T> {
@Input() buttonStyled = true
@Input() label: string
- @Input() theme: DropdownTheme = 'grey'
+ @Input() theme: DropdownTheme = 'secondary'
getActions (): DropdownAction<T>[][] {
if (this.actions.length !== 0 && Array.isArray(this.actions[0])) return this.actions as DropdownAction<T>[][]
diff --git a/client/src/app/shared/shared-main/buttons/button.component.html b/client/src/app/shared/shared-main/buttons/button.component.html
index b3f8375c8a..07c261eedb 100644
--- a/client/src/app/shared/shared-main/buttons/button.component.html
+++ b/client/src/app/shared/shared-main/buttons/button.component.html
@@ -1,16 +1,26 @@
-<button *ngIf="!ptRouterLink" type="button" class="action-button" [ngClass]="classes" [disabled]="disabled" [ngbTooltip]="title">
- <ng-container *ngTemplateOutlet="content"></ng-container>
-</button>
-
-<a *ngIf="ptRouterLink" class="action-button" [ngClass]="classes" [ngbTooltip]="title" [routerLink]="ptRouterLink">
- <ng-container *ngTemplateOutlet="content"></ng-container>
-</a>
+@if (ptRouterLink || ptQueryParams) {
+ <a
+ class="action-button"
+ [ngClass]="classes" [ngbTooltip]="title"
+ [routerLink]="ptRouterLink" [queryParams]="ptQueryParams" [queryParamsHandling]="ptQueryParamsHandling" [routerLinkActive]="ptRouterLinkActive"
+ >
+ <ng-container *ngTemplateOutlet="content"></ng-container>
+ </a>
+} @else {
+ <button type="button" class="action-button" [ngClass]="classes" [disabled]="disabled" [ngbTooltip]="title">
+ <ng-container *ngTemplateOutlet="content"></ng-container>
+ </button>
+}
<ng-template #content>
<my-loader size="sm" [ngClass]="{ displayed: loading }" [loading]="loading"></my-loader>
<my-global-icon *ngIf="icon && !loading" [iconName]="icon"></my-global-icon>
- <span *ngIf="label" class="button-label">{{ label }}</span>
-
- <ng-content></ng-content>
+ <span class="button-label ellipsis" #labelContent (cdkObserveContent)="ngOnChanges()">
+ @if (label) {
+ {{ label }}
+ } @else {
+ <ng-content></ng-content>
+ }
+ </span>
</ng-template>
diff --git a/client/src/app/shared/shared-main/buttons/button.component.scss b/client/src/app/shared/shared-main/buttons/button.component.scss
index 8ed7aa31d5..b91a5c3015 100644
--- a/client/src/app/shared/shared-main/buttons/button.component.scss
+++ b/client/src/app/shared/shared-main/buttons/button.component.scss
@@ -1,31 +1,11 @@
@use '_variables' as *;
@use '_mixins' as *;
-
-@mixin responsive-label {
- .action-button {
- padding: 0 13px;
- }
-
- .button-label {
- display: none;
- }
-
- my-global-icon {
- margin: 0 !important;
- }
-}
+@use '_button-mixins' as *;
:host {
display: inline-block;
}
-a[class$=-button],
-span[class$=-button] {
- > span {
- @include margin-left(5px);
- }
-}
-
.action-button {
width: 100%; // useful for ellipsis, allow to define a max-width on host component
@@ -37,17 +17,21 @@ span[class$=-button] {
@include margin-right(3px);
}
- &.has-icon {
- @include button-with-icon(21px);
+ &:not(.rounded-icon-button) {
+ &.has-icon {
+ @include button-with-icon(24px, 0);
+ }
}
+}
- &.icon-only my-global-icon {
- margin: 0 !important;
+@mixin responsive-label {
+ .action-button {
+ padding: pvar(--input-y-padding) 8px !important;
}
-}
-.button-label {
- @include ellipsis;
+ .button-label {
+ display: none;
+ }
}
// In a table, try to minimize the space taken by this button
diff --git a/client/src/app/shared/shared-main/buttons/button.component.ts b/client/src/app/shared/shared-main/buttons/button.component.ts
index 3a437e33fb..505d1efeb3 100644
--- a/client/src/app/shared/shared-main/buttons/button.component.ts
+++ b/client/src/app/shared/shared-main/buttons/button.component.ts
@@ -1,47 +1,94 @@
+import { ObserversModule } from '@angular/cdk/observers'
import { NgClass, NgIf, NgTemplateOutlet } from '@angular/common'
-import { ChangeDetectionStrategy, Component, Input, OnChanges, booleanAttribute } from '@angular/core'
-import { RouterLink } from '@angular/router'
+import {
+ AfterViewInit,
+ ChangeDetectionStrategy,
+ ChangeDetectorRef,
+ Component,
+ ElementRef,
+ Input,
+ OnChanges,
+ ViewChild,
+ booleanAttribute
+} from '@angular/core'
+import { Params, QueryParamsHandling, RouterLink, RouterLinkActive } from '@angular/router'
import { GlobalIconName } from '@app/shared/shared-icons/global-icon.component'
import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'
+import debug from 'debug'
import { GlobalIconComponent } from '../../shared-icons/global-icon.component'
import { LoaderComponent } from '../common/loader.component'
+const debugLogger = debug('peertube:button')
+
@Component({
selector: 'my-button',
styleUrls: [ './button.component.scss' ],
templateUrl: './button.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
- imports: [ NgIf, NgClass, NgbTooltip, NgTemplateOutlet, RouterLink, LoaderComponent, GlobalIconComponent ]
+ imports: [
+ NgIf,
+ NgClass,
+ NgbTooltip,
+ NgTemplateOutlet,
+ RouterLink,
+ LoaderComponent,
+ GlobalIconComponent,
+ ObserversModule,
+ RouterLinkActive
+ ]
})
-export class ButtonComponent implements OnChanges {
+export class ButtonComponent implements OnChanges, AfterViewInit {
@Input() label = ''
- @Input() theme: 'orange' | 'grey' = 'grey'
+ @Input() theme: 'primary' | 'secondary' | 'tertiary' = 'secondary'
@Input() icon: GlobalIconName
+
@Input() ptRouterLink: string[] | string
+ @Input() ptQueryParams: Params
+ @Input() ptQueryParamsHandling: QueryParamsHandling
+ @Input() ptRouterLinkActive = ''
+
@Input() title: string
+ @Input({ transform: booleanAttribute }) active = false
+
@Input({ transform: booleanAttribute }) loading = false
@Input({ transform: booleanAttribute }) disabled = false
@Input({ transform: booleanAttribute }) responsiveLabel = false
+ @Input({ transform: booleanAttribute }) rounded = false
+
+ @ViewChild('labelContent') labelContent: ElementRef
classes: { [id: string]: boolean } = {}
+ constructor (private cd: ChangeDetectorRef) {}
+
ngOnChanges () {
this.buildClasses()
}
+ ngAfterViewInit () {
+ this.buildClasses()
+ }
+
private buildClasses () {
- console.log('build classes')
+ const isButtonLink = !!this.ptRouterLink
this.classes = {
- 'peertube-button': !this.ptRouterLink,
- 'peertube-button-link': !!this.ptRouterLink,
- 'orange-button': this.theme === 'orange',
- 'grey-button': this.theme === 'grey',
- 'icon-only': !this.label,
+ 'active': this.active,
+ 'peertube-button': !isButtonLink,
+ 'peertube-button-link': isButtonLink,
+ 'primary-button': this.theme === 'primary',
+ 'secondary-button': this.theme === 'secondary',
+ 'tertiary-button': this.theme === 'tertiary',
'has-icon': !!this.icon,
+ 'rounded-icon-button': !!this.rounded,
+ 'icon-only': !this.label && !(this.labelContent?.nativeElement as HTMLElement)?.innerText,
'responsive-label': this.responsiveLabel
}
+
+ debugLogger('Built button classes', { classes: this.classes, labelContent: this.labelContent })
+
+ this.cd.markForCheck()
}
}
diff --git a/client/src/app/shared/shared-main/buttons/copy-button.component.html b/client/src/app/shared/shared-main/buttons/copy-button.component.html
index 149a36cc75..c33da3447c 100644
--- a/client/src/app/shared/shared-main/buttons/copy-button.component.html
+++ b/client/src/app/shared/shared-main/buttons/copy-button.component.html
@@ -1,5 +1,5 @@
<button
- class="btn btn-outline-secondary btn-sm copy-button"
+ class="btn btn-outline-secondary copy-button"
(click)="copy()"
[title]="title" [ngClass]="{ 'is-input-group': isInputGroup, 'with-border': withBorder }"
>
diff --git a/client/src/app/shared/shared-main/buttons/copy-button.component.scss b/client/src/app/shared/shared-main/buttons/copy-button.component.scss
index edfdedbd51..800bd14af0 100644
--- a/client/src/app/shared/shared-main/buttons/copy-button.component.scss
+++ b/client/src/app/shared/shared-main/buttons/copy-button.component.scss
@@ -12,4 +12,9 @@ button:not(.with-border, .is-input-group) {
my-global-icon {
width: 15px;
+ line-height: 15px;
+ height: 15px;
+ display: inline-block;
+
+ @include margin-right(5px);
}
diff --git a/client/src/app/shared/shared-main/buttons/copy-button.component.ts b/client/src/app/shared/shared-main/buttons/copy-button.component.ts
index 0dffa9fb50..edb7004fb6 100644
--- a/client/src/app/shared/shared-main/buttons/copy-button.component.ts
+++ b/client/src/app/shared/shared-main/buttons/copy-button.component.ts
@@ -30,6 +30,5 @@ export class CopyButtonComponent {
this.clipboard.copy(this.value || this.elementContent?.innerText)
if (this.notification) this.notifier.success(this.notification)
-
}
}
diff --git a/client/src/app/shared/shared-main/buttons/delete-button.component.ts b/client/src/app/shared/shared-main/buttons/delete-button.component.ts
index 773caf94f3..3b5b883d35 100644
--- a/client/src/app/shared/shared-main/buttons/delete-button.component.ts
+++ b/client/src/app/shared/shared-main/buttons/delete-button.component.ts
@@ -5,7 +5,7 @@ import { ButtonComponent } from './button.component'
selector: 'my-delete-button',
template: `
<my-button
- icon="delete" className="grey-button"
+ icon="delete" theme="secondary"
[disabled]="disabled" [label]="label" [title]="title"
[responsiveLabel]="responsiveLabel"
></my-button>
diff --git a/client/src/app/shared/shared-main/buttons/help.component.scss b/client/src/app/shared/shared-main/buttons/help.component.scss
index e9b9072d0c..6231531b43 100644
--- a/client/src/app/shared/shared-main/buttons/help.component.scss
+++ b/client/src/app/shared/shared-main/buttons/help.component.scss
@@ -4,14 +4,16 @@
.help-tooltip-button {
my-global-icon {
width: 17px;
+ height: 17px;
+ line-height: 17px;
+ display: inline-block;
position: relative;
top: -1px;
-
- @include apply-svg-color(pvar(--greyForegroundColor));
+ color: pvar(--fg-400);
}
}
-::ng-deep {
+:host ::ng-deep {
.help-popover {
min-width: 200px;
max-width: 300px;
diff --git a/client/src/app/shared/shared-main/channel/channels-setup-message.component.html b/client/src/app/shared/shared-main/channel/channels-setup-message.component.html
index c8d5ab88ab..178db914a3 100644
--- a/client/src/app/shared/shared-main/channel/channels-setup-message.component.html
+++ b/client/src/app/shared/shared-main/channel/channels-setup-message.component.html
@@ -3,5 +3,5 @@
<div i18n>Some of your channels are not fully set up. Make them welcoming and explicit about what you publish by adding a <strong>banner</strong>, an <strong>avatar</strong> and a <strong>description</strong>.</div>
- <a *ngIf="!hideLink" class="peertube-button-link grey-button mt-2" routerLink="/my-library/video-channels" i18n>Set up my channels</a>
+ <a *ngIf="!hideLink" class="peertube-button-link secondary-button mt-2" routerLink="/my-library/video-channels" i18n>Set up my channels</a>
</my-alert>
diff --git a/client/src/app/shared/shared-main/channel/channels-setup-message.component.scss b/client/src/app/shared/shared-main/channel/channels-setup-message.component.scss
index 7df835c16b..225f6f2c62 100644
--- a/client/src/app/shared/shared-main/channel/channels-setup-message.component.scss
+++ b/client/src/app/shared/shared-main/channel/channels-setup-message.component.scss
@@ -5,6 +5,4 @@ my-global-icon {
width: 32px;
display: inline-block;
margin-bottom: 0.75rem;
-
- @include apply-svg-color(pvar(--mainColor));
}
diff --git a/client/src/app/shared/shared-main/common/alert.component.html b/client/src/app/shared/shared-main/common/alert.component.html
index 576afd69f0..f277088a3b 100644
--- a/client/src/app/shared/shared-main/common/alert.component.html
+++ b/client/src/app/shared/shared-main/common/alert.component.html
@@ -1,3 +1,3 @@
-<div [ngClass]="builtClasses" role="alert">
+<div class="w-100" [ngClass]="builtClasses" role="alert">
<ng-content></ng-content>
</div>
diff --git a/client/src/app/shared/shared-main/common/infinite-scroller.directive.ts b/client/src/app/shared/shared-main/common/infinite-scroller.directive.ts
index 2ad446e928..e3189c4e9b 100644
--- a/client/src/app/shared/shared-main/common/infinite-scroller.directive.ts
+++ b/client/src/app/shared/shared-main/common/infinite-scroller.directive.ts
@@ -1,7 +1,7 @@
+import { AfterViewChecked, booleanAttribute, Directive, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'
+import { PeerTubeRouterService, RouterSetting } from '@app/core'
import { fromEvent, Observable, Subscription } from 'rxjs'
import { distinctUntilChanged, filter, map, share, startWith, throttleTime } from 'rxjs/operators'
-import { AfterViewChecked, Directive, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'
-import { PeerTubeRouterService, RouterSetting } from '@app/core'
@Directive({
selector: '[myInfiniteScroller]',
@@ -9,11 +9,11 @@ import { PeerTubeRouterService, RouterSetting } from '@app/core'
})
export class InfiniteScrollerDirective implements OnInit, OnDestroy, AfterViewChecked {
@Input() percentLimit = 70
- @Input() onItself = false
+ @Input({ transform: booleanAttribute }) onItself = false
@Input() dataObservable: Observable<any[]>
// Add angular state in query params to reuse the routed component
- @Input() setAngularState: boolean
+ @Input({ transform: booleanAttribute }) setAngularState: boolean
@Input() parentDisabled = false
@Output() nearOfBottom = new EventEmitter<void>()
diff --git a/client/src/app/shared/shared-main/common/link.component.html b/client/src/app/shared/shared-main/common/link.component.html
index f95aba9588..048429a7ea 100644
--- a/client/src/app/shared/shared-main/common/link.component.html
+++ b/client/src/app/shared/shared-main/common/link.component.html
@@ -1,4 +1,6 @@
<ng-template #content>
+ <my-global-icon *ngIf="icon" [iconName]="icon"></my-global-icon>
+
<ng-content></ng-content>
</ng-template>
diff --git a/client/src/app/shared/shared-main/common/link.component.ts b/client/src/app/shared/shared-main/common/link.component.ts
index 9649536953..0fe6d41c6a 100644
--- a/client/src/app/shared/shared-main/common/link.component.ts
+++ b/client/src/app/shared/shared-main/common/link.component.ts
@@ -1,13 +1,14 @@
+import { NgClass, NgIf, NgTemplateOutlet } from '@angular/common'
import { Component, Input, OnInit } from '@angular/core'
import { RouterLink } from '@angular/router'
-import { NgIf, NgClass, NgTemplateOutlet } from '@angular/common'
+import { GlobalIconComponent, GlobalIconName } from '@app/shared/shared-icons/global-icon.component'
@Component({
selector: 'my-link',
styleUrls: [ './link.component.scss' ],
templateUrl: './link.component.html',
standalone: true,
- imports: [ NgIf, RouterLink, NgClass, NgTemplateOutlet ]
+ imports: [ NgIf, RouterLink, NgClass, NgTemplateOutlet, GlobalIconComponent ]
})
export class LinkComponent implements OnInit {
@Input() internalLink?: string | any[]
@@ -24,6 +25,8 @@ export class LinkComponent implements OnInit {
@Input() ariaLabel: string
+ @Input() icon: GlobalIconName
+
builtClasses: string
ngOnInit () {
diff --git a/client/src/app/shared/shared-main/common/progress-bar.component.scss b/client/src/app/shared/shared-main/common/progress-bar.component.scss
index fbee4d56bb..5e772d9812 100644
--- a/client/src/app/shared/shared-main/common/progress-bar.component.scss
+++ b/client/src/app/shared/shared-main/common/progress-bar.component.scss
@@ -1,8 +1,9 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_button-mixins' as *;
.progress-container {
- background-color: pvar(--greyBackgroundColor);
+ background-color: pvar(--bg-secondary-500);
display: flex;
overflow: hidden;
height: 2rem;
@@ -13,7 +14,7 @@
span {
position: absolute;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-400);
line-height: 2rem;
margin: 0 12px;
}
@@ -28,8 +29,8 @@
.progress-bar {
font-weight: $font-semibold;
- color: pvar(--mainBackgroundColor);
- background-color: pvar(--mainColor);
+ color: pvar(--bg);
+ background-color: pvar(--primary);
display: flex;
flex-direction: column;
justify-content: center;
@@ -65,5 +66,5 @@
}
@include disable-outline;
- @include button-focus(pvar(--mainColorLightest));
+ @include button-focus(pvar(--primary-100));
}
diff --git a/client/src/app/shared/shared-main/feeds/feed.component.scss b/client/src/app/shared/shared-main/feeds/feed.component.scss
index fa7ed286de..d3c771ffd2 100644
--- a/client/src/app/shared/shared-main/feeds/feed.component.scss
+++ b/client/src/app/shared/shared-main/feeds/feed.component.scss
@@ -7,7 +7,7 @@
}
.feed-link {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
display: block;
min-width: 100px;
diff --git a/client/src/app/shared/shared-main/menu/horizontal-menu.component.html b/client/src/app/shared/shared-main/menu/horizontal-menu.component.html
new file mode 100644
index 0000000000..6df31a064a
--- /dev/null
+++ b/client/src/app/shared/shared-main/menu/horizontal-menu.component.html
@@ -0,0 +1,24 @@
+<div class="root">
+ <h1 *ngIf="h1">
+ <my-global-icon *ngIf="h1Icon" [iconName]="h1Icon"></my-global-icon>
+
+ {{ h1 }}
+ </h1>
+
+ <ng-template #entryTemplate let-item="item">
+ <a
+ myPluginSelector [pluginSelectorId]="item.pluginSelectorId"
+ [routerLink]="item.routerLink" [queryParams]="item.queryParams" routerLinkActive="active" class="entry"
+ [ngClass]="{ 'child-active': activeParent === item }">{{ item.label }}</a>
+ </ng-template>
+
+ <div class="parent-container">
+ <my-list-overflow [items]="menuEntries" [itemTemplate]="entryTemplate" hasBorder="true"></my-list-overflow>
+ </div>
+
+ @if (children && children.length !== 0) {
+ <div class="children-container">
+ <my-list-overflow [items]="children" [itemTemplate]="entryTemplate"></my-list-overflow>
+ </div>
+ }
+</div>
diff --git a/client/src/app/shared/shared-main/menu/horizontal-menu.component.scss b/client/src/app/shared/shared-main/menu/horizontal-menu.component.scss
new file mode 100644
index 0000000000..5b760675d8
--- /dev/null
+++ b/client/src/app/shared/shared-main/menu/horizontal-menu.component.scss
@@ -0,0 +1,103 @@
+@use '_variables' as *;
+@use '_mixins' as *;
+
+.root {
+ width: 100%;
+
+ margin-bottom: 2rem;
+}
+
+h1 {
+ margin-bottom: 1.5rem;
+ color: pvar(--fg-400);
+
+ @include font-size(2rem);
+
+ my-global-icon {
+ @include global-icon-size(28px);
+ @include margin-right(0.5rem);
+ }
+}
+
+.parent-container {
+ .entry {
+ color: pvar(--fg-100);
+ display: inline-block;
+ font-weight: $font-bold;
+ white-space: nowrap;
+
+ @include font-size(22px);
+ @include disable-default-a-behaviour;
+ @include margin-right(2rem);
+
+ &.active,
+ &.child-active {
+ color: pvar(--fg);
+ position: relative;
+
+ &::after {
+ content: '';
+ display: block;
+ height: 4px;
+ background-color: pvar(--border-primary);
+ border-radius: 2px;
+ position: absolute;
+ bottom: -3px;
+ width: 100%;
+ }
+ }
+
+ &:hover,
+ &:active,
+ &:focus {
+ color: pvar(--fg);
+ }
+ }
+}
+
+.children-container {
+ margin-top: 1.25rem;
+
+ @include rfs(margin-bottom, 2.5rem);
+
+ ::ng-deep li {
+ white-space: nowrap;
+
+ &:not(:first-child)::before {
+ content: '•';
+
+ color: pvar(--secondary-icon-color);
+
+ display: inline-block;
+ margin: 0 0.5rem;
+
+ position: relative;
+ top: -1px;
+ }
+ }
+
+ .entry {
+ color: pvar(--fg-250);
+ display: inline-block;
+ white-space: nowrap;
+ padding: 12px 16px;
+ border-radius: 200px;
+ line-height: 1;
+
+ @include font-size(18px);
+
+ &.active {
+ color: pvar(--fg-350);
+ font-weight: $font-bold;
+ background-color: pvar(--bg-secondary-400);
+ position: relative;
+ text-decoration: none;
+ }
+
+ &:hover,
+ &:active,
+ &:focus {
+ color: pvar(--fg);
+ }
+ }
+}
diff --git a/client/src/app/shared/shared-main/menu/horizontal-menu.component.ts b/client/src/app/shared/shared-main/menu/horizontal-menu.component.ts
new file mode 100644
index 0000000000..fb4a7cc448
--- /dev/null
+++ b/client/src/app/shared/shared-main/menu/horizontal-menu.component.ts
@@ -0,0 +1,103 @@
+import { CommonModule } from '@angular/common'
+import { Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core'
+import { ActivatedRoute, NavigationEnd, Router, RouterModule } from '@angular/router'
+import { GlobalIconComponent, GlobalIconName } from '@app/shared/shared-icons/global-icon.component'
+import { logger } from '@root-helpers/logger'
+import { filter, Subscription } from 'rxjs'
+import { PluginSelectorDirective } from '../plugins/plugin-selector.directive'
+import { ListOverflowComponent } from './list-overflow.component'
+
+export type HorizontalMenuEntry = {
+ label: string
+ iconName?: GlobalIconName
+
+ routerLink: string
+ queryParams?: Record<string, any>
+
+ isDisplayed?: () => boolean // Default: () => true
+ pluginSelectorId?: string // Default: () => true
+
+ children?: {
+ label: string
+
+ routerLink: string
+ queryParams?: Record<string, any>
+
+ isDisplayed?: () => boolean // Default: () => true
+ }[]
+}
+
+@Component({
+ selector: 'my-horizontal-menu',
+ templateUrl: './horizontal-menu.component.html',
+ styleUrls: [ './horizontal-menu.component.scss' ],
+ standalone: true,
+ imports: [
+ CommonModule,
+ RouterModule,
+ ListOverflowComponent,
+ GlobalIconComponent,
+ PluginSelectorDirective
+ ]
+})
+export class HorizontalMenuComponent implements OnInit, OnChanges, OnDestroy {
+ @Input() menuEntries: HorizontalMenuEntry[] = []
+
+ @Input() h1: string
+ @Input() h1Icon: GlobalIconName
+
+ activeParent: HorizontalMenuEntry
+ children: HorizontalMenuEntry[] = []
+
+ private routerSub: Subscription
+
+ constructor (private router: Router, private route: ActivatedRoute) {
+
+ }
+
+ ngOnInit () {
+ this.routerSub = this.router.events.pipe(
+ filter((event: any) => event instanceof NavigationEnd)
+ ).subscribe(() => this.buildChildren())
+ }
+
+ ngOnChanges () {
+ this.buildChildren()
+ }
+
+ ngOnDestroy () {
+ if (this.routerSub) this.routerSub.unsubscribe()
+ }
+
+ private buildChildren () {
+ this.children = []
+ this.activeParent = undefined
+
+ const currentUrl = window.location.pathname
+ const currentComponentPath = this.route.snapshot.pathFromRoot.reduce((a, c) => {
+ if (c.url.length === 0) return a
+
+ return a + '/' + c.url[0].path
+ }, '')
+
+ const entry = this.menuEntries.find(parent => {
+ if (currentUrl.startsWith(parent.routerLink)) return true
+ if (!parent.routerLink.startsWith('/') && `${currentComponentPath}/${parent.routerLink}` === currentUrl) return true
+
+ if (parent.children) return parent.children.some(child => currentUrl.startsWith(child.routerLink))
+
+ return false
+ })
+
+ if (!entry) {
+ if (this.menuEntries.length !== 0) {
+ logger.info(`Unable to find entry for ${currentUrl} or ${currentComponentPath}`, { menuEntries: this.menuEntries })
+ }
+
+ return
+ }
+
+ this.children = entry.children
+ this.activeParent = entry
+ }
+}
diff --git a/client/src/app/shared/shared-main/menu/list-overflow.component.html b/client/src/app/shared/shared-main/menu/list-overflow.component.html
index 6f29eaefaa..550ef3f03c 100644
--- a/client/src/app/shared/shared-main/menu/list-overflow.component.html
+++ b/client/src/app/shared/shared-main/menu/list-overflow.component.html
@@ -1,39 +1,56 @@
-<div #itemsParent class="list-overflow-parent">
- <span [id]="getId(id)" #itemsRendered *ngFor="let item of items; index as id">
- <ng-container *ngTemplateOutlet="itemTemplate; context: {item: item}"></ng-container>
- </span>
+<div class="root">
+ <div #itemsParent class="list-overflow-parent" [ngClass]="{ 'opacity-0': !initialized, 'has-border': hasBorder }">
- <ng-container *ngIf="isMenuDisplayed()">
- <button *ngIf="isInMobileView" class="btn btn-outline-secondary btn-sm list-overflow-menu" (click)="toggleModal()">
- <span class="chevron-down"></span>
- </button>
+ <ul class="ul-unstyle d-flex">
+ @for (item of items; track item.label; let id = $index) {
+ @if (!item.isDisplayed || item.isDisplayed()) {
+ <li class="d-inline-block" [id]="getId(id)" #itemsRendered [style]="{ visibility: showItemsUntilIndexExcluded && id >= showItemsUntilIndexExcluded ? 'hidden' : 'inherit' }">
+ <ng-container *ngTemplateOutlet="itemTemplate; context: {item: item}"></ng-container>
+ </li>
+ }
+ }
+ </ul>
- <div
- *ngIf="!isInMobileView" class="list-overflow-menu"
- ngbDropdown container="body" #dropdown="ngbDropdown"
- (mouseleave)="closeDropdownIfHovered(dropdown)" (mouseenter)="openDropdownOnHover(dropdown)"
- >
- <button class="btn btn-outline-secondary btn-sm" [ngClass]="{ 'route-active': active }"
- ngbDropdownAnchor (click)="dropdownAnchorClicked(dropdown)" role="button"
- >
- <span class="chevron-down"></span>
- </button>
+ @if (isMenuDisplayed()) {
+ @if (isInMobileView) {
+ <button type="button" class="peertube-button tertiary-button p-0 list-overflow-menu" (click)="toggleModal()">
+ <span class="chevron-down"></span>
+ </button>
+ } @else {
+ <div class="list-overflow-menu" ngbDropdown container="body" #dropdown="ngbDropdown">
+ <button class="peertube-button tertiary-button p-0" ngbDropdownToggle type="button">
+ <span class="chevron-down"></span>
+ </button>
- <div ngbDropdownMenu>
- <a *ngFor="let item of items | slice:showItemsUntilIndexExcluded:items.length"
- [routerLink]="item.routerLink" routerLinkActive="active" class="dropdown-item">
- {{ item.label }}
- </a>
- </div>
- </div>
- </ng-container>
-</div >
+ <ul class="ul-unstyle" ngbDropdownMenu>
+ @for (item of items | slice:showItemsUntilIndexExcluded:items.length; track item.label) {
+ @if (!item.isDisplayed || item.isDisplayed()) {
+ <li>
+ <a [routerLink]="item.routerLink" routerLinkActive="active" class="dropdown-item">
+ {{ item.label }}
+ </a>
+ </li>
+ }
+ }
+ </ul>
+ </div>
+ }
+ }
+ </div >
-<ng-template #modal let-close="close" let-dismiss="dismiss">
- <div class="modal-body">
- <a *ngFor="let item of items | slice:showItemsUntilIndexExcluded:items.length"
- [routerLink]="item.routerLink" routerLinkActive="active" (click)="dismissOtherModals()">
- {{ item.label }}
- </a>
- </div>
-</ng-template>
+ <ng-template #modal let-close="close" let-dismiss="dismiss">
+ <div class="modal-body">
+ <ul class="ul-unstyle">
+ @for (item of items | slice:showItemsUntilIndexExcluded:items.length; track item.label) {
+ @if (!item.isDisplayed || item.isDisplayed()) {
+ <li>
+ <a [routerLink]="item.routerLink" routerLinkActive="active" (click)="dismissOtherModals()">
+ {{ item.label }}
+ </a>
+ </li>
+ }
+ }
+ </ul>
+ </div>
+ </ng-template>
+</div>
diff --git a/client/src/app/shared/shared-main/menu/list-overflow.component.scss b/client/src/app/shared/shared-main/menu/list-overflow.component.scss
index 5b54e324fe..d60f904c46 100644
--- a/client/src/app/shared/shared-main/menu/list-overflow.component.scss
+++ b/client/src/app/shared/shared-main/menu/list-overflow.component.scss
@@ -5,22 +5,35 @@
width: 100%;
}
-.list-overflow-parent {
+li {
+ // Fix child outline on focus-visible
+ padding-top: 2px;
+}
+
+.root {
overflow: hidden;
+ max-width: calc(100vw - 30px);
+ padding-bottom: 3px;
+}
+
+.list-overflow-parent {
display: flex;
+ align-items: center;
+
// For the menu icon
- max-width: calc(100vw - 30px);
+ position: relative;
+
+ &.has-border {
+ border-bottom: 1px solid pvar(--fg-200);
+ }
}
.list-overflow-menu {
position: absolute;
- right: 25px;
+ right: 0;
}
button {
- width: 30px;
- border: 0;
-
&::after {
display: none;
}
@@ -28,7 +41,7 @@ button {
&.route-active {
&::after {
display: inherit;
- border: 2px solid pvar(--mainColor);
+ border: 2px solid pvar(--primary);
position: relative;
right: 95%;
top: 50%;
@@ -36,13 +49,6 @@ button {
}
}
-::ng-deep .dropdown-menu {
- margin-top: 0 !important;
- position: static;
- right: auto;
- bottom: auto;
-}
-
.modal-body {
a {
color: currentColor;
@@ -57,8 +63,8 @@ button {
@include disable-default-a-behaviour;
&.active {
- color: pvar(--mainBackgroundColor) !important;
- background-color: pvar(--mainHoverColor);
+ color: pvar(--on-primary) !important;
+ background-color: pvar(--primary-450);
opacity: .9;
}
}
diff --git a/client/src/app/shared/shared-main/menu/list-overflow.component.ts b/client/src/app/shared/shared-main/menu/list-overflow.component.ts
index 0d75189aa3..cedb976746 100644
--- a/client/src/app/shared/shared-main/menu/list-overflow.component.ts
+++ b/client/src/app/shared/shared-main/menu/list-overflow.component.ts
@@ -1,29 +1,32 @@
-import { lowerFirst, uniqueId } from 'lodash-es'
-import { take } from 'rxjs/operators'
+import { NgClass, NgTemplateOutlet, SlicePipe } from '@angular/common'
import {
AfterViewInit,
+ booleanAttribute,
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ElementRef,
HostListener,
Input,
+ OnInit,
QueryList,
TemplateRef,
ViewChild,
ViewChildren
} from '@angular/core'
+import { RouterLink, RouterLinkActive } from '@angular/router'
import { ScreenService } from '@app/core'
-import { NgbDropdown, NgbModal, NgbDropdownAnchor, NgbDropdownMenu } from '@ng-bootstrap/ng-bootstrap'
+import { NgbDropdown, NgbDropdownMenu, NgbDropdownToggle, NgbModal } from '@ng-bootstrap/ng-bootstrap'
+import { randomInt } from '@peertube/peertube-core-utils'
import debug from 'debug'
-import { RouterLinkActive, RouterLink } from '@angular/router'
-import { NgFor, NgTemplateOutlet, NgIf, NgClass, SlicePipe } from '@angular/common'
+import { lowerFirst, uniqueId } from 'lodash-es'
const debugLogger = debug('peertube:main:ListOverflowItem')
export interface ListOverflowItem {
label: string
routerLink: string | any[]
+ isDisplayed?: () => boolean
}
@Component({
@@ -33,11 +36,9 @@ export interface ListOverflowItem {
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
- NgFor,
NgTemplateOutlet,
- NgIf,
NgbDropdown,
- NgbDropdownAnchor,
+ NgbDropdownToggle,
NgClass,
NgbDropdownMenu,
RouterLinkActive,
@@ -45,19 +46,20 @@ export interface ListOverflowItem {
SlicePipe
]
})
-export class ListOverflowComponent<T extends ListOverflowItem> implements AfterViewInit {
+export class ListOverflowComponent<T extends ListOverflowItem> implements OnInit, AfterViewInit {
@Input() items: T[]
@Input() itemTemplate: TemplateRef<{ item: T }>
+ @Input({ transform: booleanAttribute }) hasBorder = false
@ViewChild('modal', { static: true }) modal: ElementRef
@ViewChild('itemsParent', { static: true }) parent: ElementRef<HTMLDivElement>
@ViewChildren('itemsRendered') itemsRendered: QueryList<ElementRef>
showItemsUntilIndexExcluded: number
- active = false
isInMobileView = false
+ initialized = false
- private openedOnHover = false
+ private randomInt: number
constructor (
private cdr: ChangeDetectorRef,
@@ -65,8 +67,15 @@ export class ListOverflowComponent<T extends ListOverflowItem> implements AfterV
private screenService: ScreenService
) {}
+ ngOnInit () {
+ this.randomInt = randomInt(1, 2000)
+ }
+
ngAfterViewInit () {
- setTimeout(() => this.onWindowResize(), 0)
+ setTimeout(() => {
+ this.onWindowResize()
+ this.initialized = true
+ }, 0)
}
isMenuDisplayed () {
@@ -85,13 +94,10 @@ export class ListOverflowComponent<T extends ListOverflowItem> implements AfterV
for (const [ index, el ] of this.itemsRendered.toArray().entries()) {
accWidth += el.nativeElement.getBoundingClientRect().width
+
if (showItemsUntilIndexExcluded === undefined) {
showItemsUntilIndexExcluded = (parentWidth < accWidth) ? index : undefined
}
-
- const e = document.getElementById(this.getId(index))
- const shouldBeVisible = showItemsUntilIndexExcluded ? index < showItemsUntilIndexExcluded : true
- e.style.visibility = shouldBeVisible ? 'inherit' : 'hidden'
}
debugLogger('Accumulated children width is %d so exclude index is %d', accWidth, showItemsUntilIndexExcluded)
@@ -100,32 +106,6 @@ export class ListOverflowComponent<T extends ListOverflowItem> implements AfterV
this.cdr.markForCheck()
}
- openDropdownOnHover (dropdown: NgbDropdown) {
- this.openedOnHover = true
- dropdown.open()
-
- // Menu was closed
- dropdown.openChange
- .pipe(take(1))
- .subscribe(() => this.openedOnHover = false)
- }
-
- dropdownAnchorClicked (dropdown: NgbDropdown) {
- if (this.openedOnHover) {
- this.openedOnHover = false
- return
- }
-
- return dropdown.toggle()
- }
-
- closeDropdownIfHovered (dropdown: NgbDropdown) {
- if (this.openedOnHover === false) return
-
- dropdown.close()
- this.openedOnHover = false
- }
-
toggleModal () {
this.modalService.open(this.modal, { centered: true })
}
@@ -135,6 +115,6 @@ export class ListOverflowComponent<T extends ListOverflowItem> implements AfterV
}
getId (id: number | string = uniqueId()): string {
- return lowerFirst(this.constructor.name) + '_' + id
+ return lowerFirst(this.constructor.name) + '_' + this.randomInt + '_' + id
}
}
diff --git a/client/src/app/shared/shared-main/menu/top-menu-dropdown.component.html b/client/src/app/shared/shared-main/menu/top-menu-dropdown.component.html
deleted file mode 100644
index 02fc155bfb..0000000000
--- a/client/src/app/shared/shared-main/menu/top-menu-dropdown.component.html
+++ /dev/null
@@ -1,63 +0,0 @@
-<ul class="sub-menu" [ngClass]="{ 'sub-menu-fixed': !isBroadcastMessageDisplayed, 'no-scroll': isModalOpened }">
- <ng-container *ngFor="let menuEntry of menuEntries; index as id">
- @if (isDisplayed(menuEntry)) {
- @if (menuEntry.routerLink) {
- <li>
- <a
- class="sub-menu-entry" [routerLink]="menuEntry.routerLink" routerLinkActive="active"
- #routerLink (click)="onActiveLinkScrollToTop(routerLink)" ariaCurrentWhenActive="page"
- >{{ menuEntry.label }}</a>
- </li>
- } @else if (isInSmallView) { <!-- On mobile, use a modal to display sub menu items -->
- <li>
- <button class="sub-menu-entry" [ngClass]="{ active: !!suffixLabels[menuEntry.label] }" (click)="openModal(id)">
- {{ menuEntry.label }}
-
- <span class="chevron-down"></span>
- </button>
- </li>
- } @else {
- <!-- On desktop, use a classic dropdown -->
- <li ngbDropdown #dropdown="ngbDropdown" autoClose="true" container="body">
- <button ngbDropdownToggle class="sub-menu-entry" [ngClass]="{ active: !!suffixLabels[menuEntry.label] }">{{ menuEntry.label }}</button>
-
- <ul ngbDropdownMenu>
- <li *ngFor="let menuChild of menuEntry.children">
- <a
- *ngIf="isDisplayed(menuChild)" ngbDropdownItem
- routerLinkActive="active" ariaCurrentWhenActive="page"
- [routerLink]="menuChild.routerLink" #routerLink (click)="onActiveLinkScrollToTop(routerLink)"
- [queryParams]="menuChild.queryParams"
- >
- <my-global-icon *ngIf="menuChild.iconName" [iconName]="menuChild.iconName" aria-hidden="true"></my-global-icon>
-
- {{ menuChild.label }}
- </a>
- </li>
- </ul>
- </li>
- }
- }
- </ng-container>
-</ul>
-
-<ng-template #modal let-close="close" let-dismiss="dismiss">
- <div class="modal-body">
- <ng-container *ngFor="let menuEntry of menuEntries; index as id">
-
- <div [ngClass]="{ hidden: id !== currentMenuEntryIndex }">
- <ng-container *ngFor="let menuChild of menuEntry.children">
- <a
- *ngIf="isDisplayed(menuChild)" [ngClass]="{ icon: hasIcons }" [routerLink]="menuChild.routerLink" routerLinkActive="active"
- #routerLink (click)="dismissOtherModals(); onActiveLinkScrollToTop(routerLink)" ariaCurrentWhenActive="page"
- >
- <my-global-icon *ngIf="menuChild.iconName" [iconName]="menuChild.iconName" aria-hidden="true"></my-global-icon>
-
- {{ menuChild.label }}
- </a>
- </ng-container>
- </div>
-
- </ng-container>
- </div>
-</ng-template>
diff --git a/client/src/app/shared/shared-main/menu/top-menu-dropdown.component.scss b/client/src/app/shared/shared-main/menu/top-menu-dropdown.component.scss
deleted file mode 100644
index 26062b7935..0000000000
--- a/client/src/app/shared/shared-main/menu/top-menu-dropdown.component.scss
+++ /dev/null
@@ -1,56 +0,0 @@
-@use '_variables' as *;
-@use '_mixins' as *;
-
-ul {
- list-style: none;
- margin: 0;
- padding: 0;
-}
-
-.sub-menu ::ng-deep .dropdown-toggle::after {
- position: relative;
- top: 2px;
-}
-
-.sub-menu ::ng-deep .dropdown-menu {
- margin-top: 0 !important;
-}
-
-.dropdown-menu .dropdown-item {
- top: -1px;
-
- @include dropdown-with-icon-item;
-}
-
-.sub-menu.no-scroll {
- overflow-x: hidden;
-}
-
-.modal-body {
- .hidden {
- display: none;
- }
-
- my-global-icon {
- @include margin-right(10px);
- }
-
- a {
- color: currentColor;
- box-sizing: border-box;
- display: block;
- font-size: 1.2rem;
- padding: 9px 12px;
- text-align: initial;
- text-transform: unset;
- width: 100%;
-
- @include disable-default-a-behaviour;
-
- &.active {
- color: pvar(--mainBackgroundColor) !important;
- background-color: pvar(--mainHoverColor);
- opacity: .9;
- }
- }
-}
diff --git a/client/src/app/shared/shared-main/menu/top-menu-dropdown.component.ts b/client/src/app/shared/shared-main/menu/top-menu-dropdown.component.ts
deleted file mode 100644
index 6370daa7c2..0000000000
--- a/client/src/app/shared/shared-main/menu/top-menu-dropdown.component.ts
+++ /dev/null
@@ -1,144 +0,0 @@
-import { Subscription } from 'rxjs'
-import { filter } from 'rxjs/operators'
-import { Component, Input, OnChanges, OnDestroy, OnInit, ViewChild } from '@angular/core'
-import { NavigationEnd, Router, RouterLinkActive, RouterLink } from '@angular/router'
-import { MenuService, ScreenService } from '@app/core'
-import { scrollToTop } from '@app/helpers'
-import { GlobalIconName } from '@app/shared/shared-icons/global-icon.component'
-import { NgbDropdown, NgbModal, NgbDropdownToggle, NgbDropdownMenu, NgbDropdownItem } from '@ng-bootstrap/ng-bootstrap'
-import { GlobalIconComponent } from '../../shared-icons/global-icon.component'
-import { NgClass, NgFor, NgIf } from '@angular/common'
-
-export type TopMenuDropdownParam = {
- label: string
- routerLink?: string
- isDisplayed?: () => boolean // Default: () => true
-
- children?: {
- label: string
- routerLink: string
- queryParams?: { [id: string]: string }
- iconName: GlobalIconName
-
- isDisplayed?: () => boolean // Default: () => true
- }[]
-}
-
-@Component({
- selector: 'my-top-menu-dropdown',
- templateUrl: './top-menu-dropdown.component.html',
- styleUrls: [ './top-menu-dropdown.component.scss' ],
- standalone: true,
- imports: [
- NgClass,
- NgFor,
- NgIf,
- RouterLinkActive,
- RouterLink,
- NgbDropdown,
- NgbDropdownToggle,
- NgbDropdownMenu,
- NgbDropdownItem,
- GlobalIconComponent
- ]
-})
-export class TopMenuDropdownComponent implements OnInit, OnChanges, OnDestroy {
- @Input() menuEntries: TopMenuDropdownParam[] = []
-
- @ViewChild('modal', { static: true }) modal: NgbModal
-
- suffixLabels: { [ parentLabel: string ]: string }
- hasIcons = false
- isModalOpened = false
- currentMenuEntryIndex: number
-
- private routeSub: Subscription
-
- constructor (
- private router: Router,
- private modalService: NgbModal,
- private screen: ScreenService,
- private menuService: MenuService
- ) { }
-
- get isInSmallView () {
- let marginLeft = 0
- if (this.menuService.isMenuDisplayed) {
- marginLeft = this.menuService.menuWidth
- }
-
- return this.screen.isInSmallView(marginLeft)
- }
-
- get isBroadcastMessageDisplayed () {
- return this.screen.isBroadcastMessageDisplayed
- }
-
- ngOnInit () {
- this.updateChildLabels(window.location.pathname)
-
- this.routeSub = this.router.events
- .pipe(filter(event => event instanceof NavigationEnd))
- .subscribe(() => this.updateChildLabels(window.location.pathname))
- }
-
- ngOnChanges () {
- this.updateChildLabels(window.location.pathname)
- }
-
- ngOnDestroy () {
- if (this.routeSub) this.routeSub.unsubscribe()
- }
-
- dropdownAnchorClicked (dropdown: NgbDropdown) {
- return dropdown.toggle()
- }
-
- openModal (index: number) {
- this.currentMenuEntryIndex = index
- this.isModalOpened = true
-
- this.modalService.open(this.modal, {
- centered: true,
- beforeDismiss: () => {
- this.onModalDismiss()
-
- return true
- }
- })
- }
-
- onModalDismiss () {
- this.isModalOpened = false
- }
-
- onActiveLinkScrollToTop (link: HTMLAnchorElement) {
- if (!this.isBroadcastMessageDisplayed && this.router.url.includes(link.getAttribute('href'))) {
- scrollToTop('smooth')
- }
- }
-
- dismissOtherModals () {
- this.modalService.dismissAll()
- }
-
- isDisplayed (obj: { isDisplayed?: () => boolean }) {
- if (typeof obj.isDisplayed !== 'function') return true
-
- return obj.isDisplayed()
- }
-
- private updateChildLabels (path: string) {
- this.suffixLabels = {}
-
- for (const entry of this.menuEntries) {
- if (!entry.children) continue
-
- for (const child of entry.children) {
- if (path.startsWith(child.routerLink)) {
- this.suffixLabels[entry.label] = child.label
- }
- }
- }
- }
-}
diff --git a/client/src/app/shared/shared-main/plugins/plugin-selector.directive.ts b/client/src/app/shared/shared-main/plugins/plugin-selector.directive.ts
index 52dfa89882..cb6e1552a8 100644
--- a/client/src/app/shared/shared-main/plugins/plugin-selector.directive.ts
+++ b/client/src/app/shared/shared-main/plugins/plugin-selector.directive.ts
@@ -16,6 +16,8 @@ export class PluginSelectorDirective implements OnInit {
}
ngOnInit () {
+ if (!this.pluginSelectorId) return
+
const id = this.hostElement.nativeElement.getAttribute('id')
if (id) throw new Error('Cannot set id on element that already has an id')
diff --git a/client/src/app/shared/shared-main/search/simple-search-input.component.scss b/client/src/app/shared/shared-main/search/simple-search-input.component.scss
index e3e7671539..5180ad18a8 100644
--- a/client/src/app/shared/shared-main/search/simple-search-input.component.scss
+++ b/client/src/app/shared/shared-main/search/simple-search-input.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
.root {
display: flex;
@@ -12,10 +13,10 @@
my-global-icon {
height: 28px;
width: 28px;
- color: pvar(--mainColor);
+ color: pvar(--fg-400);
&:hover {
- color: pvar(--mainHoverColor);
+ color: pvar(--fg-300);
}
}
}
@@ -31,4 +32,6 @@ input {
.form-control-clear my-global-icon {
width: 20px;
height: 20px;
+ line-height: 20px;
+ display: inline-block;
}
diff --git a/client/src/app/shared/shared-main/users/login-link.component.html b/client/src/app/shared/shared-main/users/login-link.component.html
index f90ffba686..77a4dea31d 100644
--- a/client/src/app/shared/shared-main/users/login-link.component.html
+++ b/client/src/app/shared/shared-main/users/login-link.component.html
@@ -1 +1,3 @@
-<my-link i18n internalLink="/login" [href]="getExternalLoginHref()" [className]="className">{{ label }}</my-link>
+<my-link class="d-flex" internalLink="/login" [href]="getExternalLoginHref()" [className]="className" [icon]="icon ? 'sign-in' : undefined">
+ {{ label }}
+</my-link>
diff --git a/client/src/app/shared/shared-main/users/login-link.component.scss b/client/src/app/shared/shared-main/users/login-link.component.scss
new file mode 100644
index 0000000000..21ff7520c6
--- /dev/null
+++ b/client/src/app/shared/shared-main/users/login-link.component.scss
@@ -0,0 +1,6 @@
+@use '_variables' as *;
+@use '_mixins' as *;
+
+my-global-icon {
+ @include global-icon-size(24px);
+}
diff --git a/client/src/app/shared/shared-main/users/login-link.component.ts b/client/src/app/shared/shared-main/users/login-link.component.ts
index af91f154f0..ea783b4f95 100644
--- a/client/src/app/shared/shared-main/users/login-link.component.ts
+++ b/client/src/app/shared/shared-main/users/login-link.component.ts
@@ -1,4 +1,4 @@
-import { Component, Input } from '@angular/core'
+import { booleanAttribute, Component, Input } from '@angular/core'
import { ServerService } from '@app/core'
import { PluginsManager } from '@root-helpers/plugins-manager'
import { environment } from 'src/environments/environment'
@@ -7,11 +7,13 @@ import { LinkComponent } from '../common/link.component'
@Component({
selector: 'my-login-link',
templateUrl: './login-link.component.html',
+ styleUrls: [ './login-link.component.scss' ],
standalone: true,
imports: [ LinkComponent ]
})
export class LoginLinkComponent {
@Input() label = $localize`Login`
+ @Input({ transform: booleanAttribute }) icon = false
@Input() className?: string
diff --git a/client/src/app/shared/shared-main/users/signup-label.component.html b/client/src/app/shared/shared-main/users/signup-label.component.html
index 35d6c53606..3311dd6023 100644
--- a/client/src/app/shared/shared-main/users/signup-label.component.html
+++ b/client/src/app/shared/shared-main/users/signup-label.component.html
@@ -1,2 +1,13 @@
-<ng-container i18n *ngIf="requiresApproval">Request an account</ng-container>
-<ng-container i18n *ngIf="!requiresApproval">Create an account</ng-container>
+@if (withInstanceName) {
+ @if (requiresApproval) {
+ <ng-container i18n>Request an account on {{ instanceName }}</ng-container>
+ } @else {
+ <ng-container i18n>Create an account on {{ instanceName }}</ng-container>
+ }
+} @else {
+ @if (requiresApproval) {
+ <ng-container i18n>Request an account</ng-container>
+ } @else {
+ <ng-container i18n>Create an account</ng-container>
+ }
+}
diff --git a/client/src/app/shared/shared-main/users/signup-label.component.ts b/client/src/app/shared/shared-main/users/signup-label.component.ts
index c194c78dd6..4210f3ac53 100644
--- a/client/src/app/shared/shared-main/users/signup-label.component.ts
+++ b/client/src/app/shared/shared-main/users/signup-label.component.ts
@@ -1,5 +1,6 @@
-import { Component, Input } from '@angular/core'
+import { booleanAttribute, Component, Input } from '@angular/core'
import { NgIf } from '@angular/common'
+import { ServerService } from '@app/core'
@Component({
selector: 'my-signup-label',
@@ -8,5 +9,13 @@ import { NgIf } from '@angular/common'
imports: [ NgIf ]
})
export class SignupLabelComponent {
- @Input() requiresApproval: boolean
+ @Input({ transform: booleanAttribute }) requiresApproval: boolean
+ @Input({ transform: booleanAttribute }) withInstanceName = false
+
+ constructor (private server: ServerService) {
+ }
+
+ get instanceName () {
+ return this.server.getHTMLConfig().instance.name
+ }
}
diff --git a/client/src/app/shared/shared-main/users/user-notification.model.ts b/client/src/app/shared/shared-main/users/user-notification.model.ts
index 9989a68edb..bd459b2c32 100644
--- a/client/src/app/shared/shared-main/users/user-notification.model.ts
+++ b/client/src/app/shared/shared-main/users/user-notification.model.ts
@@ -243,11 +243,11 @@ export class UserNotification implements UserNotificationServer {
break
case UserNotificationType.NEW_INSTANCE_FOLLOWER:
- this.instanceFollowUrl = '/admin/follows/followers-list'
+ this.instanceFollowUrl = '/admin/settings/follows/followers-list'
break
case UserNotificationType.AUTO_INSTANCE_FOLLOWING:
- this.instanceFollowUrl = '/admin/follows/following-list'
+ this.instanceFollowUrl = '/admin/settings/follows/following-list'
break
case UserNotificationType.NEW_PEERTUBE_VERSION:
@@ -255,7 +255,7 @@ export class UserNotification implements UserNotificationServer {
break
case UserNotificationType.NEW_PLUGIN_VERSION:
- this.pluginUrl = `/admin/plugins/list-installed`
+ this.pluginUrl = `/admin/settings/plugins/list-installed`
this.pluginQueryParams.pluginType = this.plugin.type + ''
break
diff --git a/client/src/app/shared/shared-main/users/user-quota.component.html b/client/src/app/shared/shared-main/users/user-quota.component.html
index 275a65925e..f98360d36e 100644
--- a/client/src/app/shared/shared-main/users/user-quota.component.html
+++ b/client/src/app/shared/shared-main/users/user-quota.component.html
@@ -1,6 +1,6 @@
<div class="user-quota mb-3">
<div>
- <div class="mb-2 fw-bold" i18n>Total video quota</div>
+ <div class="label" i18n>Total video quota</div>
<my-progress-bar
[label]="labelQuota()" [max]="user?.videoQuota || 0" [value]="userVideoQuotaUsed"
@@ -11,7 +11,7 @@
</div>
<div *ngIf="hasDailyQuota()" class="mt-3">
- <div class="mb-2 fw-bold" i18n>Daily video quota</div>
+ <div class="label" i18n>Daily video quota</div>
<my-progress-bar
[label]="labelQuotaDaily()" [max]="user?.videoQuotaDaily || 0" [value]="userVideoQuotaUsedDaily"
diff --git a/client/src/app/shared/shared-moderation/account-blocklist.component.html b/client/src/app/shared/shared-moderation/account-blocklist.component.html
index 65fde65e40..33ac003b2b 100644
--- a/client/src/app/shared/shared-moderation/account-blocklist.component.html
+++ b/client/src/app/shared/shared-moderation/account-blocklist.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="user-x" aria-hidden="true"></my-global-icon>
- <h1 i18n>Muted accounts</h1>
- </div>
-</div>
-
<p-table
[value]="blockedAccounts" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords"
[rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions" [first]="pagination.start"
@@ -30,7 +23,7 @@
<ng-template pTemplate="body" let-accountBlock>
<tr>
<td class="action-cell">
- <button class="peertube-button grey-button" (click)="unblockAccount(accountBlock)" i18n>Unmute</button>
+ <button class="peertube-button secondary-button" (click)="unblockAccount(accountBlock)" i18n>Unmute</button>
</td>
<td>
<a [href]="accountBlock.blockedAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer">
diff --git a/client/src/app/shared/shared-moderation/batch-domains-modal.component.html b/client/src/app/shared/shared-moderation/batch-domains-modal.component.html
index 0b02959242..ddb27d7fa4 100644
--- a/client/src/app/shared/shared-moderation/batch-domains-modal.component.html
+++ b/client/src/app/shared/shared-moderation/batch-domains-modal.component.html
@@ -30,11 +30,11 @@
<div class="form-group inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
- <input type="submit" [value]="action" class="peertube-button orange-button" [disabled]="!form.valid" />
+ <input type="submit" [value]="action" class="peertube-button primary-button" [disabled]="!form.valid" />
</div>
</form>
</div>
diff --git a/client/src/app/shared/shared-moderation/moderation.scss b/client/src/app/shared/shared-moderation/moderation.scss
index e983e812d9..11957a6288 100644
--- a/client/src/app/shared/shared-moderation/moderation.scss
+++ b/client/src/app/shared/shared-moderation/moderation.scss
@@ -48,7 +48,8 @@ my-action-dropdown.show {
.table-comment-link,
.table-account-link {
- color: var(--mainForegroundColor);
+ text-decoration: none;
+ color: pvar(--fg);
@include disable-outline;
diff --git a/client/src/app/shared/shared-moderation/report-modals/report.component.html b/client/src/app/shared/shared-moderation/report-modals/report.component.html
index 751ffd8000..496fe2f766 100644
--- a/client/src/app/shared/shared-moderation/report-modals/report.component.html
+++ b/client/src/app/shared/shared-moderation/report-modals/report.component.html
@@ -52,11 +52,11 @@
<div class="form-group inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
- <input type="submit" i18n-value value="Submit" class="peertube-button orange-button" [disabled]="!form.valid">
+ <input type="submit" i18n-value value="Submit" class="peertube-button primary-button" [disabled]="!form.valid">
</div>
</form>
diff --git a/client/src/app/shared/shared-moderation/report-modals/report.component.scss b/client/src/app/shared/shared-moderation/report-modals/report.component.scss
index 2aaf0536e8..15469a5ce7 100644
--- a/client/src/app/shared/shared-moderation/report-modals/report.component.scss
+++ b/client/src/app/shared/shared-moderation/report-modals/report.component.scss
@@ -1,8 +1,9 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
my-timestamp-input {
- width: 85px;
+ width: 100px;
}
.information {
diff --git a/client/src/app/shared/shared-moderation/report-modals/video-report.component.html b/client/src/app/shared/shared-moderation/report-modals/video-report.component.html
index 421c0c4259..2aee483124 100644
--- a/client/src/app/shared/shared-moderation/report-modals/video-report.component.html
+++ b/client/src/app/shared/shared-moderation/report-modals/video-report.component.html
@@ -83,11 +83,11 @@
<div class="form-group inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
- <input type="submit" i18n-value value="Submit" class="peertube-button orange-button" [disabled]="!form.valid">
+ <input type="submit" i18n-value value="Submit" class="peertube-button primary-button" [disabled]="!form.valid">
</div>
</form>
diff --git a/client/src/app/shared/shared-moderation/server-blocklist.component.html b/client/src/app/shared/shared-moderation/server-blocklist.component.html
index 59ebc85f2a..c8ab868c88 100644
--- a/client/src/app/shared/shared-moderation/server-blocklist.component.html
+++ b/client/src/app/shared/shared-moderation/server-blocklist.component.html
@@ -1,10 +1,3 @@
-<div class="sub-title-container">
- <div class="sub-title">
- <my-global-icon iconName="peertube-x" aria-hidden="true"></my-global-icon>
- <h1 i18n>Muted servers</h1>
- </div>
-</div>
-
<p-table
[value]="blockedServers" [paginator]="totalRecords > 0" [totalRecords]="totalRecords"
[rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions" [first]="pagination.start"
@@ -17,7 +10,7 @@
<div class="left-buttons">
<button class="peertube-create-button" (click)="addServersToBlock()" (key.enter)="addServersToBlock()">
<my-global-icon iconName="add" aria-hidden="true"></my-global-icon>
- <ng-container i18n>Mute domain</ng-container>
+ <ng-container i18n>Mute domains</ng-container>
</button>
</div>
@@ -38,7 +31,7 @@
<ng-template pTemplate="body" let-serverBlock>
<tr>
<td class="action-cell">
- <button class="peertube-button grey-button" (click)="unblockServer(serverBlock)" i18n>Unmute</button>
+ <button class="peertube-button secondary-button" (click)="unblockServer(serverBlock)" i18n>Unmute</button>
</td>
<td>
<a [href]="'https://' + serverBlock.blockedServer.host" i18n-title title="Open instance in a new tab" target="_blank" rel="noopener noreferrer">
diff --git a/client/src/app/shared/shared-moderation/server-blocklist.component.scss b/client/src/app/shared/shared-moderation/server-blocklist.component.scss
index ada0fbb6d3..78ebea6aa8 100644
--- a/client/src/app/shared/shared-moderation/server-blocklist.component.scss
+++ b/client/src/app/shared/shared-moderation/server-blocklist.component.scss
@@ -2,17 +2,5 @@
@use '_mixins' as *;
a {
- display: inline-block;
-
- @include disable-default-a-behaviour;
-
- &,
- &:hover {
- color: pvar(--mainForegroundColor);
- }
-
- span {
- font-size: 80%;
- color: pvar(--inputPlaceholderColor);
- }
+ color: pvar(--fg);
}
diff --git a/client/src/app/shared/shared-moderation/user-ban-modal.component.html b/client/src/app/shared/shared-moderation/user-ban-modal.component.html
index e1acee7d59..d45ffe6d4d 100644
--- a/client/src/app/shared/shared-moderation/user-ban-modal.component.html
+++ b/client/src/app/shared/shared-moderation/user-ban-modal.component.html
@@ -33,11 +33,11 @@
<div class="form-group inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
- <input type="submit" i18n-value [value]="getModalTitle()" class="peertube-button orange-button" [disabled]="!form.valid" />
+ <input type="submit" i18n-value [value]="getModalTitle()" class="peertube-button primary-button" [disabled]="!form.valid" />
</div>
</form>
</div>
diff --git a/client/src/app/shared/shared-moderation/user-ban-modal.component.scss b/client/src/app/shared/shared-moderation/user-ban-modal.component.scss
index 376fb16932..8afc5f1034 100644
--- a/client/src/app/shared/shared-moderation/user-ban-modal.component.scss
+++ b/client/src/app/shared/shared-moderation/user-ban-modal.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
.description {
margin-bottom: 15px;
diff --git a/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts b/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts
index e6fd5cf066..95fa94812a 100644
--- a/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts
+++ b/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts
@@ -260,7 +260,7 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges {
}
getRouterUserEditLink (user: User) {
- return [ '/admin', 'users', 'update', user.id ]
+ return [ '/admin', 'overview', 'users', 'update', user.id ]
}
private isMyUser (user: User) {
diff --git a/client/src/app/shared/shared-moderation/video-block.component.html b/client/src/app/shared/shared-moderation/video-block.component.html
index f73cb7bc16..8187dbdc73 100644
--- a/client/src/app/shared/shared-moderation/video-block.component.html
+++ b/client/src/app/shared/shared-moderation/video-block.component.html
@@ -45,11 +45,11 @@
<div class="form-group inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
- <input type="submit" i18n-value value="Block" class="peertube-button orange-button" [disabled]="!form.valid" />
+ <input type="submit" i18n-value value="Block" class="peertube-button primary-button" [disabled]="!form.valid" />
</div>
</form>
diff --git a/client/src/app/shared/shared-moderation/video-block.component.scss b/client/src/app/shared/shared-moderation/video-block.component.scss
index 7726eca111..07d486b4d1 100644
--- a/client/src/app/shared/shared-moderation/video-block.component.scss
+++ b/client/src/app/shared/shared-moderation/video-block.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
textarea {
@include peertube-textarea(100%, 100px);
diff --git a/client/src/app/shared/shared-share-modal/video-share.component.html b/client/src/app/shared/shared-share-modal/video-share.component.html
index f0181e9940..5b488651f9 100644
--- a/client/src/app/shared/shared-share-modal/video-share.component.html
+++ b/client/src/app/shared/shared-share-modal/video-share.component.html
@@ -16,7 +16,7 @@
<my-alert *ngIf="isPrivatePlaylist()" class="alert-private" type="warning">
<div i18n>This playlist is private so you won't be able to share it with external users</div>
- <a i18n class="peertube-button-link orange-button" [routerLink]="[ '/my-library/video-playlists/update', playlist.shortUUID ]" target="_blank" rel="noopener noreferrer">
+ <a i18n class="peertube-button-link primary-button" [routerLink]="[ '/my-library/video-playlists/update', playlist.shortUUID ]" target="_blank" rel="noopener noreferrer">
Update playlist privacy
</a>
</my-alert>
@@ -57,7 +57,7 @@
[withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true"
></my-input-text>
- <my-alert i18n *ngIf="notSecure()" type="warning">
+ <my-alert i18n *ngIf="notSecure()" type="warning" class="mt-3">
The url is not secured (no HTTPS), so the embed video won't work on HTTPS websites (web browsers block non secured HTTP requests on HTTPS websites).
</my-alert>
@@ -106,7 +106,7 @@
<my-alert *ngIf="isPrivateVideo()" class="alert-private" type="warning">
<div i18n>This video is private so you won't be able to share it with external users</div>
- <a i18n class="peertube-button-link orange-button" [routerLink]="[ '/videos/', 'update', video.shortUUID ]" target="_blank" rel="noopener noreferrer">
+ <a i18n class="peertube-button-link primary-button mt-3" [routerLink]="[ '/videos/', 'update', video.shortUUID ]" target="_blank" rel="noopener noreferrer">
Update video privacy
</a>
</my-alert>
@@ -151,7 +151,7 @@
[withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true"
></my-input-text>
- <my-alert i18n *ngIf="notSecure()" type="warning">
+ <my-alert i18n *ngIf="notSecure()" type="warning" class="mt-3">
The url is not secured (no HTTPS), so the embed video won't work on HTTPS websites (web browsers block non secured HTTP requests on HTTPS websites).
</my-alert>
diff --git a/client/src/app/shared/shared-share-modal/video-share.component.scss b/client/src/app/shared/shared-share-modal/video-share.component.scss
index e9b9971fdf..0929e2de64 100644
--- a/client/src/app/shared/shared-share-modal/video-share.component.scss
+++ b/client/src/app/shared/shared-share-modal/video-share.component.scss
@@ -1,8 +1,9 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
my-timestamp-input {
- width: 85px;
+ width: 100px;
}
my-input-text {
@@ -34,10 +35,6 @@ my-input-text {
margin-top: 20px;
}
-.alert-private {
- margin-top: 0;
-}
-
.filters {
margin-top: 30px;
@@ -74,6 +71,7 @@ my-input-text {
display: flex;
align-items: center;
justify-content: space-between;
+ width: 100%;
}
h5 {
diff --git a/client/src/app/shared/shared-support-modal/support-modal.component.html b/client/src/app/shared/shared-support-modal/support-modal.component.html
index fbe94432ad..926c91ddbb 100644
--- a/client/src/app/shared/shared-support-modal/support-modal.component.html
+++ b/client/src/app/shared/shared-support-modal/support-modal.component.html
@@ -10,7 +10,7 @@
<div class="modal-footer inputs">
<input
- type="button" role="button" i18n-value value="Close" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Close" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
</div>
diff --git a/client/src/app/shared/shared-tables/video-cell.component.scss b/client/src/app/shared/shared-tables/video-cell.component.scss
index 4b2f81253f..13b389c1fa 100644
--- a/client/src/app/shared/shared-tables/video-cell.component.scss
+++ b/client/src/app/shared/shared-tables/video-cell.component.scss
@@ -36,10 +36,6 @@
border-radius: 2px;
}
- span {
- color: pvar(--inputPlaceholderColor);
- }
-
.table-video-image-label {
position: absolute;
border-radius: 3px;
@@ -58,11 +54,11 @@
flex-direction: column;
justify-content: center;
font-size: 90%;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
line-height: 1rem;
div + div {
- color: var(--greyForegroundColor);
+ color: pvar(--fg-300);
font-size: 11px;
}
}
diff --git a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html
index 1059204de7..f98fedbbe1 100644
--- a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html
+++ b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html
@@ -27,9 +27,14 @@
<div class="label-overlay danger"><ng-content select="label-danger"></ng-content></div>
@if (video.isLive) {
- <div class="live-overlay" [ngClass]="{ 'live-ended': isLiveEnded() }">
- <ng-container i18n *ngIf="!isLiveEnded()">LIVE</ng-container>
- <ng-container i18n *ngIf="isLiveEnded()">LIVE ENDED</ng-container>
+ <div class="live-overlay" [ngClass]="{ 'live-streaming': isLiveStreaming(), 'ended-live': isEndedLive() }">
+ @if (isLiveStreaming()) {
+ <ng-container i18n >LIVE</ng-container>
+ } @else if (isEndedLive()) {
+ <ng-container i18n>LIVE ENDED</ng-container>
+ } @else {
+ <ng-container i18n>WAIT LIVE</ng-container>
+ }
</div>
} @else {
<div class="duration-overlay" [ariaLabel]="getDurationOverlayLabel()">{{ video.durationLabel }}</div>
diff --git a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.scss b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.scss
index d664d638bc..7d664b286f 100644
--- a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.scss
+++ b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.scss
@@ -15,7 +15,7 @@
div {
height: 100%;
- background-color: pvar(--mainColor);
+ background-color: pvar(--primary);
}
}
@@ -23,16 +23,15 @@
.label-overlay,
.duration-overlay,
.live-overlay {
- border-radius: 3px;
- font-size: 12px;
- font-weight: $font-semibold;
- line-height: 1.1;
+ font-size: 0.75rem;
+ line-height: normal;
z-index: z(miniature);
@include static-thumbnail-overlay;
}
.label-overlay {
+ border-radius: 3px;
position: absolute;
padding: 0 5px;
left: 5px;
@@ -40,23 +39,37 @@
font-weight: $font-bold;
&.warning { background-color: #ffa500; }
- &.danger { background-color: #ff0000; }
+ &.danger { background-color: pvar(--red); }
}
.duration-overlay,
.live-overlay {
position: absolute;
- padding: 0 3px;
- right: 5px;
- bottom: 5px;
+ padding: 2px 8px;
+ right: 0;
+ bottom: 0;
+ border-top-left-radius: 4px;
}
.live-overlay {
- font-weight: $font-semibold;
- color: #fff;
+ font-weight: $font-bold;
+ color: #F4F4F5;
+
+ &.live-streaming {
+ color: #F4F4F5;
+
+ &::before {
+ content: '';
+ display: inline-block;
+ width: 6px;
+ height: 6px;
+ border-radius: 100%;
+ background-color: pvar(--primary);
+ position: relative;
+ top: -1px;
- &:not(.live-ended) {
- background-color: rgba(224, 8, 8, 0.7);
+ @include margin-right(8px);
+ }
}
}
@@ -68,6 +81,8 @@
top: 5px;
opacity: 0;
+ font-weight: $font-semibold;
+
div:not(:first-child) {
margin-top: 2px;
}
@@ -75,11 +90,12 @@
.watch-icon-overlay {
padding: 3px;
+ border-radius: 3px;
my-global-icon {
width: 22px;
height: 22px;
- @include apply-svg-color(#fff);
+ color: #F4F4F5;
}
}
diff --git a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts
index 013078c7bb..4146a803d8 100644
--- a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts
+++ b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts
@@ -46,10 +46,16 @@ export class VideoThumbnailComponent {
return this.addToWatchLaterText
}
- isLiveEnded () {
- if (!this.video.state) return
+ isLiveStreaming () {
+ // In non moderator mode we only display published live
+ // If in moderator mode, the server adds the state info to the object
+ if (!this.video.isLive) return false
- return this.video.state.id === VideoState.LIVE_ENDED
+ return !this.video.state || this.video.state?.id === VideoState.PUBLISHED
+ }
+
+ isEndedLive () {
+ return this.video.state?.id === VideoState.LIVE_ENDED
}
getImageUrl () {
diff --git a/client/src/app/shared/shared-user-settings/user-interface-settings.component.html b/client/src/app/shared/shared-user-settings/user-interface-settings.component.html
index e6847aabd5..c17c8db789 100644
--- a/client/src/app/shared/shared-user-settings/user-interface-settings.component.html
+++ b/client/src/app/shared/shared-user-settings/user-interface-settings.component.html
@@ -3,15 +3,8 @@
<div class="form-group">
<label i18n for="theme">Theme</label>
- <div class="peertube-select-container">
- <select formControlName="theme" id="theme" class="form-control">
- <option i18n value="instance-default">{{ instanceName }} default theme ({{ getDefaultInstanceThemeLabel() }})</option>
- <option i18n value="default">{{ getDefaultThemeLabel() }}</option>
-
- <option *ngFor="let theme of availableThemes" [value]="theme.id">{{ theme.label }}</option>
- </select>
- </div>
+ <my-select-options inputId="theme" formControlName="theme" [items]="availableThemes"></my-select-options>
</div>
- <input *ngIf="!reactiveUpdate" type="submit" class="mt-0" i18n-value value="Save interface settings" [disabled]="!form.valid">
+ <input *ngIf="!reactiveUpdate" type="submit" class="peertube-button primary-button" i18n-value value="Save interface settings" [disabled]="!form.valid">
</form>
diff --git a/client/src/app/shared/shared-user-settings/user-interface-settings.component.scss b/client/src/app/shared/shared-user-settings/user-interface-settings.component.scss
index 4114b8079f..9a2f49720c 100644
--- a/client/src/app/shared/shared-user-settings/user-interface-settings.component.scss
+++ b/client/src/app/shared/shared-user-settings/user-interface-settings.component.scss
@@ -1,13 +1,7 @@
@use '_variables' as *;
@use '_mixins' as *;
-
-input[type=submit] {
- display: block;
- margin-top: 15px;
-
- @include peertube-button;
- @include orange-button;
-}
+@use '_button-mixins' as *;
+@use 'form-mixins' as *;
.peertube-select-container {
margin-bottom: 30px;
diff --git a/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts b/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts
index 4ea58b555f..ef08c24ff9 100644
--- a/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts
+++ b/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts
@@ -7,13 +7,14 @@ import { HTMLServerConfig, User, UserUpdateMe } from '@peertube/peertube-models'
import { SelectOptionsItem } from 'src/types'
import { NgFor, NgIf } from '@angular/common'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
+import { SelectOptionsComponent } from '../shared-forms/select/select-options.component'
@Component({
selector: 'my-user-interface-settings',
templateUrl: './user-interface-settings.component.html',
styleUrls: [ './user-interface-settings.component.scss' ],
standalone: true,
- imports: [ FormsModule, ReactiveFormsModule, NgFor, NgIf ]
+ imports: [ FormsModule, ReactiveFormsModule, NgFor, NgIf, SelectOptionsComponent ]
})
export class UserInterfaceSettingsComponent extends FormReactive implements OnInit, OnDestroy {
@Input() user: User
@@ -44,7 +45,13 @@ export class UserInterfaceSettingsComponent extends FormReactive implements OnIn
ngOnInit () {
this.serverConfig = this.serverService.getHTMLConfig()
- this.availableThemes = this.themeService.buildAvailableThemes()
+ this.availableThemes = [
+ { id: 'instance-default', label: $localize`${this.instanceName} theme`, description: this.getDefaultInstanceThemeLabel() },
+
+ this.themeService.getDefaultThemeItem(),
+
+ ...this.themeService.buildAvailableThemes()
+ ]
this.buildForm({
theme: null
@@ -66,20 +73,6 @@ export class UserInterfaceSettingsComponent extends FormReactive implements OnIn
this.formValuesWatcher?.unsubscribe()
}
- getDefaultThemeLabel () {
- return this.themeService.getDefaultThemeLabel()
- }
-
- getDefaultInstanceThemeLabel () {
- const theme = this.serverConfig.theme.default
-
- if (theme === 'default') {
- return this.getDefaultThemeLabel()
- }
-
- return theme
- }
-
updateInterfaceSettings () {
const theme = this.form.value['theme']
@@ -105,4 +98,15 @@ export class UserInterfaceSettingsComponent extends FormReactive implements OnIn
this.userService.updateMyAnonymousProfile(details)
if (this.notifyOnUpdate) this.notifier.success($localize`Interface settings updated.`)
}
+
+ private getDefaultInstanceThemeLabel () {
+ const theme = this.serverConfig.theme.default
+
+ if (theme === 'default') {
+ return this.themeService.getDefaultThemeItem().label
+ }
+
+ return theme
+ }
+
}
diff --git a/client/src/app/shared/shared-user-settings/user-video-settings.component.html b/client/src/app/shared/shared-user-settings/user-video-settings.component.html
index d03ebae7d8..7789ffaecd 100644
--- a/client/src/app/shared/shared-user-settings/user-video-settings.component.html
+++ b/client/src/app/shared/shared-user-settings/user-video-settings.component.html
@@ -42,7 +42,7 @@
i18n-labelText labelText="Help share videos being played"
>
<ng-container ngProjectAs="description">
- <span i18n>The <a class="link-orange" routerLink="/about/peertube" fragment="privacy" target="_blank">sharing system</a> implies that some technical information about your system (such as a public IP address) can be sent to other peers, but greatly helps to reduce server load.</span>
+ <span i18n>The <a class="link-primary" routerLink="/about/peertube" fragment="privacy" target="_blank">sharing system</a> implies that some technical information about your system (such as a public IP address) can be sent to other peers, but greatly helps to reduce server load.</span>
</ng-container>
</my-peertube-checkbox>
</div>
@@ -69,5 +69,5 @@
</my-peertube-checkbox>
</div>
- <input *ngIf="!reactiveUpdate" type="submit" i18n-value value="Save video settings" [disabled]="!form.valid">
+ <input *ngIf="!reactiveUpdate" type="submit" i18n-value value="Save video settings" [disabled]="!form.valid" class="peertube-button primary-button mt-3">
</form>
diff --git a/client/src/app/shared/shared-user-settings/user-video-settings.component.scss b/client/src/app/shared/shared-user-settings/user-video-settings.component.scss
index 1917d51107..edcb6b597b 100644
--- a/client/src/app/shared/shared-user-settings/user-video-settings.component.scss
+++ b/client/src/app/shared/shared-user-settings/user-video-settings.component.scss
@@ -1,12 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
-
-input[type=submit] {
- margin-top: 15px;
-
- @include peertube-button;
- @include orange-button;
-}
+@use '_form-mixins' as *;
.peertube-select-container {
@include peertube-select-container(340px);
diff --git a/client/src/app/shared/shared-user-subscription/remote-subscribe.component.html b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.html
index 656d1beb3e..343d756030 100644
--- a/client/src/app/shared/shared-user-subscription/remote-subscribe.component.html
+++ b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.html
@@ -1,15 +1,17 @@
<form novalidate [formGroup]="form" (ngSubmit)="formValidated()">
<div class="form-group">
- <input type="email"
- formControlName="text"
- class="form-control"
- (keyup.control.enter)="onValidKey()" (keyup.meta.enter)="onValidKey()"
- placeholder="[email protected]">
+ <input
+ type="email" formControlName="text" class="form-control"
+ (keyup.control.enter)="onValidKey()" (keyup.meta.enter)="onValidKey()" placeholder="[email protected]"
+ >
</div>
- <button type="submit" [disabled]="!form.valid" class="btn btn-sm btn-remote-follow" i18n>
- <span *ngIf="!interact">Remote subscribe</span>
- <span *ngIf="interact">Remote interact</span>
+ <button type="submit" [disabled]="!form.valid" class="peertube-button primary-button">
+ @if (interact) {
+ <span i18n>Remote interact</span>
+ } @else {
+ <span i18n>Remote subscribe</span>
+ }
</button>
<my-help *ngIf="!interact && showHelp">
diff --git a/client/src/app/shared/shared-user-subscription/remote-subscribe.component.scss b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.scss
deleted file mode 100644
index e87f43b631..0000000000
--- a/client/src/app/shared/shared-user-subscription/remote-subscribe.component.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-@use '_mixins' as *;
-
-.btn-remote-follow {
- @include peertube-button;
- @include orange-button;
-}
diff --git a/client/src/app/shared/shared-user-subscription/remote-subscribe.component.ts b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.ts
index 1eae1c7d12..8fa11355ba 100644
--- a/client/src/app/shared/shared-user-subscription/remote-subscribe.component.ts
+++ b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.ts
@@ -12,7 +12,6 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'
@Component({
selector: 'my-remote-subscribe',
templateUrl: './remote-subscribe.component.html',
- styleUrls: [ './remote-subscribe.component.scss' ],
standalone: true,
imports: [ FormsModule, ReactiveFormsModule, NgIf, HelpComponent, PeerTubeTemplateDirective ]
})
diff --git a/client/src/app/shared/shared-user-subscription/subscribe-button.component.scss b/client/src/app/shared/shared-user-subscription/subscribe-button.component.scss
index f1d0fd0bd7..74b7ce5f53 100644
--- a/client/src/app/shared/shared-user-subscription/subscribe-button.component.scss
+++ b/client/src/app/shared/shared-user-subscription/subscribe-button.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
.btn-group {
padding: 0;
@@ -7,6 +8,7 @@
.peertube-button {
// Prevent weird border radius blur on chrome
z-index: unset !important;
+ padding: pvar(--input-y-padding) 10px;
}
.dropdown-toggle::after {
diff --git a/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts b/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts
index 325e77f88e..706bdd0c06 100644
--- a/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts
+++ b/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts
@@ -236,8 +236,8 @@ export class SubscribeButtonComponent implements OnChanges {
private buildClasses () {
this.buttonClasses = {
'peertube-button': true,
- 'orange-button': !this.isAllChannelsSubscribed,
- 'grey-button': this.isAllChannelsSubscribed
+ 'primary-button': !this.isAllChannelsSubscribed,
+ 'secondary-button': this.isAllChannelsSubscribed
}
}
}
diff --git a/client/src/app/shared/shared-video-comment/video-comment-list-admin-owner.component.html b/client/src/app/shared/shared-video-comment/video-comment-list-admin-owner.component.html
index a9fd8367ad..e28c85887d 100644
--- a/client/src/app/shared/shared-video-comment/video-comment-list-admin-owner.component.html
+++ b/client/src/app/shared/shared-video-comment/video-comment-list-admin-owner.component.html
@@ -9,7 +9,7 @@
<div class="caption">
<div>
<my-action-dropdown
- *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange"
+ *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="primary"
[actions]="bulkActions" [entry]="selectedRows"
>
</my-action-dropdown>
@@ -31,7 +31,7 @@
<th scope="col" style="width: 40px;">
<span i18n class="visually-hidden">More information</span>
</th>
- <th scope="col" style="width: 150px;">
+ <th scope="col" style="width: 70px;">
<span i18n class="visually-hidden">Actions</span>
</th>
<th scope="col" i18n>Account</th>
@@ -56,7 +56,7 @@
<td class="action-cell">
<my-action-dropdown
[ngClass]="{ 'show': expanded }" placement="bottom-right" container="body"
- i18n-label label="Actions" [actions]="videoCommentActions" [entry]="videoComment"
+ [actions]="videoCommentActions" [entry]="videoComment" buttonSize="small"
></my-action-dropdown>
</td>
@@ -64,7 +64,7 @@
<a [href]="videoComment.account.localUrl" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer">
<div class="chip two-lines">
<my-actor-avatar [actor]="videoComment.account" actorType="account" size="32"></my-actor-avatar>
- <div>
+ <div>
{{ videoComment.account.displayName }}
<span>{{ videoComment.by }}</span>
</div>
@@ -75,7 +75,7 @@
<td class="video">
<em i18n>Commented video</em>
- <a [href]="videoComment.localUrl" target="_blank" rel="noopener noreferrer">{{ videoComment.video.name }}</a>
+ <a [href]="videoComment.localUrl" target="_blank" rel="noopener noreferrer" class="text-decoration-none">{{ videoComment.video.name }}</a>
</td>
<td class="c-hand comment-content-cell" [pRowToggler]="videoComment">
diff --git a/client/src/app/shared/shared-video-comment/video-comment-list-admin-owner.component.scss b/client/src/app/shared/shared-video-comment/video-comment-list-admin-owner.component.scss
index 3cab616924..97cb6faa68 100644
--- a/client/src/app/shared/shared-video-comment/video-comment-list-admin-owner.component.scss
+++ b/client/src/app/shared/shared-video-comment/video-comment-list-admin-owner.component.scss
@@ -15,7 +15,7 @@ my-global-icon {
}
a {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
@include ellipsis;
}
@@ -47,6 +47,8 @@ my-global-icon {
.right-form {
display: flex;
+ flex-wrap: wrap;
+ row-gap: 0.5rem;
> *:not(:last-child) {
@include margin-right(10px);
diff --git a/client/src/app/shared/shared-video-live/live-documentation-link.component.html b/client/src/app/shared/shared-video-live/live-documentation-link.component.html
index 9e5195e74e..2efb0a5c10 100644
--- a/client/src/app/shared/shared-video-live/live-documentation-link.component.html
+++ b/client/src/app/shared/shared-video-live/live-documentation-link.component.html
@@ -1,4 +1,4 @@
<p i18n>
- See <a class="link-orange" href="https://docs.joinpeertube.org/use/create-upload-video#publish-a-live" target="_blank" rel="noopener noreferrer">the documentation</a>
+ See <a class="link-primary" href="https://docs.joinpeertube.org/use/create-upload-video#publish-a-live" target="_blank" rel="noopener noreferrer">the documentation</a>
to learn how to use the PeerTube live streaming feature.
</p>
diff --git a/client/src/app/shared/shared-video-live/live-stream-information.component.html b/client/src/app/shared/shared-video-live/live-stream-information.component.html
index 325a6e44a8..7be81e8d0b 100644
--- a/client/src/app/shared/shared-video-live/live-stream-information.component.html
+++ b/client/src/app/shared/shared-video-live/live-stream-information.component.html
@@ -51,7 +51,7 @@
<div class="modal-footer">
<div class="form-group inputs">
- <input type="button" role="button" i18n-value value="Close" class="peertube-button grey-button" (click)="dismiss()" />
+ <input type="button" role="button" i18n-value value="Close" class="peertube-button secondary-button" (click)="dismiss()" />
<my-edit-button
i18n-label label="Update live settings"
diff --git a/client/src/app/shared/shared-video-miniature/download/subtitle-files-download.component.html b/client/src/app/shared/shared-video-miniature/download/subtitle-files-download.component.html
index 0780eece4e..c0caaeb6ec 100644
--- a/client/src/app/shared/shared-video-miniature/download/subtitle-files-download.component.html
+++ b/client/src/app/shared/shared-video-miniature/download/subtitle-files-download.component.html
@@ -23,5 +23,5 @@
<div class="modal-footer inputs">
<ng-content select="cancel-button"></ng-content>
- <input type="submit" i18n-value value="Download" class="peertube-button orange-button" (click)="download()" />
+ <input type="submit" i18n-value value="Download" class="peertube-button primary-button" (click)="download()" />
</div>
diff --git a/client/src/app/shared/shared-video-miniature/download/video-download.component.html b/client/src/app/shared/shared-video-miniature/download/video-download.component.html
index c95d6abbf8..e2ce7dab02 100644
--- a/client/src/app/shared/shared-video-miniature/download/video-download.component.html
+++ b/client/src/app/shared/shared-video-miniature/download/video-download.component.html
@@ -1,7 +1,7 @@
<ng-template #modal let-hide="close">
<div class="modal-header">
- <h4 class="modal-title">
- <ng-container i18n>Download</ng-container>
+ <div class="d-flex align-items-center me-auto">
+ <h4 class="modal-title" i18n>Download</h4>
<div class="peertube-select-container title-select ms-2">
<select id="type" name="type" [(ngModel)]="type" class="form-control">
@@ -10,9 +10,9 @@
<option *ngIf="hasCaptions()" value="subtitle-files" i18n>Subtitle files</option>
</select>
</div>
- </h4>
+ </div>
- <button class="border-0 p-0" title="Close this modal" i18n-title (click)="hide()">
+ <button class="border-0 p-0 align-self-start" title="Close this modal" i18n-title (click)="hide()">
<my-global-icon iconName="cross"></my-global-icon>
</button>
</div>
@@ -20,7 +20,7 @@
<div class="modal-body" [ngClass]="{ 'opacity-0': !loaded }">
<ng-template #cancelBlock>
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
</ng-template>
diff --git a/client/src/app/shared/shared-video-miniature/download/video-download.component.scss b/client/src/app/shared/shared-video-miniature/download/video-download.component.scss
index 0237a8855d..c888c74cc8 100644
--- a/client/src/app/shared/shared-video-miniature/download/video-download.component.scss
+++ b/client/src/app/shared/shared-video-miniature/download/video-download.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use 'form-mixins' as *;
.modal-body ::ng-deep {
@@ -26,9 +27,6 @@
}
.peertube-select-container.title-select {
- display: inline-block;
- vertical-align: top;
-
@include peertube-select-container(auto);
}
diff --git a/client/src/app/shared/shared-video-miniature/download/video-files-download.component.html b/client/src/app/shared/shared-video-miniature/download/video-files-download.component.html
index ec3c77aa44..705f4abc26 100644
--- a/client/src/app/shared/shared-video-miniature/download/video-files-download.component.html
+++ b/client/src/app/shared/shared-video-miniature/download/video-files-download.component.html
@@ -123,5 +123,5 @@
<div class="modal-footer inputs">
<ng-content select="cancel-button"></ng-content>
- <input type="submit" i18n-value value="Download" class="peertube-button orange-button" (click)="download()" />
+ <input type="submit" i18n-value value="Download" class="peertube-button primary-button" (click)="download()" />
</div>
diff --git a/client/src/app/shared/shared-video-miniature/download/video-files-download.component.scss b/client/src/app/shared/shared-video-miniature/download/video-files-download.component.scss
index ee5445dd1c..67fd78ac84 100644
--- a/client/src/app/shared/shared-video-miniature/download/video-files-download.component.scss
+++ b/client/src/app/shared/shared-video-miniature/download/video-files-download.component.scss
@@ -30,7 +30,7 @@
> span:first-child {
min-width: 142px;
display: inline-block;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
font-weight: $font-bold;
@include padding-right(5px);
diff --git a/client/src/app/shared/shared-video-miniature/download/video-generate-download.component.html b/client/src/app/shared/shared-video-miniature/download/video-generate-download.component.html
index f00bba8be8..9de7d6759d 100644
--- a/client/src/app/shared/shared-video-miniature/download/video-generate-download.component.html
+++ b/client/src/app/shared/shared-video-miniature/download/video-generate-download.component.html
@@ -39,5 +39,5 @@
<div class="modal-footer inputs">
<ng-content select="cancel-button"></ng-content>
- <input type="submit" i18n-value value="Download" class="peertube-button orange-button" (click)="download()" />
+ <input type="submit" i18n-value value="Download" class="peertube-button primary-button" (click)="download()" />
</div>
diff --git a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.scss b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.scss
index 67d7ee86ac..cb1d255999 100644
--- a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.scss
+++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.scss
@@ -7,6 +7,6 @@
}
}
-::ng-deep .icon-playlist-add {
+:host ::ng-deep .icon-playlist-add {
left: 2px;
}
diff --git a/client/src/app/shared/shared-video-miniature/video-filters-header.component.html b/client/src/app/shared/shared-video-miniature/video-filters-header.component.html
index dd8854c5b9..2c7f041f30 100644
--- a/client/src/app/shared/shared-video-miniature/video-filters-header.component.html
+++ b/client/src/app/shared/shared-video-miniature/video-filters-header.component.html
@@ -1,130 +1,153 @@
-<ng-template #updateSettings let-fragment>
- <div class="update-your-settings muted" i18n>
- Update
-
- <a routerLink="/my-account/settings" [fragment]="fragment" (click)="onAccountSettingsClick($event)">your settings</a
- ></div>
-</ng-template>
-
-
<div class="root" [formGroup]="form">
- <div class="first-row">
- <div class="active-filters">
- <button
- class="pastille filters-toggle" (click)="areFiltersCollapsed = !areFiltersCollapsed"
- [attr.aria-expanded]="!areFiltersCollapsed" aria-controls="collapseBasic"
- [ngClass]="{ active: !areFiltersCollapsed }"
- >
- @if (areFiltersCollapsed) {
- <ng-container i18n>More filters</ng-container>
+ <div class="d-flex flex-wrap mb-3">
+ @for (quickFilter of quickFilters; track quickFilter) {
+ <my-button
+ theme="secondary" [icon]="quickFilter.iconName" class="me-2 mb-2"
+ ptRouterLink="." [ptQueryParams]="quickFilter.filters" [active]="quickFilter.isActive()" ptQueryParamsHandling="merge"
+ (click)="onQuickFilter($event, quickFilter)"
+ >{{ quickFilter.label }} </my-button>
+ }
+ </div>
+
+ <div class="d-flex flex-wrap-reverse align-items-start justify-content-between">
+ <div class="me-3">
+ <div class="scope-info" *ngIf="totalFollowing && !hideScope">
+ @if (filters.scope === 'local') {
+ <ng-container i18n>Videos on <strong>{{ instanceName }}</strong></ng-container>
} @else {
- <ng-container i18n>Hide filters</ng-container>
+ <ng-container i18n>Videos on <strong>{{ instanceName }}</strong> and <strong>{{ totalFollowing }}</strong> other platforms</ng-container>
}
+ </div>
- <my-global-icon iconName="chevrons-up"></my-global-icon>
- </button>
-
- <div
- *ngFor="let activeFilter of filters.getActiveFilters()"
- class="active-filter pastille button-unstyle" [ngClass]="{ 'can-remove': activeFilter.canRemove }" [title]="getFilterTitle(activeFilter.canRemove)"
- >
- <span>
- {{ activeFilter.label }}
-
- <ng-container *ngIf="activeFilter.value">: {{ getFilterValue(activeFilter) }}</ng-container>
- </span>
+ <div class="filters-summary d-inline-block">
+ <div class="d-inline-block active-filters">
+ @for (filter of filters.getActiveFilters(); track filter.key + (filter.value || '')) {
+ @if (filter.key !== 'scope') {
+ <div class="d-inline-block">
+ <span i18n *ngIf="filter.value">{{ filter.label }}: </span>
+ <strong>{{ getFilterValue(filter) || filter.label }}</strong>
+ </div>
+ }
+ }
+ </div>
<button
- *ngIf="activeFilter.canRemove" type="button" class="remove-button"
- (click)="resetFilter(activeFilter.key, activeFilter.canRemove)"
- i18n-title title="Remove this filter"
+ class="filters-toggle peertube-button-like-link" (click)="areFiltersCollapsed = !areFiltersCollapsed"
+ [attr.aria-expanded]="!areFiltersCollapsed" aria-controls="collapseBasic"
+ [ngClass]="{ active: !areFiltersCollapsed }"
>
- <my-global-icon iconName="cross"></my-global-icon>
+ @if (areFiltersCollapsed) {
+ <ng-container i18n>More filters</ng-container>
+ } @else {
+ <ng-container i18n>Hide filters</ng-container>
+ }
+
+ <my-global-icon iconName="chevrons-up"></my-global-icon>
</button>
</div>
</div>
- <label class="visually-hidden" for="sort-videos">Sort videos</label>
+ <div class="d-flex flex-wrap align-items-center mb-2">
+ <label for="sort-videos" i18n class="select-label">Sort by:</label>
- <my-select-options inputId="sort-videos" class="sort" formControlName="sort" [items]="sortItems">
- <ng-template ptTemplate="item" let-item>
- <ng-container>Sort by <strong>"{{ item.label }}"</strong></ng-container>
- </ng-template>
- </my-select-options>
+ <my-select-options inputId="sort-videos" class="d-inline-block me-2" formControlName="sort" [items]="sortItems"></my-select-options>
+ </div>
</div>
<div [ngbCollapse]="areFiltersCollapsed" [animation]="true">
<div class="filters">
- <div class="form-group">
- <label class="with-description" for="languageOneOf" i18n>Languages:</label>
- <ng-template *ngTemplateOutlet="updateSettings; context: { $implicit: 'video-languages-subtitles' }"></ng-template>
+ <div class="section">
+ <div class="section-title">
+ <ng-container i18n>Content preferences</ng-container>
- <my-select-languages inputId="languageOneOf" [maxLanguages]="20" formControlName="languageOneOf"></my-select-languages>
- </div>
+ <div class="with-description">
+ <ng-container i18n>You always use the same preferences?</ng-container>
- <div class="form-group" role="radiogroup">
- <label class="with-description" for="nsfw" i18n>Sensitive content:</label>
- <ng-template *ngTemplateOutlet="updateSettings; context: { $implicit: 'video-sensitive-content-policy' }"></ng-template>
+ <ng-container i18n>
+ Update your <a routerLink="/my-account/settings" fragment="video-languages-subtitles" (click)="onAccountSettingsClick($event)">default settings</a>
+ </ng-container>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label for="languageOneOf" i18n>Languages</label>
- <div class="peertube-radio-container">
- <input formControlName="nsfw" type="radio" name="nsfw" id="nsfwBoth" value="both" />
- <label for="nsfwBoth">{{ filters.getNSFWDisplayLabel() }}</label>
+ <my-select-languages inputId="languageOneOf" [maxLanguages]="20" formControlName="languageOneOf"></my-select-languages>
</div>
- <div class="peertube-radio-container">
- <input formControlName="nsfw" type="radio" name="nsfw" id="nsfwFalse" value="false" />
- <label for="nsfwFalse" i18n>Hide</label>
+ <div class="form-group" role="radiogroup">
+ <label for="nsfw" i18n>Sensitive content</label>
+
+ <div class="peertube-radio-container">
+ <input formControlName="nsfw" type="radio" name="nsfw" id="nsfwBoth" value="both" />
+ <label for="nsfwBoth">{{ filters.getNSFWDisplayLabel() }}</label>
+ </div>
+
+ <div class="peertube-radio-container">
+ <input formControlName="nsfw" type="radio" name="nsfw" id="nsfwFalse" value="false" />
+ <label for="nsfwFalse" i18n>Hide</label>
+ </div>
</div>
</div>
- <div class="form-group" *ngIf="!hideScope" role="radiogroup">
- <label for="scope" i18n>Scope:</label>
+ <div class="section" *ngIf="totalFollowing && !hideScope">
+ <div class="section-title">
+ <ng-container i18n>Platforms order</ng-container>
+
+ <div class="with-description">
+ <div i18n>{{ instanceName }} platform subscribes to content from <a routerLink="/about/follows" target="_blank">{{ totalFollowing }} other platforms</a>.</div>
- <div class="peertube-radio-container">
- <input formControlName="scope" type="radio" name="scope" id="scopeLocal" value="local" />
- <label for="scopeLocal" i18n>Local videos (this instance)</label>
+ <div i18n>Set your display preferences here.</div>
+ </div>
</div>
- <div class="peertube-radio-container">
- <input formControlName="scope" type="radio" name="scope" id="scopeFederated" value="federated" />
- <label for="scopeFederated" i18n>Federated videos (this instance + followed instances)</label>
+ <div class="form-group" >
+ <label for="scope" i18n>Displayed videos</label>
+
+ <my-select-options inputId="scope" class="scope-select" formControlName="scope" [items]="availableScopes"></my-select-options>
</div>
</div>
- <div class="form-group" role="radiogroup">
- <label for="type" i18n>Type:</label>
+ <div class="section">
+ <div class="section-title" i18n>Content type</div>
- <div class="peertube-radio-container">
- <input formControlName="live" type="radio" name="live" id="liveBoth" value="both" />
- <label for="liveBoth" i18n>VOD & Live videos</label>
- </div>
+ <div class="form-group">
+ <label for="categoryOneOf" i18n>Categories</label>
- <div class="peertube-radio-container">
- <input formControlName="live" type="radio" name="live" id="liveTrue" value="true" />
- <label for="liveTrue" i18n>Live videos</label>
+ <my-select-categories inputId="categoryOneOf" formControlName="categoryOneOf"></my-select-categories>
</div>
- <div class="peertube-radio-container">
- <input formControlName="live" type="radio" name="live" id="liveFalse" value="false" />
- <label for="liveFalse" i18n>VOD videos</label>
- </div>
- </div>
+ <div class="form-group" role="radiogroup">
+ <label for="type" i18n>Type</label>
- <div class="form-group">
- <label for="categoryOneOf" i18n>Categories:</label>
+ <div class="peertube-radio-container">
+ <input formControlName="live" type="radio" name="live" id="liveBoth" value="both" />
+ <label for="liveBoth" i18n>VOD & Live videos</label>
+ </div>
- <my-select-categories inputId="categoryOneOf" formControlName="categoryOneOf"></my-select-categories>
+ <div class="peertube-radio-container">
+ <input formControlName="live" type="radio" name="live" id="liveTrue" value="true" />
+ <label for="liveTrue" i18n>Live videos</label>
+ </div>
+
+ <div class="peertube-radio-container">
+ <input formControlName="live" type="radio" name="live" id="liveFalse" value="false" />
+ <label for="liveFalse" i18n>VOD videos</label>
+ </div>
+ </div>
</div>
- <div class="form-group" *ngIf="canSeeAllVideos()">
- <label for="allVideos" i18n>Moderation:</label>
+ <div class="section" *ngIf="canSeeAllVideos()">
+ <div class="section-title" i18n>Moderation</div>
- <my-peertube-checkbox
- formControlName="allVideos"
- inputName="allVideos"
- i18n-labelText labelText="Display all videos (private, unlisted, password protected or not yet published)"
- ></my-peertube-checkbox>
+ <div class="form-group">
+ <my-peertube-checkbox
+ formControlName="allVideos"
+ inputName="allVideos"
+ i18n-labelText labelText="Display all videos (private, unlisted, password protected or not yet published)"
+ ></my-peertube-checkbox>
+ </div>
</div>
</div>
</div>
diff --git a/client/src/app/shared/shared-video-miniature/video-filters-header.component.scss b/client/src/app/shared/shared-video-miniature/video-filters-header.component.scss
index 2177aef5ab..697e05e5ca 100644
--- a/client/src/app/shared/shared-video-miniature/video-filters-header.component.scss
+++ b/client/src/app/shared/shared-video-miniature/video-filters-header.component.scss
@@ -1,113 +1,115 @@
@use '_variables' as *;
@use '_mixins' as *;
+$filters-background: pvar(--bg-secondary-400);
+
.root {
- margin-bottom: 45px;
-}
+ margin-bottom: 1rem;
-.first-row {
- display: flex;
- justify-content: space-between;
+ // Prevent layout shift
+ min-height: 140px;
}
-.active-filters {
- display: flex;
- flex-wrap: wrap;
+.scope-info {
+ font-size: 20px;
+ color: pvar(--fg-350);
}
-.filters {
- display: flex;
- flex-wrap: wrap;
- margin-top: 25px;
+.select-label {
+ font-weight: normal;
+ margin-bottom: 0;
+ color: pvar(--fg-200);
+ font-size: 1rem;
- border-bottom: 1px solid $separator-border-color;
+ @include margin-right(0.5rem);
+}
- input[type=radio] + label {
- font-weight: $font-regular;
- }
+.section {
+ @include margin-right(3rem);
+}
- .form-group > label:first-child {
- display: block;
+.section-title {
+ font-size: 1.25rem;
+ font-weight: $font-bold;
+ color: pvar(--fg-300);
+ margin-bottom: 0.5rem;
- &.with-description {
- margin-bottom: 0;
- }
+ .with-description {
+ font-size: 14px;
+ font-weight: normal;
- &:not(.with-description) {
- margin-bottom: 10px;
+ a {
+ color: inherit;
}
}
-
- .form-group {
- @include margin-right(30px);
- }
}
-.pastille {
- border-radius: 24px;
- padding: 4px 15px;
- margin-bottom: 15px;
- cursor: pointer;
+.filters {
+ --input-bg: #{pvar(--input-bg-in-secondary)};
+ --input-border-color: #{pvar(--input-bg-in-secondary)};
- @include margin-right(15px);
+ display: flex;
+ flex-wrap: wrap;
+ background-color: $filters-background;
+ padding: 1.5rem;
+ border-radius: 14px;
- &:focus-visible {
- outline: pvar(--mainColor) auto 1px;
+ input[type=radio] + label {
+ font-weight: $font-regular;
}
-}
-
-.filters-toggle {
- border: 2px solid pvar(--mainForegroundColor);
- my-global-icon {
- @include margin-left(5px);
- }
+ .form-group {
+ margin-bottom: 1.5rem;
- &.active my-global-icon {
- position: relative;
- top: -1px;
+ > label:not(.select-label) {
+ display: block;
+ color: pvar(--fg-300);
+ font-size: 18px;
+ }
}
+}
- &:not(.active) {
- my-global-icon ::ng-deep svg {
- transform: rotate(180deg);
- }
+.active-filters {
+ > div:not(:last-child)::after {
+ content: '•';
+ font-weight: normal;
+ display: inline-block;
+ margin: 0 5px;
}
}
-// Than have an icon
-.filters-toggle,
-.active-filter.can-remove {
- padding: 4px 11px 4px 15px;
+.filters-summary {
+ color: pvar(--fg-200);
}
-.active-filter {
- background-color: pvar(--channelBackgroundColor);
- display: flex;
- align-items: center;
+.filters-toggle {
+ padding: pvar(--input-y-padding) 0.5rem calc(#{pvar(--input-y-padding)} + 0.75rem) 0.75rem;
- &:not(.can-remove) {
- cursor: default;
- }
+ @include margin-left(0.25rem);
- &.can-remove:hover {
- opacity: 0.9;
- }
+ my-global-icon {
+ color: pvar(--secondary-icon-color);
- > .remove-button {
- border: 0;
- padding: 0;
+ @include margin-left(5px);
+ }
- @include margin-left(10px);
+ &.active {
+ background-color: $filters-background;
+ border-start-start-radius: 14px;
+ border-start-end-radius: 14px;
my-global-icon {
- width: 16px;
- color: pvar(--greyForegroundColor);
+ position: relative;
+ top: -1px;
}
}
+
+ &:not(.active) my-global-icon ::ng-deep svg {
+ transform: rotate(180deg);
+ }
}
-.sort {
+.scope-select {
min-width: 250px;
max-width: 300px;
height: min-content;
@@ -124,13 +126,13 @@ my-select-categories {
margin-bottom: 10px;
a {
- color: pvar(--mainColor);
+ color: pvar(--primary);
text-decoration: underline;
}
}
@media screen and (max-width: $small-view) {
- .first-row {
+ .filters-row {
flex-direction: column;
}
}
diff --git a/client/src/app/shared/shared-video-miniature/video-filters-header.component.ts b/client/src/app/shared/shared-video-miniature/video-filters-header.component.ts
index 08828c6f72..4c92f027ed 100644
--- a/client/src/app/shared/shared-video-miniature/video-filters-header.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-filters-header.component.ts
@@ -1,25 +1,33 @@
-import { NgClass, NgFor, NgIf, NgTemplateOutlet } from '@angular/common'
-import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'
+import { NgClass, NgIf } from '@angular/common'
+import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'
import { RouterLink } from '@angular/router'
-import { AuthService } from '@app/core'
+import { AuthService, RedirectService } from '@app/core'
import { ServerService } from '@app/core/server/server.service'
import { NgbCollapse } from '@ng-bootstrap/ng-bootstrap'
import { UserRight, VideoConstant } from '@peertube/peertube-models'
+import { AttributesOnly } from '@peertube/peertube-typescript-utils'
import debug from 'debug'
-import { Subscription } from 'rxjs'
import { SelectOptionsItem } from 'src/types'
import { PeertubeCheckboxComponent } from '../shared-forms/peertube-checkbox.component'
import { SelectCategoriesComponent } from '../shared-forms/select/select-categories.component'
import { SelectLanguagesComponent } from '../shared-forms/select/select-languages.component'
import { SelectOptionsComponent } from '../shared-forms/select/select-options.component'
-import { GlobalIconComponent } from '../shared-icons/global-icon.component'
-import { PeerTubeTemplateDirective } from '../shared-main/common/peertube-template.directive'
+import { GlobalIconComponent, GlobalIconName } from '../shared-icons/global-icon.component'
+import { InstanceFollowService } from '../shared-instance/instance-follow.service'
+import { ButtonComponent } from '../shared-main/buttons/button.component'
import { PeertubeModalService } from '../shared-main/peertube-modal/peertube-modal.service'
import { VideoFilterActive, VideoFilters } from './video-filters.model'
const debugLogger = debug('peertube:videos:VideoFiltersHeaderComponent')
+type QuickFilter = {
+ iconName: GlobalIconName
+ label: string
+ isActive: () => boolean
+ filters: Partial<AttributesOnly<VideoFilters>>
+}
+
@Component({
selector: 'my-video-filters-header',
styleUrls: [ './video-filters-header.component.scss' ],
@@ -32,17 +40,16 @@ const debugLogger = debug('peertube:videos:VideoFiltersHeaderComponent')
NgClass,
NgIf,
GlobalIconComponent,
- NgFor,
NgbCollapse,
- NgTemplateOutlet,
SelectLanguagesComponent,
SelectCategoriesComponent,
PeertubeCheckboxComponent,
SelectOptionsComponent,
- PeerTubeTemplateDirective
- ]
+ ButtonComponent
+ ],
+ providers: [ InstanceFollowService ]
})
-export class VideoFiltersHeaderComponent implements OnInit, OnDestroy {
+export class VideoFiltersHeaderComponent implements OnInit {
@Input() filters: VideoFilters
@Input() displayModerationBlock = false
@Input() hideScope = false
@@ -54,21 +61,30 @@ export class VideoFiltersHeaderComponent implements OnInit, OnDestroy {
form: FormGroup
sortItems: SelectOptionsItem[] = []
+ availableScopes: SelectOptionsItem[] = []
+
+ quickFilters: QuickFilter[] = []
+
+ instanceName: string
+ totalFollowing: number
private videoCategories: VideoConstant<number>[] = []
private videoLanguages: VideoConstant<string>[] = []
- private routeSub: Subscription
-
constructor (
private auth: AuthService,
private serverService: ServerService,
private fb: FormBuilder,
- private modalService: PeertubeModalService
+ private modalService: PeertubeModalService,
+ private redirectService: RedirectService,
+ private server: ServerService,
+ private followService: InstanceFollowService
) {
}
ngOnInit () {
+ this.instanceName = this.server.getHTMLConfig().instance.name
+
this.form = this.fb.group({
sort: [ '' ],
nsfw: [ '' ],
@@ -98,11 +114,16 @@ export class VideoFiltersHeaderComponent implements OnInit, OnDestroy {
this.serverService.getVideoLanguages()
.subscribe(languages => this.videoLanguages = languages)
- this.buildSortItems()
- }
+ this.followService.getFollowing({ pagination: { count: 1, start: 0 }, state: 'accepted' })
+ .subscribe(({ total }) => this.totalFollowing = total)
- ngOnDestroy () {
- if (this.routeSub) this.routeSub.unsubscribe()
+ this.availableScopes = [
+ { id: 'local', label: $localize`Only videos from this platform` },
+ { id: 'federated', label: $localize`Videos from all platforms` }
+ ]
+
+ this.buildSortItems()
+ this.buildQuickFilters()
}
canSeeAllVideos () {
@@ -112,26 +133,57 @@ export class VideoFiltersHeaderComponent implements OnInit, OnDestroy {
return this.auth.getUser().hasRight(UserRight.SEE_ALL_VIDEOS)
}
+ // ---------------------------------------------------------------------------
+
+ onQuickFilter (e: Event, quickFilter: QuickFilter) {
+ e.preventDefault()
+
+ this.filters.load(quickFilter.filters)
+ this.filtersChanged.emit()
+ }
+
+ private buildQuickFilters () {
+ const trendingSort = this.redirectService.getDefaultTrendingSort()
+
+ this.quickFilters = [
+ {
+ label: $localize`Recently added`,
+ iconName: 'add',
+ isActive: () => this.filters.sort === '-publishedAt',
+ filters: { sort: '-publishedAt' }
+ },
+
+ {
+ label: $localize`Trending`,
+ iconName: 'trending',
+ isActive: () => this.filters.sort === trendingSort,
+ filters: { sort: trendingSort }
+ }
+ ]
+ }
+
+ // ---------------------------------------------------------------------------
+
private buildSortItems () {
this.sortItems = [
- { id: '-publishedAt', label: 'Recently Added' },
- { id: '-originallyPublishedAt', label: 'Original Publication Date' },
- { id: 'name', label: 'Name' }
+ { id: '-publishedAt', label: $localize`Recently Added` },
+ { id: '-originallyPublishedAt', label: $localize`Original Publication Date` },
+ { id: 'name', label: $localize`Name` }
]
if (this.isTrendingSortEnabled('most-viewed')) {
- this.sortItems.push({ id: '-trending', label: 'Recent Views' })
+ this.sortItems.push({ id: '-trending', label: $localize`Recent Views` })
}
if (this.isTrendingSortEnabled('hot')) {
- this.sortItems.push({ id: '-hot', label: 'Hot' })
+ this.sortItems.push({ id: '-hot', label: $localize`Hot` })
}
if (this.isTrendingSortEnabled('most-liked')) {
- this.sortItems.push({ id: '-likes', label: 'Likes' })
+ this.sortItems.push({ id: '-likes', label: $localize`Likes` })
}
- this.sortItems.push({ id: '-views', label: 'Global Views' })
+ this.sortItems.push({ id: '-views', label: $localize`Global Views` })
}
private isTrendingSortEnabled (sort: 'most-viewed' | 'hot' | 'most-liked') {
@@ -140,20 +192,6 @@ export class VideoFiltersHeaderComponent implements OnInit, OnDestroy {
return serverConfig.trending.videos.algorithms.enabled.includes(sort)
}
- resetFilter (key: string, canRemove: boolean) {
- if (!canRemove) return
-
- this.filters.reset(key)
- this.patchForm(false)
- this.filtersChanged.emit()
- }
-
- getFilterTitle (canRemove: boolean) {
- if (canRemove) return $localize`Remove this filter`
-
- return ''
- }
-
getFilterValue (filter: VideoFilterActive) {
if ((filter.key === 'categoryOneOf' || filter.key === 'languageOneOf') && Array.isArray(filter.rawValue)) {
if (filter.rawValue.length > 2) {
diff --git a/client/src/app/shared/shared-video-miniature/video-filters.model.ts b/client/src/app/shared/shared-video-miniature/video-filters.model.ts
index 8c2ddc8a29..c746a1047d 100644
--- a/client/src/app/shared/shared-video-miniature/video-filters.model.ts
+++ b/client/src/app/shared/shared-video-miniature/video-filters.model.ts
@@ -156,8 +156,8 @@ export class VideoFilters {
canRemove: false,
label: $localize`Scope`,
value: this.scope === 'federated'
- ? $localize`Federated`
- : $localize`Local`
+ ? $localize`All platforms`
+ : $localize`This platform`
})
if (this.languageOneOf && this.languageOneOf.length !== 0) {
@@ -192,13 +192,13 @@ export class VideoFilters {
this.activeFilters.push({
key: 'live',
canRemove: true,
- label: $localize`Live videos`
+ label: $localize`Only lives`
})
} else if (this.live === 'false') {
this.activeFilters.push({
key: 'live',
canRemove: true,
- label: $localize`VOD videos`
+ label: $localize`Only VOD`
})
}
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.html b/client/src/app/shared/shared-video-miniature/video-miniature.component.html
index bd2e464949..5057b9d670 100644
--- a/client/src/app/shared/shared-video-miniature/video-miniature.component.html
+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.html
@@ -4,71 +4,75 @@
[video]="video" [nsfw]="isVideoBlur" [videoRouterLink]="videoRouterLink" [videoHref]="videoHref" [videoTarget]="videoTarget"
[displayWatchLaterPlaylist]="isWatchLaterPlaylistDisplayed()" [inWatchLaterPlaylist]="inWatchLaterPlaylist" (watchLaterClick)="onWatchLaterClick($event)"
>
- <ng-container ngProjectAs="label-warning" *ngIf="displayOptions.privacyLabel && isUnlistedVideo()" i18n>Unlisted</ng-container>
- <ng-container ngProjectAs="label-danger" *ngIf="displayOptions.privacyLabel && isPrivateVideo()" i18n>Private</ng-container>
- <ng-container ngProjectAs="label-danger" *ngIf="displayOptions.privacyLabel && isPasswordProtectedVideo()" i18n>Password protected</ng-container>
+ @if (displayOptions.privacyLabel) {
+ <ng-container ngProjectAs="label-warning" *ngIf="isUnlistedVideo()" i18n>Unlisted</ng-container>
+ <ng-container ngProjectAs="label-danger" *ngIf="isPrivateVideo()" i18n>Private</ng-container>
+ <ng-container ngProjectAs="label-danger" *ngIf="isPasswordProtectedVideo()" i18n>Password protected</ng-container>
+ }
</my-video-thumbnail>
<div class="video-bottom">
- <div class="video-miniature-information">
- <div class="d-flex video-miniature-meta">
- <my-actor-avatar
- *ngIf="displayOptions.avatar && displayOwnerVideoChannel() && !displayAsRow" [title]="channelLinkTitle"
- [actor]="video.channel" actorType="channel" [size]="actorImageSize" [internalHref]="[ '/c', video.byVideoChannel ]"
- size="32"
- ></my-actor-avatar>
+ <div class="video-info">
+ <div *ngIf="displayOptions.avatar || displayOptions.by" class="owner min-width-0">
+ @if (displayOptions.avatar) {
- <my-actor-avatar
- *ngIf="displayOptions.avatar && displayOwnerAccount() && !displayAsRow" [title]="channelLinkTitle"
- [actor]="video.account" actorType="channel" [size]="actorImageSize" [internalHref]="[ '/c', video.byVideoChannel ]"
- size="32"
- ></my-actor-avatar>
+ @if (displayOwnerVideoChannel()) {
+ <my-actor-avatar
+ [title]="channelLinkTitle" actorType="channel" [size]="actorImageSize"
+ [actor]="video.channel" [internalHref]="[ '/c', video.byVideoChannel ]"
+ ></my-actor-avatar>
+ } @else if (displayOwnerAccount()) {
+ <my-actor-avatar
+ [title]="channelLinkTitle" actorType="account" [size]="actorImageSize"
+ [actor]="video.account" [internalHref]="[ '/c', video.byVideoChannel ]"
+ ></my-actor-avatar>
+ }
+ }
- <div class="w-100 d-flex flex-column min-width-0">
- <my-link
- [internalLink]="videoRouterLink" [href]="videoHref" [target]="videoTarget" [inheritParentCSS]="true"
- [ariaLabel]="getAriaLabel()"
- [title]="video.name" class="video-miniature-name" className="ellipsis-multiline-2" [ngClass]="{ 'blur-filter': isVideoBlur }"
- >
- {{ video.name }}
- </my-link>
-
- <span class="video-miniature-created-at-views">
- <my-date-toggle *ngIf="displayOptions.date" [date]="video.publishedAt"></my-date-toggle>
-
- <span class="views" [title]="video.getExactNumberOfViews()">
- <ng-container *ngIf="displayOptions.date && displayOptions.views"> • </ng-container>
+ <a *ngIf="displayOptions.by" class="owner-label ellipsis" [routerLink]="[ '/c', video.byVideoChannel ]">
+ @if (displayOwnerAccount()) {
+ {{ authorAccount }}
+ } @else if (displayOwnerVideoChannel()) {
+ {{ authorChannel }}
+ }
+ </a>
+ </div>
- <my-video-views-counter *ngIf="displayOptions.views" [video]="video"></my-video-views-counter>
- </span>
- </span>
+ <my-link
+ [internalLink]="videoRouterLink" [href]="videoHref" [target]="videoTarget" [inheritParentCSS]="true"
+ [ariaLabel]="getAriaLabel()"
+ [title]="video.name" class="video-name" className="ellipsis-multiline-2" [ngClass]="{ 'blur-filter': isVideoBlur }"
+ >
+ {{ video.name }}
+ </my-link>
- <a *ngIf="displayOptions.by" class="video-miniature-account" [routerLink]="[ '/c', video.byVideoChannel ]">
- <ng-container *ngIf="displayOwnerAccount()">{{ authorAccount }}</ng-container>
- <ng-container *ngIf="displayOwnerVideoChannel()">{{ authorChannel }}</ng-container>
- </a>
+ <div class="date-and-views">
+ <my-date-toggle *ngIf="displayOptions.date" [date]="video.publishedAt"></my-date-toggle>
- <div class="video-info-privacy">
- <ng-container *ngIf="displayOptions.privacyText">{{ video.privacy.label }}</ng-container>
- <ng-container *ngIf="displayOptions.privacyText && displayOptions.state && getStateLabel(video)"> - </ng-container>
- <ng-container *ngIf="displayOptions.state">{{ getStateLabel(video) }}</ng-container>
- </div>
+ <span class="views" [title]="video.getExactNumberOfViews()">
+ <ng-container *ngIf="displayOptions.date && displayOptions.views"> • </ng-container>
- <div *ngIf="containedInPlaylists" class="contained-in-playlists">
- <a *ngFor="let playlist of containedInPlaylists" class="pt-badge badge-secondary" [routerLink]="['/w/p/', playlist.playlistShortUUID]">
- {{ playlist.playlistDisplayName }}
- </a>
- </div>
- </div>
+ <my-video-views-counter *ngIf="displayOptions.views" [video]="video"></my-video-views-counter>
+ </span>
</div>
- <div *ngIf="displayOptions.blacklistInfo && video.blacklisted" class="video-info-blocked">
- <span class="blocked-label" i18n>Blocked</span>
- <span class="blocked-reason" *ngIf="video.blacklistedReason">{{ video.blacklistedReason }}</span>
+ <div class="video-info-privacy fw-semibold">
+ <ng-container *ngIf="displayOptions.privacyText">{{ video.privacy.label }}</ng-container>
+ <ng-container *ngIf="displayOptions.privacyText && displayOptions.state && getStateLabel(video)"> - </ng-container>
+ <ng-container *ngIf="displayOptions.state">{{ getStateLabel(video) }}</ng-container>
</div>
- <div i18n *ngIf="displayOptions.nsfw && video.nsfw" class="video-info-nsfw">
- Sensitive
+ <div *ngIf="containedInPlaylists" class="badges">
+ <a *ngFor="let playlist of containedInPlaylists" class="pt-badge badge-secondary" [routerLink]="['/w/p/', playlist.playlistShortUUID]">
+ {{ playlist.playlistDisplayName }}
+ </a>
+
+ <span *ngIf="displayOptions.blacklistInfo && video.blacklisted" class="pt-badge badge-danger video-info-blocked">
+ <span class="fw-semibold" i18n>Blocked</span>
+ <span *ngIf="video.blacklistedReason"> - {{ video.blacklistedReason }}</span>
+ </span>
+
+ <span i18n *ngIf="displayOptions.nsfw && video.nsfw" class="pt-badge badge-danger video-info-nsfw">Sensitive</span>
</div>
</div>
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.scss b/client/src/app/shared/shared-video-miniature/video-miniature.component.scss
index c5367155a5..bd698cb405 100644
--- a/client/src/app/shared/shared-video-miniature/video-miniature.component.scss
+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.scss
@@ -5,57 +5,51 @@
$more-button-width: 40px;
.video-miniature {
- font-size: 14px;
+ --co-fs-small: #{$miniature-fs-small};
+ --co-fs-medium: #{$miniature-fs-medium};
+ --co-fs-big: #{$miniature-fs-big};
}
-.video-miniature-name {
+.video-name {
+ font-size: var(--co-fs-big);
+
@include miniature-name;
}
-.video-miniature-information {
+.video-info {
width: calc(100% - #{$more-button-width});
+
+ display: grid;
+}
+
+.owner {
+ display: flex;
+ position: relative;
+ font-size: var(--co-fs-medium);
}
-my-actor-avatar {
- @include margin(10px, 10px, 0, 0);
+.date-and-views,
+.video-info-privacy,
+.badges {
+ font-size: var(--co-fs-small);
}
-.video-miniature-created-at-views {
- font-size: 13px;
+.date-and-views {
+ color: pvar(--fg-200);
}
-.video-miniature-account,
-.video-miniature-channel {
+.owner-label {
display: block;
- font-size: 13px;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
@include disable-default-a-behaviour;
@include ellipsis;
&:hover {
- color: $grey-foreground-hover-color;
+ color: pvar(--fg);
}
}
-.video-info-privacy,
-.video-info-blocked .blocked-label,
-.video-info-nsfw {
- font-weight: $font-semibold;
-}
-
-.video-info-blocked {
- color: #ff0000;
-
- .blocked-reason::before {
- content: ' - ';
- }
-}
-
-.video-info-nsfw {
- color: #ff0000;
-}
-
.video-actions {
width: $more-button-width;
height: 30px;
@@ -85,31 +79,59 @@ my-actor-avatar {
}
}
+.video-bottom {
+ display: flex;
+ min-width: 1px;
+}
+
// Grid mode
// Takes all the width on mobile
.video-miniature:not(.display-as-row) {
display: flex;
flex-direction: column;
- padding-bottom: $video-miniature-margin-bottom;
+ padding-bottom: 1rem;
width: 100%;
my-video-thumbnail {
+ margin-bottom: 0.35rem;
+
@include block-ratio($selector: '::ng-deep .video-thumbnail');
}
.video-bottom {
- display: flex;
width: 100%;
- min-width: 1px;
}
- .video-miniature-name {
- margin-top: 10px;
- margin-bottom: 5px;
+ &.has-avatar .video-bottom {
+ @include padding-left(0.75rem);
}
- .video-miniature-created-at-views {
- display: block;
+ my-actor-avatar {
+ border: 2px solid pvar(--bg);
+ position: absolute;
+ top: -20px;
+ background: pvar(--bg);
+
+ @include left(-2px);
+
+ &[actorType=account] {
+ // TODO: use SASS var in sync with thumbnail component
+ border-radius: 100%;
+ }
+
+ &[actorType=channel] {
+ // TODO: use SASS var in sync with thumbnail component
+ border-radius: 5px;
+ }
+
+ & + .owner-label {
+ // Keep 34px in sync with the component
+ @include margin-left(calc(0.5rem + 34px));
+ }
+ }
+
+ .date-and-views {
+ margin-top: 3px;
}
.video-actions {
@@ -120,7 +142,7 @@ my-actor-avatar {
width: 100%;
margin-bottom: 25px;
- .video-miniature-information {
+ .video-info {
margin: 0 10px;
width: 100%;
@@ -144,38 +166,46 @@ my-actor-avatar {
}
.video-miniature.display-as-row {
- --rowThumbnailWidth: #{$video-thumbnail-width};
- --rowThumbnailHeight: #{$video-thumbnail-height};
+ --co-fs-small: #{$miniature-fs-row-small};
+ --co-fs-medium: #{$miniature-fs-row-medium};
+ --co-fs-big: #{$miniature-fs-row-big};
+
+ --co-row-thumbnail-width: #{$video-thumbnail-width};
+ --co-row-thumbnail-height: #{$video-thumbnail-height};
display: flex;
flex-direction: row;
- .video-bottom {
- display: flex;
- min-width: 1px;
+ my-video-thumbnail {
+ min-width: var(--co-row-thumbnail-width);
+ max-width: var(--co-row-thumbnail-width);
+ height: var(--co-row-thumbnail-height);
+
+ @include margin-right(1rem);
}
- // We don't display avatar in row mode
- .channel-avatar {
- display: none;
+ .video-info {
+ grid-template-rows: auto;
+ height: min-content;
}
- my-video-thumbnail {
- min-width: var(--rowThumbnailWidth);
- max-width: var(--rowThumbnailWidth);
- height: var(--rowThumbnailHeight);
+ .video-name {
+ grid-row: 1;
+ }
- @include margin-right(1rem);
+ .date-and-views {
+ grid-row: 2;
}
- .video-miniature-name {
- font-size: $video-miniature-row-name-font-size;
+ .owner {
+ grid-row: 3;
+ align-items: center;
+ margin-top: 0.5rem;
+ margin-bottom: 0.5rem;
}
- .video-miniature-created-at-views,
- .video-miniature-account,
- .video-miniature-channel {
- font-size: $video-miniature-row-info-font-size;
+ my-actor-avatar {
+ @include margin-right(0.5rem);
}
.video-actions {
@@ -183,34 +213,32 @@ my-actor-avatar {
}
}
-.contained-in-playlists {
+.badges {
display: flex;
flex-wrap: wrap;
- column-gap: 5px;
- row-gap: 5px;
+ gap: 5px;
font-size: 1rem;
+ margin-top: 0.25rem;
}
@include on-small-main-col {
.video-miniature.display-as-row {
- --rowThumbnailWidth: #{$video-thumbnail-medium-width};
- --rowThumbnailHeight: #{$video-thumbnail-medium-height};
+ --co-row-thumbnail-width: #{$video-thumbnail-medium-width};
+ --co-row-thumbnail-height: #{$video-thumbnail-medium-height};
}
}
@include on-mobile-main-col {
.video-miniature.display-as-row {
- --rowThumbnailWidth: #{$video-thumbnail-small-width};
- --rowThumbnailHeight: #{$video-thumbnail-small-height};
+ --co-row-thumbnail-width: #{$video-thumbnail-small-width};
+ --co-row-thumbnail-height: #{$video-thumbnail-small-height};
- .video-miniature-name {
- font-size: $video-miniature-row-info-font-size;
- }
+ --co-fs-small: #{$miniature-fs-mobile-small};
+ --co-fs-medium: #{$miniature-fs-mobile-medium};
+ --co-fs-big: #{$miniature-fs-mobile-big};
- .video-miniature-created-at-views,
- .video-miniature-account,
- .video-miniature-channel {
- font-size: $video-miniature-row-mobile-info-font-size;
+ my-actor-avatar {
+ display: none;
}
}
}
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts
index fa3563a74d..2b220e3079 100644
--- a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts
@@ -1,4 +1,4 @@
-import { switchMap } from 'rxjs/operators'
+import { NgClass, NgFor, NgIf } from '@angular/common'
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
@@ -9,22 +9,23 @@ import {
LOCALE_ID,
OnInit,
Output,
+ booleanAttribute,
numberAttribute
} from '@angular/core'
+import { RouterLink } from '@angular/router'
import { AuthService, ScreenService, ServerService, User } from '@app/core'
import { HTMLServerConfig, VideoExistInPlaylist, VideoPlaylistType, VideoPrivacy, VideoState } from '@peertube/peertube-models'
+import { switchMap } from 'rxjs/operators'
import { LinkType } from '../../../types/link.type'
-import { VideoActionsDisplayType, VideoActionsDropdownComponent } from './video-actions-dropdown.component'
-import { RouterLink } from '@angular/router'
-import { VideoViewsCounterComponent } from '../shared-video/video-views-counter.component'
-import { DateToggleComponent } from '../shared-main/date/date-toggle.component'
-import { LinkComponent } from '../shared-main/common/link.component'
import { ActorAvatarComponent } from '../shared-actor-image/actor-avatar.component'
-import { VideoThumbnailComponent } from '../shared-thumbnail/video-thumbnail.component'
-import { NgClass, NgIf, NgFor } from '@angular/common'
+import { LinkComponent } from '../shared-main/common/link.component'
+import { DateToggleComponent } from '../shared-main/date/date-toggle.component'
import { Video } from '../shared-main/video/video.model'
import { VideoService } from '../shared-main/video/video.service'
+import { VideoThumbnailComponent } from '../shared-thumbnail/video-thumbnail.component'
import { VideoPlaylistService } from '../shared-video-playlist/video-playlist.service'
+import { VideoViewsCounterComponent } from '../shared-video/video-views-counter.component'
+import { VideoActionsDisplayType, VideoActionsDropdownComponent } from './video-actions-dropdown.component'
export type MiniatureDisplayOptions = {
date?: boolean
@@ -67,7 +68,7 @@ export class VideoMiniatureComponent implements OnInit {
date: true,
views: true,
by: true,
- avatar: false,
+ avatar: true,
privacyLabel: false,
privacyText: false,
state: false,
@@ -89,9 +90,9 @@ export class VideoMiniatureComponent implements OnInit {
stats: false
}
- @Input({ transform: numberAttribute }) actorImageSize = 40
+ @Input({ transform: numberAttribute }) actorImageSize = 34
- @Input() displayAsRow = false
+ @Input({ transform: booleanAttribute }) displayAsRow = false
@Input() videoLinkType: LinkType = 'internal'
@@ -304,7 +305,8 @@ export class VideoMiniatureComponent implements OnInit {
getClasses () {
return {
- 'display-as-row': this.displayAsRow
+ 'display-as-row': this.displayAsRow,
+ 'has-avatar': this.displayOptions.avatar
}
}
diff --git a/client/src/app/shared/shared-video-miniature/videos-list.component.html b/client/src/app/shared/shared-video-miniature/videos-list.component.html
index e6f735e7c6..237a62446c 100644
--- a/client/src/app/shared/shared-video-miniature/videos-list.component.html
+++ b/client/src/app/shared/shared-video-miniature/videos-list.component.html
@@ -1,40 +1,17 @@
<div class="margin-content">
- <div class="videos-header pt-4 mb-4">
- <h1 *ngIf="displayTitle" class="title mb-1" placement="bottom" [ngbTooltip]="titleTooltip" container="body">
- {{ title }}
- </h1>
-
- <div [ngClass]="{ 'no-title': !displayTitle, invisible: !syndicationItems || syndicationItems.length === 0 }" class="title-subscription">
- <ng-container i18n>Subscribe to RSS feed "{{ title }}"</ng-container>
-
- <my-feed [syndicationItems]="syndicationItems"></my-feed>
- </div>
-
- <div *ngIf="headerActions.length !== 0" class="action-block mt-3">
+ <div class="videos-header">
+ <div *ngIf="headerActions.length !== 0" class="action-block mb-4">
<ng-container *ngFor="let action of headerActions">
- <a *ngIf="action.routerLink" class="ms-2" [routerLink]="action.routerLink" routerLinkActive="active">
- <ng-container *ngTemplateOutlet="actionContent; context:{ $implicit: action }"></ng-container>
- </a>
-
- <button *ngIf="!action.routerLink && !action.href && action.click" class="ms-2 button-unstyle" (click)="action.click($event)" (key.enter)="action.click($event)">
- <ng-container *ngTemplateOutlet="actionContent; context:{ $implicit: action }"></ng-container>
- </button>
-
- <a *ngIf="!action.routerLink && action.href && action.click" class="ms-2" (click)="action.click($event)" (key.enter)="action.click($event)" [href]="action.href">
- <ng-container *ngTemplateOutlet="actionContent; context:{ $implicit: action }"></ng-container>
- </a>
-
- <ng-template #actionContent let-action>
- <my-button *ngIf="!action.justIcon" [icon]="action.iconName" [label]="action.label"></my-button>
- <my-button *ngIf="action.justIcon" [icon]="action.iconName" [ngbTooltip]="action.label"></my-button>
- </ng-template>
+ @if (action.routerLink) {
+ <my-button theme="secondary" [ptRouterLink]="action.routerLink" [icon]="action.iconName">{{ action.label }}</my-button>
+ }
</ng-container>
</div>
</div>
<my-video-filters-header
- *ngIf="displayFilters" [displayModerationBlock]="displayModerationBlock" [hideScope]="hideScopeFilter"
- [filters]="filters"
+ *ngIf="displayFilters" class="d-block"
+ [displayModerationBlock]="displayModerationBlock" [hideScope]="hideScopeFilter" [filters]="filters"
(filtersChanged)="onFiltersChanged(true)"
></my-video-filters-header>
diff --git a/client/src/app/shared/shared-video-miniature/videos-list.component.scss b/client/src/app/shared/shared-video-miniature/videos-list.component.scss
index dcbe4fd5b2..4aef322ab1 100644
--- a/client/src/app/shared/shared-video-miniature/videos-list.component.scss
+++ b/client/src/app/shared/shared-video-miniature/videos-list.component.scss
@@ -10,42 +10,10 @@ $margin-top: 2rem;
display: grid;
grid-template-columns: auto 1fr auto;
- .title,
- .title-subscription {
- grid-column: 1;
- }
-
- .title {
- font-size: 18px;
- color: pvar(--mainForegroundColor);
- display: inline-block;
- font-weight: $font-semibold;
- }
-
- .title-subscription {
- grid-row: 2;
- font-size: 14px;
- color: pvar(--greyForegroundColor);
-
- &.no-title {
- margin-top: 10px;
- }
- }
-
.action-block {
grid-column: 3;
grid-row: 1/3;
}
-
- my-feed {
- display: inline-block;
- width: 16px;
- color: pvar(--mainColor);
- position: relative;
- top: -2px;
-
- @include margin-left(5px);
- }
}
.date-title {
@@ -68,8 +36,8 @@ $margin-top: 2rem;
}
.display-as-row.videos {
- @include margin-left(pvar(--horizontalMarginContent));
- @include margin-right(pvar(--horizontalMarginContent));
+ @include margin-left(pvar(--x-margin-content));
+ @include margin-right(pvar(--x-margin-content));
.video-wrapper {
margin-bottom: 1rem;
diff --git a/client/src/app/shared/shared-video-miniature/videos-list.component.ts b/client/src/app/shared/shared-video-miniature/videos-list.component.ts
index 14db74ed9f..1f6845dda1 100644
--- a/client/src/app/shared/shared-video-miniature/videos-list.component.ts
+++ b/client/src/app/shared/shared-video-miniature/videos-list.component.ts
@@ -1,27 +1,24 @@
-import { NgClass, NgFor, NgIf, NgTemplateOutlet } from '@angular/common'
+import { NgClass, NgFor, NgIf } from '@angular/common'
import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, booleanAttribute } from '@angular/core'
-import { ActivatedRoute, RouterLink, RouterLinkActive } from '@angular/router'
+import { ActivatedRoute } from '@angular/router'
import {
AuthService,
ComponentPaginationLight,
Notifier,
PeerTubeRouterService,
ScreenService,
- ServerService,
User,
UserService
} from '@app/core'
import { GlobalIconComponent, GlobalIconName } from '@app/shared/shared-icons/global-icon.component'
-import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'
import { isLastMonth, isLastWeek, isThisMonth, isToday, isYesterday } from '@peertube/peertube-core-utils'
import { ResultList, UserRight, VideoSortField } from '@peertube/peertube-models'
import { logger } from '@root-helpers/logger'
import debug from 'debug'
import { Observable, Subject, Subscription, forkJoin, fromEvent, of } from 'rxjs'
import { concatMap, debounceTime, map, switchMap } from 'rxjs/operators'
-import { InfiniteScrollerDirective } from '../shared-main/common/infinite-scroller.directive'
import { ButtonComponent } from '../shared-main/buttons/button.component'
-import { FeedComponent } from '../shared-main/feeds/feed.component'
+import { InfiniteScrollerDirective } from '../shared-main/common/infinite-scroller.directive'
import { Syndication } from '../shared-main/feeds/syndication.model'
import { Video } from '../shared-main/video/video.model'
import { VideoFiltersHeaderComponent } from './video-filters-header.component'
@@ -33,10 +30,7 @@ const debugLogger = debug('peertube:videos:VideosListComponent')
export type HeaderAction = {
iconName: GlobalIconName
label: string
- justIcon?: boolean
routerLink?: string
- href?: string
- click?: (e: Event) => void
}
enum GroupDate {
@@ -56,13 +50,9 @@ enum GroupDate {
standalone: true,
imports: [
NgIf,
- NgbTooltip,
NgClass,
- FeedComponent,
NgFor,
- RouterLinkActive,
- RouterLink,
- NgTemplateOutlet,
+ ButtonComponent,
ButtonComponent,
VideoFiltersHeaderComponent,
InfiniteScrollerDirective,
@@ -73,11 +63,6 @@ enum GroupDate {
export class VideosListComponent implements OnInit, OnChanges, OnDestroy {
@Input() getVideosObservableFunction: (pagination: ComponentPaginationLight, filters: VideoFilters) => Observable<ResultList<Video>>
@Input() getSyndicationItemsFunction: (filters: VideoFilters) => Promise<Syndication[]> | Syndication[]
- @Input() baseRouteBuilderFunction: (filters: VideoFilters) => string[]
-
- @Input() title: string
- @Input() titleTooltip: string
- @Input({ transform: booleanAttribute }) displayTitle = true
@Input() defaultSort: VideoSortField
@Input() defaultScope: VideoFilterScope = 'federated'
@@ -117,7 +102,7 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy {
date: true,
views: true,
by: true,
- avatar: false,
+ avatar: true,
privacyLabel: true,
privacyText: false,
state: false,
@@ -151,8 +136,7 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy {
private userService: UserService,
private route: ActivatedRoute,
private screenService: ScreenService,
- private peertubeRouter: PeerTubeRouterService,
- private serverService: ServerService
+ private peertubeRouter: PeerTubeRouterService
) {
}
@@ -213,8 +197,8 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy {
if (changes['displayOptions'] || !this.displayOptions) {
this.displayOptions = {
...this.defaultDisplayOptions,
- avatar: this.serverService.getHTMLConfig().client.videos.miniature.displayAuthorAvatar,
- ...changes['displayOptions']
+
+ ...(changes['displayOptions']?.currentValue ?? {})
}
}
@@ -426,18 +410,8 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy {
debugLogger('Will inject %O in URL query', queryParams)
- const baseRoute = this.baseRouteBuilderFunction
- ? this.baseRouteBuilderFunction(this.filters)
- : []
-
- const pathname = window.location.pathname
-
- const baseRouteChanged = baseRoute.length !== 0 &&
- pathname !== '/' && // Exclude special '/' case, we'll be redirected without component change
- baseRoute.length !== 0 && pathname !== baseRoute.join('/')
-
- if (baseRouteChanged || Object.keys(baseQuery).length !== 0 || customizedByUser) {
- this.peertubeRouter.silentNavigate(baseRoute, queryParams)
+ if (Object.keys(baseQuery).length !== 0 || customizedByUser) {
+ this.peertubeRouter.silentNavigate([], queryParams)
}
this.filtersChanged.emit(this.filters)
diff --git a/client/src/app/shared/shared-video-miniature/videos-selection.component.html b/client/src/app/shared/shared-video-miniature/videos-selection.component.html
index 8931158a95..8ea03b127f 100644
--- a/client/src/app/shared/shared-video-miniature/videos-selection.component.html
+++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.html
@@ -20,7 +20,7 @@
<!-- Display only once -->
<div class="action-selection-mode" *ngIf="isInSelectionMode() === true && i === 0">
<div class="action-selection-mode-child">
- <button i18n class="action-button action-button-cancel-selection" (click)="abortSelectionMode()">
+ <button i18n class="cancel-selection peertube-button secondary-button me-2" (click)="abortSelectionMode()">
Cancel
</button>
diff --git a/client/src/app/shared/shared-video-miniature/videos-selection.component.scss b/client/src/app/shared/shared-video-miniature/videos-selection.component.scss
index 7912412921..ea6df643c4 100644
--- a/client/src/app/shared/shared-video-miniature/videos-selection.component.scss
+++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.scss
@@ -18,11 +18,6 @@
}
}
-.action-button-cancel-selection {
- @include peertube-button;
- @include grey-button;
-}
-
.video {
@include row-blocks($column-responsive: false);
diff --git a/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.html b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.html
index 8000f9b6bb..9270d1365b 100644
--- a/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.html
+++ b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.html
@@ -44,6 +44,7 @@
></my-peertube-checkbox>
<my-timestamp-input
+ class="me-2"
[maxTimestamp]="video.duration"
[(ngModel)]="element.startTimestamp"
(inputBlur)="onElementTimestampUpdate(playlist, element)"
@@ -79,6 +80,6 @@
</div>
</div>
- <input type="submit" i18n-value value="Create" [disabled]="!form.valid">
+ <input type="submit" class="peertube-button primary-button" i18n-value value="Create" [disabled]="!form.valid">
</form>
</div>
diff --git a/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.scss b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.scss
index 83e36f0714..e2afee7a8a 100644
--- a/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.scss
+++ b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.scss
@@ -1,8 +1,9 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
my-timestamp-input {
- width: 60px;
+ width: 100px;
}
.header,
@@ -32,7 +33,7 @@ my-timestamp-input {
}
.playlists {
- max-height: 180px;
+ max-height: 200px;
overflow-y: auto;
}
@@ -84,8 +85,8 @@ my-timestamp-input {
top: 1px;
width: 19px;
height: 19px;
+ color: pvar(--fg-400);
- @include apply-svg-color(#333);
@include margin-right(0);
}
@@ -97,7 +98,7 @@ my-timestamp-input {
.optional-rows {
display: grid;
- grid-template-columns: 35px 80px 80px;
+ grid-template-columns: 35px 105px 105px;
row-gap: 3px;
column-gap: 10px;
align-items: center;
@@ -108,7 +109,7 @@ my-timestamp-input {
.header-label {
font-size: 13px;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
padding-left: 2px;
&:nth-child(1) {
@@ -136,17 +137,14 @@ my-timestamp-input {
top: -1px;
width: 21px;
height: 21px;
+ line-height: 21px;
+ display: inline-block;
+ color: pvar(--fg-400);
- @include apply-svg-color(#333);
- @include margin-right(4px);
+ @include margin-right(13px);
}
}
input[type=text] {
@include peertube-input-text(200px);
}
-
-input[type=submit] {
- @include peertube-button;
- @include orange-button;
-}
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html
index 258710a8e7..d238bd4614 100644
--- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html
+++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html
@@ -25,7 +25,7 @@
<span i18n *ngIf="isVideoPasswordProtected()" class="pt-badge badge-yellow">Password protected</span>
</div>
- <span class="video-miniature-created-at-views">
+ <span class="date-and-views">
<my-date-toggle [date]="playlistElement.video.publishedAt"></my-date-toggle>
<span class="views" [title]="playlistElement.video.getExactNumberOfViews()">
@@ -97,7 +97,7 @@
></my-timestamp-input>
</div>
- <input type="submit" i18n-value value="Save" (click)="updateTimestamps(playlistElement)">
+ <input class="peertube-button primary-button mt-2" type="submit" i18n-value value="Save" (click)="updateTimestamps(playlistElement)">
</div>
</ng-container>
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss
index 04383a70cf..359f13871f 100644
--- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss
+++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss
@@ -6,7 +6,7 @@ $thumbnail-width: 130px;
$thumbnail-height: 72px;
my-timestamp-input {
- width: 85px;
+ width: 100px;
}
my-video-thumbnail {
@@ -29,7 +29,7 @@ my-video-thumbnail,
.video {
display: grid;
grid-template-columns: 1fr auto;
- background-color: pvar(--mainBackgroundColor);
+ background-color: pvar(--bg);
padding: 10px;
border-bottom: 1px solid $separator-border-color;
@@ -38,12 +38,13 @@ my-video-thumbnail,
}
a {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
@include disable-default-a-behaviour;
}
> a {
+ grid-row: 1 / 3;
display: flex;
min-width: 0;
align-items: center;
@@ -51,15 +52,14 @@ my-video-thumbnail,
.position {
font-weight: $font-semibold;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
min-width: 25px;
my-global-icon {
width: 17px;
position: relative;
left: -2px;
-
- @include apply-svg-color(pvar(--greyForegroundColor));
+ color: pvar(--fg-300);
}
}
}
@@ -86,7 +86,7 @@ my-video-thumbnail,
}
my-global-icon {
- @include apply-svg-color(pvar(--greyForegroundColor));
+ color: pvar(--fg-300);
}
}
@@ -140,13 +140,13 @@ my-video-thumbnail,
.video-info-owner,
.video-info-timestamp {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
}
}
.video-info-owner,
.video-info-timestamp,
-.video-miniature-created-at-views {
+.date-and-views {
font-size: 14px;
}
@@ -174,13 +174,6 @@ my-video-thumbnail,
my-peertube-checkbox {
@include margin-right(5px);
}
-
- input {
- margin-top: 10px;
-
- @include peertube-button;
- @include orange-button;
- }
}
}
@@ -231,37 +224,10 @@ my-video-thumbnail,
}
@media screen and (min-width: $small-view) {
- :host-context(.expanded) {
- @include more-dropdown-control();
- }
-}
-
-@media screen and (max-width: $small-view) {
- :host-context(.expanded) {
- @include edit-button-control();
- }
+ @include more-dropdown-control();
+ @include edit-button-control();
}
@media screen and (max-width: $mobile-view) {
- :host-context(.expanded) {
- @include edit-button-in-mobile-view();
- }
-}
-
-@media screen and (min-width: #{$small-view + $menu-width}) {
- :host-context(.main-col:not(.expanded)) {
- @include more-dropdown-control();
- }
-}
-
-@media screen and (max-width: #{$small-view + $menu-width}) {
- :host-context(.main-col:not(.expanded)) {
- @include edit-button-control();
- }
-}
-
-@media screen and (max-width: #{$mobile-view + $menu-width}) {
- :host-context(.main-col:not(.expanded)) {
- @include edit-button-in-mobile-view();
- }
+ @include edit-button-in-mobile-view();
}
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.scss b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.scss
index c9a6427c84..79743babe2 100644
--- a/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.scss
+++ b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.scss
@@ -49,14 +49,15 @@
.by {
display: block;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
@include disable-default-a-behaviour;
}
.privacy-date {
margin-top: 5px;
- font-size: 14px;
+ color: pvar(--fg-200);
+ font-size: $miniature-fs-small;
.privacy {
font-weight: $font-semibold;
@@ -70,7 +71,7 @@
.description {
margin-top: 10px;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
@include peertube-word-wrap;
}
@@ -79,6 +80,7 @@
.miniature:not(.display-as-row) {
.miniature-name {
+ font-size: $miniature-fs-big;
margin-top: 10px;
margin-bottom: 5px;
}
@@ -92,19 +94,23 @@
}
.miniature.display-as-row {
- --rowThumbnailWidth: #{$video-thumbnail-width};
- --rowThumbnailHeight: #{$video-thumbnail-height};
+ --co-row-thumbnail-width: #{$video-thumbnail-width};
+ --co-row-thumbnail-height: #{$video-thumbnail-height};
display: flex;
.miniature-name {
- font-size: $video-miniature-row-name-font-size;
+ font-size: $miniature-fs-row-big;
+ }
+
+ .privacy-date {
+ font-size: $miniature-fs-row-small;
}
.miniature-thumbnail {
- min-width: var(--rowThumbnailWidth);
- max-width: var(--rowThumbnailWidth);
- height: var(--rowThumbnailHeight);
+ min-width: var(--co-row-thumbnail-width);
+ max-width: var(--co-row-thumbnail-width);
+ height: var(--co-row-thumbnail-height);
@include margin-right(1rem);
}
@@ -112,14 +118,22 @@
@include on-small-main-col {
.miniature.display-as-row {
- --rowThumbnailWidth: #{$video-thumbnail-medium-width};
- --rowThumbnailHeight: #{$video-thumbnail-medium-height};
+ --co-row-thumbnail-width: #{$video-thumbnail-medium-width};
+ --co-row-thumbnail-height: #{$video-thumbnail-medium-height};
}
}
@include on-mobile-main-col {
.miniature.display-as-row {
- --rowThumbnailWidth: #{$video-thumbnail-small-width};
- --rowThumbnailHeight: #{$video-thumbnail-small-height};
+ --co-row-thumbnail-width: #{$video-thumbnail-small-width};
+ --co-row-thumbnail-height: #{$video-thumbnail-small-height};
+
+ .miniature-name {
+ font-size: $miniature-fs-mobile-big;
+ }
+
+ .privacy-date {
+ font-size: $miniature-fs-mobile-small;
+ }
}
}
diff --git a/client/src/app/+manage/video-channel-edit/video-channel-create.component.ts b/client/src/app/shared/standalone-channels/video-channel-create.component.ts
similarity index 89%
rename from client/src/app/+manage/video-channel-edit/video-channel-create.component.ts
rename to client/src/app/shared/standalone-channels/video-channel-create.component.ts
index b5878fa12c..fe6b3e874f 100644
--- a/client/src/app/+manage/video-channel-edit/video-channel-create.component.ts
+++ b/client/src/app/shared/standalone-channels/video-channel-create.component.ts
@@ -16,11 +16,11 @@ import { AlertComponent } from '@app/shared/shared-main/common/alert.component'
import { HttpStatusCode, VideoChannelCreate } from '@peertube/peertube-models'
import { of } from 'rxjs'
import { switchMap } from 'rxjs/operators'
-import { ActorAvatarEditComponent } from '../../shared/shared-actor-image-edit/actor-avatar-edit.component'
-import { ActorBannerEditComponent } from '../../shared/shared-actor-image-edit/actor-banner-edit.component'
-import { MarkdownTextareaComponent } from '../../shared/shared-forms/markdown-textarea.component'
-import { PeertubeCheckboxComponent } from '../../shared/shared-forms/peertube-checkbox.component'
-import { HelpComponent } from '../../shared/shared-main/buttons/help.component'
+import { ActorAvatarEditComponent } from '../shared-actor-image-edit/actor-avatar-edit.component'
+import { ActorBannerEditComponent } from '../shared-actor-image-edit/actor-banner-edit.component'
+import { MarkdownTextareaComponent } from '../shared-forms/markdown-textarea.component'
+import { PeertubeCheckboxComponent } from '../shared-forms/peertube-checkbox.component'
+import { HelpComponent } from '../shared-main/buttons/help.component'
import { VideoChannelEdit } from './video-channel-edit'
@Component({
diff --git a/client/src/app/+manage/video-channel-edit/video-channel-edit.component.html b/client/src/app/shared/standalone-channels/video-channel-edit.component.html
similarity index 95%
rename from client/src/app/+manage/video-channel-edit/video-channel-edit.component.html
rename to client/src/app/shared/standalone-channels/video-channel-edit.component.html
index 529a2b8a25..1ebf4e5a6a 100644
--- a/client/src/app/+manage/video-channel-edit/video-channel-edit.component.html
+++ b/client/src/app/shared/standalone-channels/video-channel-edit.component.html
@@ -1,6 +1,6 @@
<my-alert *ngIf="error" type="danger">{{ error }}</my-alert>
-<div class="margin-content pt-4">
+<div class="pt-4">
<form (ngSubmit)="formValidated()" [formGroup]="form">
<div class="pt-two-cols"> <!-- channel grid -->
@@ -82,7 +82,7 @@
></my-peertube-checkbox>
</div>
- <input type="submit" class="peertube-button orange-button mt-4" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
+ <input type="submit" class="peertube-button primary-button mt-4" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
</div>
</div>
</form>
diff --git a/client/src/app/+manage/video-channel-edit/video-channel-edit.component.scss b/client/src/app/shared/standalone-channels/video-channel-edit.component.scss
similarity index 93%
rename from client/src/app/+manage/video-channel-edit/video-channel-edit.component.scss
rename to client/src/app/shared/standalone-channels/video-channel-edit.component.scss
index 2bd74bda4f..c0308366c3 100644
--- a/client/src/app/+manage/video-channel-edit/video-channel-edit.component.scss
+++ b/client/src/app/shared/standalone-channels/video-channel-edit.component.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
my-actor-banner-edit {
max-width: 500px;
diff --git a/client/src/app/+manage/video-channel-edit/video-channel-edit.ts b/client/src/app/shared/standalone-channels/video-channel-edit.ts
similarity index 100%
rename from client/src/app/+manage/video-channel-edit/video-channel-edit.ts
rename to client/src/app/shared/standalone-channels/video-channel-edit.ts
diff --git a/client/src/app/+manage/video-channel-edit/video-channel-update.component.ts b/client/src/app/shared/standalone-channels/video-channel-update.component.ts
similarity index 93%
rename from client/src/app/+manage/video-channel-edit/video-channel-update.component.ts
rename to client/src/app/shared/standalone-channels/video-channel-update.component.ts
index 3e63d31743..e7a0424f29 100644
--- a/client/src/app/+manage/video-channel-edit/video-channel-update.component.ts
+++ b/client/src/app/shared/standalone-channels/video-channel-update.component.ts
@@ -16,11 +16,11 @@ import { AlertComponent } from '@app/shared/shared-main/common/alert.component'
import { shallowCopy } from '@peertube/peertube-core-utils'
import { VideoChannelUpdate } from '@peertube/peertube-models'
import { Subscription } from 'rxjs'
-import { ActorAvatarEditComponent } from '../../shared/shared-actor-image-edit/actor-avatar-edit.component'
-import { ActorBannerEditComponent } from '../../shared/shared-actor-image-edit/actor-banner-edit.component'
-import { MarkdownTextareaComponent } from '../../shared/shared-forms/markdown-textarea.component'
-import { PeertubeCheckboxComponent } from '../../shared/shared-forms/peertube-checkbox.component'
-import { HelpComponent } from '../../shared/shared-main/buttons/help.component'
+import { ActorAvatarEditComponent } from '../shared-actor-image-edit/actor-avatar-edit.component'
+import { ActorBannerEditComponent } from '../shared-actor-image-edit/actor-banner-edit.component'
+import { MarkdownTextareaComponent } from '../shared-forms/markdown-textarea.component'
+import { PeertubeCheckboxComponent } from '../shared-forms/peertube-checkbox.component'
+import { HelpComponent } from '../shared-main/buttons/help.component'
import { VideoChannelEdit } from './video-channel-edit'
@Component({
diff --git a/client/src/app/shared/standalone-notifications/user-notifications.component.scss b/client/src/app/shared/standalone-notifications/user-notifications.component.scss
index ac1580540e..18f65878fc 100644
--- a/client/src/app/shared/standalone-notifications/user-notifications.component.scss
+++ b/client/src/app/shared/standalone-notifications/user-notifications.component.scss
@@ -13,17 +13,22 @@
align-items: center;
font-size: inherit;
padding: 15px 5px 15px 10px;
- border-bottom: 1px solid $separator-border-color;
+ border-bottom: 1px solid $separator-border-color-on-secondary;
word-break: break-word;
&.unread {
- background-color: rgba(0, 0, 0, 0.05);
+ background-color: pvar(--bg-secondary-400);
+ cursor: pointer;
+ }
+
+ &:hover {
+ background-color: pvar(--bg-secondary-350);
}
my-global-icon {
width: 24px;
+ color: pvar(--secondary-icon-color);
- @include apply-svg-color(#{pvar(--mainForegroundColor)});
@include margin-right(11px);
@include margin-left(3px);
}
@@ -43,12 +48,13 @@
a {
font-weight: $font-semibold;
+ text-decoration: underline;
}
}
.from-date {
font-size: 0.85em;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
min-width: 70px;
text-align: end;
diff --git a/client/src/app/shared/standalone-upload/upload-progress.component.html b/client/src/app/shared/standalone-upload/upload-progress.component.html
index 0c55d1e9f1..f96324d297 100644
--- a/client/src/app/shared/standalone-upload/upload-progress.component.html
+++ b/client/src/app/shared/standalone-upload/upload-progress.component.html
@@ -8,7 +8,7 @@
<input
*ngIf="uploaded === false"
- type="button" class="peertube-button grey-button ms-1" i18n-value="Cancel ongoing upload" value="Cancel" (click)="cancel.emit()"
+ type="button" class="peertube-button secondary-button ms-1" i18n-value="Cancel ongoing upload" value="Cancel" (click)="cancel.emit()"
/>
</div>
@@ -19,8 +19,8 @@
>
</my-progress-bar>
- <input type="button" class="peertube-button grey-button ms-1" i18n-value="Retry failed upload" value="Retry" (click)="retry.emit()" />
- <input type="button" class="peertube-button grey-button ms-1" i18n-value="Cancel ongoing upload" value="Cancel" (click)="cancel.emit()" />
+ <input type="button" class="peertube-button secondary-button ms-1" i18n-value="Retry failed upload" value="Retry" (click)="retry.emit()" />
+ <input type="button" class="peertube-button secondary-button ms-1" i18n-value="Cancel ongoing upload" value="Cancel" (click)="cancel.emit()" />
</div>
<my-alert *ngIf="error && !enableRetryAfterError" type="danger">
diff --git a/client/src/app/shared/standalone-watched-words/watched-words-list-admin-owner.component.html b/client/src/app/shared/standalone-watched-words/watched-words-list-admin-owner.component.html
index f47cc1cfd6..46088d3db5 100644
--- a/client/src/app/shared/standalone-watched-words/watched-words-list-admin-owner.component.html
+++ b/client/src/app/shared/standalone-watched-words/watched-words-list-admin-owner.component.html
@@ -44,7 +44,7 @@
<td class="action-cell">
<my-action-dropdown
[ngClass]="{ 'show': expanded }" placement="bottom-right" container="body"
- i18n-label label="Actions" [actions]="actions" [entry]="list"
+ i18n-label label="Actions" [actions]="actions" [entry]="list" buttonSize="small"
></my-action-dropdown>
</td>
diff --git a/client/src/app/shared/standalone-watched-words/watched-words-list-save-modal.component.html b/client/src/app/shared/standalone-watched-words/watched-words-list-save-modal.component.html
index 0c3b02a773..70b8a5f2dc 100644
--- a/client/src/app/shared/standalone-watched-words/watched-words-list-save-modal.component.html
+++ b/client/src/app/shared/standalone-watched-words/watched-words-list-save-modal.component.html
@@ -36,12 +36,12 @@
<div class="modal-footer inputs">
<input
- type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+ type="button" role="button" i18n-value value="Cancel" class="peertube-button secondary-button"
(click)="hide()" (key.enter)="hide()"
>
<input
- type="submit" i18n-value value="Save" class="peertube-button orange-button"
+ type="submit" i18n-value value="Save" class="peertube-button primary-button"
[disabled]="!form.valid" (click)="addOrUpdate()"
>
</div>
diff --git a/client/src/app/videos-parent.component.html b/client/src/app/videos-parent.component.html
new file mode 100644
index 0000000000..4727fe422e
--- /dev/null
+++ b/client/src/app/videos-parent.component.html
@@ -0,0 +1,3 @@
+<my-home-menu></my-home-menu>
+
+<router-outlet></router-outlet>
diff --git a/client/src/app/videos-parent.component.ts b/client/src/app/videos-parent.component.ts
new file mode 100644
index 0000000000..d4277721c6
--- /dev/null
+++ b/client/src/app/videos-parent.component.ts
@@ -0,0 +1,23 @@
+import { Component } from '@angular/core'
+import { RouterOutlet } from '@angular/router'
+import { HomeMenuComponent } from '@app/menu/home-menu.component'
+import { DisableForReuseHook } from './core'
+
+@Component({
+ templateUrl: './videos-parent.component.html',
+ standalone: true,
+ imports: [
+ HomeMenuComponent,
+ RouterOutlet
+ ]
+})
+export class VideosParentComponent implements DisableForReuseHook {
+
+ disableForReuse () {
+ // empty
+ }
+
+ enabledForReuse () {
+ // empty
+ }
+}
diff --git a/client/src/assets/images/feather/arrow-up-right.svg b/client/src/assets/images/feather/arrow-up-right.svg
deleted file mode 100644
index 95678e00ba..0000000000
--- a/client/src/assets/images/feather/arrow-up-right.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-up-right"><line x1="7" y1="17" x2="17" y2="7"></line><polyline points="7 7 17 7 17 17"></polyline></svg>
\ No newline at end of file
diff --git a/client/src/assets/images/feather/bell.svg b/client/src/assets/images/feather/bell.svg
index bba561c19b..eecc3ef4ba 100644
--- a/client/src/assets/images/feather/bell.svg
+++ b/client/src/assets/images/feather/bell.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bell"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path><path d="M13.73 21a2 2 0 0 1-3.46 0"></path></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bell"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/></svg>
diff --git a/client/src/assets/images/feather/channel.svg b/client/src/assets/images/feather/channel.svg
new file mode 100644
index 0000000000..022d35c51e
--- /dev/null
+++ b/client/src/assets/images/feather/channel.svg
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ version="1.1"
+ id="svg3"
+ sodipodi:docname="channel.svg"
+ inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <defs
+ id="defs3" />
+ <sodipodi:namedview
+ id="namedview3"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:showpageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ inkscape:deskcolor="#d1d1d1"
+ inkscape:zoom="30.708333"
+ inkscape:cx="12.016282"
+ inkscape:cy="12.016282"
+ inkscape:window-width="1916"
+ inkscape:window-height="1036"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="svg3" />
+ <path
+ d="M 3.741177,7.45 H 20.25885 C 21.09027,7.45 21.9,8.214145 21.9,9.331819 V 19.06819 C 21.9,20.1859 21.09027,20.95 20.25885,20.95 H 3.741177 C 2.909694,20.95 2.1,20.1859 2.1,19.06819 V 9.331819 C 2.1,8.214145 2.909694,7.45 3.741177,7.45 Z"
+ stroke="currentColor"
+ stroke-width="1.8"
+ id="path1" />
+ <path
+ d="M 6.6,2.05 11.1,7"
+ stroke="currentColor"
+ stroke-width="1.8"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ id="path2" />
+ <path
+ d="M 17.4,2.05 12.9,7"
+ stroke="currentColor"
+ stroke-width="1.8"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ id="path3" />
+</svg>
diff --git a/client/src/assets/images/feather/chevron-left.svg b/client/src/assets/images/feather/chevron-left.svg
new file mode 100644
index 0000000000..2e68eed40e
--- /dev/null
+++ b/client/src/assets/images/feather/chevron-left.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-left"><path d="m15 18-6-6 6-6"/></svg>
diff --git a/client/src/assets/images/feather/cog.svg b/client/src/assets/images/feather/cog.svg
index 19c27265aa..6045c366db 100644
--- a/client/src/assets/images/feather/cog.svg
+++ b/client/src/assets/images/feather/cog.svg
@@ -1 +1,51 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-settings"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ class="feather feather-settings"
+ version="1.1"
+ id="svg1"
+ sodipodi:docname="cog.svg"
+ inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <defs
+ id="defs1" />
+ <sodipodi:namedview
+ id="namedview1"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:showpageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ inkscape:deskcolor="#d1d1d1"
+ inkscape:zoom="30.708333"
+ inkscape:cx="12.016282"
+ inkscape:cy="12.895522"
+ inkscape:window-width="1916"
+ inkscape:window-height="1036"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="svg1"
+ showguides="true" />
+ <circle
+ cx="12"
+ cy="12"
+ id="circle1"
+ r="2.7"
+ style="stroke-width:1.8" />
+ <path
+ d="m 18.66,14.7 a 1.485,1.485 0 0 0 0.297,1.638 l 0.054,0.054 a 1.8,1.8 0 0 1 0,2.547 1.8,1.8 0 0 1 -2.547,0 L 16.41,18.885 a 1.485,1.485 0 0 0 -1.638,-0.297 1.485,1.485 0 0 0 -0.9,1.359 V 20.1 a 1.8,1.8 0 0 1 -1.8,1.8 1.8,1.8 0 0 1 -1.8,-1.8 V 20.019 A 1.485,1.485 0 0 0 9.3,18.66 1.485,1.485 0 0 0 7.662,18.957 l -0.054,0.054 a 1.8,1.8 0 0 1 -2.547,0 1.8,1.8 0 0 1 0,-2.547 L 5.115,16.41 a 1.485,1.485 0 0 0 0.297,-1.638 1.485,1.485 0 0 0 -1.359,-0.9 H 3.9 a 1.8,1.8 0 0 1 -1.8,-1.8 1.8,1.8 0 0 1 1.8,-1.8 H 3.981 A 1.485,1.485 0 0 0 5.34,9.3 1.485,1.485 0 0 0 5.043,7.662 L 4.989,7.608 a 1.8,1.8 0 0 1 0,-2.547 1.8,1.8 0 0 1 2.547,0 L 7.59,5.115 A 1.485,1.485 0 0 0 9.228,5.412 H 9.3 A 1.485,1.485 0 0 0 10.2,4.053 V 3.9 A 1.8,1.8 0 0 1 12,2.1 1.8,1.8 0 0 1 13.8,3.9 v 0.081 a 1.485,1.485 0 0 0 0.9,1.359 1.485,1.485 0 0 0 1.638,-0.297 l 0.054,-0.054 a 1.8,1.8 0 0 1 2.547,0 1.8,1.8 0 0 1 0,2.547 L 18.885,7.59 A 1.485,1.485 0 0 0 18.588,9.228 V 9.3 a 1.485,1.485 0 0 0 1.359,0.9 H 20.1 a 1.8,1.8 0 0 1 1.8,1.8 1.8,1.8 0 0 1 -1.8,1.8 h -0.081 a 1.485,1.485 0 0 0 -1.359,0.9 z"
+ id="path1"
+ style="stroke-width:1.8" />
+</svg>
diff --git a/client/src/assets/images/feather/command.svg b/client/src/assets/images/feather/command.svg
deleted file mode 100644
index 306eba774e..0000000000
--- a/client/src/assets/images/feather/command.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-command"><path d="M18 3a3 3 0 00-3 3v12a3 3 0 003 3 3 3 0 003-3 3 3 0 00-3-3H6a3 3 0 00-3 3 3 3 0 003 3 3 3 0 003-3V6a3 3 0 00-3-3 3 3 0 00-3 3 3 3 0 003 3h12a3 3 0 003-3 3 3 0 00-3-3z"/></svg>
\ No newline at end of file
diff --git a/client/src/assets/images/feather/config.svg b/client/src/assets/images/feather/config.svg
new file mode 100644
index 0000000000..c1208aacfa
--- /dev/null
+++ b/client/src/assets/images/feather/config.svg
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M14.7001 6.3C14.5169 6.48692 14.4142 6.73824 14.4142 7C14.4142 7.26175 14.5169 7.51307 14.7001 7.7L16.3001 9.3C16.487 9.48322 16.7383 9.58585 17.0001 9.58585C17.2619 9.58585 17.5132 9.48322 17.7001 9.3L21.4701 5.53C21.9729 6.64118 22.1252 7.87923 21.9066 9.07914C21.6879 10.2791 21.1088 11.3838 20.2464 12.2463C19.3839 13.1087 18.2792 13.6878 17.0792 13.9065C15.8793 14.1251 14.6413 13.9728 13.5301 13.47L6.6201 20.38C6.22227 20.7778 5.68271 21.0013 5.1201 21.0013C4.55749 21.0013 4.01792 20.7778 3.6201 20.38C3.22227 19.9822 2.99878 19.4426 2.99878 18.88C2.99878 18.3174 3.22227 17.7778 3.6201 17.38L10.5301 10.47C10.0273 9.35881 9.87502 8.12076 10.0936 6.92085C10.3123 5.72094 10.8914 4.61615 11.7538 3.75372C12.6163 2.89128 13.721 2.31216 14.921 2.09354C16.1209 1.87491 17.3589 2.02716 18.4701 2.52999L14.7101 6.29L14.7001 6.3Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+</svg>
diff --git a/client/src/assets/images/feather/delete.svg b/client/src/assets/images/feather/delete.svg
index f24d55bf64..6867b42147 100644
--- a/client/src/assets/images/feather/delete.svg
+++ b/client/src/assets/images/feather/delete.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-trash-2"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-trash"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/></svg>
diff --git a/client/src/assets/images/feather/edit-2.svg b/client/src/assets/images/feather/edit-2.svg
index 06830c9d0c..13a00256e1 100644
--- a/client/src/assets/images/feather/edit-2.svg
+++ b/client/src/assets/images/feather/edit-2.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2"><path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-pen"><path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/></svg>
diff --git a/client/src/assets/images/feather/help.svg b/client/src/assets/images/feather/help.svg
index 51fddd80de..5ecb0eb4d1 100644
--- a/client/src/assets/images/feather/help.svg
+++ b/client/src/assets/images/feather/help.svg
@@ -1 +1,5 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-help-circle"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>
\ No newline at end of file
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M12 2C17.519 2 22 6.481 22 12C22 17.519 17.519 22 12 22C6.481 22 2 17.519 2 12C2 6.481 6.481 2 12 2Z" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/>
+ <path d="M9.09009 9C9.57509 7.62 10.9851 6.791 12.4271 7.039C13.8691 7.286 14.9221 8.537 14.9201 10C14.9201 11.234 13.4941 12 12.5001 12C12.0001 12 12.0001 14 12.0001 14" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/>
+ <path d="M12 15.355V16.355V17.355" stroke="currentColor" stroke-width="2"/>
+</svg>
diff --git a/client/src/assets/images/feather/history.svg b/client/src/assets/images/feather/history.svg
new file mode 100644
index 0000000000..0797c39ac5
--- /dev/null
+++ b/client/src/assets/images/feather/history.svg
@@ -0,0 +1,5 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M4 12.2432V12.2432C4 7.13834 8.13834 3 13.2432 3V3V3C18.0795 3 22 6.92054 22 11.7568V12.2432V12.2432C22 17.0795 18.0795 21 13.2432 21V21C13.2432 21 13.2432 21 13.2432 21C13.2432 21 8.86486 21 6.91892 18.0811" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+ <path d="M12 7V11.4296C12 12.0983 12.3342 12.7228 12.8906 13.0937L16.5 15.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+ <path d="M6.93939 11.5606L4.00012 14.5L1.0607 11.5606" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+</svg>
diff --git a/client/src/assets/images/feather/home.svg b/client/src/assets/images/feather/home.svg
index 7bb31b23dc..6e9e3184e5 100644
--- a/client/src/assets/images/feather/home.svg
+++ b/client/src/assets/images/feather/home.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-house"><path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"/><path d="M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></svg>
diff --git a/client/src/assets/images/feather/keyboard.svg b/client/src/assets/images/feather/keyboard.svg
new file mode 100644
index 0000000000..8bdc054a65
--- /dev/null
+++ b/client/src/assets/images/feather/keyboard.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-keyboard"><path d="M10 8h.01"/><path d="M12 12h.01"/><path d="M14 8h.01"/><path d="M16 12h.01"/><path d="M18 8h.01"/><path d="M6 8h.01"/><path d="M7 16h10"/><path d="M8 12h.01"/><rect width="20" height="16" x="2" y="4" rx="2"/></svg>
diff --git a/client/src/assets/images/feather/list.svg b/client/src/assets/images/feather/list.svg
deleted file mode 100644
index 5ce38eaa9c..0000000000
--- a/client/src/assets/images/feather/list.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>
\ No newline at end of file
diff --git a/client/src/assets/images/feather/menu.svg b/client/src/assets/images/feather/menu.svg
new file mode 100644
index 0000000000..6598697ff8
--- /dev/null
+++ b/client/src/assets/images/feather/menu.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-menu"><line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/></svg>
diff --git a/client/src/assets/images/feather/moderation.svg b/client/src/assets/images/feather/moderation.svg
new file mode 100644
index 0000000000..462212c93f
--- /dev/null
+++ b/client/src/assets/images/feather/moderation.svg
@@ -0,0 +1,5 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M21 15C21 15.5304 20.7893 16.0391 20.4142 16.4142C20.0391 16.7893 19.5304 17 19 17H7L3 21V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H19C19.5304 3 20.0391 3.21071 20.4142 3.58579C20.7893 3.96086 21 4.46957 21 5V15Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+ <path d="M12 7V9" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+ <path d="M12 13H12.01" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+</svg>
diff --git a/client/src/assets/images/feather/more-vertical.svg b/client/src/assets/images/feather/more-vertical.svg
index cba6958f2c..077dbe8778 100644
--- a/client/src/assets/images/feather/more-vertical.svg
+++ b/client/src/assets/images/feather/more-vertical.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-more-vertical"><circle cx="12" cy="12" r="1"></circle><circle cx="12" cy="5" r="1"></circle><circle cx="12" cy="19" r="1"></circle></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-ellipsis-vertical"><circle cx="12" cy="12" r="1"/><circle cx="12" cy="5" r="1"/><circle cx="12" cy="19" r="1"/></svg>
diff --git a/client/src/assets/images/feather/opened-bell.svg b/client/src/assets/images/feather/opened-bell.svg
new file mode 100644
index 0000000000..0031406bfa
--- /dev/null
+++ b/client/src/assets/images/feather/opened-bell.svg
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ version="1.1"
+ id="svg2"
+ sodipodi:docname="opened-bell.svg"
+ inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <sodipodi:namedview
+ id="namedview2"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:showpageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ inkscape:deskcolor="#d1d1d1"
+ inkscape:zoom="29.429111"
+ inkscape:cx="12.402685"
+ inkscape:cy="12.504625"
+ inkscape:window-width="1916"
+ inkscape:window-height="1036"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="svg2" />
+ <g
+ clip-path="url(#clip0_951_11135)"
+ id="g2"
+ transform="matrix(1.0570193,0,0,1.0639227,2.2012811,1.3901775)">
+ <path
+ d="m 9.24991,20.2 c -0.49407,0.0164 -0.98377,-0.0974 -1.42,-0.33 -0.41075,-0.2457 -0.75429,-0.5893 -1,-1 C 6.75756,18.7562 6.70898,18.6289 6.68709,18.4958 6.6652,18.3627 6.67045,18.2266 6.70254,18.0956 c 0.03209,-0.131 0.09034,-0.2541 0.17126,-0.362 0.08091,-0.1079 0.18282,-0.1983 0.29958,-0.2658 0.11677,-0.0675 0.24598,-0.1107 0.37987,-0.127 0.13388,-0.0162 0.26967,-0.0053 0.3992,0.0323 0.12953,0.0376 0.25011,0.101 0.35451,0.1864 0.10439,0.0854 0.19044,0.191 0.25295,0.3105 0.07338,0.1235 0.17652,0.2266 0.3,0.3 0.12681,0.0709 0.26969,0.1082 0.415,0.1082 0.14531,0 0.28819,-0.0373 0.415,-0.1082 0.12856,-0.0701 0.23569,-0.1738 0.31,-0.3 0.06529,-0.1146 0.15269,-0.2151 0.25699,-0.2958 0.1044,-0.0807 0.2237,-0.1399 0.351,-0.1743 0.1273,-0.0344 0.2602,-0.0433 0.391,-0.0261 0.1308,0.0172 0.2569,0.0601 0.371,0.1262 0.1138,0.0662 0.2133,0.1541 0.293,0.2589 0.0797,0.1047 0.138,0.2241 0.1714,0.3514 0.0334,0.1272 0.0414,0.2599 0.0235,0.3902 -0.0179,0.1304 -0.0614,0.256 -0.1279,0.3695 -0.244,0.4121 -0.5879,0.756 -1,1 -0.4528,0.246 -0.96552,0.3603 -1.47999,0.33 z"
+ fill="currentColor"
+ id="path1" />
+ <path
+ d="M 15.3902,13.62 H 3.11023 C 4.2914,11.392 4.85748,8.88946 4.75023,6.37 4.74911,5.779 4.86519,5.19365 5.09177,4.6478 5.31835,4.10196 5.65091,3.60647 6.07023,3.19 6.20584,3.04845 6.33128,2.92195 6.45814,2.80776 6.95281,2.3625 7.41615,1.83811 7.69504,1.23382 7.91689,0.753114 8.20845,0.291554 8.5,0 6.5,0 5.15472,1.0781 4.2088,2.23908 3.26289,3.40007 2.74757,4.85245 2.75023,6.35 c 0,5.69 -2.299998,7.41 -2.299998,7.42 -0.186666,0.1155 -0.33012,0.2893 -0.4082307,0.4945 -0.0781105,0.2051 -0.0865361,0.4303 -0.0239754,0.6407 0.0625608,0.2105 0.1926311,0.3945 0.3701401,0.5236 C 0.565675,15.558 0.78076,15.6252 1.00023,15.62 H 17.5002 c 0.2104,-0.0029 0.4146,-0.0722 0.5833,-0.1979 0.1688,-0.1256 0.2936,-0.3014 0.3567,-0.5021 0.14,-0.41 -0.15,-1.37 -0.94,-1.35 -0.62,0.03 -1.41,0.05 -2.11,0.05 z"
+ fill="currentColor"
+ id="path2" />
+ </g>
+ <defs
+ id="defs2">
+ <clipPath
+ id="clip0_951_11135">
+ <rect
+ width="18.48"
+ height="20.200001"
+ fill="#ff0000"
+ id="rect2"
+ x="0"
+ y="0" />
+ </clipPath>
+ </defs>
+</svg>
diff --git a/client/src/assets/images/feather/overview.svg b/client/src/assets/images/feather/overview.svg
new file mode 100644
index 0000000000..17016a9e7c
--- /dev/null
+++ b/client/src/assets/images/feather/overview.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 2H9a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1"/></svg>
diff --git a/client/src/assets/images/feather/playlists.svg b/client/src/assets/images/feather/playlists.svg
new file mode 100644
index 0000000000..247c073f0e
--- /dev/null
+++ b/client/src/assets/images/feather/playlists.svg
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ version="1.1"
+ id="svg6"
+ sodipodi:docname="playlists.svg"
+ inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <defs
+ id="defs6" />
+ <sodipodi:namedview
+ id="namedview6"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:showpageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ inkscape:deskcolor="#d1d1d1"
+ inkscape:zoom="30.708333"
+ inkscape:cx="12.016282"
+ inkscape:cy="15.989145"
+ inkscape:window-width="1916"
+ inkscape:window-height="1036"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="svg6" />
+ <path
+ d="M 8.70016,4.8 H 21.90019"
+ stroke="currentColor"
+ stroke-width="1.8"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ id="path1" />
+ <path
+ d="M 2.10001,4.8 H 2.650009"
+ stroke="currentColor"
+ stroke-width="1.8"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ id="path2" />
+ <path
+ d="M 8.70016,19.2 H 21.90019"
+ stroke="currentColor"
+ stroke-width="1.8"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ id="path3" />
+ <path
+ d="M 2.10001,19.2 H 2.650009"
+ stroke="currentColor"
+ stroke-width="1.8"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ id="path4" />
+ <path
+ d="M 8.699719,12 H 21.89974"
+ stroke="currentColor"
+ stroke-width="1.8"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ id="path5" />
+ <path
+ d="M 2.10001,12 H 2.650009"
+ stroke="currentColor"
+ stroke-width="1.8"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ id="path6" />
+</svg>
diff --git a/client/src/assets/images/feather/plus-circle.svg b/client/src/assets/images/feather/plus-circle.svg
deleted file mode 100644
index 4291ff052f..0000000000
--- a/client/src/assets/images/feather/plus-circle.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus-circle"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg>
\ No newline at end of file
diff --git a/client/src/assets/images/feather/plus.svg b/client/src/assets/images/feather/plus.svg
new file mode 100644
index 0000000000..f0ebad788c
--- /dev/null
+++ b/client/src/assets/images/feather/plus.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus"><path d="M5 12h14"/><path d="M12 5v14"/></svg>
diff --git a/client/src/assets/images/feather/refresh-cw.svg b/client/src/assets/images/feather/refresh-cw.svg
index 06c358dd0c..471b2cb846 100644
--- a/client/src/assets/images/feather/refresh-cw.svg
+++ b/client/src/assets/images/feather/refresh-cw.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-refresh-cw"><polyline points="23 4 23 10 17 10"></polyline><polyline points="1 20 1 14 7 14"></polyline><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-refresh-ccw"><path d="M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/><path d="M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16"/><path d="M16 16h5v5"/></svg>
diff --git a/client/src/assets/images/feather/registry.svg b/client/src/assets/images/feather/registry.svg
new file mode 100644
index 0000000000..56e9377a39
--- /dev/null
+++ b/client/src/assets/images/feather/registry.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-container"><path d="M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z"/><path d="M10 21.9V14L2.1 9.1"/><path d="m10 14 11.9-6.9"/><path d="M14 19.8v-8.1"/><path d="M18 17.5V9.4"/></svg>
diff --git a/client/src/assets/images/feather/repeat.svg b/client/src/assets/images/feather/repeat.svg
index c7657b08ed..314e007e47 100644
--- a/client/src/assets/images/feather/repeat.svg
+++ b/client/src/assets/images/feather/repeat.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-repeat"><polyline points="17 1 21 5 17 9"></polyline><path d="M3 11V9a4 4 0 0 1 4-4h14"></path><polyline points="7 23 3 19 7 15"></polyline><path d="M21 13v2a4 4 0 0 1-4 4H3"></path></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-repeat"><path d="m17 2 4 4-4 4"/><path d="M3 11v-1a4 4 0 0 1 4-4h14"/><path d="m7 22-4-4 4-4"/><path d="M21 13v1a4 4 0 0 1-4 4H3"/></svg>
diff --git a/client/src/assets/images/feather/subscriptions.svg b/client/src/assets/images/feather/subscriptions.svg
new file mode 100644
index 0000000000..d8987f7059
--- /dev/null
+++ b/client/src/assets/images/feather/subscriptions.svg
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ width="24"
+ height="25"
+ viewBox="0 0 24 25"
+ fill="none"
+ version="1.1"
+ id="svg4"
+ sodipodi:docname="subscriptions.svg"
+ inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="namedview4"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:showpageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ inkscape:deskcolor="#d1d1d1"
+ inkscape:zoom="29.48"
+ inkscape:cx="12.008141"
+ inkscape:cy="12.483039"
+ inkscape:window-width="1916"
+ inkscape:window-height="1036"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="svg4" />
+ <path
+ d="M 3.9,6.6339205 H 20.1"
+ stroke="currentColor"
+ stroke-width="1.8"
+ stroke-linecap="round"
+ id="path1" />
+ <path
+ d="M 6.6,3.0207985 H 17.4"
+ stroke="currentColor"
+ stroke-width="1.8"
+ stroke-linecap="round"
+ id="path2" />
+ <path
+ d="M 3.741177,10.295832 H 20.25885 c 0.88119,0 1.64115,0.74376 1.64115,1.71819 v 9.16362 c 0,0.97443 -0.75996,1.71819 -1.64115,1.71819 H 3.741177 C 2.859915,22.895832 2.1,22.152072 2.1,21.177642 v -9.16362 c 0,-0.97443 0.759915,-1.71819 1.641177,-1.71819 z"
+ stroke="currentColor"
+ stroke-width="1.8"
+ id="path3" />
+ <path
+ d="m 9.3,13.583172 v 6.3 l 5.4,-3.149461 z"
+ fill="currentColor"
+ id="path4"
+ style="stroke-width:0.9" />
+</svg>
diff --git a/client/src/assets/images/feather/trending.svg b/client/src/assets/images/feather/trending.svg
index 52026a4dfb..6aeded8167 100644
--- a/client/src/assets/images/feather/trending.svg
+++ b/client/src/assets/images/feather/trending.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-trending-up"><polyline points="23 6 13.5 15.5 8.5 10.5 1 18"></polyline><polyline points="17 6 23 6 23 12"></polyline></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-trending-up"><polyline points="22 7 13.5 15.5 8.5 10.5 2 17"/><polyline points="16 7 22 7 22 13"/></svg>
diff --git a/client/src/assets/images/feather/tv.svg b/client/src/assets/images/feather/tv.svg
deleted file mode 100644
index 955bbfff06..0000000000
--- a/client/src/assets/images/feather/tv.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-tv"><rect x="2" y="7" width="20" height="15" rx="2" ry="2"></rect><polyline points="17 2 12 7 7 2"></polyline></svg>
\ No newline at end of file
diff --git a/client/src/assets/images/feather/upload.svg b/client/src/assets/images/feather/upload.svg
index a1db297c5b..f6ba0fd066 100644
--- a/client/src/assets/images/feather/upload.svg
+++ b/client/src/assets/images/feather/upload.svg
@@ -1 +1,59 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-upload-cloud"><polyline points="16 16 12 12 8 16"></polyline><line x1="12" y1="12" x2="12" y2="21"></line><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"></path><polyline points="16 16 12 12 8 16"></polyline></svg>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ class="feather feather-upload-cloud"
+ version="1.1"
+ id="svg2"
+ sodipodi:docname="upload.svg"
+ inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <defs
+ id="defs2" />
+ <sodipodi:namedview
+ id="namedview2"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:showpageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ inkscape:deskcolor="#d1d1d1"
+ inkscape:zoom="30.708333"
+ inkscape:cx="12.016282"
+ inkscape:cy="12.537313"
+ inkscape:window-width="1916"
+ inkscape:window-height="1036"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="svg2" />
+ <polyline
+ points="16 16 12 12 8 16"
+ id="polyline1"
+ transform="matrix(0.9,0,0,0.9,1.2001804,1.2002762)" />
+ <line
+ x1="12.00018"
+ y1="12.000277"
+ x2="12.00018"
+ y2="20.100277"
+ id="line1"
+ style="stroke-width:1.8" />
+ <path
+ d="m 19.55118,17.751276 a 4.5,4.5 0 0 0 -2.151,-8.4509998 h -1.134 A 7.2,7.2 0 1 0 3.9001804,15.870276"
+ id="path1"
+ style="stroke-width:1.8" />
+ <polyline
+ points="16 16 12 12 8 16"
+ id="polyline2"
+ transform="matrix(0.9,0,0,0.9,1.2001804,1.2002762)" />
+</svg>
diff --git a/client/src/assets/images/feather/videos.svg b/client/src/assets/images/feather/videos.svg
new file mode 100644
index 0000000000..44b25ab395
--- /dev/null
+++ b/client/src/assets/images/feather/videos.svg
@@ -0,0 +1,5 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M3 8C1.89543 8 1 8.97683 1 10.1818V17.8182C1 19.0232 1.89543 20 3 20H16C17.1046 20 18 19 18 17.8182" stroke="currentColor" stroke-width="2"/>
+<path d="M6.35294 4H21.6471C22.3217 4 23 4.61642 23 5.54545V14.4545C23 15.3836 22.3217 16 21.6471 16H6.35294C5.67833 16 5 15.3836 5 14.4545V5.54545C5 4.61642 5.67833 4 6.35294 4Z" stroke="currentColor" stroke-width="2"/>
+<path d="M12 7V12.3846L16.3077 9.69277L12 7Z" fill="currentColor"/>
+</svg>
diff --git a/client/src/assets/images/logo.svg b/client/src/assets/images/logo.svg
index 5daccedd02..4f07ef9208 100644
--- a/client/src/assets/images/logo.svg
+++ b/client/src/assets/images/logo.svg
@@ -1,8 +1,6 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="2799 -911 16 22">
- <g>
- <path fill="#211f20" d="M2799-911v11l8-5" />
- <path fill="#737373" d="M2799-900v11l8-6" />
- <path fill="#f1680d" d="M2807-905v10l8-5" />
- <path fill="transparent" d="M2807-895v-10l-8 5z" />
- </g>
-</svg>
+<svg width="34" height="34" viewBox="0 0 34 34" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <rect width="34" height="34" rx="12" fill="#E9DFDF"/>
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11 16.3306V7L18 11.6653L11 16.3306Z" fill="black"/>
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11 25.6613V16.3307L18 20.996L11 25.6613Z" fill="#737373"/>
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M18 20.996V11.6653L25 16.3306L18 20.996Z" fill="#F1680D"/>
+ </svg>
diff --git a/client/src/assets/images/misc/history.svg b/client/src/assets/images/misc/history.svg
deleted file mode 100644
index 0386fae1ce..0000000000
--- a/client/src/assets/images/misc/history.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="material" width="24px" height="24px"><path d="M0 0h24v24H0z" fill="none"/><path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/></svg>
\ No newline at end of file
diff --git a/client/src/assets/images/misc/local.svg b/client/src/assets/images/misc/local.svg
deleted file mode 100644
index 99012b98a5..0000000000
--- a/client/src/assets/images/misc/local.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8.4666667 8.4666667" x="0px" y="0px" class="misc">
- <path fill="currentColor" d="m 4.2330754,3.0330699e-4 c -1.9062912,0 -3.45664101,1.55086299301 -3.45663572,3.45715399301 0,1.041342 0.84545222,2.220339 1.65622812,3.201355 0.8107786,0.981014 1.6190225,1.736328 1.6190225,1.736328 a 0.26460984,0.26460984 0 0 0 0.3612197,0 c 0,0 0.8082439,-0.755314 1.6190224,-1.736328 0.810776,-0.981016 1.6582946,-2.160013 1.6582946,-3.201355 0,-1.906291 -1.5508605,-3.45715399301 -3.4571516,-3.45715399301 z m 0,0.52968500301 c 1.6203083,0 2.9279876,1.30716399 2.9279849,2.92746899 0,0.721961 -0.7497154,1.914917 -1.5353056,2.865459 -0.6952271,0.8412 -1.2416102,1.3482 -1.3926793,1.491898 C 4.0825513,7.6716453 3.5360226,7.1646033 2.840396,6.3229163 2.0548058,5.3723743 1.3035373,4.1794183 1.3035373,3.4574573 1.3035347,1.8371523 2.6127671,0.52998831 4.2330754,0.52998831 Z m 0.00878,0.91518899 a 0.26460979,0.26460979 0 0 0 -0.026355,5.16e-4 0.26460979,0.26460979 0 0 0 -0.1405599,0.05116 L 2.444037,2.6998813 a 0.26474432,0.26474432 0 1 0 0.3147086,0.425813 l 0.056327,-0.04134 v 1.224733 a 0.26460979,0.26460979 0 0 0 0.2640673,0.265615 h 2.30632 a 0.26460979,0.26460979 0 0 0 0.2656152,-0.265615 v -1.223698 l 0.054777,0.04031 A 0.2647471,0.2647471 0 1 0 6.0205633,2.6998813 L 5.5513406,2.3536473 a 0.26460979,0.26460979 0 0 0 -0.00775,-0.0057 L 4.3896558,1.4968523 a 0.26460979,0.26460979 0 0 0 -0.1477963,-0.05168 z m -0.00878,0.594278 0.8888333,0.655775 v 0.217556 1.132747 H 4.4971428 v -0.437697 a 0.26460984,0.26460984 0 0 0 -0.2676843,-0.267684 0.26460984,0.26460984 0 0 0 -0.262001,0.267684 v 0.437697 H 3.344758 v -1.132747 -0.219107 z" />
-</svg>
diff --git a/client/src/assets/images/misc/markdown.svg b/client/src/assets/images/misc/markdown.svg
index 0e2831320f..afd6cc30d1 100644
--- a/client/src/assets/images/misc/markdown.svg
+++ b/client/src/assets/images/misc/markdown.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="40" height="24" viewBox="0 0 208 128"><rect width="198" height="118" x="5" y="5" ry="10" stroke="#C6C6C6" stroke-width="10" fill="none"/><path d="M30 98V30h20l20 25 20-25h20v68H90V59L70 84 50 59v39zm125 0l-30-33h20V30h20v35h20z"/></svg>
+<svg xmlns="http://www.w3.org/2000/svg" width="40" height="24" viewBox="0 0 208 128"><rect width="198" height="118" x="5" y="5" ry="10" stroke="currentColor" stroke-width="10" fill="none"/><path fill="currentColor" d="M30 98V30h20l20 25 20-25h20v68H90V59L70 84 50 59v39zm125 0l-30-33h20V30h20v35h20z"/></svg>
diff --git a/client/src/assets/images/misc/menu.svg b/client/src/assets/images/misc/menu.svg
deleted file mode 100644
index b8bb1b1283..0000000000
--- a/client/src/assets/images/misc/menu.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
- <defs/>
- <path fill="none" fill-rule="evenodd" stroke="#333" d="M3.5 7c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5s-.2.5-.5.5H4a.5.5 0 01-.5-.5zm0 5c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5s-.2.5-.5.5H4a.5.5 0 01-.5-.5zm0 5c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5s-.2.5-.5.5H4a.5.5 0 01-.5-.5z"/>
-</svg>
diff --git a/client/src/assets/images/misc/npm.svg b/client/src/assets/images/misc/npm.svg
deleted file mode 100644
index 8a4869f128..0000000000
--- a/client/src/assets/images/misc/npm.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 18 7" style="transform: scale(1.3) translateY(1px);">
- <path fill="currentColor" d="M0,0h18v6H9v1H5V6H0V0z M1,5h2V2h1v3h1V1H1V5z M6,1v5h2V5h2V1H6z M8,2h1v2H8V2z M11,1v4h2V2h1v3h1V2h1v3h1V1H11z"/>
- <polygon fill="#FFFFFF" points="1,5 3,5 3,2 4,2 4,5 5,5 5,1 1,1 "/>
- <polygon fill="#FFFFFF" d="M6,1v5h2V5h2V1H6z M9,4H8V2h1V4z"/>
- <polygon fill="#FFFFFF" points="11,1 11,5 13,5 13,2 14,2 14,5 15,5 15,2 16,2 16,5 17,5 17,1 "/>
-</svg>
diff --git a/client/src/assets/images/misc/subscriptions.svg b/client/src/assets/images/misc/subscriptions.svg
deleted file mode 100644
index 3a37266be3..0000000000
--- a/client/src/assets/images/misc/subscriptions.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="material" width="24px" height="24px"><path d="M20 8H4V6h16v2zm-2-6H6v2h12V2zm4 10v8c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2v-8c0-1.1.9-2 2-2h16c1.1 0 2 .9 2 2zm-6 4l-6-3.27v6.53L16 16z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
\ No newline at end of file
diff --git a/client/src/assets/images/misc/video-lang.svg b/client/src/assets/images/misc/video-lang.svg
index 6bcaeb9be3..f950ff353a 100644
--- a/client/src/assets/images/misc/video-lang.svg
+++ b/client/src/assets/images/misc/video-lang.svg
@@ -1,7 +1,48 @@
-<svg xmlns="http://www.w3.org/2000/svg" transform="scale(1.1)" viewBox="0 0 24 24">
- <defs/>
- <g class="layer">
- <path fill="#fff" fill-rule="evenodd" stroke="currentColor" stroke-width="1.8" d="M20.5 6.7s-.2-1.4-.8-2c-.7-.8-1.6-.8-2-.9-2.7-.2-6.9-.2-6.9-.2h0s-4.2 0-7 .2c-.3 0-1.2 0-2 .9-.5.6-.7 2-.7 2L.9 10v1.6l.2 3.3s.2 1.4.8 2c.7.8 1.7.8 2.2.9 1.6.2 6.7.2 6.7.2s4.2 0 7-.2c.3 0 1.2 0 2-.9.5-.6.7-2 .7-2l.2-3.3V10l-.2-3.3h0z"/>
- <path d="M8.7 14.7a.7.7 0 01-.5-1.2l2.9-3H8.7a.7.7 0 010-1.3h4a.7.7 0 01.5 1.2l-4 4a.7.7 0 01-.5.3zM11.7 8.6h-2a.7.7 0 110-1.4h2a.7.7 0 010 1.4z"/>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ transform="scale(1.1)"
+ viewBox="0 0 24 24"
+ version="1.1"
+ id="svg2"
+ sodipodi:docname="video-lang.svg"
+ inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <sodipodi:namedview
+ id="namedview2"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:showpageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ inkscape:deskcolor="#d1d1d1"
+ inkscape:zoom="30.708333"
+ inkscape:cx="12"
+ inkscape:cy="12.016282"
+ inkscape:window-width="1916"
+ inkscape:window-height="1036"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="svg2" />
+ <defs
+ id="defs1" />
+ <g
+ class="layer"
+ id="g2"
+ transform="translate(1.1816062,0.78854308)">
+ <path
+ fill="transparent"
+ fill-rule="evenodd"
+ stroke="currentColor"
+ stroke-width="1.8"
+ d="m 20.5,6.7 c 0,0 -0.2,-1.4 -0.8,-2 C 19,3.9 18.1,3.9 17.7,3.8 15,3.6 10.8,3.6 10.8,3.6 v 0 c 0,0 -4.2,0 -7,0.2 -0.3,0 -1.2,0 -2,0.9 -0.5,0.6 -0.7,2 -0.7,2 L 0.9,10 v 1.6 l 0.2,3.3 c 0,0 0.2,1.4 0.8,2 0.7,0.8 1.7,0.8 2.2,0.9 1.6,0.2 6.7,0.2 6.7,0.2 0,0 4.2,0 7,-0.2 0.3,0 1.2,0 2,-0.9 0.5,-0.6 0.7,-2 0.7,-2 l 0.2,-3.3 V 10 Z"
+ id="path1" />
+ <path
+ d="M 8.7,14.7 A 0.7,0.7 0 0 1 8.2,13.5 l 2.9,-3 H 8.7 a 0.7,0.7 0 0 1 0,-1.3 h 4 a 0.7,0.7 0 0 1 0.5,1.2 l -4,4 a 0.7,0.7 0 0 1 -0.5,0.3 z m 3,-6.1 h -2 a 0.7,0.7 0 1 1 0,-1.4 h 2 a 0.7,0.7 0 0 1 0,1.4 z"
+ id="path2" />
</g>
</svg>
diff --git a/client/src/assets/images/misc/video-library.svg b/client/src/assets/images/misc/video-library.svg
deleted file mode 100644
index f5f623a446..0000000000
--- a/client/src/assets/images/misc/video-library.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="material" width="24px" height="24px"><path d="M0 0h24v24H0z" fill="none"/><path d="M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8 12.5v-9l6 4.5-6 4.5z"/></svg>
\ No newline at end of file
diff --git a/client/src/index.html b/client/src/index.html
index ce50f7be83..16e65c65eb 100644
--- a/client/src/index.html
+++ b/client/src/index.html
@@ -50,8 +50,8 @@
<ul>
<li>Allow JavaScript in your browser</li>
- <li>Use one of the <a class="link-orange" href="https://docs.joinpeertube.org/use/third-party-application" target="_blank">third-party applications</a> to browse this instance</li>
- <li>Review the source code on <a class="link-orange" href="https://github.com/Chocobozzz/PeerTube" target="_blank">GitHub</a> or <a class="link-orange" href="https://framagit.org/framasoft/peertube/PeerTube" target="_blank">Framasoft's GitLab</a>, and ask for modifications from the instance owner.
+ <li>Use one of the <a class="link-primary" href="https://docs.joinpeertube.org/use/third-party-application" target="_blank">third-party applications</a> to browse this instance</li>
+ <li>Review the source code on <a class="link-primary" href="https://github.com/Chocobozzz/PeerTube" target="_blank">GitHub</a> or <a class="link-primary" href="https://framagit.org/framasoft/peertube/PeerTube" target="_blank">Framasoft's GitLab</a>, and ask for modifications from the instance owner.
</ul>
</noscript>
@@ -62,8 +62,8 @@
<p>We are sorry but it seems that PeerTube is not compatible with your web browser.</p>
<hr>
- <p>Please try with the latest version of <a class="link-orange" href="https://www.mozilla.org" target="_blank">Mozilla Firefox</a>.</p>
- <p class="mb-0">If you think this is a mistake, please <a class="link-orange" href="https://github.com/Chocobozzz/PeerTube/issues/new" target="_blank">report it</a>.</p>
+ <p>Please try with the latest version of <a class="link-primary" href="https://www.mozilla.org" target="_blank">Mozilla Firefox</a>.</p>
+ <p class="mb-0">If you think this is a mistake, please <a class="link-primary" href="https://github.com/Chocobozzz/PeerTube/issues/new" target="_blank">report it</a>.</p>
</div>
<script type="text/javascript">
diff --git a/client/src/main.ts b/client/src/main.ts
index 6ccbc01373..842ed53d60 100644
--- a/client/src/main.ts
+++ b/client/src/main.ts
@@ -16,7 +16,6 @@ import { AppComponent } from './app/app.component'
import routes from './app/app.routes'
import {
CustomReuseStrategy,
- MenuGuards,
PluginService,
PreloadSelectedModulesList,
RedirectService,
@@ -73,7 +72,6 @@ const bootstrap = () => bootstrapApplication(AppComponent, {
getFormProviders(),
PreloadSelectedModulesList,
- ...MenuGuards.guards,
{ provide: RouteReuseStrategy, useClass: CustomReuseStrategy },
provideRouter(routes,
diff --git a/client/src/sass/application.scss b/client/src/sass/application.scss
index f060b93f1c..402e841e23 100644
--- a/client/src/sass/application.scss
+++ b/client/src/sass/application.scss
@@ -11,6 +11,13 @@
@use './z-index';
@use './class-helpers/index.scss';
+@mixin main-col-expanded {
+ --main-col-width: 100vw;
+
+ width: calc(100% - #{$menu-collapsed-width});
+ margin-inline-start: $menu-collapsed-width;
+}
+
/* clears the ‘X’ from Chrome */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
@@ -18,73 +25,143 @@ input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration { display: none; }
body {
- /*** theme ***/
- // now beware sass requires interpolation
- // for css custom properties #{$var}
+ // ---------------------------------------------------------------------------
+ // New theme with fallback
+ // ---------------------------------------------------------------------------
+
+ --menu-bg: var(--menuBackgroundColor);
+ --menu-fg: var(--menuForegroundColor);
+
+ --fg: var(--mainForegroundColor, #000);
+
+ --bg: var(--mainBackgroundColor, #fff);
+ --bg-secondary: var(--greyBackgroundColor, #E5E5E5);
+
+ --primary: var(--mainColor, hsl(24, 90%, 45%));
+ --on-primary: #{pvar(--fg)};
+
--red: #{$red};
+ --on-red: #{$white};
+
--green: #{$green};
- --white: #{$white};
- --mainColor: #{$main-color};
- --mainColorLighter: #{$main-color-lighter};
- --mainColorLightest: #{$main-color-lightest};
- --mainColorVeryLight: #{$main-color-very-light};
+ --input-fg: var(--inputForegroundColor, #{pvar(--fg)});
+ --input-bg: var(--inputBackgroundColor, #{pvar(--bg-secondary-400)});
+ --input-placeholder: var(--inputPlaceholderColor, #{pvar(--fg-50)});
+ --input-border-color: var(--inputBorderColor, #{pvar(--input-bg)});
+ --input-bg-in-secondary: #{pvar(--bg-secondary-450)};
+
+ --input-check-active-fg: #{pvar(--on-primary)};
+ --input-check-active-bg: #{pvar(--primary)};
+
+ --input-y-padding: 5px;
+ --input-x-padding: 20px;
+
+ --textarea-fg: var(--textareaForegroundColor, #{pvar(--input-fg)});
+ --textarea-bg: var(--textareaBackgroundColor, #{pvar(--input-bg)});
+
+ --support-btn-fg: var(--supportButtonColor, #{pvar(--fg-300)});
+ --support-btn-bg: var(--supportButtonBackgroundColor, transparent);
+ --support-btn-heart-bg: var(--supportButtonHeartColor, #{$support-button-heart});
+
+ --x-margin-content: 2rem;
+ --x-videos-margin-content: 2rem;
+ --main-col-width: calc(100vw - #{$menu-width});
+
+ --secondary-icon-color: #{pvar(--fg-50)};
+ --secondary-fg: #{pvar(--fg-50)};
+
+ --border-primary: #{pvar(--primary)};
+
+ --alert-primary-fg: #{pvar(--on-primary)};
+ --alert-primary-bg: #{pvar(--primary-200)};
+ --alert-primary-border-color: #{pvar(--primary-300)};
+
+ --menu-margin-left: #{$menu-margin-left};
+
+ --header-height: #{$header-height};
+
+ @media screen and (max-width: $small-view) {
+ --header-height: #{$header-height-small-view};
+ }
+
+ @media screen and (max-width: $mobile-view) {
+ --header-height: #{$header-height-mobile-view};
+ }
+
+ // Light theme
+ &[data-pt-theme=peertube-core-light-beige],
+ &[data-pt-theme=default] {
+ --is-dark: 0;
- --mainHoverColor: #{$main-hover-color};
- --mainBackgroundHoverColor: #{$main-background-hover-color};
+ --primary: #FF8F37;
+ --border-primary: #F2690D;
- --mainBackgroundColor: #{$bg-color};
- --mainForegroundColor: #{$fg-color};
+ --fg: hsl(0 14% 2%);
- --greyForegroundColor: #{$grey-foreground-color};
- --greyBackgroundColor: #{$grey-background-color};
- --greySecondaryBackgroundColor: #{$grey-background-hover-color};
+ --bg: hsl(250 5% 96%);
+ --bg-secondary: hsl(0 12% 72%);
+ --bg-secondary-500: hsl(0 12% 72%);
+ --bg-secondary-450: hsl(0 13% 81%);
+ --bg-secondary-400: hsl(0 19% 89%);
+ --bg-secondary-350: hsl(0 13% 92%);
- --menuBackgroundColor: #{$menu-background};
- --menuForegroundColor: #{$menu-color};
+ --secondary-icon-color: hsl(0, 9%, 51%);
+ --input-placeholder: hsl(0, 9%, 51%);
- --submenuBackgroundColor: #{$sub-menu-background-color};
- --channelBackgroundColor: #{$channel-background-color};
+ --input-check-active-fg: #{pvar(--bg)};
+ --input-check-active-bg: #{pvar(--fg-250)};
- --inputForegroundColor: #{$input-foreground-color};
- --inputBackgroundColor: #{$input-background-color};
- --inputPlaceholderColor: #{$input-placeholder-color};
- --inputBorderColor: #{$input-border-color};
+ --alert-primary-fg: #{pvar(--on-primary)};
+ --alert-primary-bg: #{pvar(--primary-200)};
+ --alert-primary-border-color: #{pvar(--primary-300)};
+ }
+
+ // Brown
+ &[data-pt-theme=peertube-core-dark-brown] {
+ --is-dark: 1;
- --textareaForegroundColor: #{$textarea-foreground-color};
- --textareaBackgroundColor: #{$textarea-background-color};
- --markdownTextareaBackgroundColor: #{$markdown-textarea-background-color};
+ --primary: #FD9C50;
+ --on-primary: #111;
+ --border-primary: #F2690D;
- --actionButtonColor: #{$grey-foreground-color};
+ --input-bg: #{pvar(--bg-secondary-450)};
+ --input-bg-in-secondary: #{pvar(--bg-secondary-500)};
- --supportButtonBackgroundColor: #{transparent};
- --supportButtonColor: #{pvar(--actionButtonColor)};
- --supportButtonHeartColor: #{$support-button-heart};
+ --fg: hsl(0 10% 96%);
- --activatedActionButtonColor: #{$activated-action-button-color};
+ --bg: hsl(0 14% 7%);
+ --bg-secondary: hsl(0 14% 22%);
- --horizontalMarginContent: #{$not-expanded-horizontal-margins};
- --videosHorizontalMarginContent: 6vw;
- --mainColWidth: calc(100vw - #{$menu-width});
+ --alert-primary-fg: #{pvar(--primary-650)};
+ --alert-primary-bg: #{pvar(--primary-100)};
+ --alert-primary-border-color: #{pvar(--primary-300)};
+ }
- font-family: $main-fonts;
- font-weight: $font-regular;
- color: pvar(--mainForegroundColor);
- background-color: pvar(--mainBackgroundColor);
- font-size: 1rem;
+ & {
+ font-family: $main-fonts;
+ font-weight: $font-regular;
+ color: pvar(--fg);
+ background-color: pvar(--bg);
- // On desktop browsers, make sure vertical scroll bar is always visible
- // Allow to disable the scrollbar instead of hide it when the content fit the body
- // And not move the content and header horizontally sticked to right when the content is updating
- overflow-y: scroll;
+ // On desktop browsers, make sure vertical scroll bar is always visible
+ // Allow to disable the scrollbar instead of hide it when the content fit the body
+ // And not move the content and header horizontally sticked to right when the content is updating
+ overflow-y: scroll;
- // Fix "reboot" style that set text-align: left
- text-align: start;
+ // Fix "reboot" style that set text-align: left
+ text-align: start;
+ }
}
::selection {
- color: pvar(--mainBackgroundColor);
- background-color: pvar(--mainHoverColor);
+ color: pvar(--on-primary);
+ background-color: pvar(--primary-450);
+}
+
+// Force to override bootstrap utilities
+body [hidden] {
+ display: none !important;
}
noscript,
@@ -95,41 +172,40 @@ noscript,
margin: 1rem auto;
}
-a {
- text-decoration: none;
-}
-
strong {
font-weight: $font-semibold;
}
input[readonly] {
// Force blank on readonly inputs
- background-color: pvar(--inputBackgroundColor) !important;
+ background-color: pvar(--input-bg) !important;
}
input,
textarea {
- color: pvar(--inputForegroundColor);
+ color: pvar(--input-fg);
@include disable-outline;
}
button {
background: unset;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
@include disable-outline;
}
-label {
+label,
+.label {
font-weight: $font-bold;
margin-bottom: 0.5rem;
+ font-size: 18px;
+ color: pvar(--fg-350);
}
code {
- background-color: pvar(--greyBackgroundColor);
- color: pvar(--greyForegroundColor);
+ background-color: pvar(--bg-secondary-500);
+ color: pvar(--fg-400);
border-radius: 3px;
padding: .2em .4em;
margin: auto .4em;
@@ -138,6 +214,14 @@ code {
vertical-align: middle;
}
+a {
+ color: inherit;
+
+ &:hover {
+ opacity: 0.8;
+ }
+}
+
.main-col {
// Don't use rfs to get exact pixels
margin-inline-start: $menu-width;
@@ -146,170 +230,99 @@ code {
outline: none;
.margin-content {
- margin: 0 pvar(--horizontalMarginContent);
+ margin: 0 pvar(--x-margin-content);
flex-grow: 1;
}
.revert-margin-content {
- margin: 0 calc(#{pvar(--horizontalMarginContent)} * -1);
- }
-
- .sub-menu {
- background-color: pvar(--submenuBackgroundColor);
- width: 100%;
- display: flex;
- align-items: center;
- padding: 0 pvar(--horizontalMarginContent);
- height: $sub-menu-height;
- margin-bottom: $sub-menu-margin-bottom;
- overflow-x: auto;
-
- &.sub-menu-fixed {
- position: fixed;
- z-index: #{z('sub-menu') - 1};
- max-width: pvar(--mainColWidth);
- }
+ margin: 0 calc(#{pvar(--x-margin-content)} * -1);
}
.skip-to-content-sub-menu {
display: block;
z-index: z(modal);
padding: 1rem;
- background: pvar(--mainBackgroundColor);
+ background: pvar(--bg);
text-align: center;
text-decoration: underline;
}
- // Use an appropriate offset top when sub-menu fixed
- .sub-menu-offset-content {
- padding-top: $sub-menu-height + $sub-menu-margin-bottom;
- }
-
- .sub-menu.mb-0 + .sub-menu-offset-content {
- padding-top: $sub-menu-height;
- }
-
// Override some properties if the main content is expanded (no menu on the left)
&.expanded {
- --horizontalMarginContent: #{$expanded-horizontal-margins};
- --mainColWidth: 100vw;
-
- width: 100%;
-
- @include margin-left(0);
+ @include main-col-expanded();
}
&.lock-scroll .main-row > router-outlet + * { /* stylelint-disable-line selector-max-compound-selectors */
// Lock and hide body scrollbars
position: fixed;
-
- // Lock and hide sub-menu scrollbars
- .sub-menu { /* stylelint-disable-line */
- overflow-x: hidden;
- }
}
}
-// In tables, don't have a hover different background
-table {
- my-edit-button,
- my-delete-button {
- .action-button {
- &:hover,
- &:active,
- &:focus,
- &[disabled],
- &.disabled {
- background-color: pvar(--greyBackgroundColor) !important;
- opacity: 0.8;
- }
- }
- }
+.modal-open,
+.main-col.expanded {
+ overflow: hidden !important;
}
my-global-icon[iconName=external-link] {
margin: 0 0.3em;
width: 0.9em;
height: 0.9em;
+ line-height: 0.9em;
display: inline-block;
- color: pvar(--inputPlaceholderColor);
+ color: pvar(--secondary-icon-color);
position: relative;
top: -0.1em;
}
-@media screen and (max-width: #{breakpoint(xxl)}) {
- .main-col {
- --horizontalMarginContent: #{math.div($not-expanded-horizontal-margins, 2)};
- --videosHorizontalMarginContent: 30px;
+@media screen and (max-width: $menu-overlay-view) {
+ .menu-open {
+ overflow: hidden !important;
+ }
- &.expanded {
- --horizontalMarginContent: #{math.div($expanded-horizontal-margins, 2)};
- }
+ .main-col {
+ @include main-col-expanded();
}
}
-@media screen and (max-width: #{breakpoint(xl)}) {
+@media screen and (max-width: $small-view) {
.main-col {
- --videosHorizontalMarginContent: #{pvar(--horizontalMarginContent)};
+ --x-margin-content: 1rem;
}
- /* the following applies from 500px to 900px and is partially overridden from 500px to 800px by changes below to $small-view */
- .main-col,
- .main-col.expanded {
- --horizontalMarginContent: #{math.div($expanded-horizontal-margins, 3)};
-
- .sub-menu {
- padding: 0 50px;
-
- .title-page {
- font-size: 17px;
- }
+ my-markdown-textarea {
+ .root {
+ max-width: 100% !important;
}
}
-}
-@media screen and (min-width: $mobile-view) and (max-width: $small-view) {
- .main-col {
- width: 100%;
+ input[type=text],
+ input[type=password],
+ input[type=email],
+ textarea,
+ .peertube-select-container {
+ flex-grow: 1;
+ }
+
+ .caption input[type=text] {
+ width: unset !important;
+ flex-grow: 1;
}
}
-@media screen and (max-width: $small-view) {
+@media screen and (max-width: $mobile-view) {
.main-col,
.main-col.expanded {
- --horizontalMarginContent: 15px;
+ width: 100%;
@include margin-left(0);
+ }
+}
- .sub-menu {
- width: 100vw;
- padding: 0 15px;
- margin-bottom: $sub-menu-margin-bottom-small-view;
- overflow-x: auto;
- }
-
- // Use an appropriate offset top when sub-menu fixed
- .sub-menu-offset-content {
- padding-top: $sub-menu-height + $sub-menu-margin-bottom-small-view;
- }
-
- my-markdown-textarea {
- .root {
- max-width: 100% !important;
- }
- }
-
- input[type=text],
- input[type=password],
- input[type=email],
- textarea,
- .peertube-select-container {
- flex-grow: 1;
- }
-
- .caption input[type=text] {
- width: unset !important;
- flex-grow: 1;
- }
+ngx-loading-bar {
+ .ngx-bar {
+ height: 3px !important;
+ border-radius: 0 !important;
+ border-start-end-radius: 6px !important;
+ border-end-end-radius: 6px !important;
}
}
diff --git a/client/src/sass/bootstrap.scss b/client/src/sass/bootstrap.scss
index f38e3c981d..cac77a5e74 100644
--- a/client/src/sass/bootstrap.scss
+++ b/client/src/sass/bootstrap.scss
@@ -1,5 +1,6 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_button-mixins' as *;
@import './_bootstrap-variables';
@import 'bootstrap/scss/functions';
@import 'bootstrap/scss/variables';
@@ -24,36 +25,51 @@
@import 'bootstrap/scss/tooltip';
@import 'bootstrap/scss/popover';
@import 'bootstrap/scss/spinners';
-@import 'bootstrap/scss/helpers';
+
+/* stylelint-disable-next-line at-rule-empty-line-before */
+@import 'bootstrap/scss/helpers/clearfix';
+@import 'bootstrap/scss/helpers/color-bg';
+// @import 'bootstrap/scss/helpers/colored-links';
+@import 'bootstrap/scss/helpers/focus-ring';
+@import 'bootstrap/scss/helpers/icon-link';
+@import 'bootstrap/scss/helpers/ratio';
+@import 'bootstrap/scss/helpers/position';
+@import 'bootstrap/scss/helpers/stacks';
+@import 'bootstrap/scss/helpers/visually-hidden';
+@import 'bootstrap/scss/helpers/stretched-link';
+@import 'bootstrap/scss/helpers/text-truncation';
+@import 'bootstrap/scss/helpers/vr';
+
+/* stylelint-disable-next-line at-rule-empty-line-before */
@import 'bootstrap/scss/utilities/api';
body {
- --bs-border-color-translucent: #{pvar(--inputBorderColor)};
+ --bs-border-color-translucent: #{pvar(--input-border-color)};
- --bs-body-color: #{pvar(--mainForegroundColor)};
- --bs-body-bg: #{pvar(--mainBackgroundColor)};
+ --bs-body-color: #{pvar(--fg)};
+ --bs-body-bg: #{pvar(--bg)};
- --bs-emphasis-color: #{pvar(--mainForegroundColor)};
+ --bs-emphasis-color: #{pvar(--fg)};
}
.accordion {
- --bs-accordion-color: #{pvar(--mainForegroundColor)};
- --bs-accordion-bg: #{pvar(--mainBackgroundColor)};
+ --bs-accordion-color: #{pvar(--fg)};
+ --bs-accordion-bg: #{pvar(--bg)};
--bs-accordion-btn-color: var(--bs-accordion-color);
--bs-accordion-btn-bg: var(--bs-accordion-bg);
}
.popover {
- --bs-popover-bg: #{pvar(--mainBackgroundColor)};
- --bs-popover-body-color: #{pvar(--mainForegroundColor)};
- --bs-popover-header-color: #{pvar(--mainForegroundColor)};
+ --bs-popover-bg: #{pvar(--bg)};
+ --bs-popover-body-color: #{pvar(--fg)};
+ --bs-popover-header-color: #{pvar(--fg)};
font-family: $main-fonts;
}
.btn-outline-secondary {
- --bs-btn-color: #{pvar(--greyForegroundColor)};
+ --bs-btn-color: #{pvar(--fg-300)};
}
.btn {
@@ -75,9 +91,10 @@ body {
// ---------------------------------------------------------------------------
.dropdown-menu {
- --bs-dropdown-link-hover-bg: #{pvar(--mainBackgroundHoverColor)};
- --bs-dropdown-link-color: #{pvar(--mainForegroundColor)};
- --bs-dropdown-border-color: #{pvar(--inputBorderColor)};
+ --bs-dropdown-link-hover-bg: #{pvar(--bg-secondary-400)};
+ --bs-dropdown-link-color: #{pvar(--fg)};
+ --bs-dropdown-border-color: #{pvar(--input-border-color)};
+ --bs-dropdown-header-color: #{pvar(--fg-350)};
text-align: start;
@@ -89,8 +106,8 @@ body {
padding: 3px 15px;
&.active {
- color: pvar(--mainBackgroundColor) !important;
- background-color: pvar(--mainColor);
+ color: pvar(--on-primary) !important;
+ background-color: pvar(--primary);
font-weight: $font-semibold;
}
@@ -122,6 +139,12 @@ body {
}
}
+.alert-link {
+ &:hover {
+ opacity: 0.8;
+ }
+}
+
// ---------------------------------------------------------------------------
// Modal
// ---------------------------------------------------------------------------
@@ -148,7 +171,7 @@ body {
text-align: center;
.modal-content {
- background-color: pvar(--mainBackgroundColor);
+ background-color: pvar(--bg);
word-break: break-word;
}
@@ -191,34 +214,18 @@ body {
width: 100vw; // Make sure the content fits all the available width
}
-// On touchscreen devices, simply overflow: hidden to avoid detached overlay on scroll
-@media (hover: none) and (pointer: coarse) {
- .modal-open,
- .menu-open {
- overflow: hidden !important;
- }
-
- // On touchscreen devices display content overlay when opened menu
- .menu-open {
- .main-col {
- &::before {
- background-color: #000;
- width: 100vw;
- height: 100vh;
- opacity: 0.75;
- content: '';
- display: block;
- position: fixed;
- z-index: z(overlay);
- }
- }
- }
-}
-
// ---------------------------------------------------------------------------
// Nav
// ---------------------------------------------------------------------------
+.nav:not(.nav-pills) {
+ --bs-nav-link-padding-x: 0;
+
+ .nav-link {
+ @include margin-right(2rem);
+ }
+}
+
.nav .nav-link {
display: flex !important;
align-items: center;
@@ -241,14 +248,14 @@ body {
}
a {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
@include disable-default-a-behaviour;
}
}
.nav-tabs .nav-link {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
font-weight: $font-semibold;
border: 0;
border-bottom: 2px solid transparent;
@@ -257,9 +264,9 @@ body {
@include disable-default-a-behaviour;
&.active {
- color: pvar(--mainForegroundColor);
- background-color: pvar(--mainBackgroundColor) !important;
- border-bottom-color: pvar(--mainColor);
+ color: pvar(--fg);
+ background-color: pvar(--bg) !important;
+ border-bottom-color: pvar(--border-primary);
}
&.active,
@@ -275,18 +282,22 @@ body {
// ---------------------------------------------------------------------------
.card {
- background-color: pvar(--mainBackgroundColor);
+ background-color: pvar(--bg);
border-color: #dee2e6;
}
.accordion-button {
font-size: 18px;
+ my-global-icon {
+ color: pvar(--secondary-icon-color);
+ }
+
&:not(.collapsed) {
font-weight: $font-bold;
my-global-icon {
- color: pvar(--mainColorLighter);
+ color: pvar(--fg);
}
}
}
@@ -300,7 +311,7 @@ body {
}
.btn-outline-secondary {
- border-color: pvar(--inputBorderColor);
+ border-color: pvar(--input-border-color);
&:focus-within,
&:focus,
@@ -310,37 +321,9 @@ body {
}
}
-.btn-group.select-button {
- font-weight: $font-semibold;
-
- .active {
- @include orange-button;
- }
-
- :not(.active) {
- @include grey-button;
- }
-
- > * {
- box-shadow: none !important;
-
- @include peertube-button-link;
-
- &:not(:first-child) {
- border-top-left-radius: 0 !important;
- border-bottom-left-radius: 0 !important;
- }
-
- &:not(:last-child) {
- border-top-right-radius: 0 !important;
- border-bottom-right-radius: 0 !important;
- }
- }
-}
-
.form-control {
- color: pvar(--mainForegroundColor);
- background-color: pvar(--inputBackgroundColor);
+ color: pvar(--fg);
+ background-color: pvar(--input-bg);
outline: none;
}
diff --git a/client/src/sass/class-helpers/_buttons.scss b/client/src/sass/class-helpers/_buttons.scss
index 3f0311e9ee..602cbf02ba 100644
--- a/client/src/sass/class-helpers/_buttons.scss
+++ b/client/src/sass/class-helpers/_buttons.scss
@@ -1,4 +1,6 @@
+@use '_variables' as *;
@use '_mixins' as *;
+@use '_button-mixins' as *;
.peertube-button {
@include peertube-button;
@@ -8,6 +10,10 @@
@include peertube-button-big;
}
+.peertube-button-small {
+ @include peertube-button-small;
+}
+
.peertube-button-link {
@include peertube-button-link;
}
@@ -16,16 +22,16 @@
@include peertube-button-big-link;
}
-.orange-button {
- @include orange-button;
+.primary-button {
+ @include primary-button;
}
-.orange-button-inverted {
- @include orange-button-inverted;
+.rounded-icon-button {
+ @include rounded-icon-button;
}
-.grey-button {
- @include grey-button;
+.secondary-button {
+ @include secondary-button;
}
.tertiary-button {
@@ -36,21 +42,63 @@
@include danger-button;
}
-.peertube-radio-container {
- @include peertube-radio-container;
-}
-
.peertube-button-icon {
- @include button-with-icon(18px, 3px, -1px);
+ @include button-with-icon(24px, 8px, 0);
}
.peertube-create-button {
@include peertube-button-link;
- @include orange-button;
- @include button-with-icon(20px, 5px, -1px);
+ @include primary-button;
+ @include button-with-icon(24px, 8px, 0);
}
.button-unstyle {
padding: 0;
border: 0;
}
+
+.peertube-button-like-link {
+ padding: 0;
+ border: 0 !important;
+ text-decoration: underline;
+ color: pvar(--fg-400);
+
+ &:hover {
+ color: pvar(--fg-100);
+ }
+}
+
+.button-file {
+ @include peertube-file;
+ @include peertube-button;
+}
+
+.reset-button {
+ height: auto;
+
+ @include peertube-button;
+ @include tertiary-button;
+
+ &.reset-button-small {
+ font-size: 80%;
+ padding: 2px 5px;
+ margin: 0 0.25rem;
+ height: fit-content;
+ line-height: initial;
+ }
+}
+
+.support-button {
+ color: pvar(--support-btn-fg);
+ background-color: pvar(--support-btn-bg);
+
+ @include button-with-icon(21px, 0, -1px);
+
+ my-global-icon {
+ @include apply-svg-color(pvar(--support-btn-fg));
+
+ path:first-child {
+ fill: pvar(--support-btn-heart-bg) !important;
+ }
+ }
+}
diff --git a/client/src/sass/class-helpers/_common.scss b/client/src/sass/class-helpers/_common.scss
index 327e5b678d..f5a91a5b0b 100644
--- a/client/src/sass/class-helpers/_common.scss
+++ b/client/src/sass/class-helpers/_common.scss
@@ -2,11 +2,16 @@
@use '_icons' as *;
@use '_variables' as *;
@use '_mixins' as *;
+@use '_button-mixins' as *;
// ---------------------------------------------------------------------------
.pt-badge {
@include peertube-badge;
+
+ &:is(a) {
+ @include disable-default-a-behaviour;
+ }
}
// ---------------------------------------------------------------------------
@@ -44,7 +49,7 @@
.callout {
padding: 1.25rem;
- border: 1px solid #eee;
+ border: 1px solid pvar(--bg-secondary-400);
border-radius: 0.25rem;
position: relative;
@@ -52,7 +57,7 @@
position: relative;
top: -5px;
left: -10px;
- color: #6c757d !important;
+ color: pvar(--fg-400) !important;
font-size: 1rem;
font-weight: $font-bold;
margin-bottom: 0.5rem;
@@ -63,11 +68,11 @@
border-left-width: 0.25rem;
}
- &.callout-orange {
- border-color: pvar(--mainColorLightest);
+ &.callout-primary {
+ border-color: pvar(--primary-350);
&:not(.callout-light) {
- border-left-color: pvar(--mainColor);
+ border-left-color: pvar(--primary);
}
}
}
@@ -76,34 +81,44 @@
.anchor {
position: relative;
- top: #{- ($header-height + 20px)};
-}
-
-.sub-menu-offset-content {
-
- // if sub-menu fixed
- .anchor {
- top: #{- ($header-height + $sub-menu-height + 20px)};
- }
+ top: -calc(#{pvar(--header-height)} + 20px);
}
// ---------------------------------------------------------------------------
.alert {
&.pt-alert-primary {
- background-color: pvar(--mainColorVeryLight);
- border: 2px solid pvar(--mainColorLightest);
+ color: pvar(--alert-primary-fg);
+ background-color: pvar(--alert-primary-bg);
+ border: 2px solid pvar(--alert-primary-border-color);
+
+ .alert-link {
+ color: pvar(--alert-primary-fg) !important;
+ }
+
+ .link-primary {
+ color: inherit !important;
+ }
+
+ .secondary-button {
+ @include secondary-button(
+ $fg: pvar(--alert-primary-fg),
+ $active-bg: rgba(0, 0, 0, 0.4),
+ $hover-bg: rgba(0, 0, 0, 0.3),
+ $border-color: pvar(--alert-primary-fg)
+ );
+ }
}
}
// ---------------------------------------------------------------------------
.chip {
- --avatarSize: 1.2rem;
+ --chip-avatar-size: 1.2rem;
display: inline-flex;
- color: pvar(--mainForegroundColor);
- height: var(--avatarSize);
+ color: pvar(--fg);
+ height: var(--chip-avatar-size);
max-width: 320px;
overflow: hidden;
text-decoration: none;
@@ -114,14 +129,14 @@
my-actor-avatar {
border-radius: 5rem;
- width: var(--avatarSize);
- height: var(--avatarSize);
+ width: var(--chip-avatar-size);
+ height: var(--chip-avatar-size);
@include margin-right(0.5rem);
}
&.two-lines {
- --avatarSize: 2rem;
+ --chip-avatar-size: 2rem;
font-size: 14px;
line-height: 1rem;
@@ -143,3 +158,20 @@
.outline-0 {
outline: none;
}
+
+// ---------------------------------------------------------------------------
+
+.transform-rotate-180 {
+ transform: rotate(180deg);
+}
+
+// ---------------------------------------------------------------------------
+
+.ul-unstyle {
+ margin: 0;
+ padding: 0;
+
+ li {
+ list-style: none;
+ }
+}
diff --git a/client/src/sass/class-helpers/_forms.scss b/client/src/sass/class-helpers/_forms.scss
index 50b3b275c6..82f657be1d 100644
--- a/client/src/sass/class-helpers/_forms.scss
+++ b/client/src/sass/class-helpers/_forms.scss
@@ -1,5 +1,10 @@
@use '_variables' as *;
@use '_mixins' as *;
+@use '_form-mixins' as *;
+
+.peertube-radio-container {
+ @include peertube-radio-container;
+}
.pt-input-text {
@include peertube-input-text(100%);
@@ -42,7 +47,7 @@
+*+.form-error,
// Markdown textarea
+*+*+.form-error {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
}
}
@@ -65,20 +70,3 @@ label + .form-group-description,
margin-bottom: 10px;
margin-top: 0;
}
-
-.reset-button {
- height: auto;
-
- @include peertube-button;
- @include grey-button;
-
- &.reset-button-small {
- font-size: 80%;
- padding: 2px 5px;
- margin: 0 0.25rem;
- height: fit-content;
- line-height: initial;
- }
-}
-
-
diff --git a/client/src/sass/class-helpers/_images.scss b/client/src/sass/class-helpers/_images.scss
index edc2e1a212..6da4bbecd2 100644
--- a/client/src/sass/class-helpers/_images.scss
+++ b/client/src/sass/class-helpers/_images.scss
@@ -3,8 +3,12 @@
.banner {
@include block-ratio('img', $banner-inverted-ratio);
+
+ img {
+ border-radius: 15px;
+ }
}
.revert-margin-content.banner {
- width: calc(100% + 2 * #{pvar(--horizontalMarginContent)});
+ width: calc(100% + 2 * #{pvar(--x-margin-content)});
}
diff --git a/client/src/sass/class-helpers/_layout.scss b/client/src/sass/class-helpers/_layout.scss
index 08ca2a9a0c..e8031d3ee0 100644
--- a/client/src/sass/class-helpers/_layout.scss
+++ b/client/src/sass/class-helpers/_layout.scss
@@ -18,12 +18,11 @@
}
h2 {
- text-transform: uppercase;
- color: pvar(--mainColor);
- font-weight: $font-bold;
font-size: 1rem;
margin-bottom: 10px;
+ @include section-label;
+
&.pt-title-danger {
color: pvar(--red);
}
@@ -48,3 +47,15 @@
.min-width-0 {
min-width: 0;
}
+
+.d-none-mw {
+ @include on-mobile-main-col {
+ display: none !important;
+ }
+}
+
+.d-none-sw {
+ @include on-small-main-col {
+ display: none !important;
+ }
+}
diff --git a/client/src/sass/class-helpers/_menu.scss b/client/src/sass/class-helpers/_menu.scss
index 18aaba7b26..4403701212 100644
--- a/client/src/sass/class-helpers/_menu.scss
+++ b/client/src/sass/class-helpers/_menu.scss
@@ -5,7 +5,7 @@
border: 0;
padding: 0;
opacity: 0.7;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
display: inline-block;
font-weight: $font-semibold;
border-bottom: 2px solid transparent;
@@ -16,13 +16,13 @@
@include margin-right(55px);
&.active {
- border-bottom-color: pvar(--mainColor);
+ border-bottom-color: pvar(--border-primary);
}
&:hover,
&:active,
&:focus {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
}
&.active,
@@ -38,36 +38,15 @@
}
}
-.title-page-v2 {
- font-weight: normal;
- font-size: 15px;
- padding: 35px 25px;
-}
-
.title-page {
- margin-top: 30px;
- margin-bottom: 25px;
+ margin-bottom: 1.5rem;
+ color: pvar(--fg-400);
- color: pvar(--mainForegroundColor);
- display: inline-block;
- font-weight: $font-semibold;
- font-size: 1.25rem;
+ @include font-size(2rem);
- @include margin-right(55px);
-
- a {
- color: inherit;
-
- @include disable-default-a-behaviour;
-
- &:hover {
- color: inherit;
- opacity: 0.8;
- }
- }
-
- @media screen and (max-width: $mobile-view) {
- @include margin-left(15px);
+ my-global-icon {
+ @include global-icon-size(28px);
+ @include margin-right(0.5rem);
}
}
@@ -92,8 +71,13 @@
.breadcrumb-item {
display: flex;
+ &,
a {
- color: pvar(--mainColor);
+ color: pvar(--fg-400);
+ }
+
+ a:hover {
+ color: pvar(--fg-300);
}
+ .breadcrumb-item {
@@ -101,15 +85,10 @@
&::before {
display: inline-block;
- color: #6c757d;
content: '/';
@include padding-right(0.5rem);
}
}
-
- &.active {
- color: #6c757d;
- }
}
}
diff --git a/client/src/sass/class-helpers/_text.scss b/client/src/sass/class-helpers/_text.scss
index 25e6454c65..7a7b537dfc 100644
--- a/client/src/sass/class-helpers/_text.scss
+++ b/client/src/sass/class-helpers/_text.scss
@@ -12,30 +12,88 @@
color: pvar(--green);
}
-@mixin underline-orange {
- text-decoration: underline !important;
- text-decoration-color: pvar(--mainColor) !important;
- text-underline-offset: 0.25em !important;
- text-decoration-thickness: 0.15em !important;
+.text-fg {
+ color: pvar(--fg)
}
-.link-orange {
- color: pvar(--mainForegroundColor);
+.fg-100 {
+ color: pvar(--fg-100)
+}
+
+// ---------------------------------------------------------------------------
+
+.fg-100 {
+ color: pvar(--fg-100)
+}
+
+.fg-150 {
+ color: pvar(--fg-150)
+}
+
+.fg-200 {
+ color: pvar(--fg-200)
+}
+
+.fg-250 {
+ color: pvar(--fg-250)
+}
+
+.fg-300 {
+ color: pvar(--fg-300)
+}
+
+.fg-350 {
+ color: pvar(--fg-350)
+}
+
+.fg-400 {
+ color: pvar(--fg-400)
+}
+
+.fg-450 {
+ color: pvar(--fg-450)
+}
+
+.fg-500 {
+ color: pvar(--fg-500)
+}
+
+// ---------------------------------------------------------------------------
+
+.total-items {
+ color: pvar(--fg-300);
+ font-weight: $font-semibold;
+}
+
+.link-primary {
+ color: pvar(--fg);
font-weight: $font-semibold;
line-height: 1.1;
- @include underline-orange;
+ @include underline-primary;
&:hover {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
opacity: 0.8;
- @include underline-orange;
+ @include underline-primary;
+ }
+}
+
+.border-highlight {
+ &::after {
+ content: '';
+ display: block;
+ height: 4px;
+ background-color: pvar(--border-primary);
+ border-radius: 2px;
+ position: absolute;
+ width: 20px;
}
}
-.underline-orange {
- @include underline-orange;
+.section-label {
+ @include section-label;
}
// ---------------------------------------------------------------------------
diff --git a/client/src/sass/include/_account-channel-page.scss b/client/src/sass/include/_account-channel-page.scss
index 1c7addc040..cb690810c2 100644
--- a/client/src/sass/include/_account-channel-page.scss
+++ b/client/src/sass/include/_account-channel-page.scss
@@ -1,28 +1,12 @@
@use '_variables' as *;
@use '_mixins' as *;
-
-@mixin section-label-responsive {
- color: pvar(--mainColor);
- font-size: 12px;
- margin-bottom: 15px;
- font-weight: $font-bold;
- letter-spacing: 2.5px;
-
- @media screen and (max-width: $mobile-view) {
- font-size: 10px;
- letter-spacing: 2.1px;
- margin-bottom: 5px;
- }
-}
+@use '_button-mixins' as *;
@mixin show-more-description {
- color: pvar(--mainColor);
- cursor: pointer;
-
@include margin(10px, auto, 45px);
}
-@mixin avatar-row-responsive ($img-margin, $grey-font-size) {
+@mixin avatar-row-responsive ($img-margin, $actor-handle-font-size) {
display: flex;
grid-column: 1;
@@ -63,14 +47,14 @@
.actor-handle,
.actor-counters {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
- @include font-size($grey-font-size);
+ @include font-size($actor-handle-font-size);
}
.actor-counters > *:not(:last-child)::after {
content: '•';
margin: 0 10px;
- color: pvar(--mainColor);
+ color: pvar(--primary);
}
}
diff --git a/client/src/sass/include/_actor.scss b/client/src/sass/include/_actor.scss
index 365d9217fc..b4dcd289b3 100644
--- a/client/src/sass/include/_actor.scss
+++ b/client/src/sass/include/_actor.scss
@@ -16,7 +16,7 @@
width: fit-content;
display: flex;
align-items: baseline;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
@include disable-default-a-behaviour;
}
@@ -28,13 +28,13 @@
.actor-name {
font-size: 14px;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
@include margin-left(5px);
}
.actor-owner {
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
display: flex;
align-items: center;
diff --git a/client/src/sass/include/_badges.scss b/client/src/sass/include/_badges.scss
index 9474611f41..36b537be37 100644
--- a/client/src/sass/include/_badges.scss
+++ b/client/src/sass/include/_badges.scss
@@ -9,19 +9,21 @@
font-weight: $font-semibold;
line-height: 1.1;
max-width: 100%;
+ white-space: normal;
+ word-break: normal;
&.badge-fs-normal {
font-size: 100%;
}
&.badge-primary {
- color: pvar(--mainBackgroundColor);
- background-color: pvar(--mainColor);
+ color: pvar(--on-primary);
+ background-color: pvar(--primary);
}
&.badge-secondary {
- color: pvar(--mainBackgroundColor);
- background-color: pvar(--greyForegroundColor);
+ color: pvar(--bg);
+ background-color: pvar(--fg-300);
opacity: 0.7;
}
diff --git a/client/src/sass/include/_bootstrap-variables.scss b/client/src/sass/include/_bootstrap-variables.scss
index f3ea288c14..50f11866c2 100644
--- a/client/src/sass/include/_bootstrap-variables.scss
+++ b/client/src/sass/include/_bootstrap-variables.scss
@@ -35,35 +35,36 @@ $container-max-widths: (
xl: 1140px
);
-$input-color: pvar(--inputForegroundColor);
-$input-bg: pvar(--inputBackgroundColor);
-$input-focus-color: pvar(--inputForegroundColor);
-$input-focus-bg: pvar(--inputBackgroundColor);
+$input-color: pvar(--input-fg);
+$input-bg: pvar(--input-bg);
+$input-focus-color: pvar(--input-fg);
+$input-focus-bg: pvar(--input-bg);
$input-btn-focus-width: 0;
$input-btn-focus-color: inherit;
-$input-focus-border-color: #ced4da;
-$input-focus-box-shadow: 0 0 0 0.25rem pvar(--mainColorLightest);
+$input-focus-border-color: pvar(--input-border-color);
+$input-focus-box-shadow: #{$focus-box-shadow-form};
-$input-group-addon-color: pvar(--mainForegroundColor);
-$input-group-addon-bg: pvar(--greyBackgroundColor);
+$input-group-addon-color: pvar(--fg);
+$input-group-addon-bg: pvar(--bg-secondary-500);
+$input-group-addon-border-color: pvar(--input-border-color);
-$nav-pills-link-active-bg: pvar(--greySecondaryBackgroundColor);
-$nav-pills-link-active-color: pvar(--mainForegroundColor);
+$nav-pills-link-active-bg: pvar(--bg-secondary-500);
+$nav-pills-link-active-color: pvar(--fg);
$nav-link-transition: none;
$dropdown-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
$dropdown-border-radius: 3px;
-$dropdown-link-active-color: pvar(--mainForegroundColor);
-$dropdown-link-active-bg: pvar(--mainBackgroundHoverColor);
-$dropdown-link-hover-color: pvar(--mainForegroundColor);
-$dropdown-link-hover-bg: pvar(--mainBackgroundHoverColor);
-$dropdown-color: pvar(--mainForegroundColor);
-$dropdown-bg: pvar(--mainBackgroundColor);
+$dropdown-link-active-color: pvar(--fg);
+$dropdown-link-active-bg: pvar(--bg-secondary-300);
+$dropdown-link-hover-color: pvar(--fg);
+$dropdown-link-hover-bg: pvar(--bg-secondary-300);
+$dropdown-color: pvar(--fg);
+$dropdown-bg: pvar(--bg);
-$accordion-button-active-bg: pvar(--mainColorVeryLight);
-$accordion-button-active-color: pvar(--mainForegroundColor);
-$accordion-button-focus-border-color: pvar(--mainColorLightest);
-$accordion-button-focus-box-shadow: 0 0 0 .15rem pvar(--mainColorLightest);
-$accordion-border-color: pvar(--inputBorderColor);
+$accordion-button-active-bg: pvar(--primary-50);
+$accordion-button-active-color: pvar(--fg);
+$accordion-button-focus-border-color: pvar(--primary-100);
+$accordion-button-focus-box-shadow: #{$focus-box-shadow-form};
+$accordion-border-color: pvar(--input-border-color);
-$card-color: pvar(--mainForegroundColor);
+$card-color: pvar(--fg);
diff --git a/client/src/sass/include/_button-mixins.scss b/client/src/sass/include/_button-mixins.scss
new file mode 100644
index 0000000000..bb107ffd10
--- /dev/null
+++ b/client/src/sass/include/_button-mixins.scss
@@ -0,0 +1,247 @@
+@use 'sass:math';
+@use 'sass:color';
+@use '_variables' as *;
+@use '_mixins' as *;
+
+@mixin secondary-button (
+ $fg: pvar(--fg),
+ $active-bg: pvar(--bg-secondary-500),
+ $hover-bg: pvar(--bg-secondary-450),
+ $border-color: pvar(--bg-secondary-500)
+) {
+ & {
+ color: $fg;
+ background-color: transparent;
+ border: 1px solid $border-color !important;
+ }
+
+ &:active,
+ &.active,
+ &:focus,
+ &:focus-visible {
+ color: $fg;
+ background-color: $active-bg;
+ border-color: $border-color;
+ }
+
+ // Override bootstrap
+ &.btn:active,
+ &.btn:focus-visible,
+ &.btn.show {
+ color: $fg !important;
+ background-color: $active-bg !important;
+ border-color: $border-color !important;
+ }
+
+ &:hover {
+ color: $fg;
+ background-color: $hover-bg;
+ }
+
+ &[disabled] {
+ pointer-events: none;
+ opacity: 0.8;
+ }
+
+ &:not(.icon-only) my-global-icon {
+ color: pvar(--secondary-icon-color);
+ }
+}
+
+
+@mixin primary-button {
+ @include button-focus(pvar(--primary-350));
+
+ &,
+ &:active,
+ &.active,
+ &:focus {
+ color: pvar(--on-primary);
+ background-color: pvar(--primary);
+ border: 1px solid pvar(--primary);
+ }
+
+ // Override bootstrap
+ &.btn:active,
+ &.btn:focus-visible,
+ &.btn.show {
+ color: pvar(--on-primary) !important;
+ background-color: pvar(--primary) !important;
+ border: 1px solid pvar(--primary) !important;
+ }
+
+ &:hover {
+ color: pvar(--on-primary);
+ background-color: pvar(--primary-400);
+ }
+
+ &[disabled] {
+ pointer-events: none;
+ opacity: 0.6;
+ }
+
+ my-global-icon {
+ color: pvar(--on-primary);
+ }
+}
+
+@mixin tertiary-button {
+ color: pvar(--fg-200);
+ background-color: transparent;
+ border: 1px solid transparent;
+
+ &:hover {
+ color: pvar(--fg-200);
+ background-color: pvar(--bg-secondary-400);
+ }
+
+ &[disabled] {
+ cursor: default;
+ }
+
+ &:active {
+ background-color: pvar(--bg-secondary-450);
+ }
+
+ &.show {
+ border-color: pvar(--fg-200);
+ }
+
+ // Override bootstrap
+ &.btn:active {
+ background-color: transparent !important;
+ }
+
+ &.btn.show {
+ border-color: pvar(--fg-200) !important;
+ }
+}
+
+@mixin rounded-icon-button {
+ padding: 0.5rem !important;
+ border-radius: 100% !important;
+
+ my-global-icon {
+ width: 24px;
+ }
+}
+
+@mixin danger-button {
+ background-color: pvar(--red);
+ color: pvar(--on-red);
+
+ @include button-focus(pvar(--red));
+
+ &:hover,
+ &:active,
+ &.active,
+ &:focus:not(:focus-visible) {
+ opacity: 0.8;
+ }
+
+ &[disabled] {
+ cursor: default;
+ opacity: 0.7;
+ }
+}
+
+@mixin peertube-button {
+ padding: pvar(--input-y-padding) pvar(--input-x-padding);
+ border: 0;
+ font-weight: $font-semibold;
+
+ border-radius: 4px;
+
+ text-align: center;
+ cursor: pointer;
+
+ font-size: $button-font-size;
+ line-height: 1.5;
+
+ my-global-icon + *:not(:empty) {
+ @include margin-left(8px);
+ }
+
+ &.icon-only {
+ padding: pvar(--input-y-padding) 8px;
+ }
+
+ &:is(input[type=button]) {
+ // Because of primeng that redefines border-radius of all input[type="..."]
+ border-radius: 4px !important;
+ }
+}
+
+@mixin peertube-button-big {
+ height: auto;
+ padding: 10px 25px;
+ font-size: 18px;
+ line-height: 1.2;
+ border: 0;
+ font-weight: $font-semibold;
+
+ // Because of primeng that redefines border-radius of all input[type="..."]
+ border-radius: 4px !important;
+}
+
+@mixin peertube-button-small {
+ padding: 0 10px !important;
+ font-size: 14px !important;
+}
+
+@mixin peertube-button-link {
+ display: inline-block;
+
+ @include disable-default-a-behaviour;
+ @include peertube-button;
+}
+
+@mixin peertube-button-big-link {
+ display: inline-block;
+
+ @include disable-default-a-behaviour;
+ @include peertube-button-big;
+}
+
+@mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px, $right: 0) {
+ my-global-icon {
+ position: relative;
+ display: inline-block;
+ width: $width;
+ height: $width;
+ line-height: $width;
+ top: $top;
+ right: $right;
+
+ @include margin-right($margin-right);
+ }
+}
+
+@mixin button-focus($color) {
+ &:focus,
+ &:focus-visible {
+ box-shadow: #{$focus-box-shadow-dimensions} $color;
+ }
+}
+
+@mixin peertube-file {
+ position: relative;
+ overflow: hidden;
+ display: inline-block;
+
+ input[type=file] {
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 100%;
+ height: 100%;
+ font-size: 100px;
+ text-align: end;
+ filter: alpha(opacity=0);
+ opacity: 0;
+ outline: none;
+ background: pvar(--bg);
+ cursor: inherit;
+ display: block;
+ }
+}
diff --git a/client/src/sass/include/_form-mixins.scss b/client/src/sass/include/_form-mixins.scss
new file mode 100644
index 0000000000..440d461e06
--- /dev/null
+++ b/client/src/sass/include/_form-mixins.scss
@@ -0,0 +1,261 @@
+@use 'sass:math';
+@use 'sass:color';
+@use '_variables' as *;
+@use '_mixins' as *;
+@use '_button-mixins' as *;
+
+@mixin peertube-input-text($width, $font-size: $form-input-font-size) {
+ font-size: $font-size;
+
+ padding: pvar(--input-y-padding) pvar(--input-x-padding);
+ width: $width;
+ max-width: $width;
+ color: pvar(--input-fg);
+ background-color: pvar(--input-bg);
+ border: 1px solid pvar(--input-border-color);
+ border-radius: 4px;
+
+ @include rounded-line-height-1-5($font-size);
+
+ &::placeholder {
+ color: pvar(--input-placeholder);
+ font-size: 14px;
+ }
+
+ &[readonly] {
+ color: pvar(--fg-300);
+ }
+
+ &:focus,
+ &:focus-visible {
+ box-shadow: $focus-box-shadow-form;
+ outline: 0;
+ }
+
+ &[disabled] {
+ opacity: 0.4;
+ }
+
+ @media screen and (max-width: calc(#{$width} + 40px)) {
+ width: 100%;
+ }
+}
+
+@mixin peertube-textarea ($width, $height) {
+ @include peertube-input-text($width, 14px);
+
+ & {
+ color: pvar(--textarea-fg) !important;
+ background-color: pvar(--textarea-bg) !important;
+ height: $height;
+ padding: pvar(--input-y-padding) calc(#{pvar(--input-x-padding)} / 2);
+ }
+}
+
+@mixin peertube-select-container ($width) {
+ padding: 0;
+ margin: 0;
+ width: $width;
+ position: relative;
+ height: min-content;
+
+ @media screen and (max-width: $width) {
+ width: 100%;
+ }
+
+ &::after {
+ top: 50%;
+ right: calc(0% + 15px);
+ content: ' ';
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+ border: 5px solid rgba(0, 0, 0, 0);
+ border-top-color: pvar(--fg-300);
+ margin-top: -2px;
+ z-index: 100;
+ }
+
+ select {
+ @include secondary-button;
+ @include rounded-line-height-1-5($form-input-font-size);
+
+ & {
+ font-size: $form-input-font-size;
+
+ padding: pvar(--input-y-padding) calc(#{pvar(--input-x-padding)} + 23px) pvar(--input-y-padding) pvar(--input-x-padding);
+ position: relative;
+ border: 0 !important;
+ appearance: none;
+ text-overflow: ellipsis;
+
+ color: pvar(--input-fg);
+ background: pvar(--input-bg);
+
+ border-radius: 4px;
+ }
+
+ &:focus,
+ &:focus-visible {
+ box-shadow: $focus-box-shadow-form;
+ }
+
+ &[disabled] {
+ opacity: 0.4;
+ }
+ }
+}
+
+// Thanks: https://codepen.io/manabox/pen/raQmpL
+@mixin peertube-radio-container {
+ &[disabled] {
+ opacity: 0.4;
+ }
+
+ label {
+ font-size: $form-input-font-size;
+ }
+
+ [type=radio]:focus-visible,[type=radio]:focus {
+ & + label::before {
+ box-shadow: $focus-box-shadow-form;
+ }
+ }
+
+ [type=radio]:checked,
+ [type=radio]:not(:checked) {
+ position: absolute;
+ opacity: 0;
+ cursor: pointer;
+ height: 0;
+ width: 0;
+ }
+
+ [type=radio]:checked + label,
+ [type=radio]:not(:checked) + label {
+ position: relative;
+ padding-left: 28px;
+ cursor: pointer;
+ line-height: 20px;
+ display: inline-block;
+ font-weight: $font-regular;
+ color: pvar(--fg);
+ }
+
+ [type=radio]:checked + label::before,
+ [type=radio]:not(:checked) + label::before {
+ content: '';
+ position: absolute;
+ left: 0;
+ top: -1px;
+ width: 20px;
+ height: 20px;
+ border: 2px solid pvar(--fg-300);
+ border-radius: 100%;
+ }
+
+ [type=radio]:checked + label::after,
+ [type=radio]:not(:checked) + label::after {
+ content: '';
+ width: 10px;
+ height: 10px;
+ background: pvar(--input-check-active-bg);
+ position: absolute;
+ top: 4px;
+ left: 5px;
+ border-radius: 100%;
+ transition: all 0.2s ease;
+ }
+ [type=radio]:not(:checked) + label::after {
+ opacity: 0;
+ transform: scale(0);
+ }
+
+ [type=radio]:checked + label::before {
+ border: 2px solid pvar(--fg);
+ }
+
+ [type=radio]:checked + label::after {
+ opacity: 1;
+ transform: scale(1);
+ }
+
+ .form-group-description {
+ display: block;
+ margin-top: -7px;
+ margin-bottom: 10px;
+ margin-left: 29px;
+ }
+}
+
+@mixin peertube-checkbox {
+ $border-width: 2px;
+
+ opacity: 0;
+ position: absolute;
+
+ &:focus + span {
+ box-shadow: $focus-box-shadow-form;
+ }
+
+ + span {
+ position: relative;
+ width: 20px;
+ min-width: 20px;
+ height: 20px;
+ border: $border-width solid pvar(--fg-400);
+ border-radius: 2px;
+ vertical-align: middle;
+ cursor: pointer;
+
+ &::after {
+ content: '';
+ position: absolute;
+ top: 4px;
+ left: 6px;
+ width: 5px;
+ height: 7px;
+ opacity: 0;
+ transform: rotate(45deg) scale(0);
+ border-right: 2px solid pvar(--input-check-active-fg);
+ border-bottom: 2px solid pvar(--input-check-active-fg);
+ }
+ }
+
+ &:checked + span {
+ background: pvar(--input-check-active-bg);
+ animation: jelly 0.6s ease;
+
+ &::before {
+ content: '';
+ width: 100%;
+ height: 100%;
+ background: pvar(--input-check-active-bg);
+ position: absolute;
+ left: 0;
+ transition: all 0.2s ease;
+ border: 2px solid pvar(--input-check-active-fg);
+ border-radius: 2px;
+ }
+
+ &::after {
+ opacity: 1;
+ transform: rotate(45deg) scale(1);
+ }
+ }
+
+ + span + span {
+ font-weight: $font-regular;
+ cursor: pointer;
+ display: inline;
+
+ @include margin-left(8px);
+ }
+
+ &[disabled] + span,
+ &[disabled] + span + span {
+ opacity: 0.4;
+ cursor: default;
+ }
+}
diff --git a/client/src/sass/include/_icons.scss b/client/src/sass/include/_icons.scss
index 9e961d0032..f6044a6d2f 100644
--- a/client/src/sass/include/_icons.scss
+++ b/client/src/sass/include/_icons.scss
@@ -82,7 +82,7 @@
height: 0;
border-left: $size solid transparent;
border-right: $size solid transparent;
- border-bottom: $size solid pvar(--mainForegroundColor);
+ border-bottom: $size solid pvar(--fg);
}
@mixin arrow-down ($size) {
@@ -90,5 +90,5 @@
height: 0;
border-left: $size solid transparent;
border-right: $size solid transparent;
- border-top: $size solid pvar(--mainForegroundColor);
+ border-top: $size solid pvar(--fg);
}
diff --git a/client/src/sass/include/_miniature.scss b/client/src/sass/include/_miniature.scss
index fd1d7f535d..b41f70d94c 100644
--- a/client/src/sass/include/_miniature.scss
+++ b/client/src/sass/include/_miniature.scss
@@ -1,11 +1,11 @@
+@use 'sass:math';
@use '_variables' as *;
@use '_mixins' as *;
@mixin miniature-name {
- font-size: 1.1em;
transition: color 0.2s;
- font-weight: $font-semibold;
- color: pvar(--mainForegroundColor);
+ font-weight: $font-bold;
+ color: pvar(--fg);
@include peertube-word-wrap(false);
@@ -28,7 +28,7 @@
display: flex;
flex-direction: column;
position: relative;
- border-radius: 3px;
+ border-radius: 4px;
width: 100%;
height: 100%;
overflow: hidden;
@@ -45,7 +45,7 @@
width: inherit;
height: inherit;
opacity: 0;
- background-color: rgba(0, 0, 0, 0.3);
+ background-color: rgba(46, 35, 35, 0.80);
&,
.icon {
@@ -54,6 +54,24 @@
.icon {
@include play-icon($play-overlay-width, $play-overlay-height);
+
+ &::before {
+ $background-play-size: 49px;
+
+ display: block;
+ content: '';
+ width: $background-play-size;
+ height: $background-play-size;
+
+ top: math.round(math.div($background-play-size, 2)) * -1;
+ // Add some pixels at the end because it's visually better
+ right: #{math.round(math.div($background-play-size - $play-overlay-width, 2)) * -1 + 3};
+
+ border-radius: 100%;
+ position: absolute;
+ background-color: pvar(--primary-450);
+ opacity: 0.3;
+ }
}
}
@@ -69,11 +87,6 @@
}
}
- &:focus-visible {
- box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
- outline: none;
- }
-
img {
width: inherit;
height: inherit;
@@ -94,13 +107,13 @@
@mixin static-thumbnail-overlay {
display: inline-block;
- background-color: rgba(0, 0, 0, 0.7);
- color: #fff;
+ background-color: rgba(17, 17, 17, 0.8);
+ color: #E9DFDF;
}
// Use margin by default, or padding if $margin is false
@mixin grid-videos-miniature-margins ($margin: true, $min-margin: 0) {
- --gridVideosMiniatureMargins: #{pvar(--videosHorizontalMarginContent)};
+ --gridVideosMiniatureMargins: #{pvar(--x-videos-margin-content)};
@if $margin {
@include margin-left(var(--gridVideosMiniatureMargins) !important);
@@ -117,20 +130,26 @@
}
}
-@mixin grid-videos-miniature-layout {
+@mixin grid-videos-miniature-layout ($rows-limit: 0) {
@media screen and (min-width: $mobile-view) {
.videos,
.playlists {
- --miniatureMinWidth: #{$video-thumbnail-width - 25px};
- --miniatureMaxWidth: #{$video-thumbnail-width};
+ --co-miniature-min-width: #{$video-thumbnail-width - 25px};
+ --co-miniature-max-width: #{$video-thumbnail-width};
display: grid;
column-gap: 30px;
grid-template-columns: repeat(
auto-fill,
- minmax(var(--miniatureMinWidth), 1fr)
+ minmax(var(--co-miniature-min-width), 1fr)
);
+ @if ($rows-limit != 0) {
+ grid-template-rows: repeat($rows-limit, auto);
+ overflow: hidden;
+ grid-auto-rows: 0;
+ }
+
.video-wrapper,
.playlist-wrapper {
margin: 0 auto;
@@ -139,8 +158,8 @@
my-video-miniature,
my-video-playlist-miniature {
display: block;
- min-width: var(--miniatureMinWidth);
- max-width: var(--miniatureMaxWidth);
+ min-width: var(--co-miniature-min-width);
+ max-width: var(--co-miniature-max-width);
}
}
@@ -155,7 +174,7 @@
}
}
-@mixin grid-videos-miniature-layout-with-margins {
+@mixin grid-videos-miniature-layout-with-margins ($rows-limit: 0) {
@include grid-videos-miniature-margins;
- @include grid-videos-miniature-layout;
+ @include grid-videos-miniature-layout($rows-limit);
}
diff --git a/client/src/sass/include/_mixins.scss b/client/src/sass/include/_mixins.scss
index 87fb476dbd..0f54c1d975 100644
--- a/client/src/sass/include/_mixins.scss
+++ b/client/src/sass/include/_mixins.scss
@@ -3,7 +3,28 @@
@use '_variables' as *;
@import '_bootstrap-mixins';
+@mixin underline-primary {
+ text-decoration: underline !important;
+ text-decoration-color: pvar(--border-primary) !important;
+ text-underline-offset: 0.25em !important;
+ text-decoration-thickness: 0.15em !important;
+}
+
+@mixin section-label {
+ color: pvar(--fg-300);
+ font-size: 14px;
+ margin-bottom: 15px;
+ font-weight: $font-bold;
+ letter-spacing: 1px;
+
+ @media screen and (max-width: $mobile-view) {
+ font-size: 12px;
+ margin-bottom: 5px;
+ }
+}
+
@mixin disable-default-a-behaviour {
+ &,
&:hover,
&:focus,
&:active {
@@ -28,7 +49,7 @@
}
@mixin muted {
- color: pvar(--greyForegroundColor) !important;
+ color: pvar(--fg-300) !important;
}
@mixin fade-text ($fade-after, $background-color) {
@@ -73,289 +94,8 @@
}
}
-@mixin button-focus($color) {
- &:focus,
- &:focus-visible {
- box-shadow: #{$focus-box-shadow-form} $color;
- }
-}
-
@mixin rounded-line-height-1-5 ($font-size) {
- line-height: $font-size + math.round(math.div($font-size, 2));
-}
-
-@mixin peertube-input-text($width, $font-size: $form-input-font-size) {
- font-size: $font-size;
-
- padding: 3px 15px;
- width: $width;
- max-width: $width;
- color: pvar(--inputForegroundColor);
- background-color: pvar(--inputBackgroundColor);
- border: 1px solid pvar(--inputBorderColor);
- border-radius: 3px;
-
- @include rounded-line-height-1-5($font-size);
-
- &::placeholder {
- color: pvar(--inputPlaceholderColor);
- }
-
- &[readonly] {
- color: pvar(--greyForegroundColor);
- }
-
- @media screen and (max-width: calc(#{$width} + 40px)) {
- width: 100%;
- }
-}
-
-@mixin peertube-textarea ($width, $height) {
- color: pvar(--textareaForegroundColor) !important;
- background-color: pvar(--textareaBackgroundColor) !important;
- height: $height;
- padding: 5px 15px;
-
- @include peertube-input-text($width);
-}
-
-@mixin orange-button {
- @include button-focus(pvar(--mainColorLightest));
-
- &,
- &:active,
- &:focus {
- color: #fff;
- background-color: pvar(--mainColor);
- border-color: inherit;
- }
-
- // Override bootstrap
- &.btn:active,
- &.btn:focus-visible,
- &.btn.show {
- color: #fff !important;
- background-color: pvar(--mainColor) !important;
- border-color: inherit !important;
- }
-
- &:hover {
- color: #fff;
- background-color: pvar(--mainHoverColor);
- }
-
- &[disabled] {
- cursor: default;
- color: #fff;
- background-color: pvar(--inputBorderColor);
- }
-
- my-global-icon {
- @include apply-svg-color(#fff);
- }
-}
-
-@mixin orange-button-inverted {
- padding: 2px 13px;
- border: 2px solid pvar(--mainColor);
- font-weight: $font-semibold;
-
- @include button-focus(pvar(--mainColorLightest));
-
- &,
- &:active,
- &:focus {
- color: pvar(--mainColor);
- background-color: pvar(--mainBackgroundColor);
- }
-
- // Override bootstrap
- &.btn:active,
- &.btn:focus-visible,
- &.btn.show {
- color: pvar(--mainColor);
- background-color: pvar(--mainBackgroundColor);
- border-color: inherit !important;
- }
-
- &:hover {
- color: pvar(--mainColor);
- background-color: pvar(--mainColorLightest);
- }
-
- &[disabled] {
- cursor: default;
- color: pvar(--mainColor);
- background-color: pvar(--inputBorderColor);
- }
-
- my-global-icon {
- @include apply-svg-color(pvar(--mainColor));
- }
-}
-
-@mixin tertiary-button {
- color: pvar(--greyForegroundColor);
- background-color: transparent;
-
- @include button-focus($grey-button-outline-color);
-
- &[disabled] {
- cursor: default;
- }
-
- my-global-icon {
- @include apply-svg-color(transparent);
- }
-}
-
-@mixin grey-button {
- color: pvar(--greyForegroundColor);
- background-color: pvar(--greyBackgroundColor);
-
- @include button-focus($grey-button-outline-color);
-
- &:hover,
- &:active,
- &:focus,
- &[disabled] {
- color: pvar(--greyForegroundColor);
- background-color: pvar(--greySecondaryBackgroundColor);
- }
-
- // Override bootstrap
- &.btn:active,
- &.btn:focus-visible,
- &.btn.show {
- color: pvar(--greyForegroundColor);
- background-color: pvar(--greySecondaryBackgroundColor);
- border-color: inherit !important;
- }
-
- &[disabled] {
- cursor: default;
- }
-
- my-global-icon {
- @include apply-svg-color(pvar(--greyForegroundColor));
- }
-}
-
-@mixin danger-button {
- background-color: pvar(--red);
- color: pvar(--white);
-
- @include button-focus(pvar(--red));
-
- &:hover,
- &:active,
- &:focus:not(:focus-visible) {
- opacity: 0.8;
- }
-
- &[disabled] {
- cursor: default;
- opacity: 0.7;
- }
-
- my-global-icon {
- @include apply-svg-color(pvar(--white));
- }
-}
-
-@mixin peertube-button {
- padding: 4px 13px;
-
- border: 0;
- font-weight: $font-semibold;
-
- border-radius: 3px;
-
- text-align: center;
- cursor: pointer;
-
- font-size: $button-font-size;
-
- @include rounded-line-height-1-5($button-font-size);
-
- my-global-icon + * {
- @include margin-right(4px);
- @include margin-left(4px);
- }
-}
-
-@mixin peertube-button-big {
- height: auto;
- padding: 10px 25px;
- font-size: 18px;
- line-height: 1.2;
- border: 0;
- font-weight: $font-semibold;
-
- // Because of primeng that redefines border-radius of all input[type="..."]
- border-radius: 3px !important;
-}
-
-@mixin peertube-button-link {
- display: inline-block;
-
- @include disable-default-a-behaviour;
- @include peertube-button;
-}
-
-@mixin peertube-button-big-link {
- display: inline-block;
-
- @include disable-default-a-behaviour;
- @include peertube-button-big;
-}
-
-@mixin peertube-button-outline {
- display: inline-block;
- border: 1px solid;
-
- @include disable-default-a-behaviour;
- @include peertube-button;
-}
-
-@mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) {
- my-global-icon {
- position: relative;
- display: inline-block;
- width: $width;
- top: $top;
-
- @include margin-right($margin-right);
- }
-}
-
-@mixin peertube-file {
- position: relative;
- overflow: hidden;
- display: inline-block;
-
- input[type=file] {
- position: absolute;
- top: 0;
- right: 0;
- width: 100%;
- height: 100%;
- font-size: 100px;
- text-align: end;
- filter: alpha(opacity=0);
- opacity: 0;
- outline: none;
- background: pvar(--mainBackgroundColor);
- cursor: inherit;
- display: block;
- }
-}
-
-@mixin peertube-button-file ($width) {
- width: $width;
-
- @include peertube-file;
- @include peertube-button;
+ line-height: calc(#{$font-size} + #{math.round(math.div($font-size, 2))});
}
@mixin icon ($size) {
@@ -368,226 +108,33 @@
cursor: pointer;
}
-@mixin responsive-width ($width) {
- width: $width;
-
- @media screen and (max-width: $width) {
- width: 100%;
- }
+@mixin global-icon-size ($size) {
+ display: inline-block;
+ width: $size;
+ height: $size;
+ line-height: $size;
}
-@mixin peertube-select-container ($width) {
- padding: 0;
- margin: 0;
+@mixin responsive-width ($width) {
width: $width;
- border-radius: 3px;
- color: pvar(--inputForegroundColor);
- background: pvar(--inputBackgroundColor);
- position: relative;
- height: min-content;
-
- select[disabled] {
- background-color: #f9f9f9;
- }
@media screen and (max-width: $width) {
width: 100%;
}
-
- &::after {
- top: 50%;
- right: calc(0% + 15px);
- content: ' ';
- height: 0;
- width: 0;
- position: absolute;
- pointer-events: none;
- border: 5px solid rgba(0, 0, 0, 0);
- border-top-color: pvar(--mainForegroundColor);
- margin-top: -2px;
- z-index: 100;
- }
-
- select {
- font-size: $form-input-font-size;
-
- padding: 3px 35px 3px 12px;
- position: relative;
- border: 1px solid pvar(--inputBorderColor);
- background: transparent none;
- appearance: none;
- text-overflow: ellipsis;
- color: pvar(--mainForegroundColor);
-
- @include rounded-line-height-1-5($form-input-font-size);
-
- option {
- color: #000;
- }
- }
-
- &.peertube-select-button {
- @include grey-button;
-
- select {
- font-weight: $font-semibold;
- color: pvar(--greyForegroundColor);
- border: 0;
-
- // No border, add +1 to vertical padding
- padding: 4px 35px 4px 12px;
- }
- }
-}
-
-// Thanks: https://codepen.io/manabox/pen/raQmpL
-@mixin peertube-radio-container {
- label {
- font-size: $form-input-font-size;
- }
-
- [type=radio]:focus-visible + label::before {
- outline: 2px solid;
- }
-
- [type=radio]:checked,
- [type=radio]:not(:checked) {
- position: absolute;
- opacity: 0;
- cursor: pointer;
- height: 0;
- width: 0;
- }
-
- [type=radio]:checked + label,
- [type=radio]:not(:checked) + label {
- position: relative;
- padding-left: 28px;
- cursor: pointer;
- line-height: 20px;
- display: inline-block;
- font-weight: $font-regular;
- }
-
- [type=radio]:checked + label::before,
- [type=radio]:not(:checked) + label::before {
- content: '';
- position: absolute;
- left: 0;
- top: 0;
- width: 18px;
- height: 18px;
- border: 1px solid pvar(--inputBorderColor);
- border-radius: 100%;
- background: #fff;
- }
-
- [type=radio]:checked + label::after,
- [type=radio]:not(:checked) + label::after {
- content: '';
- width: 10px;
- height: 10px;
- background: pvar(--mainColor);
- position: absolute;
- top: 4px;
- left: 4px;
- border-radius: 100%;
- transition: all 0.2s ease;
- }
- [type=radio]:not(:checked) + label::after {
- opacity: 0;
- transform: scale(0);
- }
- [type=radio]:checked + label::after {
- opacity: 1;
- transform: scale(1);
- }
-
- .form-group-description {
- display: block;
- margin-top: -7px;
- margin-bottom: 10px;
- margin-left: 29px;
- }
-}
-
-@mixin peertube-checkbox ($border-width) {
- opacity: 0;
- position: absolute;
-
- &:focus + span {
- box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
- }
-
- + span {
- position: relative;
- width: 18px;
- min-width: 18px;
- height: 18px;
- border: $border-width solid pvar(--inputBorderColor);
- border-radius: 3px;
- vertical-align: middle;
- cursor: pointer;
-
- &::after {
- content: '';
- position: absolute;
- top: calc(2px - #{$border-width});
- left: 5px;
- width: 5px;
- height: 12px;
- opacity: 0;
- transform: rotate(45deg) scale(0);
- border-right: 2px solid pvar(--mainBackgroundColor);
- border-bottom: 2px solid pvar(--mainBackgroundColor);
- }
- }
-
- &:checked + span {
- border-color: transparent;
- background: pvar(--mainColor);
- animation: jelly 0.6s ease;
-
- &::after {
- opacity: 1;
- transform: rotate(45deg) scale(1);
- }
- }
-
- + span + span {
- font-weight: $font-regular;
- cursor: pointer;
- display: inline;
-
- @include margin-left(5px);
- }
-
- &[disabled] + span,
- &[disabled] + span + span {
- opacity: 0.5;
- cursor: default;
- }
}
@mixin actor-counters ($separator-margin: 10px) {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
display: flex;
align-items: center;
> *:not(:last-child)::after {
content: '•';
margin: 0 $separator-margin;
- color: pvar(--mainColor);
+ color: pvar(--primary);
}
}
-@mixin in-content-small-title {
- text-transform: uppercase;
- color: pvar(--mainColor);
- font-weight: $font-bold;
- font-size: 13px;
-}
-
@mixin row-blocks ($column-responsive: true, $min-height: 130px, $separator: true) {
display: flex;
min-height: $min-height;
@@ -595,7 +142,7 @@
margin-bottom: 20px;
@if $separator {
- border-bottom: 1px solid pvar(--inputBorderColor);
+ border-bottom: 1px solid pvar(--input-border-color);
}
@media screen and (max-width: $small-view) {
@@ -612,7 +159,7 @@
}
@mixin dropdown-with-icon-item {
- padding: 6px 15px;
+ padding: pvar(--input-y-padding) 15px;
my-global-icon {
width: 22px;
@@ -624,7 +171,7 @@
}
}
-@mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
+@mixin divider($color: pvar(--bg-secondary-400), $background: pvar(--bg)) {
width: 95%;
border-top: .05rem solid $color;
height: .05rem;
@@ -668,57 +215,6 @@
}
}
-@mixin sub-menu-h1 {
- ::ng-deep .sub-title-container {
- display: flex;
- align-items: center;
- justify-content: space-between;
- flex-wrap: wrap;
- gap: 0.5rem;
-
- border-bottom: 2px solid $grey-background-color;
- padding-bottom: 15px;
- margin-bottom: $sub-menu-margin-bottom;
-
- > * {
- gap: 0.5rem;
- display: flex;
- align-items: center;
- }
-
- .sub-title {
- &,
- h1 {
- font-size: 1.3rem;
- }
-
- h1 {
- margin: 0;
- }
-
- > my-global-icon {
- width: 24px;
- height: 24px;
-
- svg {
- vertical-align: initial;
- }
- }
-
- my-feed {
- display: inline-block;
- width: 15px;
-
- my-global-icon svg {
- vertical-align: initial;
- position: relative;
- top: 1px;
- }
- }
- }
- }
-}
-
@mixin play-icon ($width, $height) {
width: 0;
height: 0;
@@ -731,34 +227,18 @@
border-top: #{math.div($height, 2)} solid transparent;
border-bottom: #{math.div($height, 2)} solid transparent;
- border-left: $width solid rgba(255, 255, 255, 0.95);
+ border-left: $width solid #F4F4F5;
}
@mixin on-small-main-col () {
- :host-context(.main-col:not(.expanded)) {
- @media screen and (max-width: #{$small-view + $menu-width}) {
- @content;
- }
- }
-
- :host-context(.main-col.expanded) {
- @media screen and (max-width: $small-view) {
- @content;
- }
+ @media screen and (max-width: $small-view) {
+ @content;
}
}
@mixin on-mobile-main-col () {
- :host-context(.main-col:not(.expanded)) {
- @media screen and (max-width: #{$mobile-view + $menu-width}) {
- @content;
- }
- }
-
- :host-context(.main-col.expanded) {
- @media screen and (max-width: $mobile-view) {
- @content;
- }
+ @media screen and (max-width: $mobile-view) {
+ @content;
}
}
diff --git a/client/src/sass/include/_nav.scss b/client/src/sass/include/_nav.scss
index e4311c1c19..0a462076b6 100644
--- a/client/src/sass/include/_nav.scss
+++ b/client/src/sass/include/_nav.scss
@@ -32,7 +32,7 @@
border-bottom-color: transparent;
span {
- border-bottom-color: pvar(--mainColor);
+ border-bottom-color: pvar(--border-primary);
}
}
diff --git a/client/src/sass/include/_variables.scss b/client/src/sass/include/_variables.scss
index 3e7e4fa38d..c32d619a5a 100644
--- a/client/src/sass/include/_variables.scss
+++ b/client/src/sass/include/_variables.scss
@@ -11,49 +11,26 @@ $font-semibold: 600;
$font-bold: 700;
$line-height-normal: 1.2;
-$grey-background-color: #E5E5E5;
-$grey-background-hover-color: #EFEFEF;
-$grey-foreground-color: #585858;
-$grey-foreground-hover-color: #303030;
-$grey-button-outline-color: color.scale($grey-foreground-color, $alpha: -95%);
-
-$main-color: hsl(24, 90%, 50%);
-$main-color-lighter: color.adjust($main-color, $lightness: 10%);
-$main-color-lightest: color.adjust($main-color, $lightness: 40%);
-$main-color-very-light: #fff5eb;
-
-$main-hover-color: color.adjust($main-color, $lightness: 5%);
-$main-background-hover-color: #e9ecef;
-
$support-button: inherit;
$support-button-heart: #e83e8c;
-$bg-color: #fff;
-$fg-color: #212529;
-
$red: #dc3545;
$green: #198754;
$white: #fff;
-$expanded-horizontal-margins: 150px;
-$not-expanded-horizontal-margins: 30px;
+$button-font-size: 1rem;
-$button-font-size: 15px;
+$header-height: 94px;
+$header-height-small-view: 74px;
+$header-height-mobile-view: 124px;
-$header-height: 50px;
-$header-border-color: #e9eff6;
-$search-input-width: 375px;
+$menu-width: 248px;
+$menu-collapsed-width: 50px;
+$menu-margin-left: 2rem;
+$menu-overlay-view: 1200px;
-$menu-background: #000;
-$menu-color: #fff;
-$menu-width: 240px;
-$menu-lateral-padding: 26px;
-
-$sub-menu-background-color: #F7F7F7;
$sub-menu-height: 81px;
-$channel-background-color: #f6ede8;
-
$banner-inverted-ratio: math.div(1, 6);
$max-channels-width: 1200px;
@@ -61,15 +38,19 @@ $max-channels-width: 1200px;
$footer-height: 30px;
$footer-margin: 30px;
-$separator-border-color: rgba(0, 0, 0, 0.1);
+// ---------------------------------------------------------------------------
-$video-miniature-margin-bottom: 15px;
+$miniature-fs-small: 0.75rem;
+$miniature-fs-medium: 0.875rem;
+$miniature-fs-big: 1rem;
-$video-miniature-row-name-font-size: 1.3em;
-$video-miniature-row-mobile-name-font-size: 14px;
+$miniature-fs-row-small: 0.875rem;
+$miniature-fs-row-medium: 1rem;
+$miniature-fs-row-big: 1.25rem;
-$video-miniature-row-info-font-size: 14px;
-$video-miniature-row-mobile-info-font-size: 12px;
+$miniature-fs-mobile-small: 0.875rem;
+$miniature-fs-mobile-medium: 0.875rem;
+$miniature-fs-mobile-big: 1rem;
$video-thumbnail-height: 153px;
$video-thumbnail-width: 280px;
@@ -78,82 +59,115 @@ $video-thumbnail-medium-width: 201px;
$video-thumbnail-small-height: 71px;
$video-thumbnail-small-width: 125px;
+// ---------------------------------------------------------------------------
+
$theater-bottom-space: 115px;
$player-portrait-bottom-space: 50px;
-$input-foreground-color: $fg-color;
-$input-background-color: $bg-color;
-$input-placeholder-color: #797676;
-$input-border-color: #C6C6C6;
-
-$textarea-foreground-color: $fg-color;
-$textarea-background-color: $bg-color;
-$markdown-textarea-background-color: $grey-background-hover-color;
-
$sub-menu-margin-bottom: 30px;
$sub-menu-margin-bottom-small-view: 10px;
-$activated-action-button-color: #212529;
+$focus-box-shadow-dimensions: 0 0 0 .2rem;
-$focus-box-shadow-form: 0 0 0 .2rem;
-$form-input-font-size: 15px;
+$form-input-font-size: 16px;
$video-watch-info-margin-left: 44px;
$primeng-breakpoint: 960px;
-/*** map theme ***/
+// ---------------------------------------------------------------------------
+// Theme variables with key check using pvar() function
+// ---------------------------------------------------------------------------
-// pass variables into a sass map,
-// to be warned of non-existing variables
$variables: (
- --red: var(--red),
- --green: var(--green),
- --white: var(--white),
-
- --mainColor: var(--mainColor),
- --mainColorLighter: var(--mainColorLighter),
- --mainColorLightest: var(--mainColorLightest),
- --mainColorVeryLight: var(--mainColorVeryLight),
-
- --mainHoverColor: var(--mainHoverColor),
- --mainBackgroundHoverColor: var(--mainBackgroundHoverColor),
+ --embed-foreground-color: var(--embed-foreground-color),
+ --embed-big-play-background-color: var(--embed-big-play-background-color),
- --mainBackgroundColor: var(--mainBackgroundColor),
- --mainForegroundColor: var(--mainForegroundColor),
+ --x-margin-content: var(--x-margin-content),
+ --x-videos-margin-content: var(--x-videos-margin-content),
+ --main-col-width: var(--main-col-width),
+ --header-height: var(--header-height),
- --greyForegroundColor: var(--greyForegroundColor),
- --greyBackgroundColor: var(--greyBackgroundColor),
- --greySecondaryBackgroundColor: var(--greySecondaryBackgroundColor),
+ --fg: var(--fg),
+ --bg: var(--bg),
- --menuBackgroundColor: var(--menuBackgroundColor),
- --menuForegroundColor: var(--menuForegroundColor),
-
- --submenuBackgroundColor: var(--submenuBackgroundColor),
- --channelBackgroundColor: var(--channelBackgroundColor),
-
- --inputForegroundColor: var(--inputForegroundColor),
- --inputBackgroundColor: var(--inputBackgroundColor),
- --inputPlaceholderColor: var(--inputPlaceholderColor),
- --inputBorderColor: var(--inputBorderColor),
-
- --textareaForegroundColor: var(--textareaForegroundColor),
- --textareaBackgroundColor: var(--textareaBackgroundColor),
- --markdownTextareaBackgroundColor: var(--markdownTextareaBackgroundColor),
-
- --actionButtonColor: var(--actionButtonColor),
- --activatedActionButtonColor: var(--activatedActionButtonColor),
-
- --supportButtonColor: var(--supportButtonColor),
- --supportButtonBackgroundColor: var(--supportButtonBackgroundColor),
- --supportButtonHeartColor: var(--supportButtonHeartColor),
+ --red: var(--red),
+ --on-red: var(--on-red),
- --embedForegroundColor: var(--embedForegroundColor),
- --embedBigPlayBackgroundColor: var(--embedBigPlayBackgroundColor),
+ --green: var(--green),
- --horizontalMarginContent: var(--horizontalMarginContent),
- --videosHorizontalMarginContent: var(--videosHorizontalMarginContent),
- --mainColWidth: var(--mainColWidth)
+ --input-fg: var(--input-fg),
+ --input-bg: var(--input-bg),
+
+ --input-placeholder: var(--input-placeholder),
+ --input-border-color: var(--input-border-color),
+ --input-bg-in-secondary: var(--input-bg-in-secondary),
+
+ --input-check-active-fg: var(--input-check-active-fg),
+ --input-check-active-bg: var(--input-check-active-bg),
+
+ --input-x-padding: var(--input-x-padding),
+ --input-y-padding: var(--input-y-padding),
+
+ --textarea-fg: var(--textarea-fg),
+ --textarea-bg: var(--textarea-bg),
+
+ --support-btn-bg: var(--support-btn-bg),
+ --support-btn-fg: var(--support-btn-fg),
+ --support-btn-heart-bg: var(--support-btn-heart-bg),
+
+ --secondary-icon-color: var(--secondary-icon-color),
+
+ --fg-500: var(--fg-500),
+ --fg-450: var(--fg-450),
+ --fg-400: var(--fg-400),
+ --fg-350: var(--fg-350),
+ --fg-300: var(--fg-300),
+ --fg-250: var(--fg-250),
+ --fg-200: var(--fg-200),
+ --fg-150: var(--fg-150),
+ --fg-100: var(--fg-100),
+ --fg-50: var(--fg-50),
+
+ --bg-secondary-600: var(--bg-secondary-600),
+ --bg-secondary-550: var(--bg-secondary-550),
+ --bg-secondary-500: var(--bg-secondary-500),
+ --bg-secondary-450: var(--bg-secondary-450),
+ --bg-secondary-400: var(--bg-secondary-400),
+ --bg-secondary-350: var(--bg-secondary-350),
+ --bg-secondary-300: var(--bg-secondary-300),
+ --bg-secondary-250: var(--bg-secondary-250),
+ --bg-secondary-200: var(--bg-secondary-200),
+
+ --on-primary: var(--on-primary),
+
+ --primary: var(--primary),
+ --primary-700: var(--primary-700),
+ --primary-650: var(--primary-650),
+ --primary-600: var(--primary-600),
+ --primary-550: var(--primary-550),
+ --primary-500: var(--primary-500),
+ --primary-450: var(--primary-450),
+ --primary-400: var(--primary-400),
+ --primary-350: var(--primary-350),
+ --primary-300: var(--primary-300),
+ --primary-250: var(--primary-250),
+ --primary-200: var(--primary-200),
+ --primary-150: var(--primary-150),
+ --primary-100: var(--primary-100),
+ --primary-50: var(--primary-50),
+
+ --border-primary: var(--border-primary),
+
+ --alert-primary-fg: var(--alert-primary-fg),
+ --alert-primary-bg: var(--alert-primary-bg),
+ --alert-primary-border-color: var(--alert-primary-border-color),
+
+ --menu-margin-left: var(--menu-margin-left),
+
+ // Optional variables
+ --menu-fg: var(--menu-fg),
+ --menu-bg: var(--menu-bg)
);
// SASS type check our CSS variables
@@ -165,11 +179,20 @@ $variables: (
}
}
-/*** z-index groups ***/
+@function pvar-fallback($variable, $fallback) {
+ @if map.has-key($variables, $variable) and map.has-key($variables, $fallback) {
+ @return var($variable, map.get($variables, $fallback));
+ } @else {
+ @error 'ERROR: Variable #{$variable} or #{$fallback} does not exist';
+ }
+}
+
+// ---------------------------------------------------------------------------
+// z-index groups
+// ---------------------------------------------------------------------------
$zindex: (
miniature : 10,
- sub-menu : 12500,
overlay : 12550,
menu : 12600,
search-typeahead: 12650,
@@ -188,3 +211,11 @@ $zindex: (
@function z($label) {
@return map.get($zindex, $label);
}
+
+// ---------------------------------------------------------------------------
+// Other variables that use pvar()
+// ---------------------------------------------------------------------------
+
+$separator-border-color: pvar(--bg-secondary-400);
+$separator-border-color-on-secondary: pvar(--bg-secondary-450);
+$focus-box-shadow-form: #{$focus-box-shadow-dimensions} #{pvar(--fg-100)};
diff --git a/client/src/sass/player/_player-variables.scss b/client/src/sass/player/_player-variables.scss
index a6e06290c7..8691bf6b2b 100644
--- a/client/src/sass/player/_player-variables.scss
+++ b/client/src/sass/player/_player-variables.scss
@@ -19,8 +19,6 @@ $control-bar-button-width: 34px;
$control-bar-total-height: $control-bar-height - $control-bar-slider-top;
-$slider-bg-color: color.adjust($primary-background-color, $lightness: 33%);
-
$progress-margin: 10px;
$dock-padding: 20px;
diff --git a/client/src/sass/player/context-menu.scss b/client/src/sass/player/context-menu.scss
index b5d1529015..ee04e5fd0e 100644
--- a/client/src/sass/player/context-menu.scss
+++ b/client/src/sass/player/context-menu.scss
@@ -16,7 +16,7 @@ $context-menu-width: 350px;
.vjs-menu-content {
opacity: $primary-foreground-opacity;
- color: pvar(--embedForegroundColor);
+ color: pvar(--embed-foreground-color);
font-size: $font-size !important;
font-weight: $font-semibold;
}
diff --git a/client/src/sass/player/control-bar.scss b/client/src/sass/player/control-bar.scss
index 74e694fb80..cb2d88d561 100644
--- a/client/src/sass/player/control-bar.scss
+++ b/client/src/sass/player/control-bar.scss
@@ -27,7 +27,7 @@ $chapter-marker-size: 9px;
border-radius: $chapter-marker-size;
margin-left: - math.div($chapter-marker-size, 2);
- background-color: $bg-color;
+ background-color: pvar(--bg);
cursor: pointer;
transition: transform 50ms ease-in-out, border-color 50ms ease-in-out;
border: 2px solid transparent;
@@ -36,7 +36,7 @@ $chapter-marker-size: 9px;
&:hover {
transform: scale(1.5);
- border-color: $main-color;
+ border-color: pvar(--primary);
}
}
@@ -77,7 +77,7 @@ $chapter-marker-size: 9px;
.vjs-theater-control,
.vjs-caption-toggle-control,
.vjs-settings {
- color: pvar(--embedForegroundColor) !important;
+ color: pvar(--embed-foreground-color) !important;
opacity: $primary-foreground-opacity;
transition: opacity .1s;
@@ -90,7 +90,7 @@ $chapter-marker-size: 9px;
.vjs-current-time,
.vjs-duration,
.vjs-peertube {
- color: pvar(--embedForegroundColor);
+ color: pvar(--embed-foreground-color);
opacity: $primary-foreground-opacity;
}
@@ -111,7 +111,7 @@ $chapter-marker-size: 9px;
transition: none;
.vjs-play-progress {
- background: pvar(--embedForegroundColor);
+ background: pvar(--embed-foreground-color);
// Not display the circle if the progress is not hovered
&::before {
diff --git a/client/src/sass/player/dock.scss b/client/src/sass/player/dock.scss
index 57d95908bf..a21b546786 100644
--- a/client/src/sass/player/dock.scss
+++ b/client/src/sass/player/dock.scss
@@ -6,7 +6,7 @@
.video-js.vjs-peertube-skin {
.peertube-dock {
- --avatarSize: 48px;
+ --dock-avatar-size: 48px;
transition: opacity 0.1s;
@@ -28,10 +28,10 @@
.peertube-dock-avatar {
border-radius: 50%;
margin-right: 10px;
- min-width: var(--avatarSize);
- min-height: var(--avatarSize);
- max-height: var(--avatarSize);
- max-height: var(--avatarSize);
+ min-width: var(--dock-avatar-size);
+ min-height: var(--dock-avatar-size);
+ max-height: var(--dock-avatar-size);
+ max-height: var(--dock-avatar-size);
}
.peertube-dock-title-description {
@@ -70,7 +70,7 @@
.video-js.vjs-peertube-skin.vjs-size-750 {
.peertube-dock-avatar {
- --avatarSize: 40px;
+ --dock-avatar-size: 40px;
}
.peertube-dock {
@@ -85,7 +85,7 @@
.video-js.vjs-peertube-skin.vjs-size-570 {
.peertube-dock-avatar {
- --avatarSize: 35px;
+ --dock-avatar-size: 35px;
}
.peertube-dock {
@@ -95,7 +95,7 @@
.video-js.vjs-peertube-skin.vjs-size-350 {
.peertube-dock-avatar {
- --avatarSize: 30px;
+ --dock-avatar-size: 30px;
}
.peertube-dock {
diff --git a/client/src/sass/player/offline-notification.scss b/client/src/sass/player/offline-notification.scss
index 450c95bbc3..e806db3e41 100644
--- a/client/src/sass/player/offline-notification.scss
+++ b/client/src/sass/player/offline-notification.scss
@@ -6,8 +6,8 @@ $height: 40px;
left: 0;
right: 0;
height: $height;
- color: #000;
- background-color: var(--mainColorLightest);
+ color: pvar(--on-primary);
+ background-color: pvar(--primary-50);
text-align: center;
z-index: 1;
display: flex;
diff --git a/client/src/sass/player/peertube-skin.scss b/client/src/sass/player/peertube-skin.scss
index 2567559101..0c069e88eb 100644
--- a/client/src/sass/player/peertube-skin.scss
+++ b/client/src/sass/player/peertube-skin.scss
@@ -4,9 +4,9 @@
@use './_player-variables' as *;
body {
- --embedForegroundColor: #{$primary-foreground-color};
+ --embed-foreground-color: #{$primary-foreground-color};
- --embedBigPlayBackgroundColor: #{$primary-background-color};
+ --embed-big-play-background-color: #{$primary-background-color};
}
@mixin big-play-button-triangle-size($triangle-size) {
@@ -18,7 +18,7 @@ body {
.video-js.vjs-peertube-skin {
font-size: $font-size;
- color: pvar(--embedForegroundColor);
+ color: pvar(--embed-foreground-color);
&.disabled {
cursor: default;
@@ -67,7 +67,7 @@ body {
&:focus-visible,
&:hover {
- background-color: var(--mainColor, #696969);
+ background-color: pvar(--primary);
}
}
@@ -101,7 +101,7 @@ body {
}
.vjs-big-play-button {
- background-color: pvar(--embedBigPlayBackgroundColor);
+ background-color: pvar(--embed-big-play-background-color);
}
.vjs-settings-dialog,
diff --git a/client/src/sass/player/playlist.scss b/client/src/sass/player/playlist.scss
index 2965561423..c3e571b003 100644
--- a/client/src/sass/player/playlist.scss
+++ b/client/src/sass/player/playlist.scss
@@ -24,7 +24,7 @@ $playlist-menu-width: 350px;
}
.header {
- border-bottom: 1px solid $header-border-color;
+ border-bottom: 1px solid #e9eff6;
padding: 20px 10px;
display: flex;
justify-content: space-between;
@@ -92,8 +92,8 @@ $playlist-menu-width: 350px;
}
.vjs-playlist-icon {
- mask-image: url('#{$assets-path}/images/feather/list.svg');
- -webkit-mask-image: url('#{$assets-path}/images/feather/list.svg');
+ mask-image: url('#{$assets-path}/images/feather/playlists.svg');
+ -webkit-mask-image: url('#{$assets-path}/images/feather/playlists.svg');
mask-size: cover;
-webkit-mask-size: cover;
diff --git a/client/src/sass/player/settings-menu.scss b/client/src/sass/player/settings-menu.scss
index 5041566f63..554900bfba 100644
--- a/client/src/sass/player/settings-menu.scss
+++ b/client/src/sass/player/settings-menu.scss
@@ -19,7 +19,7 @@ $setting-transition-easing: ease-out;
position: absolute;
right: .5em;
bottom: 4em;
- color: pvar(--embedForegroundColor);
+ color: pvar(--embed-foreground-color);
opacity: $primary-foreground-opacity;
margin: 0 auto;
font-size: $font-size !important;
diff --git a/client/src/sass/primeng-custom.scss b/client/src/sass/primeng-custom.scss
index 1f3cb78908..e2be688180 100644
--- a/client/src/sass/primeng-custom.scss
+++ b/client/src/sass/primeng-custom.scss
@@ -2,6 +2,8 @@
@use '_mixins' as *;
@use '_icons' as *;
+$hover-bg: pvar(--bg-secondary-350);
+
/* stylelint-disable */
@import 'primeng/resources/primeng.css';
@@ -56,7 +58,7 @@ body .p-paginator .p-paginator-first,
body .p-paginator .p-paginator-prev,
body .p-paginator .p-paginator-next,
body .p-paginator .p-paginator-last {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
height: 2.286em;
min-width: 2.286em;
border: 0 none;
@@ -71,8 +73,8 @@ body .p-paginator .p-paginator-first:not(.p-disabled):not(.p-highlight):hover,
body .p-paginator .p-paginator-prev:not(.p-disabled):not(.p-highlight):hover,
body .p-paginator .p-paginator-next:not(.p-disabled):not(.p-highlight):hover,
body .p-paginator .p-paginator-last:not(.p-disabled):not(.p-highlight):hover {
- background-color: #e0e0e0;
- color: #333333;
+ background-color: $hover-bg;
+ color: pvar(--fg);
}
body .p-paginator .p-paginator-first:focus,
body .p-paginator .p-paginator-prev:focus,
@@ -80,19 +82,19 @@ body .p-paginator .p-paginator-next:focus,
body .p-paginator .p-paginator-last:focus {
outline: 0 none;
outline-offset: 0;
- box-shadow: 0 0 0 0.2em pvar(--mainColorLightest);
+ box-shadow: $focus-box-shadow-form;
}
body .p-paginator .p-paginator-current {
- color: #333333;
+ color: pvar(--fg);
height: 2.286em;
min-width: 2.286em;
line-height: 2.286em;
}
body .p-paginator .p-dropdown .p-dropdown-trigger, body .p-paginator .p-dropdown .p-dropdown-label {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
}
body .p-paginator .p-dropdown:hover .p-dropdown-trigger, body .p-paginator .p-dropdown:hover .p-dropdown-label {
- color: #333333;
+ color: pvar(--fg);
}
body .p-paginator .p-paginator-first:before {
position: relative;
@@ -116,7 +118,7 @@ body .p-paginator .p-paginator-pages {
padding: 0;
}
body .p-paginator .p-paginator-pages .p-paginator-page {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
height: 2.286em;
min-width: 2.286em;
border: 0 none;
@@ -128,13 +130,13 @@ body .p-paginator .p-paginator-pages .p-paginator-page {
border-radius: 0;
}
body .p-paginator .p-paginator-pages .p-paginator-page:not(.p-highlight):hover {
- background-color: #e0e0e0;
- color: #333333;
+ background-color: $hover-bg;
+ color: pvar(--fg);
}
body .p-paginator .p-paginator-pages .p-paginator-page:focus {
outline: 0 none;
outline-offset: 0;
- box-shadow: 0 0 0 0.2em pvar(--mainColorLightest);
+ box-shadow: $focus-box-shadow-form;
}
body .p-paginator .p-dropdown {
@include margin-left(0.5em);
@@ -146,19 +148,19 @@ body .p-paginator .p-dropdown {
// Dropdown
body .p-dropdown {
- background: pvar(--mainBackgroundColor);;
- border: 1px solid pvar(--inputBorderColor);
+ background: pvar(--input-bg);
+ border: 1px solid pvar(--input-border-color);
transition: border-color 0.2s, box-shadow 0.2s;
- border-radius: 3px;
+ border-radius: 4px;
}
body .p-dropdown:not(.p-disabled):hover {
- border-color: pvar(--inputBorderColor);
+ border-color: pvar(--input-border-color);
}
body .p-dropdown:not(.p-disabled).p-focus {
outline: 0 none;
outline-offset: 0;
- box-shadow: 0 0 0 0.2em pvar(--mainColorLightest);
- border-color: pvar(--inputBorderColor);
+ box-shadow: $focus-box-shadow-form;
+ border-color: pvar(--input-border-color);
}
body .p-dropdown.p-dropdown-clearable .p-dropdown-label {
@include padding-right(0);
@@ -168,7 +170,7 @@ body .p-dropdown .p-dropdown-label {
border: 0 none;
}
body .p-dropdown .p-dropdown-label.p-placeholder {
- color: pvar(--inputPlaceholderColor);
+ color: pvar(--input-placeholder);
}
.p-dropdown .p-dropdown-label:focus, .p-dropdown .p-dropdown-label:enabled:focus {
outline: 0 none;
@@ -180,26 +182,26 @@ body .p-dropdown .p-dropdown-trigger {
width: 2rem;
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
}
body .p-dropdown .p-dropdown-clear-icon {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
right: 2rem;
}
body .p-dropdown.p-dropdown-clearable .p-dropdown-label {
@include padding-right(4em);
}
body .p-dropdown-panel {
- background-color: pvar(--mainBackgroundColor);
- border: 1px solid pvar(--inputBorderColor);
+ background-color: pvar(--bg);
+ border: 1px solid pvar(--input-border-color);
border-radius: 6px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}
.p-dropdown-panel .p-dropdown-header {
padding: 0.429em 0.857em 0.429em 0.857em;
- border-bottom: 1px solid pvar(--mainColorVeryLight);
- color: pvar(--mainForegroundColor);
- background-color: pvar(--mainBackgroundColor);
+ border-bottom: 1px solid pvar(--primary-100);
+ color: pvar(--fg);
+ background-color: pvar(--bg);
margin: 0;
}
.p-dropdown-panel .p-dropdown-header .p-dropdown-filter {
@@ -211,7 +213,7 @@ body .p-dropdown-panel {
top: 50%;
margin-top: -0.5em;
right: 1.357em;
- color: pvar(--mainColor);
+ color: pvar(--input-fg);
}
body .p-dropdown-panel .p-dropdown-items {
padding: 0;
@@ -221,7 +223,7 @@ body .p-dropdown-panel .p-dropdown-items .p-dropdown-item {
margin: 0;
padding: 8px 16px;
border: 0 none;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
background-color: transparent;
-moz-border-radius: 0;
-webkit-border-radius: 0;
@@ -231,30 +233,30 @@ body .p-dropdown-panel .p-dropdown-items .p-dropdown-item {
margin-top: 0;
}
.p-dropdown-panel .p-dropdown-items .p-dropdown-item.p-highlight {
- color: pvar(--mainForegroundColor);
- background: pvar(--mainColorLightest);
+ color: pvar(--fg);
+ background: pvar(--bg-secondary-500);
}
.p-dropdown-panel .p-dropdown-items .p-dropdown-item.p-highlight.p-focus {
- background: pvar(--mainColorLightest);
+ background: pvar(--bg-secondary-500);
}
.p-dropdown-panel .p-dropdown-items .p-dropdown-item:not(.p-highlight):not(.p-disabled).p-focus {
- color: pvar(--mainForegroundColor);
- background: pvar(--mainColorVeryLight);;
+ color: pvar(--fg);
+ background: pvar(--bg-secondary-500);
}
.p-dropdown-panel .p-dropdown-items .p-dropdown-item:not(.p-highlight):not(.p-disabled):hover {
- color: pvar(--mainForegroundColor);
- background: pvar(--mainColorVeryLight);;
+ color: pvar(--fg);
+ background: $hover-bg;
}
.p-dropdown-panel .p-dropdown-items .p-dropdown-item-group {
margin: 0;
padding: 0.857rem;
- color: pvar(--mainForegroundColor);
- background: pvar(--mainColorVeryLight);;
+ color: pvar(--fg);
+ background: pvar(--bg-secondary-500);
font-weight: $font-semibold;
}
.p-dropdown-panel .p-dropdown-items .p-dropdown-empty-message {
padding: 8px 16px;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
background: transparent;
}
@@ -268,9 +270,9 @@ body .p-toast .p-toast-message {
body .p-datepicker {
padding: 0.857em;
min-width: 20em;
- background-color: #ffffff;
- color: #333333;
- border: 1px solid #a6a6a6;
+ background-color: pvar(--bg-secondary-400);
+ color: pvar(--fg);
+ border: 1px solid $separator-border-color;
}
body .p-datepicker:not(.p-datepicker-inline) {
@@ -281,18 +283,12 @@ body .p-datepicker:not(.p-disabled) .p-datepicker-header .p-datepicker-prev:focu
body .p-datepicker:not(.p-disabled) .p-datepicker-header .p-datepicker-next:focus {
outline: 0 none;
outline-offset: 0;
- box-shadow: 0 0 0 0.2em pvar(--mainColorLightest);
-}
-body .p-datepicker:not(.p-disabled) table td a:not(.p-highlight):not(.p-highlight):hover {
- background-color: #eaeaea;
-}
-body .p-datepicker:not(.p-disabled) .p-monthpicker a.p-monthpicker-month:not(.p-highlight):hover {
- background-color: #eaeaea;
+ box-shadow: $focus-box-shadow-form;
}
body .p-datepicker .p-datepicker-header {
padding: 0.429em 0.857em 0.429em 0.857em;
- background-color: #ffffff;
- color: #333333;
+ background-color: pvar(--bg-secondary-400);
+ color: pvar(--fg);
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
@@ -301,7 +297,7 @@ body .p-datepicker .p-datepicker-header .p-datepicker-prev,
body .p-datepicker .p-datepicker-header .p-datepicker-next {
cursor: pointer;
top: 0;
- color: #a6a6a6;
+ color: pvar(--fg-300);
transition: color 0.2s, box-shadow 0.2s;
}
body .p-datepicker .p-datepicker-header .p-datepicker-title {
@@ -317,7 +313,7 @@ body .p-datepicker .p-datepicker-header .p-datepicker-title select {
body .p-datepicker .p-datepicker-header .p-datepicker-title select:focus {
outline: 0 none;
outline-offset: 0;
- box-shadow: 0 0 0 0.2em pvar(--mainColorLightest);
+ box-shadow: $focus-box-shadow-form;
}
body .p-datepicker .p-datepicker-header .p-datepicker-title .p-datepicker-month {
@include margin-right(0.5rem);
@@ -330,7 +326,7 @@ body .p-datepicker table th {
padding: 0.5em;
}
body .p-datepicker table th.p-datepicker-weekheader {
- border-right: 1px solid #a6a6a6;
+ border-right: 1px solid $separator-border-color;
}
body .p-datepicker table td {
padding: 0.5em;
@@ -339,15 +335,15 @@ body .p-datepicker table td > a,
body .p-datepicker table td > span {
display: block;
text-align: center;
- color: #333333;
+ color: pvar(--fg);
padding: 0.5em;
transition: box-shadow 0.2s;
border-radius: 3px;
}
body .p-datepicker table td > a.p-highlight,
body .p-datepicker table td > span.p-highlight {
- color: #ffffff;
- background-color: pvar(--mainColor);
+ color: pvar(--on-primary);
+ background-color: pvar(--primary);
}
body .p-datepicker table td > a {
cursor: pointer;
@@ -355,17 +351,17 @@ body .p-datepicker table td > a {
body .p-datepicker table td > a:focus {
outline: 0 none;
outline-offset: 0;
- box-shadow: 0 0 0 0.2em pvar(--mainColorLightest);
+ box-shadow: $focus-box-shadow-form;
}
body .p-datepicker table td.p-datepicker-today > a,
body .p-datepicker table td.p-datepicker-today > span {
- background-color: #d0d0d0;
- color: #333333;
+ background-color: pvar(--bg-secondary-600);
+ color: pvar(--fg);
}
body .p-datepicker table td.p-datepicker-today > a.p-highlight,
body .p-datepicker table td.p-datepicker-today > span.p-highlight {
- color: #ffffff;
- background-color: pvar(--mainColor);
+ color: pvar(--on-primary);
+ background-color: pvar(--primary);
}
body .p-datepicker table td.p-datepicker-weeknumber {
border-right: 1px solid #a6a6a6;
@@ -379,21 +375,21 @@ body .p-datepicker .p-timepicker {
padding: 0.857em;
}
body .p-datepicker .p-timepicker a {
- color: #333333;
+ color: pvar(--fg);
font-size: 1.286em;
}
body .p-datepicker .p-timepicker a:hover {
- color: pvar(--mainColor);
+ color: pvar(--primary);
}
body .p-datepicker .p-timepicker span {
font-size: 1.286em;
}
body .p-datepicker .p-monthpicker .p-monthpicker-month {
- color: #333333;
+ color: pvar(--fg);
}
body .p-datepicker .p-monthpicker .p-monthpicker-month.p-highlight {
- color: #ffffff;
- background-color: pvar(--mainColor);
+ color: pvar(--on-primary);
+ background-color: pvar(--primary);
}
body .p-datepicker.p-datepicker-timeonly {
padding: 0;
@@ -458,19 +454,19 @@ body .p-autocomplete-panel .p-autocomplete-items .p-autocomplete-item {
margin: 0;
padding: 0.429em 0.857em;
border: 0 none;
- color: #333333;
+ color: pvar(--fg);
background-color: transparent;
border-radius: 0;
}
body .p-autocomplete-panel .p-autocomplete-items .p-autocomplete-item.p-highlight,
body .p-autocomplete-panel .p-autocomplete-items .p-autocomplete-item:hover {
color: #ffffff;
- background-color: pvar(--mainColor);
+ background-color: pvar(--primary);
}
body .p-autocomplete-panel .p-autocomplete-items .p-autocomplete-group {
padding: 0.429em 0.857em;
background-color: #d8dae2;
- color: #333333;
+ color: pvar(--fg);
}
body p-autocomplete.ng-dirty.ng-invalid > .p-autocomplete > .p-inputtext {
border: 1px solid #a80000;
@@ -479,27 +475,27 @@ body p-autocomplete.ng-dirty.ng-invalid > .p-autocomplete > .p-inputtext {
//chips
.p-chips:not(.p-disabled):hover .p-chips-multiple-container {
- border-color: pvar(--inputBorderColor);
+ border-color: pvar(--input-border-color);
}
.p-chips:not(.p-disabled).p-focus .p-chips-multiple-container {
outline: 0 none;
outline-offset: 0;
- box-shadow: 0 0 0 0.25rem var(--mainColorLightest);
+ box-shadow: $focus-box-shadow-form;
}
.p-chips .p-chips-multiple-container {
- padding: 3px 15px;
+ padding: pvar(--input-y-padding) pvar(--input-x-padding);
gap: 0.25rem;
}
.p-chips .p-chips-multiple-container .p-chips-token {
padding: 2px 15px;
margin-right: 0.5rem;
- background: pvar(--mainColorLightest);
- color: pvar(--mainForegroundColor);
- border-radius: 3px;
+ background: pvar(--bg-secondary-500);
+ color: pvar(--fg);
+ border-radius: 4px;
}
.p-chips .p-chips-multiple-container .p-chips-token.p-focus {
- background: pvar(--mainColorVeryLight);
- color: pvar(--mainForegroundColor);
+ background: pvar(--bg-secondary-500);
+ color: pvar(--fg);
}
.p-chips .p-chips-multiple-container .p-chips-token .p-chips-token-icon {
margin-left: 0.5rem;
@@ -508,7 +504,7 @@ body p-autocomplete.ng-dirty.ng-invalid > .p-autocomplete > .p-inputtext {
padding: 3px 0;
}
.p-chips .p-chips-multiple-container .p-chips-input-token input {
- color: pvar(--mainForegroundColor);
+ color: pvar(--input-placeholder);
padding: 0;
margin: 0;
}
@@ -521,41 +517,42 @@ p-chips.p-chips-clearable .p-inputtext {
padding-right: 1.429rem;
}
p-chips.p-chips-clearable .p-chips-clear-icon {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
right: 0.429rem;
}
// multiselect
.p-multiselect {
- background: pvar(--mainBackgroundColor);
- border: 1px solid pvar(--inputBorderColor);
+ background: pvar(--input-bg);
+ border: 1px solid pvar(--input-border-color);
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
- border-radius: 3px;
- font-size: 15px;
+ border-radius: 4px;
+ font-size: 16px;
}
.p-multiselect:not(.p-disabled):hover {
- border-color: pvar(--inputBorderColor);;
+ border-color: pvar(--input-border-color);
}
.p-multiselect:not(.p-disabled).p-focus {
outline: 0 none;
outline-offset: 0;
- box-shadow: 0 0 0 0.25rem var(--mainColorLightest);
+ box-shadow: $focus-box-shadow-form;
}
.p-multiselect .p-multiselect-label {
- padding: 4px 15px;
+ padding: pvar(--input-y-padding) pvar(--input-x-padding);
line-height: normal;
+ font-weight: normal;
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.p-multiselect .p-multiselect-label.p-placeholder {
- color: pvar(--inputPlaceholderColor);
+ color: pvar(--input-placeholder);
}
.p-multiselect.p-multiselect-chip .p-multiselect-token {
padding: 2px 7px;
margin-right: 0.25rem;
- background: pvar(--mainColorLightest);
- color: pvar(--mainForegroundColor);
- border-radius: 3px;
+ background: pvar(--bg-secondary-500);
+ color: pvar(--fg);
+ border-radius: 4px;
}
.p-multiselect.p-multiselect-chip .p-multiselect-token .p-multiselect-token-icon {
margin-left: 0.5rem;
@@ -567,39 +564,39 @@ p-chips.p-chips-clearable .p-chips-clear-icon {
border-bottom-right-radius: 3px;
}
.p-multiselect.p-variant-filled {
- background: pvar(--mainColorLightest);
+ background: pvar(--bg-secondary-500);
}
.p-multiselect.p-variant-filled:not(.p-disabled):hover {
- background-color: pvar(--mainColorLightest);
+ background-color: $hover-bg;
}
.p-multiselect.p-variant-filled:not(.p-disabled).p-focus {
- background-color: pvar(--mainColorLightest);
+ background-color: pvar(--bg-secondary-500);
}
.p-inputwrapper-filled .p-multiselect.p-multiselect-chip .p-multiselect-label {
- padding: 3px 15px;
+ padding: pvar(--input-y-padding) pvar(--input-x-padding);
}
.p-multiselect-clearable .p-multiselect-label-container {
padding-right: 1.429rem;
}
.p-multiselect-clearable .p-multiselect-clear-icon {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
right: 2.357rem;
}
.p-multiselect-panel {
- background: pvar(--mainBackgroundColor);
- color: pvar(--mainForegroundColor);
- border: 1px solid pvar(--inputBorderColor);
- border-radius: 3px;
+ background: pvar(--bg);
+ color: pvar(--fg);
+ border: 1px solid pvar(--input-border-color);
+ border-radius: 4px;
box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.16);
}
.p-multiselect-panel .p-multiselect-header {
padding: 0.429rem 0.857rem;
- border-bottom: 1px solid pvar(--inputBorderColor);
- color: pvar(--mainForegroundColor);
- background: pvar(--mainBackgroundColor);
+ border-bottom: 1px solid pvar(--input-border-color);
+ color: pvar(--fg);
+ background: pvar(--bg);
margin: 0;
border-top-right-radius: 3px;
border-top-left-radius: 3px;
@@ -609,7 +606,7 @@ p-chips.p-chips-clearable .p-chips-clear-icon {
}
.p-multiselect-panel .p-multiselect-header .p-multiselect-filter-container .p-multiselect-filter-icon {
right: 0.429rem;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
}
.p-multiselect-panel .p-multiselect-header .p-checkbox {
margin-right: 0.5rem;
@@ -618,30 +615,30 @@ p-chips.p-chips-clearable .p-chips-clear-icon {
margin-left: 0.5rem;
width: 2rem;
height: 2rem;
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
border: 0 none;
background: transparent;
border-radius: 50%;
transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.p-multiselect-panel .p-multiselect-header .p-multiselect-close:enabled:hover {
- color: pvar(--mainColor);
+ color: pvar(--fg-400);
border-color: transparent;
background: transparent;
}
.p-multiselect-panel .p-multiselect-header .p-multiselect-close:focus-visible {
outline: 0 none;
outline-offset: 0;
- box-shadow: 0 0 0 0.2rem pvar(--mainColorVeryLight);
+ box-shadow: $focus-box-shadow-form;
}
.p-multiselect-panel .p-multiselect-items {
padding: 0;
}
.p-multiselect-panel .p-multiselect-items .p-multiselect-item {
margin: 0;
- padding: 6px 14px;
+ padding: pvar(--input-y-padding) 14px;
border: 0 none;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
background: transparent;
transition: background-color 0.2s, box-shadow 0.2s;
border-radius: 0;
@@ -651,19 +648,19 @@ p-chips.p-chips-clearable .p-chips-clear-icon {
margin-top: 0;
}
.p-multiselect-panel .p-multiselect-items .p-multiselect-item.p-highlight {
- color: pvar(--mainBackgroundColor);
- background: pvar(--mainColor);
+ color: pvar(--bg);
+ background: pvar(--primary);
}
.p-multiselect-panel .p-multiselect-items .p-multiselect-item.p-highlight.p-focus {
- background: pvar(--mainColor);
+ background: pvar(--primary);
}
.p-multiselect-panel .p-multiselect-items .p-multiselect-item:not(.p-highlight):not(.p-disabled).p-focus {
- color: pvar(--mainForegroundColor);
- background: pvar(--mainColorVeryLight);
+ color: pvar(--fg);
+ background: pvar(--bg-secondary-500);
}
.p-multiselect-panel .p-multiselect-items .p-multiselect-item:not(.p-highlight):not(.p-disabled):hover {
- color: pvar(--mainForegroundColor);
- background: pvar(--mainColorVeryLight);
+ color: pvar(--fg);
+ background: pvar(--bg-secondary-500);
}
.p-multiselect-panel .p-multiselect-items .p-multiselect-item .p-checkbox {
margin-right: 0.5rem;
@@ -671,24 +668,24 @@ p-chips.p-chips-clearable .p-chips-clear-icon {
.p-multiselect-panel .p-multiselect-items .p-multiselect-item-group {
margin: 0;
padding: 0.857rem;
- color: pvar(--mainForegroundColor);
- background-color: pvar(--mainColorVeryLight);
+ color: pvar(--fg);
+ background-color: pvar(--bg-secondary-500);
font-weight: $font-semibold;
}
.p-multiselect-panel .p-multiselect-items .p-multiselect-empty-message {
padding: 0.429rem 0.857rem;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
background: transparent;
}
.p-input-filled .p-multiselect {
- background-color: pvar(--mainColorVeryLight);
+ background-color: pvar(--bg-secondary-500);
}
.p-input-filled .p-multiselect:not(.p-disabled):hover {
- background-color: pvar(--mainColorVeryLight);
+ background-color: pvar(--bg-secondary-500);
}
.p-input-filled .p-multiselect:not(.p-disabled).p-focus {
- background-color: pvar(--mainColorVeryLight);
+ background-color: pvar(--bg-secondary-500);
}
p-multiselect.ng-dirty.ng-invalid > .p-multiselect {
@@ -698,22 +695,22 @@ p-multiselect.ng-dirty.ng-invalid > .p-multiselect {
// input text (used by p-chips)
.p-inputtext {
- font-size: 15px;
- color: pvar(--mainForegroundColor);
- background: pvar(--mainBackgroundColor);
- padding: 3px 15px;
- border: 1px solid pvar(--inputBorderColor);
+ font-size: 16px;
+ color: pvar(--input-fg);
+ background: pvar(--input-bg);
+ padding: pvar(--input-y-padding) pvar(--input-x-padding);
+ border: 1px solid pvar(--input-border-color);
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
appearance: none;
- border-radius: 3px;
+ border-radius: 4px;
}
.p-inputtext:enabled:hover {
- border-color: pvar(--inputBorderColor);
+ border-color: pvar(--input-border-color);
}
.p-inputtext:enabled:focus {
outline: 0 none;
outline-offset: 0;
- box-shadow: 0 0 0 0.25rem var(--mainColorLightest);
+ box-shadow: $focus-box-shadow-form;
}
.p-inputtext.ng-dirty.ng-invalid {
border-color: pvar(--red);
@@ -758,13 +755,14 @@ p-table {
.p-datatable-header {
border: none !important;
- background-color: pvar(--mainBackgroundColor) !important;
+ background-color: pvar(--bg) !important;
.caption {
min-height: 40px;
width: 100%;
display: inline-flex;
align-items: center;
+ flex-wrap: wrap;
.left-buttons {
@include padding-left(15px);
@@ -773,7 +771,7 @@ p-table {
}
th {
- background-color: pvar(--mainBackgroundColor) !important;
+ background-color: pvar(--bg) !important;
outline: 0;
overflow: hidden;
text-overflow: ellipsis;
@@ -783,7 +781,7 @@ p-table {
td, th {
font-family: $main-fonts;
font-size: 15px;
- color: pvar(--mainForegroundColor) !important;
+ color: pvar(--fg) !important;
}
td {
@@ -802,26 +800,26 @@ p-table {
tr {
outline: 0;
- background-color: pvar(--mainBackgroundColor) !important;
+ background-color: pvar(--bg) !important;
height: 46px;
&.p-highlight {
- background-color: pvar(--submenuBackgroundColor) !important;
+ background-color: pvar(--bg-secondary-400) !important;
td, td > a {
- color: pvar(--mainForegroundColor) !important;
+ color: pvar(--fg) !important;
}
}
&:focus-visible {
- border: 1px solid pvar(--mainForegroundColor) !important
+ border: 1px solid pvar(--fg) !important
}
}
.p-datatable-tbody {
tr {
&:hover {
- background-color: pvar(--submenuBackgroundColor) !important;
+ background-color: $hover-bg !important;
}
td {
@@ -851,36 +849,36 @@ p-table {
}
th {
- @include padding-left(15px);
- @include padding-right(0px);
+ @include padding-left(1rem);
+ @include padding-right(0.25rem);
padding-top: 5px !important;
padding-bottom: 5px !important;
border: none !important;
border-bottom: 1px solid !important;
- border-color: pvar(--submenuBackgroundColor) !important;
+ border-color: pvar(--bg-secondary-400) !important;
text-align: start !important;
font-weight: $font-semibold !important;
- color: pvar(--mainForegroundColor) !important;
+ color: pvar(--fg) !important;
&.p-sortable-column:hover {
- background-color: pvar(--submenuBackgroundColor) !important;
+ background-color: $hover-bg !important;
}
&.p-sortable-column:focus-visible {
- border: 1px solid pvar(--mainForegroundColor) !important
+ border: 1px solid pvar(--fg) !important
}
&.p-highlight {
- background-color: pvar(--submenuBackgroundColor) !important;
+ background-color: pvar(--bg-secondary-400) !important;
.pi-sort-amount-up-alt,
.pi-sort-amount-down {
display: inline-block;
position: relative;
top: -1px;
- color: pvar(--mainForegroundColor) !important;
+ color: pvar(--fg) !important;
}
.pi-sort-amount-up-alt {
@@ -911,11 +909,11 @@ p-table {
p-paginator {
.p-paginator {
- background-color: pvar(--mainBackgroundColor) !important;
+ background-color: pvar(--bg) !important;
position: relative;
border: none;
border-top: 1px solid !important;
- border-color: pvar(--submenuBackgroundColor) !important;
+ border-color: pvar(--bg-secondary-400) !important;
height: 40px;
display: flex;
justify-content: center;
@@ -929,22 +927,22 @@ p-table {
}
&.p-focus {
- box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
+ box-shadow: $focus-box-shadow-form;
}
.p-label {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
}
}
.p-dropdown,
.p-dropdown-trigger {
- color: pvar(--mainForegroundColor);
- background-color: pvar(--mainBackgroundColor);
+ color: pvar(--fg);
+ background-color: pvar(--bg);
}
.p-paginator-current {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
overflow: visible;
}
@@ -963,11 +961,11 @@ p-table {
padding: 5px 2px;
height: 100%;
outline: none;
- color: pvar(--mainForegroundColor);
+ color: pvar(--fg);
&.focus-within,
&:focus {
- box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
+ box-shadow: $focus-box-shadow-form;
}
&.p-disabled:hover {
@@ -992,7 +990,7 @@ p-table {
height: auto !important;
.p-paginator-page {
- color: pvar(--mainForegroundColor) !important;
+ color: pvar(--fg) !important;
font-weight: $font-semibold !important;
margin: 0 5px !important;
outline: 0 !important;
@@ -1003,13 +1001,13 @@ p-table {
&.focus-within,
&:focus {
- box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest) !important;
+ box-shadow: #{$focus-box-shadow-form} !important;
}
&.p-highlight {
&, &:hover, &:active, &:focus {
- color: #fff !important;
- background-color: pvar(--mainColor) !important;
+ color: pvar(--fg) !important;
+ background-color: pvar(--bg-secondary-500) !important;
}
}
}
@@ -1070,13 +1068,13 @@ p-tablecheckbox:hover div .p-checkbox-box {
.p-checkbox-box {
&.p-highlight {
- color: pvar(--mainBackgroundColor) !important;
- background-color: pvar(--mainColor) !important;
- border-color: pvar(--mainColor) !important;
+ color: pvar(--bg) !important;
+ background-color: pvar(--primary) !important;
+ border-color: pvar(--primary) !important;
}
&.p-focus {
- border: 2px solid pvar(--mainForegroundColor) !important;
+ border: 2px solid pvar(--fg) !important;
}
}
}
@@ -1088,7 +1086,7 @@ p-toast {
min-width: 200px;
.p-toast-icon-close {
- color: pvar(--greyForegroundColor);
+ color: pvar(--fg-300);
position: absolute;
right: 5px;
top: 5px;
@@ -1101,8 +1099,8 @@ p-toast {
.p-toast-message {
font-family: $main-fonts;
- background-color: pvar(--mainBackgroundColor) !important;
- color: pvar(--mainForegroundColor) !important;
+ background-color: pvar(--bg) !important;
+ color: pvar(--fg) !important;
border-radius: 5px;
box-sizing: border-box;
border: 1px solid #EBEEF5 !important;
@@ -1201,7 +1199,7 @@ p-chips {
}
.p-chips-multiple-container {
- padding: 1px 15px !important;
+ padding: 4px 20px !important;
margin-block-end: 0 !important;
width: 100% !important;
}
@@ -1229,7 +1227,6 @@ p-chips {
font-size: 15px;
.p-dropdown-label {
- padding: 4px 15px;
line-height: normal;
min-height: 29px;
}
diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts
index 0e926191af..dbb9478fe5 100644
--- a/client/src/standalone/videos/embed.ts
+++ b/client/src/standalone/videos/embed.ts
@@ -341,11 +341,11 @@ export class PeerTubeEmbed {
const body = document.getElementById('custom-css')
if (this.playerOptionsBuilder.hasBigPlayBackgroundColor()) {
- body.style.setProperty('--embedBigPlayBackgroundColor', this.playerOptionsBuilder.getBigPlayBackgroundColor())
+ body.style.setProperty('--embed-big-play-background-color', this.playerOptionsBuilder.getBigPlayBackgroundColor())
}
if (this.playerOptionsBuilder.hasForegroundColor()) {
- body.style.setProperty('--embedForegroundColor', this.playerOptionsBuilder.getForegroundColor())
+ body.style.setProperty('--embed-foreground-color', this.playerOptionsBuilder.getForegroundColor())
}
}
diff --git a/client/src/standalone/videos/shared/auth-http.ts b/client/src/standalone/videos/shared/auth-http.ts
index 3dfc47b88c..436fcf8c48 100644
--- a/client/src/standalone/videos/shared/auth-http.ts
+++ b/client/src/standalone/videos/shared/auth-http.ts
@@ -3,7 +3,7 @@ import { OAuthUserTokens, objectToUrlEncoded } from '../../../root-helpers'
import { peertubeLocalStorage } from '../../../root-helpers/peertube-web-storage'
export class AuthHTTP {
- private readonly LOCAL_STORAGE_OAUTH_CLIENT_KEYS = {
+ private readonly LS_OAUTH_CLIENT_KEYS = {
CLIENT_ID: 'client_id',
CLIENT_SECRET: 'client_secret'
}
@@ -44,8 +44,8 @@ export class AuthHTTP {
if (res.status !== HttpStatusCode.UNAUTHORIZED_401) return res
const refreshingTokenPromise = new Promise<void>((resolve, reject) => {
- const clientId: string = peertubeLocalStorage.getItem(this.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_ID)
- const clientSecret: string = peertubeLocalStorage.getItem(this.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_SECRET)
+ const clientId: string = peertubeLocalStorage.getItem(this.LS_OAUTH_CLIENT_KEYS.CLIENT_ID)
+ const clientSecret: string = peertubeLocalStorage.getItem(this.LS_OAUTH_CLIENT_KEYS.CLIENT_SECRET)
const headers = new Headers()
headers.set('Content-Type', 'application/x-www-form-urlencoded')
diff --git a/client/yarn.lock b/client/yarn.lock
index e012c62cc4..b4577d709e 100644
--- a/client/yarn.lock
+++ b/client/yarn.lock
@@ -4444,6 +4444,11 @@ clone@^1.0.2:
resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e"
integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==
+color-bits@^1.0.4:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/color-bits/-/color-bits-1.0.4.tgz#9ed0acc9bc67509493a713f60f356783f189adbf"
+ integrity sha512-gcNCga5BpVlzW+ZqO+U1/4thYuJ13DsQSBzrnhBcEUUe30eF54STR/kqnPn2I18jLp0lfXDw8KJT228DTyLKXA==
+
color-convert@^1.9.0:
version "1.9.3"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
diff --git a/config/default.yaml b/config/default.yaml
index d01dae53e1..e4496c15a2 100644
--- a/config/default.yaml
+++ b/config/default.yaml
@@ -938,7 +938,7 @@ instance:
# - 17 # Kids
# - 18 # Food
- default_client_route: '/videos/trending'
+ default_client_route: '/videos/browse'
# Whether or not the instance is dedicated to NSFW content
# Enabling it will allow other administrators to know that you are mainly federating sensitive content
@@ -1032,7 +1032,6 @@ client:
miniature:
# By default PeerTube client displays author username
prefer_author_display_name: false
- display_author_avatar: false
resumable_upload:
# Max size of upload chunks, e.g. '90MB'
diff --git a/config/production.yaml.example b/config/production.yaml.example
index 4902517933..6a84f2f40e 100644
--- a/config/production.yaml.example
+++ b/config/production.yaml.example
@@ -1042,7 +1042,6 @@ client:
miniature:
# By default PeerTube client displays author username
prefer_author_display_name: false
- display_author_avatar: false
resumable_upload:
# Max size of upload chunks, e.g. '90MB'
diff --git a/packages/models/src/plugins/client/client-hook.model.ts b/packages/models/src/plugins/client/client-hook.model.ts
index 4a0818c992..c10fe9f6ef 100644
--- a/packages/models/src/plugins/client/client-hook.model.ts
+++ b/packages/models/src/plugins/client/client-hook.model.ts
@@ -18,6 +18,10 @@ export const clientFilterHookObject = {
'filter:api.recently-added-videos.videos.list.params': true,
'filter:api.recently-added-videos.videos.list.result': true,
+ // Filter params/result of the function that fetch videos of the browse videos page
+ 'filter:api.browse-videos.videos.list.params': true,
+ 'filter:api.browse-videos.videos.list.result': true,
+
// Filter params/result of the function that fetch videos of the user subscription page
'filter:api.user-subscriptions-videos.videos.list.params': true,
'filter:api.user-subscriptions-videos.videos.list.result': true,
diff --git a/packages/models/src/server/server-config.model.ts b/packages/models/src/server/server-config.model.ts
index 529c10f6c1..9e7b451ba2 100644
--- a/packages/models/src/server/server-config.model.ts
+++ b/packages/models/src/server/server-config.model.ts
@@ -39,7 +39,6 @@ export interface ServerConfig {
client: {
videos: {
miniature: {
- displayAuthorAvatar: boolean
preferAuthorDisplayName: boolean
}
resumableUpload: {
@@ -124,6 +123,9 @@ export interface ServerConfig {
theme: {
registered: ServerConfigTheme[]
+
+ builtIn: { name: 'peertube-core-light-beige' | 'peertube-core-dark-brown' }[]
+
default: string
}
diff --git a/scripts/nightly.sh b/scripts/nightly.sh
index eabc7348dd..e48ad8bda5 100755
--- a/scripts/nightly.sh
+++ b/scripts/nightly.sh
@@ -17,6 +17,7 @@ trap "shutdown" SIGINT SIGTERM
today=$(date '+%F')
directory_name="peertube-nightly-$today"
tar_name="peertube-nightly-$today.tar.xz"
+peertube_directory=$(basename $(pwd))
npm run build -- --source-map
@@ -50,9 +51,9 @@ sed -i 's/"version": "\([^"]\+\)"/"version": "\1-'"$nightly_version"'"/' ./packa
# temporary setup
cd ..
- ln -s "PeerTube" "$directory_name"
+ ln -s "$peertube_directory" "$directory_name"
- XZ_OPT=-e9 tar cfJ "PeerTube/$tar_name" "${directories_to_archive[@]}"
+ XZ_OPT=-e9 tar cfJ "$peertube_directory/$tar_name" "${directories_to_archive[@]}"
# temporary setup destruction
rm "$directory_name"
diff --git a/server/core/helpers/custom-validators/plugins.ts b/server/core/helpers/custom-validators/plugins.ts
index 875482f53c..99ee476b75 100644
--- a/server/core/helpers/custom-validators/plugins.ts
+++ b/server/core/helpers/custom-validators/plugins.ts
@@ -93,7 +93,8 @@ function areCSSPathsValid (css: any[]) {
}
function isThemeNameValid (name: string) {
- return isPluginNameValid(name)
+ return name && typeof name === 'string' &&
+ (isPluginNameValid(name) || name.startsWith('peertube-core-'))
}
function isPackageJSONValid (packageJSON: PluginPackageJSON, pluginType: PluginType_Type) {
diff --git a/server/core/initializers/checker-before-init.ts b/server/core/initializers/checker-before-init.ts
index 6f4c9e1735..fb1a5c0c23 100644
--- a/server/core/initializers/checker-before-init.ts
+++ b/server/core/initializers/checker-before-init.ts
@@ -48,7 +48,6 @@ function checkMissedConfig () {
'import.video_channel_synchronization.check_interval', 'import.video_channel_synchronization.videos_limit_per_synchronization',
'import.video_channel_synchronization.full_sync_videos_limit',
'auto_blacklist.videos.of_users.enabled', 'trending.videos.interval_days',
- 'client.videos.miniature.display_author_avatar',
'client.videos.miniature.prefer_author_display_name', 'client.menu.login.redirect_on_single_external_auth',
'defaults.publish.download_enabled', 'defaults.publish.comments_policy', 'defaults.publish.privacy', 'defaults.publish.licence',
'instance.name', 'instance.short_description', 'instance.description', 'instance.terms', 'instance.default_client_route',
diff --git a/server/core/initializers/config.ts b/server/core/initializers/config.ts
index 9b68384bae..73511b28dc 100644
--- a/server/core/initializers/config.ts
+++ b/server/core/initializers/config.ts
@@ -77,8 +77,7 @@ const CONFIG = {
CLIENT: {
VIDEOS: {
MINIATURE: {
- get PREFER_AUTHOR_DISPLAY_NAME () { return config.get<boolean>('client.videos.miniature.prefer_author_display_name') },
- get DISPLAY_AUTHOR_AVATAR () { return config.get<boolean>('client.videos.miniature.display_author_avatar') }
+ get PREFER_AUTHOR_DISPLAY_NAME () { return config.get<boolean>('client.videos.miniature.prefer_author_display_name') }
},
RESUMABLE_UPLOAD: {
get MAX_CHUNK_SIZE () { return parseBytes(config.get<number>('client.videos.resumable_upload.max_chunk_size') || 0) }
diff --git a/server/core/lib/plugins/theme-utils.ts b/server/core/lib/plugins/theme-utils.ts
index 4a64a579aa..651ddd1955 100644
--- a/server/core/lib/plugins/theme-utils.ts
+++ b/server/core/lib/plugins/theme-utils.ts
@@ -1,8 +1,9 @@
import { DEFAULT_THEME_NAME, DEFAULT_USER_THEME_NAME } from '../../initializers/constants.js'
import { PluginManager } from './plugin-manager.js'
import { CONFIG } from '../../initializers/config.js'
+import { ServerConfigManager } from '../server-config-manager.js'
-function getThemeOrDefault (name: string, defaultTheme: string) {
+export function getThemeOrDefault (name: string, defaultTheme: string) {
if (isThemeRegistered(name)) return name
// Fallback to admin default theme
@@ -11,14 +12,9 @@ function getThemeOrDefault (name: string, defaultTheme: string) {
return defaultTheme
}
-function isThemeRegistered (name: string) {
+export function isThemeRegistered (name: string) {
if (name === DEFAULT_THEME_NAME || name === DEFAULT_USER_THEME_NAME) return true
- return !!PluginManager.Instance.getRegisteredThemes()
- .find(r => r.name === name)
-}
-
-export {
- getThemeOrDefault,
- isThemeRegistered
+ return PluginManager.Instance.getRegisteredThemes().some(r => r.name === name) ||
+ ServerConfigManager.Instance.getBuiltInThemes().some(r => r.name === name)
}
diff --git a/server/core/lib/server-config-manager.ts b/server/core/lib/server-config-manager.ts
index 2f87e94c4c..ac5818d2cc 100644
--- a/server/core/lib/server-config-manager.ts
+++ b/server/core/lib/server-config-manager.ts
@@ -56,7 +56,6 @@ class ServerConfigManager {
client: {
videos: {
miniature: {
- displayAuthorAvatar: CONFIG.CLIENT.VIDEOS.MINIATURE.DISPLAY_AUTHOR_AVATAR,
preferAuthorDisplayName: CONFIG.CLIENT.VIDEOS.MINIATURE.PREFER_AUTHOR_DISPLAY_NAME
},
resumableUpload: {
@@ -131,6 +130,7 @@ class ServerConfigManager {
},
theme: {
registered: this.getRegisteredThemes(),
+ builtIn: this.getBuiltInThemes(),
default: defaultTheme
},
email: {
@@ -371,6 +371,17 @@ class ServerConfigManager {
}))
}
+ getBuiltInThemes () {
+ return [
+ {
+ name: 'peertube-core-dark-brown' as 'peertube-core-dark-brown'
+ },
+ {
+ name: 'peertube-core-light-beige' as 'peertube-core-light-beige'
+ }
+ ]
+ }
+
getRegisteredPlugins () {
return PluginManager.Instance.getRegisteredPlugins()
.map(p => ({