mirror of https://github.com/Chocobozzz/PeerTube
Fix button router link
Using the default one assigns the directive to the host, where we just want to put it inside the `my-button` componentpull/5949/head
parent
c925e99ca4
commit
ca589b42f1
|
@ -9,7 +9,7 @@
|
|||
<my-plugin-card [plugin]="plugin" [version]="plugin.version" [pluginType]="pluginType">
|
||||
<div ngProjectAs="buttons">
|
||||
<my-edit-button
|
||||
*ngIf="!isTheme(plugin)" [routerLink]="getShowRouterLink(plugin)" label="Settings" i18n-label
|
||||
*ngIf="!isTheme(plugin)" [ptRouterLink]="getShowRouterLink(plugin)" label="Settings" i18n-label
|
||||
[responsiveLabel]="true"
|
||||
></my-edit-button>
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
<div ngProjectAs="buttons">
|
||||
<my-edit-button
|
||||
*ngIf="plugin.installed === true && !isThemeSearch()" [routerLink]="getShowRouterLink(plugin)"
|
||||
*ngIf="plugin.installed === true && !isThemeSearch()" [ptRouterLink]="getShowRouterLink(plugin)"
|
||||
label="Settings" i18n-label [responsiveLabel]="true"
|
||||
></my-edit-button>
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<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 [routerLink]="[ '/my-account/two-factor-auth' ]" className="orange-button-link" i18n>Enable two-factor authentication</my-button>
|
||||
<my-button [ptRouterLink]="[ '/my-account/two-factor-auth' ]" className="orange-button-link" i18n>Enable two-factor authentication</my-button>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="twoFactorEnabled">
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
</div>
|
||||
|
||||
<div class="video-channel-buttons">
|
||||
<my-edit-button label [routerLink]="[ '/manage/update', videoChannel.nameWithHost ]"></my-edit-button>
|
||||
<my-edit-button label [ptRouterLink]="[ '/manage/update', videoChannel.nameWithHost ]"></my-edit-button>
|
||||
<my-delete-button label (click)="deleteVideoChannel(videoChannel)"></my-delete-button>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<td class="action-cell">
|
||||
<my-button *ngIf="isVideoImportPending(videoImport)" i18n-label label="Cancel" icon="no" (click)="cancelImport(videoImport)"></my-button>
|
||||
<my-delete-button *ngIf="isVideoImportFailed(videoImport) || isVideoImportCancelled(videoImport) || !videoImport.video" (click)="deleteImport(videoImport)"></my-delete-button>
|
||||
<my-edit-button *ngIf="isVideoImportSuccess(videoImport) && videoImport.video" [routerLink]="getEditVideoUrl(videoImport.video)"></my-edit-button>
|
||||
<my-edit-button *ngIf="isVideoImportSuccess(videoImport) && videoImport.video" [ptRouterLink]="getEditVideoUrl(videoImport.video)"></my-edit-button>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<div *ngIf="isRegularPlaylist(playlist)" class="video-playlist-buttons">
|
||||
<my-delete-button label (click)="deleteVideoPlaylist(playlist)"></my-delete-button>
|
||||
|
||||
<my-edit-button label [routerLink]="[ 'update', playlist.uuid ]"></my-edit-button>
|
||||
<my-edit-button label [ptRouterLink]="[ 'update', playlist.uuid ]"></my-edit-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
|
||||
<ng-template ptTemplate="rowButtons" let-video>
|
||||
<div class="action-button">
|
||||
<my-edit-button label [routerLink]="[ '/videos', 'update', video.uuid ]"></my-edit-button>
|
||||
<my-edit-button label [ptRouterLink]="[ '/videos', 'update', video.uuid ]"></my-edit-button>
|
||||
|
||||
<my-video-actions-dropdown
|
||||
[video]="video" [displayOptions]="videoDropdownDisplayOptions" [moreActions]="moreVideoActions"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<button *ngIf="!routerLink" class="action-button" [ngClass]="classes" [ngbTooltip]="title">
|
||||
<button *ngIf="!ptRouterLink" class="action-button" [ngClass]="classes" [ngbTooltip]="title">
|
||||
<ng-container *ngTemplateOutlet="content"></ng-container>
|
||||
</button>
|
||||
|
||||
<a *ngIf="routerLink" class="action-button" [ngClass]="classes" [ngbTooltip]="title" [routerLink]="routerLink">
|
||||
<a *ngIf="ptRouterLink" class="action-button" [ngClass]="classes" [ngbTooltip]="title" [routerLink]="ptRouterLink">
|
||||
<ng-container *ngTemplateOutlet="content"></ng-container>
|
||||
</a>
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ export class ButtonComponent implements OnInit, OnChanges {
|
|||
@Input() label = ''
|
||||
@Input() className = 'grey-button'
|
||||
@Input() icon: GlobalIconName = undefined
|
||||
@Input() routerLink: string[] | string
|
||||
@Input() ptRouterLink: string[] | string
|
||||
@Input() title: string = undefined
|
||||
@Input() loading = false
|
||||
@Input() disabled = false
|
||||
|
|
|
@ -6,14 +6,14 @@ import { Component, Input, OnInit } from '@angular/core'
|
|||
<my-button
|
||||
icon="edit" className="grey-button-link"
|
||||
[label]="label" [title]="title" [responsiveLabel]="responsiveLabel"
|
||||
[routerLink]="routerLink"
|
||||
[ptRouterLink]="ptRouterLink"
|
||||
></my-button>
|
||||
`
|
||||
})
|
||||
export class EditButtonComponent implements OnInit {
|
||||
@Input() label: string
|
||||
@Input() title: string
|
||||
@Input() routerLink: string[] | string = []
|
||||
@Input() ptRouterLink: string[] | string = []
|
||||
@Input() responsiveLabel = false
|
||||
|
||||
ngOnInit () {
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
<my-edit-button
|
||||
i18n-label label="Update live settings"
|
||||
[routerLink]="[ '/videos', 'update', video.uuid ]" (click)="dismiss()"
|
||||
[ptRouterLink]="[ '/videos', 'update', video.uuid ]" (click)="dismiss()"
|
||||
></my-edit-button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
</div>
|
||||
</a>
|
||||
|
||||
<my-edit-button *ngIf="owned && touchScreenEditButton" [routerLink]="[ '/my-library', 'video-playlists', playlist.uuid ]"></my-edit-button>
|
||||
<my-edit-button *ngIf="owned && touchScreenEditButton" [ptRouterLink]="[ '/my-library', 'video-playlists', playlist.uuid ]"></my-edit-button>
|
||||
|
||||
<div *ngIf="owned" class="more dropdown-root" ngbDropdown #moreDropdown="ngbDropdown" placement="left auto"
|
||||
(openChange)="onDropdownOpenChange()" autoClose="outside" container="body"
|
||||
|
|
Loading…
Reference in New Issue