From 370d582fbec6503238d52cb64cbc583a7d526908 Mon Sep 17 00:00:00 2001 From: Mattias Bodlund Date: Fri, 18 Sep 2026 16:42:58 +0200 Subject: [PATCH] na --- app/assets/images/ico-thumb.svg | 1 - app/javascript/rating_controller.js | 31 ----------------------------- 2 files changed, 32 deletions(-) delete mode 100644 app/assets/images/ico-thumb.svg delete mode 100644 app/javascript/rating_controller.js diff --git a/app/assets/images/ico-thumb.svg b/app/assets/images/ico-thumb.svg deleted file mode 100644 index a0831bd..0000000 --- a/app/assets/images/ico-thumb.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/javascript/rating_controller.js b/app/javascript/rating_controller.js deleted file mode 100644 index a19518a..0000000 --- a/app/javascript/rating_controller.js +++ /dev/null @@ -1,31 +0,0 @@ -import { Controller } from "@hotwired/stimulus" - -// Thumbs up / down on the results screen. Fire-and-forget: the button state -// flips immediately and the POST is not awaited, so a slow network never makes -// the tap feel dead. One rating per player -- tapping the other thumb just -// overwrites the previous one server-side. -export default class extends Controller { - static targets = ["button"] - static values = { url: String } - - rate(event) { - const button = event.currentTarget - const direction = button.dataset.direction - - this.buttonTargets.forEach((b) => b.classList.toggle("is-selected", b === button)) - - const body = new FormData() - body.append("direction", direction) - - fetch(this.urlValue, { - method: "POST", - body, - headers: { "X-CSRF-Token": this.csrfToken }, - credentials: "same-origin" - }).catch(() => {}) - } - - get csrfToken() { - return document.querySelector("meta[name='csrf-token']")?.content || "" - } -}