Removed unused css. Added a robots.txt. Attempt to block iOS from adding invalid telephone link. Added last sync to guest details. Changed DateTimeFormat from en-US to en-GB

This commit is contained in:
Glenn de Haan
2024-04-26 18:33:13 +02:00
parent f68ee13ec0
commit d785edd028
7 changed files with 27 additions and 38 deletions

View File

@@ -1,28 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
.divider {
display: flex;
align-items: center;
text-align: center;
@apply mt-6;
}
/* To show the lines on right
and left sides of the text */
.divider::after,
.divider::before {
content: "";
flex: 1;
@apply border;
}
/* Space on left and right sides of text */
.divider:not(:empty)::before {
margin-right: 1em;
}
.divider:not(:empty)::after {
margin-left: 1em;
}

2
public/robots.txt Normal file
View File

@@ -0,0 +1,2 @@
User-agent: *
Disallow: /

View File

@@ -424,7 +424,8 @@ if(webService) {
timeConvert: time,
bytesConvert: bytes,
voucher,
guests
guests,
updated: cache.updated
});
} else {
res.status(404);

View File

@@ -1,6 +1,8 @@
<!DOCTYPE html>
<html lang="en" class="h-full bg-gray-100 dark:bg-gray-900">
<head>
<meta name="format-detection" content="telephone=no">
<title>Not Found | UniFi Voucher</title>
<meta charset="UTF-8">

View File

@@ -21,7 +21,7 @@
<dl>
<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">Code</dt>
<dd class="text-sm leading-6 text-gray-600 dark:text-gray-400 col-span-2 mt-0"><%= voucher.code.slice(0, 5) %>-<%= voucher.code.slice(5) %></dd>
<dd class="text-sm leading-6 text-gray-600 dark:text-gray-400 col-span-2 mt-0 pointer-events-none no-underline text-inherit"><%= voucher.code.slice(0, 5) %>-<%= voucher.code.slice(5) %></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">Status</dt>
@@ -60,13 +60,18 @@
</dl>
</div>
<div class="space-y-6 pb-5 pt-6">
<div>
<h3 class="text-base font-semibold leading-7 text-gray-900 dark:text-white">
Guest Details
</h3>
<p class="mt-1 text-sm leading-6 text-gray-600 dark:text-gray-400">
Guest Details for Voucher.
</p>
<div class="grid grid-cols-2">
<div>
<h3 class="text-base font-semibold leading-7 text-gray-900 dark:text-white">
Guest Details
</h3>
<p class="mt-1 text-sm leading-6 text-gray-600 dark:text-gray-400">
Guest Details for Voucher.
</p>
</div>
<div class="text-xs text-right self-center italic text-gray-900 dark:text-white">
Last Sync:<br/><%= new Intl.DateTimeFormat('en-GB', {dateStyle: 'short', timeStyle: 'short', hour12: false}).format(new Date(updated)) %>
</div>
</div>
<% if(guests.length < 1) { %>
<div>
@@ -109,7 +114,7 @@
</svg>
</dt>
<dd class="text-sm font-medium leading-6 text-gray-600 dark:text-gray-400">
<%= new Intl.DateTimeFormat('en-US', {dateStyle: 'short', timeStyle: 'short', hour12: false}).format(new Date(guest.end * 1000)) %>
<%= new Intl.DateTimeFormat('en-GB', {dateStyle: 'short', timeStyle: 'short', hour12: false}).format(new Date(guest.end * 1000)) %>
</dd>
</div>
<div class="mt-4 flex w-full flex-none gap-x-4 px-6">

View File

@@ -1,6 +1,8 @@
<!DOCTYPE html>
<html lang="en" class="h-full bg-gray-100 dark:bg-gray-900">
<head>
<meta name="format-detection" content="telephone=no">
<title>Login | UniFi Voucher</title>
<meta charset="UTF-8">

View File

@@ -1,6 +1,8 @@
<!DOCTYPE html>
<html lang="en" class="h-full bg-gray-100 dark:bg-gray-900">
<head>
<meta name="format-detection" content="telephone=no">
<title>Voucher | UniFi Voucher</title>
<meta charset="UTF-8">
@@ -102,14 +104,14 @@
</h1>
<div class="grid">
<a href="<%= baseUrl %>/vouchers?refresh=true" id="reload-vouchers" type="button" class="relative inline-flex items-center gap-x-1.5 rounded-md bg-sky-700 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-sky-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-700">
<a href="<%= baseUrl %>/vouchers?refresh=true" id="reload-vouchers" type="button" class="w-fit justify-self-end relative inline-flex items-center gap-x-1.5 rounded-md bg-sky-700 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-sky-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-700">
<svg class="-ml-0.5 h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M15.312 11.424a5.5 5.5 0 0 1-9.201 2.466l-.312-.311h2.433a.75.75 0 0 0 0-1.5H3.989a.75.75 0 0 0-.75.75v4.242a.75.75 0 0 0 1.5 0v-2.43l.31.31a7 7 0 0 0 11.712-3.138.75.75 0 0 0-1.449-.39Zm1.23-3.723a.75.75 0 0 0 .219-.53V2.929a.75.75 0 0 0-1.5 0V5.36l-.31-.31A7 7 0 0 0 3.239 8.188a.75.75 0 1 0 1.448.389A5.5 5.5 0 0 1 13.89 6.11l.311.31h-2.432a.75.75 0 0 0 0 1.5h4.243a.75.75 0 0 0 .53-.219Z" clip-rule="evenodd" />
</svg>
Sync Vouchers
</a>
<span class="mt-2 text-xs text-center italic text-gray-900 dark:text-white">
Last Sync: <%= new Intl.DateTimeFormat('en-US', {dateStyle: 'short', timeStyle: 'short', hour12: false}).format(new Date(updated)) %>
Last Sync: <%= new Intl.DateTimeFormat('en-GB', {dateStyle: 'short', timeStyle: 'short', hour12: false}).format(new Date(updated)) %>
</span>
</div>
</header>
@@ -137,7 +139,7 @@
<div class="flex items-center gap-x-3">
<h2 class="min-w-0 text-sm font-semibold leading-6 text-gray-900 dark:text-white">
<div class="flex gap-x-2">
<span class="tabular-nums"><%= voucher.code.slice(0, 5) %>-<%= voucher.code.slice(5) %></span>
<span class="tabular-nums pointer-events-none no-underline text-inherit"><%= voucher.code.slice(0, 5) %>-<%= voucher.code.slice(5) %></span>
<% if(voucher.used > 0) { %>
<div class="rounded-full flex-none py-1 px-2 text-xs font-medium ring-1 ring-inset bg-yellow-50 text-yellow-800 ring-yellow-600/20 dark:text-yellow-400 dark:bg-yellow-400/10 dark:ring-yellow-400/20">
In Use