app.kluk.fr/app/views/day_logs/edit.html.erb
Christophe Robillard 7a7fa4c095
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
redesign app on top of the kluk.fr charte
- drop Bulma and Font Awesome, plain CSS built on charte.css
- dashboard: GitHub-like calendar grouped by year, selected day panel
  (sticky side column on desktop, bottom bar on mobile), keyboard navigation
- public page: today's mood and last months fit in one screen, journal hidden
- day log page: mode picker as pills, illustration follows the chosen mode
- login, password and invitation screens in French, global flash messages
- add User#current_mode_since

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

44 lines
1.8 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<% titre = @day_log.day ? date_longue(@day_log.day).capitalize : "Journal" %>
<% content_for :title, "#{titre} – Kluk" %>
<% mode_id = params.dig(:day_log, :mode_id).presence&.to_i || @mood&.mode_id %>
<% mode = Current.user.modes.find { |m| m.id == mode_id } %>
<div class="page-jour" data-controller="choix-mode">
<header class="page-jour-entete">
<p class="retour"><%= link_to "Retour à mes humeurs", dashboard_path(day: @day_log.day) %></p>
<h1 class="page-jour-titre"><%= titre %></h1>
</header>
<figure class="carte-humeur" data-choix-mode-target="carte" style="<%= "--humeur: #{mode.color}" if mode %>">
<%= image_tag (mode || Mode.new).image_url, alt: "", data: { choix_mode_target: "image" } %>
</figure>
<%= form_with model: @day_log, class: "formulaire" do |f| %>
<%= render "charte/formulaire_erreur", messages: @day_log.errors.full_messages %>
<%= f.hidden_field :day %>
<fieldset class="champ">
<legend>Mode du jour</legend>
<ul class="choix-modes">
<% Current.user.modes.each do |m| %>
<li>
<%= radio_button_tag "day_log[mode_id]", m.id, m.id == mode_id,
data: { image: m.image_url, couleur: m.color, action: "choix-mode#changer" } %>
<%= label_tag "day_log_mode_id_#{m.id}" do %>
<span class="pastille" style="--humeur: <%= m.color %>"></span><%= m.label %>
<% end %>
</li>
<% end %>
</ul>
</fieldset>
<%= render "charte/champ", form: f, attribut: :info, libelle: "Journal" do %>
<%= f.text_area :info, rows: 8, placeholder: "Ce qui a compté ce jour-là…" %>
<% end %>
<div class="actions">
<%= f.submit "Enregistrer", class: "bouton" %>
<%= link_to "Annuler", dashboard_path(day: @day_log.day) %>
</div>
<% end %>
</div>