From d785edd0289fa84c708c7ae10136d2b7eb6f7894 Mon Sep 17 00:00:00 2001 From: Glenn de Haan Date: Fri, 26 Apr 2024 18:33:13 +0200 Subject: [PATCH] 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 --- css/style.css | 25 ------------------------- public/robots.txt | 2 ++ server.js | 3 ++- template/404.ejs | 2 ++ template/components/details.ejs | 23 ++++++++++++++--------- template/login.ejs | 2 ++ template/voucher.ejs | 8 +++++--- 7 files changed, 27 insertions(+), 38 deletions(-) create mode 100644 public/robots.txt diff --git a/css/style.css b/css/style.css index 30c9cbd..b5c61c9 100644 --- a/css/style.css +++ b/css/style.css @@ -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; -} diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..1f53798 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/server.js b/server.js index 96e8650..be93ee2 100644 --- a/server.js +++ b/server.js @@ -424,7 +424,8 @@ if(webService) { timeConvert: time, bytesConvert: bytes, voucher, - guests + guests, + updated: cache.updated }); } else { res.status(404); diff --git a/template/404.ejs b/template/404.ejs index 490a040..6b7ea7e 100644 --- a/template/404.ejs +++ b/template/404.ejs @@ -1,6 +1,8 @@ + + Not Found | UniFi Voucher diff --git a/template/components/details.ejs b/template/components/details.ejs index 217dcc2..4aa3007 100644 --- a/template/components/details.ejs +++ b/template/components/details.ejs @@ -21,7 +21,7 @@
Code
-
<%= voucher.code.slice(0, 5) %>-<%= voucher.code.slice(5) %>
+
<%= voucher.code.slice(0, 5) %>-<%= voucher.code.slice(5) %>
Status
@@ -60,13 +60,18 @@
-
-

- Guest Details -

-

- Guest Details for Voucher. -

+
+
+

+ Guest Details +

+

+ Guest Details for Voucher. +

+
+
+ Last Sync:
<%= new Intl.DateTimeFormat('en-GB', {dateStyle: 'short', timeStyle: 'short', hour12: false}).format(new Date(updated)) %> +
<% if(guests.length < 1) { %>
@@ -109,7 +114,7 @@
- <%= 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)) %>
diff --git a/template/login.ejs b/template/login.ejs index c4d4805..78367db 100644 --- a/template/login.ejs +++ b/template/login.ejs @@ -1,6 +1,8 @@ + + Login | UniFi Voucher diff --git a/template/voucher.ejs b/template/voucher.ejs index 1b1e665..8f48333 100644 --- a/template/voucher.ejs +++ b/template/voucher.ejs @@ -1,6 +1,8 @@ + + Voucher | UniFi Voucher @@ -102,14 +104,14 @@
- + Sync Vouchers - 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)) %>
@@ -137,7 +139,7 @@

- <%= voucher.code.slice(0, 5) %>-<%= voucher.code.slice(5) %> + <%= voucher.code.slice(0, 5) %>-<%= voucher.code.slice(5) %> <% if(voucher.used > 0) { %>
In Use