diff options
Diffstat (limited to 'users/aspen/bbbg/resources')
23 files changed, 284 insertions, 0 deletions
diff --git a/users/aspen/bbbg/resources/base.css b/users/aspen/bbbg/resources/base.css new file mode 100644 index 000000000000..c86c3f24f009 --- /dev/null +++ b/users/aspen/bbbg/resources/base.css @@ -0,0 +1,152 @@ +/* montserrat-italic - latin */ +@font-face { + font-family: "Montserrat"; + font-style: italic; + font-weight: 400; + src: local("Montserrat Italic"), local("Montserrat-Italic"), + url("/fonts/montserrat-v15-latin-italic.woff2") format("woff2"), + /* Chrome 26+, Opera 23+, Firefox 39+ */ + url("/fonts/montserrat-v15-latin-italic.woff") format("woff"); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} + +/* montserrat-regular - latin */ +@font-face { + font-family: "Montserrat"; + font-style: normal; + font-weight: 400; + src: local("Montserrat Regular"), local("Montserrat-Regular"), + url("/fonts/montserrat-v15-latin-regular.woff2") format("woff2"), + /* Chrome 26+, Opera 23+, Firefox 39+ */ + url("/fonts/montserrat-v15-latin-regular.woff") format("woff"); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} + +/* montserrat-500 - latin */ +@font-face { + font-family: "Montserrat"; + font-style: normal; + font-weight: 500; + src: local("Montserrat Medium"), local("Montserrat-Medium"), + url("/fonts/montserrat-v15-latin-500.woff2") format("woff2"), + /* Chrome 26+, Opera 23+, Firefox 39+ */ + url("/fonts/montserrat-v15-latin-500.woff") format("woff"); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} + +/* montserrat-500italic - latin */ +@font-face { + font-family: "Montserrat"; + font-style: italic; + font-weight: 500; + src: local("Montserrat Medium Italic"), local("Montserrat-MediumItalic"), + url("/fonts/montserrat-v15-latin-500italic.woff2") format("woff2"), + /* Chrome 26+, Opera 23+, Firefox 39+ */ + url("/fonts/montserrat-v15-latin-500italic.woff") format("woff"); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} + +/* montserrat-600 - latin */ +@font-face { + font-family: "Montserrat"; + font-style: normal; + font-weight: 600; + src: local("Montserrat SemiBold"), local("Montserrat-SemiBold"), + url("/fonts/montserrat-v15-latin-600.woff2") format("woff2"), + /* Chrome 26+, Opera 23+, Firefox 39+ */ + url("/fonts/montserrat-v15-latin-600.woff") format("woff"); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} + +/* montserrat-800 - latin */ +@font-face { + font-family: "Montserrat"; + font-style: normal; + font-weight: 800; + src: local("Montserrat ExtraBold"), local("Montserrat-ExtraBold"), + url("/fonts/montserrat-v15-latin-800.woff2") format("woff2"), + /* Chrome 26+, Opera 23+, Firefox 39+ */ + url("/fonts/montserrat-v15-latin-800.woff") format("woff"); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} + +/* montserrat-800italic - latin */ +@font-face { + font-family: "Montserrat"; + font-style: italic; + font-weight: 800; + src: local("Montserrat ExtraBold Italic"), local("Montserrat-ExtraBoldItalic"), + url("/fonts/montserrat-v15-latin-800italic.woff2") format("woff2"), + /* Chrome 26+, Opera 23+, Firefox 39+ */ + url("/fonts/montserrat-v15-latin-800italic.woff") format("woff"); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} + +body { + width: 100%; + font-family: "Montserrat", Helvetica, sans-serif; + margin: 0; + box-sizing: border-box; +} + +*, +::before, +::after { + box-sizing: border-box; +} + +ul, +ol { + padding: 0; +} + +body, +h1, +h2, +h3, +h4, +p, +ul, +ol, +li, +figure, +figcaption, +blockquote, +dl, +dd { + margin: 0; +} + +body { + min-height: 100vh; + scroll-behavior: smooth; + text-rendering: optimizeSpeed; + line-height: 1.5; +} + +ul[class], +ol[class] { + list-style: none; +} + +a:not([class]) { + text-decoration-skip-ink: auto; +} + +img { + max-width: 100%; + display: block; +} + +article > * + * { + margin-top: 1em; +} + +input, +button, +textarea, +select { + font: inherit; +} + +@media (prefers-reduced-motion: reduce) { + * { + animation-duration: 0.01ms !important; + animation-iteration-count: 1 !important; + transition-duration: 0.01ms !important; + scroll-behavior: auto !important; + } +} diff --git a/users/aspen/bbbg/resources/migrations/20211212165646-init-schema.down.sql b/users/aspen/bbbg/resources/migrations/20211212165646-init-schema.down.sql new file mode 100644 index 000000000000..69b818a4f4ab --- /dev/null +++ b/users/aspen/bbbg/resources/migrations/20211212165646-init-schema.down.sql @@ -0,0 +1,14 @@ +drop table "public"."user"; + +-- ;; + +drop table "public"."event_attendee"; + + +-- ;; + +drop table "public"."event"; + +-- ;; + +drop table "public"."attendee"; diff --git a/users/aspen/bbbg/resources/migrations/20211212165646-init-schema.up.sql b/users/aspen/bbbg/resources/migrations/20211212165646-init-schema.up.sql new file mode 100644 index 000000000000..9718d84748ae --- /dev/null +++ b/users/aspen/bbbg/resources/migrations/20211212165646-init-schema.up.sql @@ -0,0 +1,32 @@ +CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; +-- ;; +CREATE TABLE "attendee" ( + "id" UUID PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(), + "meetup_name" TEXT NOT NULL, + "discord_name" TEXT, + "meetup_user_id" TEXT, + "organizer_notes" TEXT NOT NULL DEFAULT '', + "created_at" TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT now() +); +-- ;; +CREATE TABLE "event" ( + "id" UUID PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(), + "date" DATE NOT NULL, + "created_at" TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT now() +); +-- ;; +CREATE TABLE "event_attendee" ( + "event_id" UUID NOT NULL REFERENCES "event" ("id"), + "attendee_id" UUID NOT NULL REFERENCES "attendee" ("id"), + "rsvpd_attending" BOOL, + "attended" BOOL, + "created_at" TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT now(), + PRIMARY KEY ("event_id", "attendee_id") +); +-- ;; +CREATE TABLE "user" ( + "id" UUID PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(), + "username" TEXT NOT NULL, + "discord_user_id" TEXT NOT NULL, + "created_at" TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT now() +); diff --git a/users/aspen/bbbg/resources/migrations/20211220002229-add-attendee-checks.down.sql b/users/aspen/bbbg/resources/migrations/20211220002229-add-attendee-checks.down.sql new file mode 100644 index 000000000000..936abf6c7d19 --- /dev/null +++ b/users/aspen/bbbg/resources/migrations/20211220002229-add-attendee-checks.down.sql @@ -0,0 +1 @@ +DROP TABLE "attendee_check"; diff --git a/users/aspen/bbbg/resources/migrations/20211220002229-add-attendee-checks.up.sql b/users/aspen/bbbg/resources/migrations/20211220002229-add-attendee-checks.up.sql new file mode 100644 index 000000000000..5e82dcb1711c --- /dev/null +++ b/users/aspen/bbbg/resources/migrations/20211220002229-add-attendee-checks.up.sql @@ -0,0 +1,7 @@ +CREATE TABLE attendee_check ( + "id" UUID PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(), + "attendee_id" UUID NOT NULL REFERENCES attendee ("id"), + "user_id" UUID NOT NULL REFERENCES "public"."user" ("id"), + "last_dose_at" DATE, + "checked_at" TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT now() +); diff --git a/users/aspen/bbbg/resources/migrations/20211224161028-add-attendee-unique-meetup-id.down.sql b/users/aspen/bbbg/resources/migrations/20211224161028-add-attendee-unique-meetup-id.down.sql new file mode 100644 index 000000000000..cbee0c00acd9 --- /dev/null +++ b/users/aspen/bbbg/resources/migrations/20211224161028-add-attendee-unique-meetup-id.down.sql @@ -0,0 +1 @@ +drop index attendee_uniq_meetup_user_id; diff --git a/users/aspen/bbbg/resources/migrations/20211224161028-add-attendee-unique-meetup-id.up.sql b/users/aspen/bbbg/resources/migrations/20211224161028-add-attendee-unique-meetup-id.up.sql new file mode 100644 index 000000000000..5895cad56bdf --- /dev/null +++ b/users/aspen/bbbg/resources/migrations/20211224161028-add-attendee-unique-meetup-id.up.sql @@ -0,0 +1,2 @@ +create unique index "attendee_uniq_meetup_user_id" on attendee (meetup_user_id); +-- ;; diff --git a/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-500.woff b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-500.woff new file mode 100644 index 000000000000..1c83d8518d3d --- /dev/null +++ b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-500.woff Binary files differdiff --git a/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-500.woff2 b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-500.woff2 new file mode 100644 index 000000000000..9dc5c7f158af --- /dev/null +++ b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-500.woff2 Binary files differdiff --git a/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-500italic.woff b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-500italic.woff new file mode 100644 index 000000000000..71476d858fd5 --- /dev/null +++ b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-500italic.woff Binary files differdiff --git a/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-500italic.woff2 b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-500italic.woff2 new file mode 100644 index 000000000000..0fb9838c9d76 --- /dev/null +++ b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-500italic.woff2 Binary files differdiff --git a/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-600.woff b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-600.woff new file mode 100644 index 000000000000..e7f8a31ba35c --- /dev/null +++ b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-600.woff Binary files differdiff --git a/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-600.woff2 b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-600.woff2 new file mode 100644 index 000000000000..29cc1a973450 --- /dev/null +++ b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-600.woff2 Binary files differdiff --git a/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-800.woff b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-800.woff new file mode 100644 index 000000000000..79203dd7801d --- /dev/null +++ b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-800.woff Binary files differdiff --git a/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-800.woff2 b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-800.woff2 new file mode 100644 index 000000000000..0abb707aeddf --- /dev/null +++ b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-800.woff2 Binary files differdiff --git a/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-800italic.woff b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-800italic.woff new file mode 100644 index 000000000000..65415571a7f4 --- /dev/null +++ b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-800italic.woff Binary files differdiff --git a/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-800italic.woff2 b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-800italic.woff2 new file mode 100644 index 000000000000..674e6eabe747 --- /dev/null +++ b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-800italic.woff2 Binary files differdiff --git a/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-italic.woff b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-italic.woff new file mode 100644 index 000000000000..67f1e85379c2 --- /dev/null +++ b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-italic.woff Binary files differdiff --git a/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-italic.woff2 b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-italic.woff2 new file mode 100644 index 000000000000..469aede09c6b --- /dev/null +++ b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-italic.woff2 Binary files differdiff --git a/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-regular.woff b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-regular.woff new file mode 100644 index 000000000000..676a065e24ff --- /dev/null +++ b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-regular.woff Binary files differdiff --git a/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-regular.woff2 b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-regular.woff2 new file mode 100644 index 000000000000..70788c273207 --- /dev/null +++ b/users/aspen/bbbg/resources/public/fonts/montserrat-v15-latin-regular.woff2 Binary files differdiff --git a/users/aspen/bbbg/resources/public/main.js b/users/aspen/bbbg/resources/public/main.js new file mode 100644 index 000000000000..87c0b64d0a37 --- /dev/null +++ b/users/aspen/bbbg/resources/public/main.js @@ -0,0 +1,73 @@ +window.onload = () => { + const input = document.getElementById("name-autocomplete"); + if (input != null) { + const attendeeList = document.getElementById("attendees-list"); + const filterAttendees = (filter) => { + if (filter == "") { + for (let elt of attendeeList.querySelectorAll("li")) { + elt.classList.remove("hidden"); + } + + return; + } + + let re = ""; + for (let c of filter) { + re += `${c}.*`; + } + let filterRe = new RegExp(re, "i"); + + for (let elt of attendeeList.querySelectorAll("li")) { + const attendee = JSON.parse(elt.dataset.attendee); + if (attendee["bbbg.attendee/meetup-name"].match(filterRe) == null) { + elt.classList.add("hidden"); + } else { + elt.classList.remove("hidden"); + } + } + }; + + const attendeeIDInput = document.getElementById("attendee-id"); + const submit = document.querySelector("#submit-button"); + const signupForm = document.getElementById("signup-form"); + + input.oninput = (e) => { + filterAttendees(e.target.value); + attendeeIDInput.value = null; + submit.classList.add("hidden"); + submit.setAttribute("disabled", "disabled"); + signupForm.setAttribute("disabled", "disabled"); + }; + + attendeeList.addEventListener("click", (e) => { + if (!(e.target instanceof HTMLLIElement)) { + return; + } + if (e.target.dataset.attendee == null) { + return; + } + + const attendee = JSON.parse(e.target.dataset.attendee); + input.value = attendee["bbbg.attendee/meetup-name"]; + attendeeIDInput.value = attendee["bbbg.attendee/id"]; + + submit.classList.remove("hidden"); + submit.removeAttribute("disabled"); + signupForm.removeAttribute("disabled"); + }); + } + + document.querySelectorAll("form").forEach((form) => { + form.addEventListener("submit", (e) => { + if (e.target.attributes.disabled) { + e.preventDefault(); + } + + const confirmMessage = e.target.dataset.confirm; + if (confirmMessage != null && !confirm(confirmMessage)) { + e.stopImmediatePropagation(); + e.preventDefault(); + } + }); + }); +}; diff --git a/users/aspen/bbbg/resources/public/robots.txt b/users/aspen/bbbg/resources/public/robots.txt new file mode 100644 index 000000000000..1f53798bb4fe --- /dev/null +++ b/users/aspen/bbbg/resources/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / |