diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-01-15 19:25:51 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-01-21 11:59:41 +0100 |
commit | 9b82d49da868536701d80ef1071df0e7cd301b7a (patch) | |
tree | d34997edf0157d390f44d367f6fd795e0d681760 /client/src/app/shared | |
parent | c78d3db71baa397971a83b110c0159169646eae4 (diff) | |
download | PeerTube-9b82d49da868536701d80ef1071df0e7cd301b7a.tar.gz PeerTube-9b82d49da868536701d80ef1071df0e7cd301b7a.tar.zst PeerTube-9b82d49da868536701d80ef1071df0e7cd301b7a.zip |
Add action dropdown descriptions
Diffstat (limited to 'client/src/app/shared')
8 files changed, 46 insertions, 18 deletions
diff --git a/client/src/app/shared/buttons/action-dropdown.component.html b/client/src/app/shared/buttons/action-dropdown.component.html index 99e8b7ec1..54f5bf97c 100644 --- a/client/src/app/shared/buttons/action-dropdown.component.html +++ b/client/src/app/shared/buttons/action-dropdown.component.html | |||
@@ -15,17 +15,23 @@ | |||
15 | <ng-container *ngFor="let action of actions"> | 15 | <ng-container *ngFor="let action of actions"> |
16 | <ng-container *ngIf="action.isDisplayed === undefined || action.isDisplayed(entry) === true"> | 16 | <ng-container *ngIf="action.isDisplayed === undefined || action.isDisplayed(entry) === true"> |
17 | 17 | ||
18 | <a *ngIf="action.linkBuilder" [ngClass]="{ 'with-icon': !!action.iconName }" class="dropdown-item" [routerLink]="action.linkBuilder(entry)"> | 18 | <ng-template #templateActionLabel let-action> |
19 | <my-global-icon *ngIf="action.iconName" [iconName]="action.iconName" [ngClass]="'icon-' + action.iconName"></my-global-icon> | 19 | <my-global-icon *ngIf="action.iconName" [iconName]="action.iconName" [ngClass]="'icon-' + action.iconName"></my-global-icon> |
20 | {{ action.label }} | 20 | <div class="d-flex flex-column"> |
21 | <span i18n>{{ action.label }}</span> | ||
22 | <small class="text-muted" *ngIf="action.description">{{ action.description }}</small> | ||
23 | </div> | ||
24 | </ng-template> | ||
25 | |||
26 | <a *ngIf="action.linkBuilder" [ngClass]="{ 'with-icon': !!action.iconName }" class="dropdown-item" [routerLink]="action.linkBuilder(entry)" [title]="action.title || ''"> | ||
27 | <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container> | ||
21 | </a> | 28 | </a> |
22 | 29 | ||
23 | <span | 30 | <span |
24 | *ngIf="!action.linkBuilder" [ngClass]="{ 'with-icon': !!action.iconName }" (click)="action.handler(entry)" | 31 | *ngIf="!action.linkBuilder" [ngClass]="{ 'with-icon': !!action.iconName }" (click)="action.handler(entry)" |
25 | class="custom-action dropdown-item" role="button" | 32 | class="custom-action dropdown-item" role="button" [title]="action.title || ''" |
26 | > | 33 | > |
27 | <my-global-icon *ngIf="action.iconName" [iconName]="action.iconName" [ngClass]="'icon-' + action.iconName"></my-global-icon> | 34 | <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container> |
28 | {{ action.label }} | ||
29 | </span> | 35 | </span> |
30 | 36 | ||
31 | </ng-container> | 37 | </ng-container> |
diff --git a/client/src/app/shared/buttons/action-dropdown.component.scss b/client/src/app/shared/buttons/action-dropdown.component.scss index e33aa8d24..442c90984 100644 --- a/client/src/app/shared/buttons/action-dropdown.component.scss +++ b/client/src/app/shared/buttons/action-dropdown.component.scss | |||
@@ -52,6 +52,7 @@ | |||
52 | 52 | ||
53 | .dropdown-menu { | 53 | .dropdown-menu { |
54 | .dropdown-item { | 54 | .dropdown-item { |
55 | display: flex; | ||
55 | cursor: pointer; | 56 | cursor: pointer; |
56 | color: #000 !important; | 57 | color: #000 !important; |
57 | 58 | ||
diff --git a/client/src/app/shared/buttons/action-dropdown.component.ts b/client/src/app/shared/buttons/action-dropdown.component.ts index 5330ca220..a8b3ab16c 100644 --- a/client/src/app/shared/buttons/action-dropdown.component.ts +++ b/client/src/app/shared/buttons/action-dropdown.component.ts | |||
@@ -4,6 +4,8 @@ import { GlobalIconName } from '@app/shared/images/global-icon.component' | |||
4 | export type DropdownAction<T> = { | 4 | export type DropdownAction<T> = { |
5 | label?: string | 5 | label?: string |
6 | iconName?: GlobalIconName | 6 | iconName?: GlobalIconName |
7 | description?: string | ||
8 | title?: string | ||
7 | handler?: (a: T) => any | 9 | handler?: (a: T) => any |
8 | linkBuilder?: (a: T) => (string | number)[] | 10 | linkBuilder?: (a: T) => (string | number)[] |
9 | isDisplayed?: (a: T) => boolean | 11 | isDisplayed?: (a: T) => boolean |
diff --git a/client/src/app/shared/moderation/user-moderation-dropdown.component.ts b/client/src/app/shared/moderation/user-moderation-dropdown.component.ts index 89f275a04..7ae5f40e3 100644 --- a/client/src/app/shared/moderation/user-moderation-dropdown.component.ts +++ b/client/src/app/shared/moderation/user-moderation-dropdown.component.ts | |||
@@ -243,20 +243,24 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges { | |||
243 | if (this.user && authUser.hasRight(UserRight.MANAGE_USERS) && authUser.canManage(this.user)) { | 243 | if (this.user && authUser.hasRight(UserRight.MANAGE_USERS) && authUser.canManage(this.user)) { |
244 | this.userActions.push([ | 244 | this.userActions.push([ |
245 | { | 245 | { |
246 | label: this.i18n('Edit user'), | 246 | label: this.i18n('Edit'), |
247 | description: this.i18n('Change quota, role, and more.'), | ||
247 | linkBuilder: ({ user }) => this.getRouterUserEditLink(user) | 248 | linkBuilder: ({ user }) => this.getRouterUserEditLink(user) |
248 | }, | 249 | }, |
249 | { | 250 | { |
250 | label: this.i18n('Delete user'), | 251 | label: this.i18n('Delete'), |
252 | description: this.i18n('Videos will be deleted, comments will be tombstoned.'), | ||
251 | handler: ({ user }) => this.removeUser(user) | 253 | handler: ({ user }) => this.removeUser(user) |
252 | }, | 254 | }, |
253 | { | 255 | { |
254 | label: this.i18n('Ban user'), | 256 | label: this.i18n('Ban'), |
257 | description: this.i18n('Videos will be kept as private, comments will be kept as is.'), | ||
255 | handler: ({ user }) => this.openBanUserModal(user), | 258 | handler: ({ user }) => this.openBanUserModal(user), |
256 | isDisplayed: ({ user }) => !user.blocked | 259 | isDisplayed: ({ user }) => !user.blocked |
257 | }, | 260 | }, |
258 | { | 261 | { |
259 | label: this.i18n('Unban user'), | 262 | label: this.i18n('Unban user'), |
263 | description: this.i18n('Allow the user to login and create videos/comments again'), | ||
260 | handler: ({ user }) => this.unbanUser(user), | 264 | handler: ({ user }) => this.unbanUser(user), |
261 | isDisplayed: ({ user }) => user.blocked | 265 | isDisplayed: ({ user }) => user.blocked |
262 | }, | 266 | }, |
@@ -274,21 +278,25 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges { | |||
274 | this.userActions.push([ | 278 | this.userActions.push([ |
275 | { | 279 | { |
276 | label: this.i18n('Mute this account'), | 280 | label: this.i18n('Mute this account'), |
281 | description: this.i18n('Hide any content from that user for you.'), | ||
277 | isDisplayed: ({ account }) => account.mutedByUser === false, | 282 | isDisplayed: ({ account }) => account.mutedByUser === false, |
278 | handler: ({ account }) => this.blockAccountByUser(account) | 283 | handler: ({ account }) => this.blockAccountByUser(account) |
279 | }, | 284 | }, |
280 | { | 285 | { |
281 | label: this.i18n('Unmute this account'), | 286 | label: this.i18n('Unmute this account'), |
287 | description: this.i18n('Show back content from that user for you.'), | ||
282 | isDisplayed: ({ account }) => account.mutedByUser === true, | 288 | isDisplayed: ({ account }) => account.mutedByUser === true, |
283 | handler: ({ account }) => this.unblockAccountByUser(account) | 289 | handler: ({ account }) => this.unblockAccountByUser(account) |
284 | }, | 290 | }, |
285 | { | 291 | { |
286 | label: this.i18n('Mute the instance'), | 292 | label: this.i18n('Mute the instance'), |
293 | description: this.i18n('Hide any content from that instance for you.'), | ||
287 | isDisplayed: ({ account }) => !account.userId && account.mutedServerByInstance === false, | 294 | isDisplayed: ({ account }) => !account.userId && account.mutedServerByInstance === false, |
288 | handler: ({ account }) => this.blockServerByUser(account.host) | 295 | handler: ({ account }) => this.blockServerByUser(account.host) |
289 | }, | 296 | }, |
290 | { | 297 | { |
291 | label: this.i18n('Unmute the instance'), | 298 | label: this.i18n('Unmute the instance'), |
299 | description: this.i18n('Show back content from that instance for you.'), | ||
292 | isDisplayed: ({ account }) => !account.userId && account.mutedServerByInstance === true, | 300 | isDisplayed: ({ account }) => !account.userId && account.mutedServerByInstance === true, |
293 | handler: ({ account }) => this.unblockServerByUser(account.host) | 301 | handler: ({ account }) => this.unblockServerByUser(account.host) |
294 | } | 302 | } |
@@ -301,11 +309,13 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges { | |||
301 | instanceActions = instanceActions.concat([ | 309 | instanceActions = instanceActions.concat([ |
302 | { | 310 | { |
303 | label: this.i18n('Mute this account by your instance'), | 311 | label: this.i18n('Mute this account by your instance'), |
312 | description: this.i18n('Hide any content from that user for you, your instance and its users.'), | ||
304 | isDisplayed: ({ account }) => account.mutedByInstance === false, | 313 | isDisplayed: ({ account }) => account.mutedByInstance === false, |
305 | handler: ({ account }) => this.blockAccountByInstance(account) | 314 | handler: ({ account }) => this.blockAccountByInstance(account) |
306 | }, | 315 | }, |
307 | { | 316 | { |
308 | label: this.i18n('Unmute this account by your instance'), | 317 | label: this.i18n('Unmute this account by your instance'), |
318 | description: this.i18n('Show back content from that user for you, your instance and its users.'), | ||
309 | isDisplayed: ({ account }) => account.mutedByInstance === true, | 319 | isDisplayed: ({ account }) => account.mutedByInstance === true, |
310 | handler: ({ account }) => this.unblockAccountByInstance(account) | 320 | handler: ({ account }) => this.unblockAccountByInstance(account) |
311 | } | 321 | } |
@@ -317,11 +327,13 @@ export class UserModerationDropdownComponent implements OnInit, OnChanges { | |||
317 | instanceActions = instanceActions.concat([ | 327 | instanceActions = instanceActions.concat([ |
318 | { | 328 | { |
319 | label: this.i18n('Mute the instance by your instance'), | 329 | label: this.i18n('Mute the instance by your instance'), |
330 | description: this.i18n('Hide any content from that instance for you, your instance and its users.'), | ||
320 | isDisplayed: ({ account }) => !account.userId && account.mutedServerByInstance === false, | 331 | isDisplayed: ({ account }) => !account.userId && account.mutedServerByInstance === false, |
321 | handler: ({ account }) => this.blockServerByInstance(account.host) | 332 | handler: ({ account }) => this.blockServerByInstance(account.host) |
322 | }, | 333 | }, |
323 | { | 334 | { |
324 | label: this.i18n('Unmute the instance by your instance'), | 335 | label: this.i18n('Unmute the instance by your instance'), |
336 | description: this.i18n('Show back content from that instance for you, your instance and its users.'), | ||
325 | isDisplayed: ({ account }) => !account.userId && account.mutedServerByInstance === true, | 337 | isDisplayed: ({ account }) => !account.userId && account.mutedServerByInstance === true, |
326 | handler: ({ account }) => this.unblockServerByInstance(account.host) | 338 | handler: ({ account }) => this.unblockServerByInstance(account.host) |
327 | } | 339 | } |
diff --git a/client/src/app/shared/user-subscription/remote-subscribe.component.html b/client/src/app/shared/user-subscription/remote-subscribe.component.html index 59ee1cb04..acfec0a8e 100644 --- a/client/src/app/shared/user-subscription/remote-subscribe.component.html +++ b/client/src/app/shared/user-subscription/remote-subscribe.component.html | |||
@@ -1,5 +1,5 @@ | |||
1 | <form novalidate [formGroup]="form" (ngSubmit)="formValidated()"> | 1 | <form novalidate [formGroup]="form" (ngSubmit)="formValidated()"> |
2 | <div class="form-group"> | 2 | <div class="form-group mb-2"> |
3 | <input type="email" | 3 | <input type="email" |
4 | formControlName="text" | 4 | formControlName="text" |
5 | class="form-control" | 5 | class="form-control" |
diff --git a/client/src/app/shared/user-subscription/subscribe-button.component.html b/client/src/app/shared/user-subscription/subscribe-button.component.html index 2a4df29f7..f08c88f3c 100644 --- a/client/src/app/shared/user-subscription/subscribe-button.component.html +++ b/client/src/app/shared/user-subscription/subscribe-button.component.html | |||
@@ -54,7 +54,7 @@ | |||
54 | <span *ngIf="isUserLoggedIn()" i18n>Subscribe with your local account</span> | 54 | <span *ngIf="isUserLoggedIn()" i18n>Subscribe with your local account</span> |
55 | </button> | 55 | </button> |
56 | 56 | ||
57 | <button class="dropdown-item" i18n>Subscribe with a Mastodon account:</button> | 57 | <button class="dropdown-item dropdown-item-neutral" i18n>Subscribe with a Mastodon account:</button> |
58 | <my-remote-subscribe showHelp="true" [uri]="uri"></my-remote-subscribe> | 58 | <my-remote-subscribe showHelp="true" [uri]="uri"></my-remote-subscribe> |
59 | 59 | ||
60 | <div class="dropdown-divider"></div> | 60 | <div class="dropdown-divider"></div> |
diff --git a/client/src/app/shared/user-subscription/subscribe-button.component.scss b/client/src/app/shared/user-subscription/subscribe-button.component.scss index d5b3796a1..114a12f06 100644 --- a/client/src/app/shared/user-subscription/subscribe-button.component.scss +++ b/client/src/app/shared/user-subscription/subscribe-button.component.scss | |||
@@ -69,6 +69,15 @@ | |||
69 | button { | 69 | button { |
70 | cursor: pointer; | 70 | cursor: pointer; |
71 | } | 71 | } |
72 | |||
73 | .dropdown-item-neutral { | ||
74 | cursor: default; | ||
75 | |||
76 | &:hover, | ||
77 | &:focus { | ||
78 | background-color: inherit; | ||
79 | } | ||
80 | } | ||
72 | } | 81 | } |
73 | 82 | ||
74 | .dropdown-header { | 83 | .dropdown-header { |
diff --git a/client/src/app/shared/video/video-miniature.component.html b/client/src/app/shared/video/video-miniature.component.html index ce977b3e6..46c49c15b 100644 --- a/client/src/app/shared/video/video-miniature.component.html +++ b/client/src/app/shared/video/video-miniature.component.html | |||
@@ -10,14 +10,7 @@ | |||
10 | tabindex="-1" | 10 | tabindex="-1" |
11 | class="video-miniature-name" | 11 | class="video-miniature-name" |
12 | [routerLink]="[ '/videos/watch', video.uuid ]" [attr.title]="video.name" [ngClass]="{ 'blur-filter': isVideoBlur }" | 12 | [routerLink]="[ '/videos/watch', video.uuid ]" [attr.title]="video.name" [ngClass]="{ 'blur-filter': isVideoBlur }" |
13 | > | 13 | >{{ video.name }}</a> |
14 | <ng-container *ngIf="displayOptions.privacyLabel"> | ||
15 | <span *ngIf="isUnlistedVideo()" class="badge badge-warning" i18n>Unlisted</span> | ||
16 | <span *ngIf="isPrivateVideo()" class="badge badge-danger" i18n>Private</span> | ||
17 | </ng-container> | ||
18 | |||
19 | {{ video.name }} | ||
20 | </a> | ||
21 | 14 | ||
22 | <span class="video-miniature-created-at-views"> | 15 | <span class="video-miniature-created-at-views"> |
23 | <my-date-toggle *ngIf="displayOptions.date" [date]="video.publishedAt"></my-date-toggle> | 16 | <my-date-toggle *ngIf="displayOptions.date" [date]="video.publishedAt"></my-date-toggle> |
@@ -26,6 +19,11 @@ | |||
26 | <ng-container *ngIf="displayOptions.date && displayOptions.views"> • </ng-container> | 19 | <ng-container *ngIf="displayOptions.date && displayOptions.views"> • </ng-container> |
27 | <ng-container i18n *ngIf="displayOptions.views">{video.views, plural, =1 {1 view} other {{{ video.views | myNumberFormatter }} views}}</ng-container> | 20 | <ng-container i18n *ngIf="displayOptions.views">{video.views, plural, =1 {1 view} other {{{ video.views | myNumberFormatter }} views}}</ng-container> |
28 | </span> | 21 | </span> |
22 | |||
23 | <ng-container *ngIf="displayOptions.privacyLabel"> | ||
24 | <span *ngIf="isUnlistedVideo()" class="badge badge-warning ml-1" i18n>Unlisted</span> | ||
25 | <span *ngIf="isPrivateVideo()" class="badge badge-danger ml-1" i18n>Private</span> | ||
26 | </ng-container> | ||
29 | </span> | 27 | </span> |
30 | 28 | ||
31 | <a tabindex="-1" *ngIf="displayOptions.by && displayOwnerAccount()" class="video-miniature-account" [routerLink]="[ '/accounts', video.byAccount ]"> | 29 | <a tabindex="-1" *ngIf="displayOptions.by && displayOwnerAccount()" class="video-miniature-account" [routerLink]="[ '/accounts', video.byAccount ]"> |