From d2d71468b46baa48a199d530bd89cd6cc02316ef Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Wed, 7 Jan 2026 16:44:27 +0100 Subject: [PATCH] display mood text for mobile --- app/javascript/controllers/mood_controller.js | 8 +++++--- app/views/moods/index.html.erb | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/javascript/controllers/mood_controller.js b/app/javascript/controllers/mood_controller.js index 6b8428b..6dca371 100644 --- a/app/javascript/controllers/mood_controller.js +++ b/app/javascript/controllers/mood_controller.js @@ -1,12 +1,14 @@ import { Controller } from '@hotwired/stimulus' export default class extends Controller { - static targets = [ "image", "info" ] + static targets = [ "image", "day", "mode" ] updateDayInfo(event) { const image = this.imageTarget; - const infoDay = this.infoTarget; + const day = this.dayTarget; + const mode = this.modeTarget; image.src = event.target.dataset.image; - infoDay.textContent = event.target.dataset.day; + day.textContent = event.target.dataset.day; + mode.textContent = event.target.dataset.mode; } } diff --git a/app/views/moods/index.html.erb b/app/views/moods/index.html.erb index 61567b6..b1cbdae 100644 --- a/app/views/moods/index.html.erb +++ b/app/views/moods/index.html.erb @@ -3,11 +3,11 @@ <%= image_tag(@mode + ".jpg", "data-mood-target": "image") %>
-

<%= @mode %>

+
<%= @mode %>

Comment ça KLUK aujourd'hui ?

-
Aujourd'hui
+
Aujourd'hui
<% @mood_log.each do |week| %>