app.kluk.fr/app/views/moods/_calendrier.html.erb
Christophe Robillard 764cb542ac
Some checks are pending
CI / scan_ruby (push) Waiting to run
CI / scan_js (push) Waiting to run
CI / lint (push) Waiting to run
CI / test (push) Waiting to run
let visitors pick a day on the public page
Clicking a day shows its mode and illustration in the header, with a link
back to today. The journal stays private: the calendar helper now separates
interactivity from journal exposure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 07:54:25 +02:00

30 lines
1.5 KiB
Text

<%# Calendrier des humeurs « à la GitHub » : une colonne par semaine, une ligne par jour,
regroupé par mois. Par défaut, un bloc par année, la plus récente d'abord ;
avec par_annee: false, tous les mois à la suite (l'année est ajoutée aux mois d'une autre année). %>
<%# locals: (history:, user:, interactive: false, journal: false, selected_date: nil, par_annee: true) -%>
<% blocs = par_annee ? history_by_year(history) : [ [ nil, history ] ] %>
<div class="calendrier-humeurs">
<% blocs.each do |year, months| %>
<%= tag.section class: "annee", "aria-labelledby": ("annee-#{year}" if year) do %>
<% if year %>
<h2 class="annee-titre" id="annee-<%= year %>"><%= year %></h2>
<% end %>
<div class="annee-mois">
<div class="semaine-jours" aria-hidden="true">
<span>lun.</span><span></span><span>mer.</span><span></span><span>ven.</span><span></span><span></span>
</div>
<% months.each do |month| %>
<div class="mois">
<h3 class="mois-nom"><%= l(month[:month], format: year || month[:month].year == Date.current.year ? "%B" : "%B %Y") %></h3>
<div class="mois-jours">
<% month[:weeks].flatten.each do |mood| %>
<%= case_jour(mood, user, interactive: interactive, journal: journal,
selected: mood[:recorded_at].to_date == selected_date) %>
<% end %>
</div>
</div>
<% end %>
</div>
<% end %>
<% end %>
</div>