Skip to content

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

UI improvements

Chocobozzz94c2e8bdf6d6
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 2d962b6753..aa54f9f44c 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
@@ -24,6 +24,6 @@
</button>
</div>
-<div class="user-notifications-container">
- <my-user-notifications #userNotification></my-user-notifications>
+<div>
+ <my-user-notifications #userNotification inPopup="false"></my-user-notifications>
</div>
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 b381e34e1c..e8a9d4393e 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
@@ -13,8 +13,3 @@
@include peertube-select-container(auto);
}
}
-
-.user-notifications-container {
- padding: 1rem;
- background-color: pvar(--bg-secondary-400);
-}
diff --git a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts
index 939e4fbe5c..c2067cffa6 100644
--- a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts
+++ b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts
@@ -1,8 +1,8 @@
+import { CommonModule } from '@angular/common'
import { Component, viewChild } from '@angular/core'
-import { UserNotificationsComponent } from '@app/shared/shared-notifications/user-notifications.component'
-
import { FormsModule } from '@angular/forms'
import { RouterLink } from '@angular/router'
+import { UserNotificationsComponent } from '@app/shared/shared-notifications/user-notifications.component'
import { GlobalIconComponent } from '../../shared/shared-icons/global-icon.component'
type NotificationSortType = 'createdAt' | 'read'
@@ -10,7 +10,7 @@ type NotificationSortType = 'createdAt' | 'read'
@Component({
templateUrl: './my-account-notifications.component.html',
styleUrls: [ './my-account-notifications.component.scss' ],
- imports: [ RouterLink, GlobalIconComponent, FormsModule, UserNotificationsComponent ]
+ imports: [ CommonModule, RouterLink, GlobalIconComponent, FormsModule, UserNotificationsComponent ]
})
export class MyAccountNotificationsComponent {
readonly userNotification = viewChild<UserNotificationsComponent>('userNotification')
diff --git a/client/src/app/+my-library/+my-video-channels/edit/pages/video-channel-editors.component.html b/client/src/app/+my-library/+my-video-channels/edit/pages/video-channel-editors.component.html
index b56f1106b2..b35d511599 100644
--- a/client/src/app/+my-library/+my-video-channels/edit/pages/video-channel-editors.component.html
+++ b/client/src/app/+my-library/+my-video-channels/edit/pages/video-channel-editors.component.html
@@ -17,7 +17,7 @@
<my-actor-avatar [actor]="getOwnerAccount()" actorType="account" size="60"></my-actor-avatar>
<div>
- <div class="collaborator-display-name mb-1">
+ <div class="collaborator-display-name">
<span class="fw-bold">{{ getOwnerDisplayName() }}</span>
@if (isOwner()) {
@@ -37,21 +37,23 @@
</div>
<div class="content-col">
- <p i18n>Editors <strong>can:</strong></p>
-
- <ul>
- <li i18n>Publish videos in this channel</li>
- <li i18n>Manage, update or delete videos, comments, playlists of this channel</li>
- <li i18n>Add or delete channel synchronization</li>
- <li i18n>Update information of this channel (title, description, banner...)</li>
- </ul>
-
- <p i18n>But editors <strong>cannot:</strong></p>
-
- <ul>
- <li i18n>Delete the channel</li>
- <li i18n>Add or remove other editors</li>
- </ul>
+ <div class="editor-explanation">
+ <p i18n>Editors <strong>can:</strong></p>
+
+ <ul>
+ <li i18n>Publish videos in this channel</li>
+ <li i18n>Manage, update or delete videos, comments, playlists of this channel</li>
+ <li i18n>Add or delete channel synchronization</li>
+ <li i18n>Update information of this channel (title, description, banner...)</li>
+ </ul>
+
+ <p i18n>But editors <strong>cannot:</strong></p>
+
+ <ul>
+ <li i18n>Delete the channel</li>
+ <li i18n>Add or remove other editors</li>
+ </ul>
+ </div>
<h4 i18n>Current editors</h4>
@@ -61,7 +63,7 @@
<my-actor-avatar [actor]="collaborator.account" actorType="account" size="60"></my-actor-avatar>
<div>
- <div class="collaborator-display-name fw-bold mb-1" i18>{{ collaborator.account.displayName }}</div>
+ <div class="collaborator-display-name fw-bold" i18>{{ collaborator.account.displayName }}</div>
<div class="d-flex gap-1">
<my-collaborator-state [type]="getCollaboratorState(collaborator)"></my-collaborator-state>
diff --git a/client/src/app/+my-library/+my-video-channels/edit/pages/video-channel-editors.component.scss b/client/src/app/+my-library/+my-video-channels/edit/pages/video-channel-editors.component.scss
index 4ae9ea0b54..b6a704ca76 100644
--- a/client/src/app/+my-library/+my-video-channels/edit/pages/video-channel-editors.component.scss
+++ b/client/src/app/+my-library/+my-video-channels/edit/pages/video-channel-editors.component.scss
@@ -39,3 +39,7 @@ my-user-auto-complete {
my-action-dropdown {
color: pvar(--fg-200);
}
+
+.editor-explanation {
+ color: pvar(--fg-300);
+}
diff --git a/client/src/app/+my-library/+my-video-channels/edit/video-channel-edit.component.html b/client/src/app/+my-library/+my-video-channels/edit/video-channel-edit.component.html
index 43d23ce8ac..9ec30c4c8d 100644
--- a/client/src/app/+my-library/+my-video-channels/edit/video-channel-edit.component.html
+++ b/client/src/app/+my-library/+my-video-channels/edit/video-channel-edit.component.html
@@ -19,15 +19,22 @@
[actions]="switchChannelActions"
>
<ng-template #labelExtra>
- @if (user.isEditorOfChannel(videoChannelEdit().apiInfo)) {
- <my-collaborator-state class="d-inline-flex" type="accepted"></my-collaborator-state>
+ @if (user.isCollaboratingToChannels()) {
+ @if (user.isOwnerOfChannel(videoChannelEdit().apiInfo)) {
+ <my-collaborator-state class="d-inline-flex" type="owner"></my-collaborator-state>
+ } @else if (user.isEditorOfChannel(videoChannelEdit().apiInfo)) {
+ <my-collaborator-state class="d-inline-flex" type="accepted"></my-collaborator-state>
+ }
}
-
</ng-template>
<ng-template #dropdownItemExtra let-action="action">
- @if (action.data.editor) {
- <my-collaborator-state class="d-inline-flex ms-2" small="true" type="accepted"></my-collaborator-state>
+ @if (action.data.collaborate) {
+ @if (action.data.editor) {
+ <my-collaborator-state class="d-inline-flex ms-2" small="true" type="accepted"></my-collaborator-state>
+ } @else if (action.data.owner) {
+ <my-collaborator-state class="d-inline-flex ms-2" small="true" type="owner"></my-collaborator-state>
+ }
}
</ng-template>
</my-action-dropdown>
diff --git a/client/src/app/+my-library/+my-video-channels/edit/video-channel-edit.component.ts b/client/src/app/+my-library/+my-video-channels/edit/video-channel-edit.component.ts
index d693fa62c6..8513046536 100644
--- a/client/src/app/+my-library/+my-video-channels/edit/video-channel-edit.component.ts
+++ b/client/src/app/+my-library/+my-video-channels/edit/video-channel-edit.component.ts
@@ -100,7 +100,7 @@ export class VideoChannelEditComponent implements OnInit, OnDestroy {
private buildSwitchChannelActions () {
const user = this.authService.getUser()
- const builder = (c: VideoChannel, { editor }: { editor: boolean }) => ({
+ const builder = (c: VideoChannel, { editor, owner, collaborate }: { editor: boolean, owner: boolean, collaborate: boolean }) => ({
label: c.displayName,
linkBuilder: () => {
const current = this.videoChannelEdit().channel.name
@@ -115,13 +115,17 @@ export class VideoChannelEditComponent implements OnInit, OnDestroy {
},
data: {
- editor
+ collaborate,
+ editor,
+ owner
}
})
+ const collaborate = user.isCollaboratingToChannels()
+
this.switchChannelActions = [
- ...user.videoChannels.map(c => builder(c, { editor: false })),
- ...user.videoChannelCollaborations.map(c => builder(c, { editor: true }))
+ ...user.videoChannels.map(c => builder(c, { editor: false, owner: true, collaborate })),
+ ...user.videoChannelCollaborations.map(c => builder(c, { editor: true, owner: false, collaborate }))
]
}
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 0fb5b531b9..1486955688 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
@@ -35,8 +35,13 @@
<div class="metadata">
<div class="min-width-0 d-flex flex-wrap w-fit-content align-items-center">
<a class="display-name" [routerLink]="[ '/c', videoChannel.nameWithHost ]" i18n-title title="Channel page">{{ videoChannel.displayName }}</a>
- @if (user.isCollaboratingToChannels() && user.isEditorOfChannel(videoChannel)) {
- <my-collaborator-state class="d-inline-block ms-2" type="accepted"></my-collaborator-state>
+
+ @if (user.isCollaboratingToChannels()) {
+ @if (user.isOwnerOfChannel(videoChannel)) {
+ <my-collaborator-state class="d-inline-block ms-2" type="owner"></my-collaborator-state>
+ } @else if (user.isEditorOfChannel(videoChannel)) {
+ <my-collaborator-state class="d-inline-block ms-2" type="accepted"></my-collaborator-state>
+ }
}
</div>
<span class="handle">{{ videoChannel.nameWithHost }}</span>
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 a5f16b9ea6..c6ca3cae26 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
@@ -70,8 +70,13 @@
@if (playlist.videoChannel) {
<a [routerLink]="[ '/c', playlist.videoChannel.name]" class="channel-sub-link-in-cell">
<span>{{ playlist.videoChannel.displayName }}</span>
- @if (user.isEditorOfChannel(playlist.videoChannel)) {
- <my-collaborator-state class="ms-2" type="accepted" small="true"></my-collaborator-state>
+
+ @if (user.isCollaboratingToChannels()) {
+ @if (user.isOwnerOfChannel(playlist.videoChannel)) {
+ <my-collaborator-state class="ms-2" type="owner" small="true"></my-collaborator-state>
+ } @else if (user.isEditorOfChannel(playlist.videoChannel)) {
+ <my-collaborator-state class="ms-2" type="accepted" small="true"></my-collaborator-state>
+ }
}
</a>
}
diff --git a/client/src/app/core/auth/auth-user.model.ts b/client/src/app/core/auth/auth-user.model.ts
index f4edd3008f..34f6851d36 100644
--- a/client/src/app/core/auth/auth-user.model.ts
+++ b/client/src/app/core/auth/auth-user.model.ts
@@ -60,4 +60,8 @@ export class AuthUser extends User implements ServerMyUserModel {
isEditorOfChannel (channel: Pick<VideoChannel, 'id'>) {
return this.videoChannelCollaborations.some(c => c.id === channel.id)
}
+
+ isOwnerOfChannel (channel: Pick<VideoChannel, 'id'>) {
+ return this.videoChannels.some(c => c.id === channel.id)
+ }
}
diff --git a/client/src/app/header/header.component.scss b/client/src/app/header/header.component.scss
index a7981df693..87d60c3a54 100644
--- a/client/src/app/header/header.component.scss
+++ b/client/src/app/header/header.component.scss
@@ -123,6 +123,8 @@ my-search-typeahead {
.display-name {
font-weight: $font-bold;
color: pvar(--fg);
+ line-height: 1;
+ padding-top: 3px;
}
.username {
diff --git a/client/src/app/header/notification-dropdown.component.html b/client/src/app/header/notification-dropdown.component.html
index 49f5274640..be7191808b 100644
--- a/client/src/app/header/notification-dropdown.component.html
+++ b/client/src/app/header/notification-dropdown.component.html
@@ -61,6 +61,7 @@
@defer (when opened) {
<my-user-notifications
+ inPopup="true"
[ignoreLoadingBar]="true"
[infiniteScroll]="false"
[itemsPerPage]="10"
diff --git a/client/src/app/helpers/utils/channel.ts b/client/src/app/helpers/utils/channel.ts
index 73499d6e86..1599481a36 100644
--- a/client/src/app/helpers/utils/channel.ts
+++ b/client/src/app/helpers/utils/channel.ts
@@ -9,13 +9,14 @@ export function listUserChannelsForSelect (authService: AuthService, options: {
first(),
map(() => {
const user = authService.getUser()
+ const collaborate = user.isCollaboratingToChannels()
const allChannels = options.includeCollaborations
? [
- ...formatChannels(user.videoChannels, { editor: false }),
- ...formatChannels(user.videoChannelCollaborations, { editor: true })
+ ...formatChannels(user.videoChannels, { editor: false, owner: true, collaborate }),
+ ...formatChannels(user.videoChannelCollaborations, { editor: true, owner: false, collaborate })
]
- : formatChannels(user.videoChannels, { editor: false })
+ : formatChannels(user.videoChannels, { editor: false, owner: false, collaborate })
return sortBy(allChannels, 'updatedAt').reverse()
})
@@ -26,7 +27,13 @@ export function listUserChannelsForSelect (authService: AuthService, options: {
// Private
// ---------------------------------------------------------------------------
-function formatChannels (channel: (VideoChannel & { ownerAccountId?: number })[], { editor }: { editor: boolean }) {
+function formatChannels (channel: (VideoChannel & { ownerAccountId?: number })[], options: {
+ editor: boolean
+ owner: boolean
+ collaborate: boolean
+}) {
+ const { editor, collaborate, owner } = options
+
return channel
.map(c => ({
id: c.id,
@@ -34,6 +41,8 @@ function formatChannels (channel: (VideoChannel & { ownerAccountId?: number })[]
label: c.displayName,
support: c.support,
editor,
+ collaborate,
+ owner,
avatarFileUrl: getAvatarFileUrl(c),
ownerAccountId: c.ownerAccountId,
updatedAt: c.updatedAt
diff --git a/client/src/app/modal/confirm.component.scss b/client/src/app/modal/confirm.component.scss
index 803c125f59..0949e997aa 100644
--- a/client/src/app/modal/confirm.component.scss
+++ b/client/src/app/modal/confirm.component.scss
@@ -1,13 +1,19 @@
-@use '_variables' as *;
-@use '_mixins' as *;
-@use '_form-mixins' as *;
+@use "_variables" as *;
+@use "_mixins" as *;
+@use "_form-mixins" as *;
.button {
padding: 0 13px;
}
-input[type=text] {
+input[type="text"] {
display: block;
@include peertube-input-text(100%);
}
+
+.modal-body {
+ padding-top: 0;
+ padding-bottom: 0;
+ color: pvar(--fg-300);
+}
diff --git a/client/src/app/shared/shared-forms/select/select-channel.component.ts b/client/src/app/shared/shared-forms/select/select-channel.component.ts
index 3528b63ec2..a8c6801984 100644
--- a/client/src/app/shared/shared-forms/select/select-channel.component.ts
+++ b/client/src/app/shared/shared-forms/select/select-channel.component.ts
@@ -19,8 +19,12 @@ import { CollaboratorStateComponent } from '@app/shared/shared-main/channel/coll
[filter]="channels && channels.length > 5"
>
<ng-template #itemExtra let-item>
- @if (item.editor) {
- <my-collaborator-state class="lh-1 ms-2" type="accepted" disableTooltip="true"></my-collaborator-state>
+ @if (item.collaborate) {
+ @if (item.editor) {
+ <my-collaborator-state class="lh-1 ms-2" type="accepted" disableTooltip="true"></my-collaborator-state>
+ } @else if (item.owner) {
+ <my-collaborator-state class="lh-1 ms-2" type="owner" disableTooltip="true"></my-collaborator-state>
+ }
}
</ng-template>
</my-select-options>
diff --git a/client/src/app/shared/shared-main/channel/collaborator-state.component.html b/client/src/app/shared/shared-main/channel/collaborator-state.component.html
index 524d8ccb7e..57f83ac252 100644
--- a/client/src/app/shared/shared-main/channel/collaborator-state.component.html
+++ b/client/src/app/shared/shared-main/channel/collaborator-state.component.html
@@ -1,13 +1,13 @@
@if (type() === 'owner') {
- <span class="collaborator-role collaborator-role-owner" [ngClass]="{ small: small() }" [ngbTooltip]="ownerTooltip" i18n>
+ <span class="collaborator-role collaborator-role-owner" [ngClass]="{ small: small() }" [ngbTooltip]="ownerTooltip" container="body" i18n>
Owner
</span>
} @else if (type() === 'accepted') {
- <span class="collaborator-role collaborator-role-editor" [ngClass]="{ small: small() }" [ngbTooltip]="editorTooltip" i18n>
+ <span class="collaborator-role collaborator-role-editor" [ngClass]="{ small: small() }" [ngbTooltip]="editorTooltip" container="body" i18n>
Editor
</span>
} @else if (type() === 'invited') {
- <span class="collaborator-role collaborator-role-invited" [ngClass]="{ small: small() }" [ngbTooltip]="invitationTooltip" i18n>
+ <span class="collaborator-role collaborator-role-invited" [ngClass]="{ small: small() }" [ngbTooltip]="invitationTooltip" container="body" i18n>
Invitation sent
</span>
}
diff --git a/client/src/app/shared/shared-main/channel/collaborator-state.component.scss b/client/src/app/shared/shared-main/channel/collaborator-state.component.scss
index a55cbc3c33..dfbfe5031b 100644
--- a/client/src/app/shared/shared-main/channel/collaborator-state.component.scss
+++ b/client/src/app/shared/shared-main/channel/collaborator-state.component.scss
@@ -3,10 +3,11 @@
.collaborator-role {
border-radius: 4px;
- padding: 2px 6px;
+ padding: 1px 6px;
width: fit-content;
line-height: normal;
border: 1px solid;
+ white-space: nowrap;
@include font-size(12px);
diff --git a/client/src/app/shared/shared-main/channel/collaborator-state.component.ts b/client/src/app/shared/shared-main/channel/collaborator-state.component.ts
index 83e2bb8559..2d0e956c2f 100644
--- a/client/src/app/shared/shared-main/channel/collaborator-state.component.ts
+++ b/client/src/app/shared/shared-main/channel/collaborator-state.component.ts
@@ -22,14 +22,14 @@ export class CollaboratorStateComponent implements OnInit {
ngOnInit () {
this.editorTooltip = this.disableTooltip()
? null
- : $localize`You are an editor of this channel`
+ : $localize`An editor can manage videos in this channel`
this.ownerTooltip = this.disableTooltip()
? null
- : $localize`You are the owner of this channel`
+ : $localize`Owner of the channel`
this.invitationTooltip = this.disableTooltip()
? null
- : $localize`You have been invited to be an editor of this channel`
+ : $localize`Invited to be an editor to manage videos in this channel`
}
}
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 0742e4ba5d..d6cda1c2ed 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
@@ -148,14 +148,14 @@ export class UserNotification {
case UserNotificationType.INVITED_TO_COLLABORATE_TO_CHANNEL:
if (payload.videoChannelCollaborator.state.id === VideoChannelCollaboratorState.ACCEPTED) {
- this.url = this.buildChannelEditorsUrl(payload.videoChannelCollaborator.channel)
+ this.url = this.buildChannelUrl(payload.videoChannelCollaborator.channel)
} // Else, no URL: we have buttons instead to accept/decline the invitation
break
case UserNotificationType.ACCEPTED_TO_COLLABORATE_TO_CHANNEL:
case UserNotificationType.REFUSED_TO_COLLABORATE_TO_CHANNEL:
- this.url = this.buildChannelEditorsUrl(payload.videoChannelCollaborator.channel)
+ this.url = this.buildChannelUrl(payload.videoChannelCollaborator.channel)
break
}
} catch (err) {
@@ -184,7 +184,7 @@ export class UserNotification {
return [ this.buildVideoUrl(comment.video), { threadId: comment.threadId } ]
}
- buildChannelEditorsUrl (channel: { name: string }) {
- return [ '/my-library', 'video-channels', 'manage', channel.name, 'editors' ]
+ buildChannelUrl (channel: { name: string }) {
+ return [ '/my-library', 'video-channels', 'manage', channel.name ]
}
}
diff --git a/client/src/app/shared/shared-notifications/user-notification-content.component.html b/client/src/app/shared/shared-notifications/user-notification-content.component.html
index 8edbd4d82a..47ac71e294 100644
--- a/client/src/app/shared/shared-notifications/user-notification-content.component.html
+++ b/client/src/app/shared/shared-notifications/user-notification-content.component.html
@@ -230,7 +230,7 @@
<div class="message">
<div i18n>
- <strong>{{ n.payload.videoChannelCollaborator.channelOwner.displayName }}</strong> invited you to become an editor of their channel <strong>{{ n.payload.videoChannelCollaborator.channel.displayName }}</strong>
+ <strong>{{ n.payload.videoChannelCollaborator.channelOwner.displayName }}</strong> invited you to become an<my-collaborator-state class="mx-2" type="accepted"></my-collaborator-state> of their channel <strong>{{ n.payload.videoChannelCollaborator.channel.displayName }}</strong>
</div>
</div>
diff --git a/client/src/app/shared/shared-notifications/user-notification-content.component.scss b/client/src/app/shared/shared-notifications/user-notification-content.component.scss
index d0cc110242..82d05641e4 100644
--- a/client/src/app/shared/shared-notifications/user-notification-content.component.scss
+++ b/client/src/app/shared/shared-notifications/user-notification-content.component.scss
@@ -71,6 +71,12 @@
.from-date {
color: pvar(--secondary-icon-color);
}
+
+ > my-account-on-channel-avatar,
+ > my-global-icon,
+ > my-actor-avatar {
+ opacity: 0.6;
+ }
}
.action-button {
diff --git a/client/src/app/shared/shared-notifications/user-notification-content.component.ts b/client/src/app/shared/shared-notifications/user-notification-content.component.ts
index ac8a63cce9..117b9ea10f 100644
--- a/client/src/app/shared/shared-notifications/user-notification-content.component.ts
+++ b/client/src/app/shared/shared-notifications/user-notification-content.component.ts
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common'
-import { Component, inject, input } from '@angular/core'
+import { Component, inject, input, output } from '@angular/core'
import { Router } from '@angular/router'
import { AuthService, Notifier } from '@app/core'
import { AbuseState, VideoChannelCollaboratorState, VideoState } from '@peertube/peertube-models'
@@ -10,6 +10,7 @@ import { ButtonComponent } from '../shared-main/buttons/button.component'
import { VideoChannelService } from '../shared-main/channel/video-channel.service'
import { FromNowPipe } from '../shared-main/date/from-now.pipe'
import { UserNotification } from '../shared-main/users/user-notification.model'
+import { CollaboratorStateComponent } from '../shared-main/channel/collaborator-state.component'
@Component({
selector: 'my-user-notification-content',
@@ -21,7 +22,8 @@ import { UserNotification } from '../shared-main/users/user-notification.model'
ActorAvatarComponent,
AccountOnChannelAvatarComponent,
FromNowPipe,
- ButtonComponent
+ ButtonComponent,
+ CollaboratorStateComponent
]
})
export class UserNotificationContentComponent {
@@ -32,7 +34,9 @@ export class UserNotificationContentComponent {
readonly notification = input.required<UserNotification>()
- imageSize = 30
+ readonly buttonClicked = output()
+
+ imageSize = 24
get n () {
return this.notification()
@@ -69,13 +73,15 @@ export class UserNotificationContentComponent {
acceptChannelCollab () {
const collab = this.n.payload.videoChannelCollaborator
+ this.buttonClicked.emit()
+
this.channelService.acceptCollaboratorInvitation(collab.channel.name, collab.id)
.subscribe({
next: () => {
this.authService.refreshUserInformation()
this.n.payload.videoChannelCollaborator.state.id = VideoChannelCollaboratorState.ACCEPTED
- this.n.url = this.n.buildChannelEditorsUrl(collab.channel)
+ this.n.url = this.n.buildChannelUrl(collab.channel)
this.router.navigate(this.n.url)
},
@@ -86,6 +92,8 @@ export class UserNotificationContentComponent {
rejectChannelCollab () {
const collab = this.n.payload.videoChannelCollaborator
+ this.buttonClicked.emit()
+
this.channelService.rejectCollaboratorInvitation(collab.channel.name, collab.id)
.subscribe({
next: () => {
diff --git a/client/src/app/shared/shared-notifications/user-notifications.component.html b/client/src/app/shared/shared-notifications/user-notifications.component.html
index 69b8ccb584..a2daa13054 100644
--- a/client/src/app/shared/shared-notifications/user-notifications.component.html
+++ b/client/src/app/shared/shared-notifications/user-notifications.component.html
@@ -2,7 +2,10 @@
<div class="no-notification" i18n>You don't have notifications.</div>
}
-<ul class="notifications" myInfiniteScroller (nearOfBottom)="onNearOfBottom()" [dataObservable]="onDataSubject.asObservable()">
+<ul
+ class="notifications" [ngClass]="{ 'in-popup': inPopup() }"
+ myInfiniteScroller (nearOfBottom)="onNearOfBottom()" [dataObservable]="onDataSubject.asObservable()"
+>
@for (notification of notifications; track notification.payload.id) {
<li>
@if (notification.externalUrl) {
@@ -31,15 +34,12 @@
<my-user-notification-content [notification]="notification"></my-user-notification-content>
</a>
} @else if (notification.payload.read === false) {
- <button
+ <div
class="notification button-unstyle"
[ngClass]="{ unread: !notification.payload.read }"
- (click)="markAsRead(notification)"
- i18n-title
- title="Mark as read"
- >
- <my-user-notification-content [notification]="notification"></my-user-notification-content>
- </button>
+ >
+ <my-user-notification-content [notification]="notification" (buttonClicked)="markAsRead(notification)"></my-user-notification-content>
+ </div>
}@else {
<div class="notification">
<my-user-notification-content [notification]="notification"></my-user-notification-content>
diff --git a/client/src/app/shared/shared-notifications/user-notifications.component.scss b/client/src/app/shared/shared-notifications/user-notifications.component.scss
index 3d271a886c..2ab7d26258 100644
--- a/client/src/app/shared/shared-notifications/user-notifications.component.scss
+++ b/client/src/app/shared/shared-notifications/user-notifications.component.scss
@@ -41,3 +41,17 @@ li {
text-align: left;
}
}
+
+.notifications:not(.in-popup) {
+ .notification {
+ margin-bottom: 1rem;
+
+ &.unread {
+ background-color: pvar(--bg-secondary-350);
+ }
+
+ &:not(.unread) {
+ background-color: pvar(--bg-secondary-400);
+ }
+ }
+}
diff --git a/client/src/app/shared/shared-notifications/user-notifications.component.ts b/client/src/app/shared/shared-notifications/user-notifications.component.ts
index c5fc0fccd2..29013a3312 100644
--- a/client/src/app/shared/shared-notifications/user-notifications.component.ts
+++ b/client/src/app/shared/shared-notifications/user-notifications.component.ts
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common'
-import { Component, inject, input, OnInit, output } from '@angular/core'
+import { booleanAttribute, Component, inject, input, OnInit, output } from '@angular/core'
import { RouterLink } from '@angular/router'
import { ComponentPagination, hasMoreItems, Notifier } from '@app/core'
import { Subject } from 'rxjs'
@@ -23,6 +23,7 @@ export class UserNotificationsComponent implements OnInit {
private userNotificationService = inject(UserNotificationService)
private notifier = inject(Notifier)
+ readonly inPopup = input.required({ transform: booleanAttribute })
readonly ignoreLoadingBar = input(false)
readonly infiniteScroll = input(true)
readonly itemsPerPage = input(20)
diff --git a/client/src/app/shared/shared-tables/actor-cell.component.html b/client/src/app/shared/shared-tables/actor-cell.component.html
index 83e8aa1afe..f6da414713 100644
--- a/client/src/app/shared/shared-tables/actor-cell.component.html
+++ b/client/src/app/shared/shared-tables/actor-cell.component.html
@@ -13,6 +13,8 @@
@if (isEditorOfChannel()) {
<my-collaborator-state class="ms-2" type="accepted" small="true"></my-collaborator-state>
+ } @else if (isOwnerOfChannel()) {
+ <my-collaborator-state class="ms-2" type="owner" small="true"></my-collaborator-state>
}
</div>
</a>
diff --git a/client/src/app/shared/shared-tables/actor-cell.component.ts b/client/src/app/shared/shared-tables/actor-cell.component.ts
index a4d7985c11..31e05e4a5f 100644
--- a/client/src/app/shared/shared-tables/actor-cell.component.ts
+++ b/client/src/app/shared/shared-tables/actor-cell.component.ts
@@ -36,10 +36,16 @@ export class ActorCellComponent implements OnInit {
}
isEditorOfChannel (): boolean {
- const actor = this.actor()
+ if (this.actorType() !== 'channel') return false
+
+ const user = this.authService.getUser()
+ return user.isCollaboratingToChannels() && user.isEditorOfChannel(this.actor())
+ }
+ isOwnerOfChannel (): boolean {
if (this.actorType() !== 'channel') return false
- return this.authService.getUser().isEditorOfChannel(actor)
+ const user = this.authService.getUser()
+ return user.isCollaboratingToChannels() && user.isOwnerOfChannel(this.actor())
}
}
diff --git a/client/src/app/shared/shared-tables/video-cell.component.html b/client/src/app/shared/shared-tables/video-cell.component.html
index a4d35cb981..5779ebe153 100644
--- a/client/src/app/shared/shared-tables/video-cell.component.html
+++ b/client/src/app/shared/shared-tables/video-cell.component.html
@@ -21,8 +21,12 @@
<a [routerLink]="getChannelUrl()" class="channel" [ngClass]="{ ellipsis: ellipsis }">
<span>{{ video().channel?.displayName }}</span>
- @if (displayEditorInfo() && user.isEditorOfChannel(video().channel)) {
- <my-collaborator-state class="ms-2" type="accepted" small="true"></my-collaborator-state>
+ @if (displayEditorInfo() && user.isCollaboratingToChannels()) {
+ @if (user.isEditorOfChannel(video().channel)) {
+ <my-collaborator-state class="ms-2" type="accepted" small="true"></my-collaborator-state>
+ } @else if (user.isOwnerOfChannel(video().channel)) {
+ <my-collaborator-state class="ms-2" type="owner" small="true"></my-collaborator-state>
+ }
}
</a>
}
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 d7996ff54f..b978eff30b 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
@@ -33,8 +33,12 @@
<a [routerLink]="[ '/c', comment.video.channel.name]" class="channel-sub-link-in-cell">
<span>{{ comment.video.channel.displayName }}</span>
- @if (mode() === 'user' && user.isEditorOfChannel(comment.video.channel)) {
- <my-collaborator-state class="ms-2" type="accepted" small="true"></my-collaborator-state>
+ @if (mode() === 'user' && user.isCollaboratingToChannels()) {
+ @if (user.isEditorOfChannel(comment.video.channel)) {
+ <my-collaborator-state class="ms-2" type="accepted" small="true"></my-collaborator-state>
+ } @else if (user.isOwnerOfChannel(comment.video.channel)) {
+ <my-collaborator-state class="ms-2" type="owner" small="true"></my-collaborator-state>
+ }
}
</a>
}
diff --git a/client/src/sass/application.scss b/client/src/sass/application.scss
index 80d139e06a..7dcd2f2816 100644
--- a/client/src/sass/application.scss
+++ b/client/src/sass/application.scss
@@ -116,6 +116,13 @@ a:hover {
opacity: 0.8;
}
+a.dropdown-item,
+a.action-button {
+ &:hover {
+ opacity: 1;
+ }
+}
+
a.pt {
text-decoration-color: pvar(--border-primary);
text-underline-offset: 0.25em;
diff --git a/client/src/sass/include/_bootstrap-variables.scss b/client/src/sass/include/_bootstrap-variables.scss
index 51a50f69cf..adb1ad7966 100644
--- a/client/src/sass/include/_bootstrap-variables.scss
+++ b/client/src/sass/include/_bootstrap-variables.scss
@@ -6,6 +6,7 @@ $modal-md: 600px;
$modal-lg: 900px;
$modal-content-border-radius: 14px;
$modal-content-bg: pvar(--bg-secondary-350);
+$modal-inner-padding: 2rem;
$grid-breakpoints: (
// CLASSIC BREAKPOINTS GROUP
diff --git a/client/src/sass/include/_button-mixins.scss b/client/src/sass/include/_button-mixins.scss
index f21b52f994..2d3bee0edc 100644
--- a/client/src/sass/include/_button-mixins.scss
+++ b/client/src/sass/include/_button-mixins.scss
@@ -15,6 +15,10 @@
border: 1px solid $border-color !important;
}
+ &:not(.icon-only) my-global-icon {
+ color: pvar(--secondary-icon-color);
+ }
+
&:active,
&.active,
&:focus,
@@ -36,16 +40,16 @@
&:hover {
color: $fg;
background-color: $hover-bg;
+
+ my-global-icon {
+ color: $fg !important;
+ }
}
&[disabled] {
pointer-events: none;
opacity: 0.6;
}
-
- &:not(.icon-only) my-global-icon {
- color: pvar(--secondary-icon-color);
- }
}
@mixin primary-button {
diff --git a/client/src/sass/include/_css-variables.scss b/client/src/sass/include/_css-variables.scss
index 3a2be0922d..da3de38192 100644
--- a/client/src/sass/include/_css-variables.scss
+++ b/client/src/sass/include/_css-variables.scss
@@ -56,7 +56,7 @@
--support-btn-fg: var(--supportButtonColor, #{pvar(--fg-300)});
--support-btn-bg: var(--supportButtonBackgroundColor, transparent);
- --support-btn-heart-bg: var(--supportButtonHeartColor, #{$support-button-heart});
+ --support-btn-heart-bg: var(--supportButtonHeartColor, #{pvar(--support-btn-fg)});
--x-margin-content: 2rem;
diff --git a/client/src/sass/include/_variables.scss b/client/src/sass/include/_variables.scss
index fb34a3230f..9c4cc32566 100644
--- a/client/src/sass/include/_variables.scss
+++ b/client/src/sass/include/_variables.scss
@@ -13,7 +13,6 @@ $font-bold: 700;
$line-height-normal: 1.2;
$support-button: inherit;
-$support-button-heart: #e83e8c;
$red: #dc3545;
$green: #198754;