app.kluk.fr/app/views/moods/index.html.erb

64 lines
2.8 KiB
Text
Raw Normal View History

2025-12-02 17:46:01 +01:00
<main data-controller="mood" class="columns m-auto">
2026-02-26 10:00:38 +01:00
<div class="current-day column is-hidden-mobile">
2026-01-08 13:36:58 +01:00
<section class="m-4">
2026-02-26 10:00:38 +01:00
<figure class="image has-ratio">
<%= image_tag(@user.current_mode.image_url, "data-mood-target": "image") %>
2026-01-08 13:36:58 +01:00
</figure>
</section>
</div>
<section class="section column has-background-primary-light is-flex is-flex-direction-column is-justify-content-space-around">
<div class="tracker">
<div class="legend is-flex is-flex-wrap-wrap mb-5">
2026-02-26 10:00:38 +01:00
<div class="is-flex is-align-items-center mr-4">
<div class=""><strong>Légende</strong></div>
</div>
2026-03-15 19:26:52 +01:00
<% @user.modes.each do |mode| %>
<div class="is-flex is-align-items-center mr-4">
2026-03-21 17:35:06 +01:00
<div class="bar mr-1" style="<%= style_for_mode(mode, :filled) %>"></div>
2026-03-15 19:26:52 +01:00
<div class=""><%= mode.label %></div>
</div>
<% end %>
2026-01-08 13:36:58 +01:00
</div>
2026-02-26 10:00:38 +01:00
<div class="container mb-4 p-3 has-background-white day-info">
2026-02-26 10:34:00 +01:00
<div class="title is-4">
2026-02-26 10:00:38 +01:00
<span class="icon"><i class="fa-regular fa-calendar"></i></span>
2026-03-14 16:35:48 +01:00
<span data-mood-target="modeDay">Aujourd'hui : <%= @user.current_mode.label %></span>
2026-03-21 16:36:56 +01:00
<%= link_to edit_day_log_for_day_path(day: Date.today), "data-mood-target": "dayLogLink" do %>
<span class="icon ml-2"><i class="has-text-grey fa-solid fa-pencil fa-xs"></i></span>
<% end %>
2026-02-26 10:00:38 +01:00
</div>
2026-03-22 16:32:01 +01:00
<p data-mood-target="dayLogInfo"><%= @user.current_day_log&.info %></p>
2026-02-26 10:00:38 +01:00
</div>
2026-03-21 16:16:54 +01:00
2026-01-08 13:36:58 +01:00
<div class="logs">
2026-02-07 12:09:06 +01:00
<div class="is-flex is-flex-direction-row is-flex-wrap-wrap mb-3">
2026-02-26 17:17:39 +01:00
<% @user.history.each do |month| %>
2026-02-07 12:09:06 +01:00
<div class="mr-3">
2026-02-26 11:04:01 +01:00
<div> <%= I18n.l(month[:month], format: "%b %y").capitalize %></div>
2026-02-07 12:09:06 +01:00
<div class="is-flex is-flex-wrap-wrap">
<% month[:weeks].each do |week| %>
<div class="is-flex is-flex-direction-column is-flex-wrap-wrap mb-3">
<% week.each do |mood| %>
2026-03-21 17:35:06 +01:00
<% status = day_status(mood, @user) %>
2026-02-26 17:17:39 +01:00
<% mode = mode_for(mood, @user) %>
<div data-image="<%= mode.image_url %>"
data-mode="<%= mode.label %>"
2026-03-22 22:14:40 +01:00
data-day="<%= mood[:recorded_at].to_date.iso8601 %>"
2026-03-22 16:32:01 +01:00
data-info="<%= mood[:day_log]&.info %>"
2026-03-21 17:35:06 +01:00
data-action="click->mood#updateDayInfo"
title="<%= l(mood[:recorded_at].to_date) %> : <%= mode.label %>"
2026-03-21 17:35:06 +01:00
class="<%= css_class_for_day(status) %>"
style="<%= style_for_mode(mode, status) %>">
</div>
2026-02-07 12:09:06 +01:00
<% end %>
</div>
2026-01-08 17:46:51 +01:00
<% end %>
</div>
2026-01-08 13:36:58 +01:00
</div>
2026-01-07 17:29:10 +01:00
<% end %>
</div>
2026-01-08 13:36:58 +01:00
</div>
2026-01-07 17:29:10 +01:00
</div>
2025-12-01 13:12:00 +01:00
</section>
2025-08-05 16:11:24 +02:00
</main>