Updated to . Fixed bulk-print.ejs notes view. Updated details.ejs view with additional voucher metadata. Updated voucher.ejs notes view. Created notes.js utils for extracting voucher notes and metadata. Updated docker-compose.yml. Updated README.md. Implemented voucher note check for seperator misuse. Implemented new notes-metadata embed. Implemented new voucher filter within existing chain. Fixed notes sort to only filter on the notes not the metadata. Removed unused variable forward to voucher.ejs

This commit is contained in:
Glenn de Haan
2025-07-30 19:19:43 +02:00
parent 131f726d1c
commit 0c9aeac7a5
8 changed files with 93 additions and 88 deletions

View File

@@ -64,9 +64,9 @@
</div>
<% } %>
<% } %>
<% if (voucher.note) { %>
<% if (notesConvert(voucher.note).note) { %>
<div class="hidden sm:block rounded-md flex-none py-1 px-2 text-xs font-medium ring-1 ring-inset bg-gray-50 text-gray-800 ring-gray-600/20 dark:text-gray-400 dark:bg-gray-400/10 dark:ring-gray-400/20">
<%= voucher.note %>
<%= notesConvert(voucher.note).note %>
</div>
<% } %>
</div>

View File

@@ -43,17 +43,30 @@
<% } %>
</dd>
</div>
<div class="py-2 grid grid-cols-3 gap-4 px-0">
<dt class="text-sm font-medium leading-6 text-gray-900 dark:text-white">Notes</dt>
<dd class="text-sm leading-6 text-gray-600 dark:text-gray-400 col-span-2 mt-0">
<% if (voucher.note && voucher.note.includes('|||')) { %>
<strong>Description:</strong> <%= voucher.note.split('|||')[0] %><br/>
<strong>Domain:</strong> <%= voucher.note.split('|||')[1] %>
<% } else { %>
<%= voucher.note ? voucher.note : '-' %>
<% } %>
</dd>
</div>
<% if(notesConvert(voucher.note).note) { %>
<div class="py-2 grid grid-cols-3 gap-4 px-0">
<dt class="text-sm font-medium leading-6 text-gray-900 dark:text-white">Notes</dt>
<dd class="text-sm leading-6 text-gray-600 dark:text-gray-400 col-span-2 mt-0"><%= notesConvert(voucher.note).note %></dd>
</div>
<% } %>
<% if(notesConvert(voucher.note).source) { %>
<div class="py-2 grid grid-cols-3 gap-4 px-0">
<dt class="text-sm font-medium leading-6 text-gray-900 dark:text-white">Source</dt>
<dd class="text-sm leading-6 text-gray-600 dark:text-gray-400 col-span-2 mt-0"><%= notesConvert(voucher.note).source %></dd>
</div>
<% } %>
<% if(notesConvert(voucher.note).auth_type) { %>
<div class="py-2 grid grid-cols-3 gap-4 px-0">
<dt class="text-sm font-medium leading-6 text-gray-900 dark:text-white">Authentication</dt>
<dd class="text-sm leading-6 text-gray-600 dark:text-gray-400 col-span-2 mt-0"><%= notesConvert(voucher.note).auth_type %></dd>
</div>
<% } %>
<% if(notesConvert(voucher.note).auth_oidc_domain) { %>
<div class="py-2 grid grid-cols-3 gap-4 px-0">
<dt class="text-sm font-medium leading-6 text-gray-900 dark:text-white">OIDC Domain</dt>
<dd class="text-sm leading-6 text-gray-600 dark:text-gray-400 col-span-2 mt-0"><%= notesConvert(voucher.note).auth_oidc_domain %></dd>
</div>
<% } %>
<div class="py-2 grid grid-cols-3 gap-4 px-0">
<dt class="text-sm font-medium leading-6 text-gray-900 dark:text-white">Type</dt>
<dd class="text-sm leading-6 text-gray-600 dark:text-gray-400 col-span-2 mt-0"><%= voucher.quota === 1 ? 'Single-use' : voucher.quota === 0 ? 'Multi-use (Unlimited)' : `Multi-use (${voucher.quota}x)` %></dd>

View File

@@ -166,19 +166,10 @@
</div>
<% } %>
<% } %>
<% if (voucher.note) { %>
<% if (voucher.note.includes('|||')) { %>
<div class="hidden sm:block rounded-md flex-none py-1 px-2 text-xs font-medium ring-1 ring-inset bg-gray-50 text-gray-800 ring-gray-600/20 dark:text-gray-400 dark:bg-gray-400/10 dark:ring-gray-400/20">
<%= voucher.note.split('|||')[0] %>
</div>
<div class="hidden sm:block rounded-md flex-none py-1 px-2 text-xs font-medium ring-1 ring-inset bg-gray-50 text-gray-800 ring-gray-600/20 dark:text-gray-400 dark:bg-gray-400/10 dark:ring-gray-400/20">
<%= voucher.note.split('|||')[1] %>
</div>
<% } else { %>
<div class="hidden sm:block rounded-md flex-none py-1 px-2 text-xs font-medium ring-1 ring-inset bg-gray-50 text-gray-800 ring-gray-600/20 dark:text-gray-400 dark:bg-gray-400/10 dark:ring-gray-400/20">
<%= voucher.note %>
</div>
<% } %>
<% if (notesConvert(voucher.note).note) { %>
<div class="hidden sm:block rounded-md flex-none py-1 px-2 text-xs font-medium ring-1 ring-inset bg-gray-50 text-gray-800 ring-gray-600/20 dark:text-gray-400 dark:bg-gray-400/10 dark:ring-gray-400/20">
<%= notesConvert(voucher.note).note %>
</div>
<% } %>
</div>
</h2>