From b1e6ae94d9c4bb56a9f00d8d3cc5fb8ba4edf440 Mon Sep 17 00:00:00 2001 From: Emilie Ma <45278276+kewbish@users.noreply.github.com> Date: Sat, 9 Sep 2023 19:51:35 -0700 Subject: [PATCH] Misc. website updates (#482) This PR: - removes the newsletter mentions on the website as well as the popup, as the newsletter initiative isn't something we're planning to move forward with this year - fixes the duplicated 'tutoring' card on the main page and the services page. These have been replaced with a locker rental card and a Cube menu card respectively. - (hopefully) fixes the Prettier Action version. It looks like Prettier released `3.0.0` around the time the Action stopped working, so I'm going to pin the version to `2.8.8`, the previous non-major version. Force-merging since these issues have been around for a while and I'd like to resolve them ASAP. --- .github/workflows/main.yml | 3 +- .prettierrc | 12 ++++---- assets/js/newsletter.js | 29 ------------------- content/_index.md | 2 +- content/about/_index.md | 1 - content/services/_index.md | 4 +-- layouts/index.html | 8 ++--- layouts/partials/newsletter.html | 28 ------------------ .../layouts/_default/baseof.html | 3 -- 9 files changed, 14 insertions(+), 76 deletions(-) delete mode 100644 assets/js/newsletter.js delete mode 100644 layouts/partials/newsletter.html diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 521c5a6a..c4a6e038 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,8 @@ jobs: - name: Prettify code uses: creyD/prettier_action@v4.3 with: + prettier_version: "2.8.8" prettier_options: --write **/*.+(js|html|css|json|md|yaml|yml) - prettier_plugins: prettier-plugin-go-template + prettier_plugins: "prettier-plugin-go-template" github_token: ${{ secrets.GH_TOKEN }} only_changed: True diff --git a/.prettierrc b/.prettierrc index a97e50c6..1e6df367 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,10 +1,9 @@ { + "plugins": ["prettier-plugin-go-template"], "trailingComma": "none", "overrides": [ { - "files": [ - "*.html" - ], + "files": ["*.html"], "options": { "parser": "go-template", "goTemplateBracketSpacing": true, @@ -12,9 +11,7 @@ } }, { - "files": [ - "*.js" - ], + "files": ["*.js"], "options": { "trailingComma": "none", "tabWidth": 2, @@ -22,4 +19,5 @@ } } ] -} \ No newline at end of file +} + diff --git a/assets/js/newsletter.js b/assets/js/newsletter.js deleted file mode 100644 index fdc90936..00000000 --- a/assets/js/newsletter.js +++ /dev/null @@ -1,29 +0,0 @@ -(() => { - // add 10 second delay in showing the newsletter popup - setTimeout(() => { - const newsletterModalEl = document.getElementById("newsletter-modal"); - const newsletterModal = new bootstrap.Modal(newsletterModalEl); - if (document.cookie.indexOf("newsletter") < 0) { - newsletterModalEl.addEventListener("hide.bs.modal", (event) => { - // activeElement is the element that triggered the modal to hide - const activeElement = document.activeElement; - // if the user clicks on the join button, set a cookie to not show the popup again - if (activeElement.id === "join-btn") { - document.cookie = `newsletter=1; path=/;`; - } else if (activeElement.id === "maybe-later-btn") { - // if the user clicks on the maybe later button, set a cookie to show the popup again in 3 months - const expiryDate = new Date(); - expiryDate.setMonth(expiryDate.getMonth() + 3); - document.cookie = `newsletter=1; expires=${expiryDate.toUTCString()}; path=/;`; - } else { - // if the user exits the popup in any other way (clicking outside the modal / ESC key), - // set a cookie to show the popup again in 1 month - const expiryDate = new Date(); - expiryDate.setMonth(expiryDate.getMonth() + 1); - document.cookie = `newsletter=1; expires=${expiryDate.toUTCString()}; path=/;`; - } - }); - newsletterModal.show(); - } - }, 10_000); -})(); diff --git a/content/_index.md b/content/_index.md index bc5c5ce9..7e786e2e 100644 --- a/content/_index.md +++ b/content/_index.md @@ -10,4 +10,4 @@ your interests to the department. For more events you may be interested in, plea on our social media outlets.
-Join us on Discord or Instagram and sign up for our newsletter! +Join us on Discord or Instagram! diff --git a/content/about/_index.md b/content/about/_index.md index 6073f05e..3798a8e6 100644 --- a/content/about/_index.md +++ b/content/about/_index.md @@ -52,7 +52,6 @@ We'll be publishing our events: - here on our website (which also has an [RSS feed](/index.xml)), - [Tweeting them](https://twitter.com/ubccsss), - posting them on our [Facebook page](https://www.facebook.com/ubccsss/) and our [Instagram](https://www.instagram.com/ubc_csss/), -- sending updates [via our newsletter](http://eepurl.com/h-QQ_z), - and including them in the weekly department emails. ### How can I volunteer for CSSS events? diff --git a/content/services/_index.md b/content/services/_index.md index d2dbd47e..173925c7 100644 --- a/content/services/_index.md +++ b/content/services/_index.md @@ -32,8 +32,8 @@ The UBC CSSS offers the following services. {{}}
- {{< card title="Tutoring" href="/services/tutor" src="/files/tutor.jpg" >}} - We provide a place for tutors to advertise their availability and for students to find a tutor for Computer Science courses. + {{< card title="Cube Menu" href="/cube/menu" src="/files/chips.jpg" >}} + We provide cheap snacks, like chips, pizza, candy, and drinks, in the Cube. {{}}