Migrate existing control flow directives to use new control-flow schematic

This commit is contained in:
aditya.chandel
2025-06-05 18:18:10 -06:00
committed by Aditya Chandel
parent 246efdaa34
commit 0f852ef068
86 changed files with 2567 additions and 2173 deletions
@@ -17,88 +17,89 @@
</p-toggleswitch>
</div>
<div *ngIf="opdsEnabled" class="flex items-center gap-2 mt-4">
<p class="text-lg py-1">OPDS Endpoint:</p>
<div class="flex items-center gap-4">
<input
class="min-w-[500px] max-w-[800px]"
type="text"
pInputText
[value]="opdsEndpoint"
readonly/>
<p-button
icon="pi pi-copy"
severity="info"
(onClick)="copyOpdsEndpoint()"
label="Copy"
outlined="true">
</p-button>
@if (opdsEnabled) {
<div class="flex items-center gap-2 mt-4">
<p class="text-lg py-1">OPDS Endpoint:</p>
<div class="flex items-center gap-4">
<input
class="min-w-[500px] max-w-[800px]"
type="text"
pInputText
[value]="opdsEndpoint"
readonly/>
<p-button
icon="pi pi-copy"
severity="info"
(onClick)="copyOpdsEndpoint()"
label="Copy"
outlined="true">
</p-button>
</div>
</div>
</div>
}
<div *ngIf="opdsEnabled" class="mt-6">
<div class="flex justify-between items-center">
<h2 class="text-lg flex items-center gap-2">
Current OPDS Users:
</h2>
<p-button
label="Create OPDS User"
icon="pi pi-plus"
outlined="true"
(onClick)="openCreateUserDialog()">
</p-button>
@if (opdsEnabled) {
<div class="mt-6">
<div class="flex justify-between items-center">
<h2 class="text-lg flex items-center gap-2">
Current OPDS Users:
</h2>
<p-button
label="Create OPDS User"
icon="pi pi-plus"
outlined="true"
(onClick)="openCreateUserDialog()">
</p-button>
</div>
<div class="mt-3">
<p-table [value]="users" [responsiveLayout]="'scroll'">
<ng-template pTemplate="header">
<tr>
<th>Username</th>
<th>Password</th>
<th>Reset Password</th>
<th>Delete</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-user>
<tr>
<td>{{ user.username }}</td>
<td class="flex items-center gap-2">
<p-password
[(ngModel)]="dummyPassword"
[disabled]="true">
</p-password>
<i
class="pi pi-info-circle text-sky-600"
pTooltip="The password is hidden for security reasons and is only visible once during creation. You can reset the password if needed."
tooltipPosition="right"
style="cursor: pointer;">
</i>
</td>
<td>
<p-button
icon="pi pi-key"
severity="warn"
size="small"
outlined="true"
(onClick)="openResetPasswordDialog(user)">
</p-button>
</td>
<td>
<p-button
icon="pi pi-trash"
severity="danger"
size="small"
outlined="true"
(onClick)="deleteUser(user.id)">
</p-button>
</td>
</tr>
</ng-template>
</p-table>
</div>
</div>
<div class="mt-3">
<p-table [value]="users" [responsiveLayout]="'scroll'">
<ng-template pTemplate="header">
<tr>
<th>Username</th>
<th>Password</th>
<th>Reset Password</th>
<th>Delete</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-user>
<tr>
<td>{{ user.username }}</td>
<td class="flex items-center gap-2">
<p-password
[(ngModel)]="dummyPassword"
[disabled]="true">
</p-password>
<i
class="pi pi-info-circle text-sky-600"
pTooltip="The password is hidden for security reasons and is only visible once during creation. You can reset the password if needed."
tooltipPosition="right"
style="cursor: pointer;">
</i>
</td>
<td>
<p-button
icon="pi pi-key"
severity="warn"
size="small"
outlined="true"
(onClick)="openResetPasswordDialog(user)">
</p-button>
</td>
<td>
<p-button
icon="pi pi-trash"
severity="danger"
size="small"
outlined="true"
(onClick)="deleteUser(user.id)">
</p-button>
</td>
</tr>
</ng-template>
</p-table>
</div>
</div>
}
</div>
<p-dialog