mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-04-05 08:53:53 -04:00
Implemented filter and sort selected functions
This commit is contained in:
@@ -382,7 +382,12 @@ if(variables.serviceWeb) {
|
||||
voucher_types: types(variables.voucherTypes),
|
||||
voucher_custom: variables.voucherCustom,
|
||||
vouchers: cache.vouchers,
|
||||
updated: cache.updated
|
||||
updated: cache.updated,
|
||||
filters: {
|
||||
status: req.query.status,
|
||||
quota: req.query.quota
|
||||
},
|
||||
sort: req.query.sort
|
||||
});
|
||||
});
|
||||
app.get('/voucher/:id', [authorization.web], async (req, res) => {
|
||||
|
||||
@@ -91,27 +91,27 @@
|
||||
<div class="flex flex-col">
|
||||
<label for="status" class="text-sm text-gray-900 dark:text-white mb-1">Status</label>
|
||||
<select id="status" name="status" class="bg-transparent rounded-md text-sm text-gray-600 dark:text-gray-400 focus:outline-none border-b border-black/5 dark:border-white/5" aria-label="Filter by category">
|
||||
<option value="all">All</option>
|
||||
<option value="available">Available</option>
|
||||
<option value="in-use">In Use</option>
|
||||
<option value="all"<%= filters.status === 'all' ? ' selected' : '' %>>All</option>
|
||||
<option value="available"<%= filters.status === 'available' ? ' selected' : '' %>>Available</option>
|
||||
<option value="in-use"<%= filters.status === 'in-use' ? ' selected' : '' %>>In Use</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label for="quota" class="text-sm text-gray-900 dark:text-white mb-1">Quota</label>
|
||||
<select id="quota" name="quota" class="bg-transparent rounded-md text-sm text-gray-600 dark:text-gray-400 focus:outline-none border-b border-black/5 dark:border-white/5" aria-label="Filter by category">
|
||||
<option value="all">All</option>
|
||||
<option value="multi-use">Multi-use</option>
|
||||
<option value="single-use">Single-use</option>
|
||||
<option value="all"<%= filters.quota === 'all' ? ' selected' : '' %>>All</option>
|
||||
<option value="multi-use"<%= filters.quota === 'multi-use' ? ' selected' : '' %>>Multi-use</option>
|
||||
<option value="single-use"<%= filters.quota === 'single-use' ? ' selected' : '' %>>Single-use</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label for="sort" class="text-sm text-gray-900 dark:text-white mb-1">Sort</label>
|
||||
<select id="sort" name="sort" class="bg-transparent rounded-md text-sm text-gray-600 dark:text-gray-400 focus:outline-none border-b border-black/5 dark:border-white/5" aria-label="Sort by">
|
||||
<option value="date">Date</option>
|
||||
<option value="code">Code</option>
|
||||
<option value="duration">Duration</option>
|
||||
<option value="status">Status</option>
|
||||
<option value="date"<%= sort === 'date' ? ' selected' : '' %>>Date</option>
|
||||
<option value="code"<%= sort === 'code' ? ' selected' : '' %>>Code</option>
|
||||
<option value="duration"<%= sort === 'duration' ? ' selected' : '' %>>Duration</option>
|
||||
<option value="status"<%= sort === 'status' ? ' selected' : '' %>>Status</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user