Add ability to mark magic shelves as public (#1489)
Adds a checkbox to the create/edit magic shelf dialog to set the shelf as public. If public then it shows up for all users. Only admins can edit public shelves (edit options disabled for non-admin)
This commit is contained in:
@@ -2,36 +2,46 @@
|
||||
|
||||
<div class="px-8 pt-8 flex-grow overflow-auto" [formGroup]="form">
|
||||
|
||||
<div class="mb-4 flex w-full gap-4">
|
||||
<div class="flex-1">
|
||||
<label for="shelfName" class="block mb-1 font-semibold">Shelf Name</label>
|
||||
<input pInputText id="shelfName" type="text" formControlName="name" placeholder="E.g. Rom-Zom-Coms, Fast & Furious, Missing Metadata" class="w-full"/>
|
||||
</div>
|
||||
<div class="flex items-end">
|
||||
<div>
|
||||
<label class="block mb-1 font-semibold">Shelf Icon</label>
|
||||
<p-button
|
||||
[icon]="form.get('icon')?.value || 'pi pi-plus'"
|
||||
(click)="openIconPicker()"
|
||||
[outlined]="form.get('icon')?.value"
|
||||
[severity]="form.get('icon')?.value ? 'success' : 'danger'"
|
||||
[label]="form.get('icon')?.value ? 'Icon Selected' : 'Select Icon'">
|
||||
</p-button>
|
||||
<fieldset [disabled]="form.get('isPublic')?.value && !isAdmin">
|
||||
<div class="mb-4 flex w-full gap-4">
|
||||
<div class="flex-1">
|
||||
<label for="shelfName" class="block mb-1 font-semibold">Shelf Name</label>
|
||||
<input pInputText id="shelfName" type="text" formControlName="name" placeholder="E.g. Rom-Zom-Coms, Fast & Furious, Missing Metadata" class="w-full"/>
|
||||
</div>
|
||||
<div class="flex items-end">
|
||||
<div>
|
||||
<label class="block mb-1 font-semibold">Shelf Icon</label>
|
||||
<p-button
|
||||
[icon]="form.get('icon')?.value || 'pi pi-plus'"
|
||||
(click)="openIconPicker()"
|
||||
[outlined]="form.get('icon')?.value"
|
||||
[severity]="form.get('icon')?.value ? 'success' : 'danger'"
|
||||
[label]="form.get('icon')?.value ? 'Icon Selected' : 'Select Icon'">
|
||||
</p-button>
|
||||
</div>
|
||||
</div>
|
||||
@if (isAdmin) {
|
||||
<div class="flex items-end">
|
||||
<div class="flex items-center">
|
||||
<p-checkbox formControlName="isPublic" [binary]="true" inputId="isPublic" (onChange)="onIsPublicChange($event)"></p-checkbox>
|
||||
<label for="isPublic" class="ml-2">Public</label>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="overflow-auto max-h-[40rem]">
|
||||
<ng-container *ngTemplateOutlet="groupTemplate; context: { group: form.get('group') }"></ng-container>
|
||||
</div>
|
||||
<div class="my-4 text-left">
|
||||
<p-button
|
||||
label="Save Filter"
|
||||
outlined
|
||||
severity="success"
|
||||
(click)="submit()"
|
||||
[disabled]="form.invalid"></p-button>
|
||||
</div>
|
||||
<div class="overflow-auto max-h-[40rem]">
|
||||
<ng-container *ngTemplateOutlet="groupTemplate; context: { group: form.get('group') }"></ng-container>
|
||||
</div>
|
||||
<div class="my-4 text-left">
|
||||
<p-button
|
||||
label="Save Filter"
|
||||
outlined
|
||||
severity="success"
|
||||
(click)="submit()"
|
||||
[disabled]="form.invalid"></p-button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<ng-template #groupTemplate let-group="group">
|
||||
|
||||
Reference in New Issue
Block a user