implemented advanced library filter
This commit is contained in:
1 parent
7fc1bdd875
commit
ea5289dc67
5 files changed
+493
-125
No files matched your search
@@ -12,48 +12,115 @@
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="ms-auto">
|
||||
<div class="input-group custom-group">
|
||||
<div class="input-group-text">Show</div>
|
||||
<select class="form-select" id="single-select-field" data-placeholder="Choose one thing" style="max-width: 150px;"
|
||||
[(ngModel)]="pageSize" (change)="setPageSize($event)">
|
||||
<option value="20">20</option>
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
<option value="250">250</option>
|
||||
<option value="500">500</option>
|
||||
<option value="1000">1000</option>
|
||||
</select>
|
||||
</div>
|
||||
<!--end breadcrumb-->
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-outline-dark left-btn" [class.active]="entryType === 0"
|
||||
(click)="setEntryType(0)">All</button>
|
||||
<button type="button" class="btn btn-outline-dark" [class.active]="entryType === 1"
|
||||
(click)="setEntryType(1)">Movies</button>
|
||||
<button type="button" class="btn btn-outline-dark right-btn" [class.active]="entryType === 2"
|
||||
(click)="setEntryType(2)">TV-Series</button>
|
||||
|
||||
<!-- filter -->
|
||||
|
||||
<div class="d-flex align-items-baseline gap-3 flex-wrap">
|
||||
<div class="product-count d-flex align-items-center gap-3 gap-lg-4 mb-4 fw-medium flex-wrap font-text1">
|
||||
<a href="javascript:;" (click)="onEntryTypeChange(0)"><span class="me-1">All</span><span
|
||||
class="text-secondary">({{entries.length}})</span></a>
|
||||
<a href="javascript:;" (click)="onEntryTypeChange(1)"><span class="me-1">Movies</span><span
|
||||
class="text-secondary">({{moviesCount()}})</span></a>
|
||||
<a href="javascript:;" (click)="onEntryTypeChange(2)"><span class="me-1">Tv-Series</span><span
|
||||
class="text-secondary">({{seriesCount()}})</span></a>
|
||||
<a href="javascript:;" (click)="setFavorit()"><span class="me-1">Favorit</span><span
|
||||
class="text-secondary">({{favoritCount()}})</span></a>
|
||||
<a href="javascript:;" (click)="setHidden()"><span class="me-1">Hidden</span><span
|
||||
class="text-secondary">({{hiddenCount()}})</span></a>
|
||||
</div>
|
||||
<!-- filter switches -->
|
||||
<div class="d-flex align-items-baseline gap-3 flex-wrap filter-switches">
|
||||
<!-- Favorite -->
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="favoritSwitch"
|
||||
[(ngModel)]="filterCriteria.favorit" (ngModelChange)="onFilterChange()">
|
||||
<label class="form-check-label" for="favoritSwitch">Favorit</label>
|
||||
</div>
|
||||
|
||||
<!-- Hidden -->
|
||||
<div class="form-check form-switch form-check-danger">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="hiddenSwitch"
|
||||
[(ngModel)]="filterCriteria.hidden" (ngModelChange)="onFilterChange()">
|
||||
<label class="form-check-label" for="hiddenSwitch">Show Hidden</label>
|
||||
</div>
|
||||
|
||||
<!-- Match All Criteria -->
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="matchAllSwitch"
|
||||
[(ngModel)]="filterCriteria.matchAll" (ngModelChange)="onFilterChange()">
|
||||
<label class="form-check-label" for="matchAllSwitch">Match All Criteria</label>
|
||||
</div>
|
||||
|
||||
<!-- Clear Filter Link -->
|
||||
<a href="javascript:;" class="clear-filter-link" (click)="clearFilter()">Clear Filter</a>
|
||||
</div>
|
||||
<!-- filter switches END -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="containder">
|
||||
<div class="row">
|
||||
<!-- Search Input for Title -->
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text material-icons-outlined">search</span>
|
||||
<input class="form-control" type="search" placeholder="Title..." [(ngModel)]="filterCriteria.title"
|
||||
(ngModelChange)="onFilterChange()">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Year Selector -->
|
||||
<div class="col-sm-4">
|
||||
<div class="d-flex justify-content-start align-items-center">
|
||||
<select class="form-control select2" id="year-select" multiple (change)="onYearsChange($event)">
|
||||
<option *ngFor="let year of years" [value]="year">{{ year }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Genre Selector -->
|
||||
<div class="col-sm-4">
|
||||
<div class="d-flex justify-content-start align-items-center">
|
||||
<select class="form-control select2" id="genre-select" multiple (change)="onGenresChange($event)">
|
||||
<option *ngFor="let genre of genres" [value]="genre">{{ genre }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end breadcrumb-->
|
||||
<!-- filter end -->
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Pagination -->
|
||||
<div class="pagination-container d-flex justify-content-end" *ngIf="maxPage != 1 && entries.length != 0">
|
||||
<ul class="pagination pagination-sm">
|
||||
<li class="page-item" [class.disabled]="currentPage === 1">
|
||||
<a class="page-link" href="javascript:;" (click)="goToPage(currentPage - 1)">Previous</a>
|
||||
</li>
|
||||
<!-- Dynamically generate page numbers -->
|
||||
<li class="page-item" *ngFor="let page of pageNumbers" [class.active]="currentPage === page">
|
||||
<a class="page-link" href="javascript:;" (click)="goToPage(page)">{{ page }}</a>
|
||||
</li>
|
||||
<li class="page-item" [class.disabled]="currentPage == maxPage">
|
||||
<a class="page-link" href="javascript:;" (click)="goToPage(currentPage + 1)">Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-12 d-flex justify-content-between align-items-center" style="max-height: 40px;">
|
||||
<div class="dataTables_info" role="status" aria-live="polite">
|
||||
Total entries {{entriesCount}}
|
||||
</div>
|
||||
<div class="pagination-container d-flex justify-content-end" *ngIf="maxPage != 1 && entries.length != 0">
|
||||
<ul class="pagination pagination-sm">
|
||||
<li class="page-item" [class.disabled]="currentPage === 1">
|
||||
<a class="page-link" href="javascript:;" (click)="goToPage(currentPage - 1)">Previous</a>
|
||||
</li>
|
||||
<!-- Dynamically generate page numbers -->
|
||||
<li class="page-item" *ngFor="let page of pageNumbers" [class.active]="currentPage === page">
|
||||
<a class="page-link" href="javascript:;" (click)="goToPage(page)">{{ page }}</a>
|
||||
</li>
|
||||
<li class="page-item" [class.disabled]="currentPage == maxPage">
|
||||
<a class="page-link" href="javascript:;" (click)="goToPage(currentPage + 1)">Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<app-dynamic-entry-list [entries]="entriesToShow" (removedEvent)="entryRemoved($event)"></app-dynamic-entry-list>
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user