show when day log for current day
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled

This commit is contained in:
Christophe Robillard 2026-04-19 05:03:41 +02:00
parent 1a6d60943a
commit dacd850493
3 changed files with 20 additions and 3 deletions

View file

@ -54,6 +54,21 @@ main {
height: 15px; height: 15px;
} }
.day.has-day-log {
position: relative;
}
.day.has-day-log::after {
content: '';
position: absolute;
bottom: 1px;
right: 1px;
width: 4px;
height: 4px;
border-radius: 50%;
background-color: white;
}
.selected-day { .selected-day {
border-radius: 50%; border-radius: 50%;
box-shadow: 0 0 0 3px white, 0 0 0 5px black; box-shadow: 0 0 0 3px white, 0 0 0 5px black;

View file

@ -31,7 +31,9 @@ module MoodsHelper
end end
end end
def css_class_for_day(status) def css_class_for_day(status, day_log)
status == :empty ? "day empty-day" : "day" css_class = status == :empty ? "day empty-day" : "day"
css_class += " has-day-log" if day_log
css_class
end end
end end

View file

@ -47,7 +47,7 @@
data-info="<%= mood[:day_log]&.info %>" data-info="<%= mood[:day_log]&.info %>"
data-action="click->mood#updateDayInfo" data-action="click->mood#updateDayInfo"
title="<%= l(mood[:recorded_at].to_date) %> : <%= mode.label %>" title="<%= l(mood[:recorded_at].to_date) %> : <%= mode.label %>"
class="<%= css_class_for_day(status) %>" class="<%= css_class_for_day(status, mood[:day_log]) %>"
style="<%= style_for_mode(mode, status) %>"> style="<%= style_for_mode(mode, status) %>">
</div> </div>
<% end %> <% end %>