Revamp styling and layout of settings pages
This commit is contained in:
committed by
Aditya Chandel
parent
443dcad59a
commit
13df6a79b6
+47
-33
@@ -1,38 +1,52 @@
|
||||
<div class="px-4">
|
||||
<div class="flex items-center gap-2 pb-6 pt-4">
|
||||
<p class="text-lg font-medium">Open Metadata Center</p>
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Decide how you want to view book details — inline as a full page or in a pop-up dialog."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;">
|
||||
</i>
|
||||
<div class="main-container enclosing-container">
|
||||
<div class="settings-header">
|
||||
<h2 class="settings-title">
|
||||
<i class="pi pi-window-maximize"></i>
|
||||
Open Metadata Center
|
||||
</h2>
|
||||
<p class="settings-description">
|
||||
Decide how you want to view book details — inline as a full page or in a pop-up dialog.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
||||
<p class="py-1">Display Mode:
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Choose whether to open the Metadata Center in the current page or as a popup dialog window."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;">
|
||||
</i>
|
||||
</p>
|
||||
|
||||
<div class="flex gap-4 justify-start">
|
||||
<div class="flex items-center gap-2">
|
||||
<p-radioButton name="viewMode"
|
||||
[value]="'route'"
|
||||
[(ngModel)]="viewMode"
|
||||
inputId="viewModeRoute"
|
||||
(onClick)="onViewModeChange('route')"></p-radioButton>
|
||||
<label for="viewModeRoute">Route</label>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<p-radioButton name="viewMode"
|
||||
[value]="'dialog'"
|
||||
[(ngModel)]="viewMode"
|
||||
inputId="viewModeDialog"
|
||||
(onClick)="onViewModeChange('dialog')"></p-radioButton>
|
||||
<label for="viewModeDialog">Dialog</label>
|
||||
<div class="settings-content">
|
||||
<div class="preferences-section">
|
||||
<div class="settings-card">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">
|
||||
Display Mode
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Choose whether to open the Metadata Center in the current page or as a popup dialog window."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;">
|
||||
</i>
|
||||
</label>
|
||||
<div class="radio-group">
|
||||
<div class="radio-option">
|
||||
<p-radioButton name="viewMode"
|
||||
[value]="'route'"
|
||||
[(ngModel)]="viewMode"
|
||||
inputId="viewModeRoute"
|
||||
(onClick)="onViewModeChange('route')"></p-radioButton>
|
||||
<label for="viewModeRoute">Route</label>
|
||||
</div>
|
||||
<div class="radio-option">
|
||||
<p-radioButton name="viewMode"
|
||||
[value]="'dialog'"
|
||||
[(ngModel)]="viewMode"
|
||||
inputId="viewModeDialog"
|
||||
(onClick)="onViewModeChange('dialog')"></p-radioButton>
|
||||
<label for="viewModeDialog">Dialog</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
Choose whether to open the Metadata Center in the current page or as a popup dialog window.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
.main-container {
|
||||
width: 100%;
|
||||
padding: 1rem;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.enclosing-container {
|
||||
border-color: var(--p-content-border-color);
|
||||
background: var(--p-content-background);
|
||||
}
|
||||
|
||||
.settings-header {
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.settings-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
color: var(--p-text-color);
|
||||
margin: 0 0 0.75rem 0;
|
||||
|
||||
.pi {
|
||||
color: var(--p-primary-color);
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-description {
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.settings-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.preferences-section {
|
||||
@media (min-width: 768px) {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-card {
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
background: var(--p-content-background);
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.setting-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 2rem;
|
||||
padding: 0.25rem 0;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
.setting-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-weight: 600;
|
||||
color: var(--p-text-color);
|
||||
font-size: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.setting-label-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.setting-label {
|
||||
margin-bottom: 0;
|
||||
flex-shrink: 0;
|
||||
min-width: 150px;
|
||||
}
|
||||
|
||||
.radio-group {
|
||||
display: flex;
|
||||
gap: 1.5rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.setting-description {
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-control {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
align-items: flex-end;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.radio-group {
|
||||
display: flex;
|
||||
gap: 1.5rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.radio-option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
|
||||
label {
|
||||
font-size: 0.875rem;
|
||||
color: var(--p-text-color);
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
+61
-40
@@ -1,46 +1,67 @@
|
||||
<div class="px-4 pb-2">
|
||||
<div class="flex items-center gap-2 pb-6 pt-4">
|
||||
<p class="text-lg">Sidebar Library and Shelf Sorting Preference</p>
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Configure sorting options for your library and shelves shown in the sidebar."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;">
|
||||
</i>
|
||||
<div class="main-container enclosing-container">
|
||||
<div class="settings-header">
|
||||
<h2 class="settings-title">
|
||||
<i class="pi pi-sort-alt"></i>
|
||||
Sidebar Library and Shelf Sorting Preference
|
||||
</h2>
|
||||
<p class="settings-description">
|
||||
Configure sorting options for your library and shelves shown in the sidebar.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
||||
<p class="py-1">Library:
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Choose how books are sorted and displayed in the library sidebar."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;">
|
||||
</i>
|
||||
</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="sortingOptions"
|
||||
[(ngModel)]="selectedLibrarySorting"
|
||||
(ngModelChange)="onLibrarySortingChange()"
|
||||
placeholder="Select Sorting">
|
||||
</p-select>
|
||||
</div>
|
||||
<div class="settings-content">
|
||||
<div class="preferences-section">
|
||||
<div class="settings-card">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">
|
||||
Library
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Choose how books are sorted and displayed in the library sidebar."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;">
|
||||
</i>
|
||||
</label>
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="sortingOptions"
|
||||
[(ngModel)]="selectedLibrarySorting"
|
||||
(ngModelChange)="onLibrarySortingChange()"
|
||||
placeholder="Select Sorting">
|
||||
</p-select>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
Choose how books are sorted and displayed in the library sidebar.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="py-4">Shelf:
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Choose how books are sorted and displayed in the shelf sidebar."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;">
|
||||
</i>
|
||||
</p>
|
||||
<div class="flex gap-4 justify-start">
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="sortingOptions"
|
||||
[(ngModel)]="selectedShelfSorting"
|
||||
(ngModelChange)="onShelfSortingChange()"
|
||||
placeholder="Select Sorting">
|
||||
</p-select>
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">
|
||||
Shelf
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Choose how books are sorted and displayed in the shelf sidebar."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;">
|
||||
</i>
|
||||
</label>
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="sortingOptions"
|
||||
[(ngModel)]="selectedShelfSorting"
|
||||
(ngModelChange)="onShelfSortingChange()"
|
||||
placeholder="Select Sorting">
|
||||
</p-select>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
Choose how books are sorted and displayed in the shelf sidebar.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
.main-container {
|
||||
width: 100%;
|
||||
padding: 1rem;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.enclosing-container {
|
||||
border-color: var(--p-content-border-color);
|
||||
background: var(--p-content-background);
|
||||
}
|
||||
|
||||
.settings-header {
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.settings-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
color: var(--p-text-color);
|
||||
margin: 0 0 0.75rem 0;
|
||||
|
||||
.pi {
|
||||
color: var(--p-primary-color);
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-description {
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.settings-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.preferences-section {
|
||||
@media (min-width: 768px) {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-card {
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
background: var(--p-content-background);
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.setting-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 2rem;
|
||||
padding: 0.25rem 0;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
.setting-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-weight: 600;
|
||||
color: var(--p-text-color);
|
||||
font-size: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.setting-label-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.setting-label {
|
||||
margin-bottom: 0;
|
||||
flex-shrink: 0;
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
p-select {
|
||||
min-width: 200px;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
min-width: 180px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.setting-description {
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-control {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
align-items: flex-end;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
+9
-2
@@ -1,7 +1,14 @@
|
||||
<div class="w-full h-[calc(100dvh-10.5rem)] md:h-[calc(100dvh-11.65rem)] overflow-y-auto border rounded-lg enclosing-container">
|
||||
<app-view-preferences></app-view-preferences>
|
||||
<p-divider></p-divider>
|
||||
<div class="pt-8">
|
||||
<p-divider></p-divider>
|
||||
</div>
|
||||
<app-sidebar-sorting-preferences></app-sidebar-sorting-preferences>
|
||||
<p-divider></p-divider>
|
||||
<div class="pt-8">
|
||||
<p-divider></p-divider>
|
||||
</div>
|
||||
<app-meta-center-view-mode-component></app-meta-center-view-mode-component>
|
||||
<div class="pt-8">
|
||||
<p-divider></p-divider>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+121
-68
@@ -1,74 +1,127 @@
|
||||
<div class="p-4">
|
||||
<p class="text-lg pb-6 pt-4">
|
||||
Library and Shelf View & Sort Preferences:
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Configure default and per-library/shelf preferences for sorting and view mode (grid or table) in the browser."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;"></i>
|
||||
</p>
|
||||
<div class="main-container enclosing-container">
|
||||
<div class="settings-header">
|
||||
<h2 class="settings-title">
|
||||
<i class="pi pi-table"></i>
|
||||
Library and Shelf View & Sort Preferences
|
||||
</h2>
|
||||
<p class="settings-description">
|
||||
Configure default and per-library/shelf preferences for sorting and view mode (grid or table) in the browser.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
||||
<p>Default:</p>
|
||||
<div class="flex gap-4 pl-4">
|
||||
<p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
||||
[(ngModel)]="selectedSort" placeholder="Sort" class="w-full md:w-72"></p-select>
|
||||
<p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="selectedSortDir"
|
||||
placeholder="Direction" class="w-full md:w-44"></p-select>
|
||||
<p-select size="small" [options]="viewModeOptions" [(ngModel)]="selectedView"
|
||||
placeholder="View" class="w-full md:w-44"></p-select>
|
||||
<div class="settings-content">
|
||||
<div class="preferences-section">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-cog"></i>
|
||||
Default Settings
|
||||
</h3>
|
||||
<p class="section-description">
|
||||
Set the default sorting and view preferences that will apply to all libraries and shelves unless overridden.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-card">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Default Preferences</label>
|
||||
<div class="select-group">
|
||||
<p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
||||
[(ngModel)]="selectedSort" placeholder="Sort" class="select-item"></p-select>
|
||||
<p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="selectedSortDir"
|
||||
placeholder="Direction" class="select-item"></p-select>
|
||||
<p-select size="small" [options]="viewModeOptions" [(ngModel)]="selectedView"
|
||||
placeholder="View" class="select-item"></p-select>
|
||||
</div>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
Configure the default sorting field, direction, and view mode for all libraries and shelves.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center mt-8">
|
||||
<p>Overrides:</p>
|
||||
<div class="flex gap-4">
|
||||
<p-button label="Add New Override" outlined size="small" (onClick)="addOverride()" severity="info" [disabled]="availableLibraries.length === 0"></p-button>
|
||||
<div class="preferences-section">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-list"></i>
|
||||
Specific Overrides
|
||||
</h3>
|
||||
<p class="section-description">
|
||||
Create specific sorting and view preferences for individual libraries or shelves that override the default settings.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-card">
|
||||
<div class="setting-item no-border">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Override Management</label>
|
||||
<p-button label="Add New Override" outlined size="small" (onClick)="addOverride()"
|
||||
severity="info" [disabled]="availableLibraries.length === 0"></p-button>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
Add custom preferences for specific libraries or shelves.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (overrides.length > 0) {
|
||||
<div class="overrides-table">
|
||||
<p-table [value]="overrides">
|
||||
<ng-template pTemplate="header">
|
||||
<tr>
|
||||
<th class="min-w-[150px] max-w-[220px]">Type</th>
|
||||
<th class="min-w-[220px] max-w-[280px]">Name</th>
|
||||
<th class="min-w-[190px] max-w-[250px]">Sort By</th>
|
||||
<th class="min-w-[125px]">Sort Dir</th>
|
||||
<th class="min-w-[125px]">View</th>
|
||||
<th class="w-[75px] text-center"></th>
|
||||
</tr>
|
||||
</ng-template>
|
||||
<ng-template pTemplate="body" let-override let-rowIndex="rowIndex">
|
||||
<tr>
|
||||
<td>
|
||||
<p-select size="small" [options]="entityTypeOptions" [(ngModel)]="override.entityType"
|
||||
class="w-full" appendTo="body"></p-select>
|
||||
</td>
|
||||
<td>
|
||||
@if (override.entityType) {
|
||||
<p-select size="small"
|
||||
[options]="getAvailableEntities(rowIndex, override.entityType)"
|
||||
[(ngModel)]="override.library"
|
||||
optionLabel="label" optionValue="value"
|
||||
class="w-full" appendTo="body"></p-select>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
||||
[(ngModel)]="override.sort" class="w-full" appendTo="body"></p-select>
|
||||
</td>
|
||||
<td>
|
||||
<p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="override.sortDir"
|
||||
class="w-full" appendTo="body"></p-select>
|
||||
</td>
|
||||
<td>
|
||||
<p-select size="small" [options]="viewModeOptions" [(ngModel)]="override.view"
|
||||
class="w-full" appendTo="body"></p-select>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<p-button icon="pi pi-trash" severity="danger" size="small" [outlined]="true"
|
||||
(onClick)="removeOverride(rowIndex)"></p-button>
|
||||
</td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
</p-table>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="save-section">
|
||||
<p-button label="Save" icon="pi pi-save" severity="success" outlined size="small" (onClick)="saveSettings()"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pl-2 pt-2 min-w-[400px] max-w-[1000px]">
|
||||
@if (overrides.length > 0) {
|
||||
<p-table [value]="overrides" class="relative z-0" [responsiveLayout]="'scroll'">
|
||||
<ng-template pTemplate="header">
|
||||
<tr>
|
||||
<th class="min-w-[150px] max-w-[220px]">Type</th>
|
||||
<th class="min-w-[220px] max-w-[280px]">Name</th>
|
||||
<th class="min-w-[190px] max-w-[250px]">Sort By</th>
|
||||
<th class="min-w-[125px]">Sort Dir</th>
|
||||
<th class="min-w-[125px]">View</th>
|
||||
<th class="w-[75px] text-center"></th>
|
||||
</tr>
|
||||
</ng-template>
|
||||
<ng-template pTemplate="body" let-override let-rowIndex="rowIndex">
|
||||
<tr>
|
||||
<td><p-select size="small" [options]="entityTypeOptions" [(ngModel)]="override.entityType"
|
||||
class="w-full" appendTo="body"></p-select></td>
|
||||
<td>
|
||||
@if (override.entityType) {
|
||||
<p-select size="small"
|
||||
[options]="getAvailableEntities(rowIndex, override.entityType)"
|
||||
[(ngModel)]="override.library"
|
||||
optionLabel="label" optionValue="value"
|
||||
class="w-full" appendTo="body"></p-select>
|
||||
}
|
||||
</td>
|
||||
<td><p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
||||
[(ngModel)]="override.sort" class="w-full" appendTo="body"></p-select></td>
|
||||
<td><p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="override.sortDir"
|
||||
class="w-full" appendTo="body"></p-select></td>
|
||||
<td><p-select size="small" [options]="viewModeOptions" [(ngModel)]="override.view"
|
||||
class="w-full" appendTo="body"></p-select></td>
|
||||
<td class="text-center">
|
||||
<p-button icon="pi pi-trash" severity="danger" class="p-button-sm" [outlined]="true"
|
||||
(onClick)="removeOverride(rowIndex)"></p-button>
|
||||
</td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
</p-table>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="flex justify-start px-6 pt-4">
|
||||
<p-button label="Save" icon="pi pi-save" outlined size="small" (onClick)="saveSettings()"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+223
@@ -0,0 +1,223 @@
|
||||
.main-container {
|
||||
width: 100%;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.enclosing-container {
|
||||
border-color: var(--p-content-border-color);
|
||||
background: var(--p-content-background);
|
||||
}
|
||||
|
||||
.settings-header {
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.settings-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
color: var(--p-text-color);
|
||||
margin: 0 0 0.75rem 0;
|
||||
|
||||
.pi {
|
||||
color: var(--p-primary-color);
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-description {
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.settings-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.preferences-section {
|
||||
@media (min-width: 768px) {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-header {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
color: var(--p-text-color);
|
||||
margin: 0 0 0.5rem 0;
|
||||
|
||||
.pi {
|
||||
color: var(--p-primary-color);
|
||||
}
|
||||
}
|
||||
|
||||
.section-description {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.5rem;
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
|
||||
.pi {
|
||||
color: var(--p-primary-color);
|
||||
margin-top: 0.125rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-card {
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
background: var(--p-content-background);
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.setting-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 2rem;
|
||||
padding: 0.25rem 0;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
&.no-border {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
.setting-label {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
color: var(--p-text-color);
|
||||
font-size: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.setting-label-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.setting-label {
|
||||
margin-bottom: 0;
|
||||
flex-shrink: 0;
|
||||
min-width: 180px;
|
||||
}
|
||||
|
||||
.select-group {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
flex-wrap: wrap;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.select-item {
|
||||
min-width: 150px;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
min-width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.setting-description {
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-control {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
align-items: flex-end;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.select-group {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
flex-wrap: wrap;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.select-item {
|
||||
min-width: 200px;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
min-width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.overrides-table {
|
||||
width: 100%;
|
||||
|
||||
::ng-deep {
|
||||
.p-datatable {
|
||||
.p-datatable-thead > tr > th {
|
||||
font-weight: 600;
|
||||
padding: 0.75rem;
|
||||
}
|
||||
|
||||
.p-datatable-tbody > tr > td {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.save-section {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
-2
@@ -4,7 +4,6 @@ import {Button} from 'primeng/button';
|
||||
import {MessageService} from 'primeng/api';
|
||||
import {Select} from 'primeng/select';
|
||||
import {TableModule} from 'primeng/table';
|
||||
import {Tooltip} from 'primeng/tooltip';
|
||||
import {User, UserService} from '../../user-management/user.service';
|
||||
import {LibraryService} from '../../../book/service/library.service';
|
||||
import {ShelfService} from '../../../book/service/shelf.service';
|
||||
@@ -18,7 +17,6 @@ import {filter, take, takeUntil} from 'rxjs/operators';
|
||||
standalone: true,
|
||||
imports: [
|
||||
Select,
|
||||
Tooltip,
|
||||
FormsModule,
|
||||
Button,
|
||||
TableModule,
|
||||
|
||||
Reference in New Issue
Block a user