Files
growstuff/app/views/jobs/_notepad_groups.html.haml
T

26 lines
1.3 KiB
Plaintext
Raw 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.
-# The groups of jobs in the notepad. Also what adding or moving a job sends back.
- groups.each do |group|
.notepad-group{ class: "notepad-group-#{group.key}", data: { drop: (group.droppable ? group.drop_date.to_s.presence || 'none' : nil) } }
.notepad-heading
%h2= t("jobs.pad.#{group.key}")
- if group.key == :today
%small= l(group.from, format: '%a %-d %b')
- elsif %i(week weekend next_weekend).include?(group.key) && group.from <= group.to
%small= "#{l(group.from, format: '%a %-d')} – #{l(group.to, format: '%a %-d %b')}"
- elsif group.key == :someday
%small= t('jobs.pad.someday_note')
- if group.jobs.empty?
%p.notepad-drop-hint= t('jobs.pad.drop_here')
-# Later is rolled up until asked for: it is not for today's list.
- row_for = ->(job) { render 'jobs/notepad_row', job:, in_garden: local_assigns[:in_garden] }
- if group.key == :later && group.jobs.any?
%details.notepad-older
%summary= t('jobs.pad.show_later', count: group.jobs.size)
= safe_join(group.shown.map(&row_for))
- else
= safe_join(group.shown.map(&row_for))
- if group.older.any?
%details.notepad-older
%summary= t('jobs.pad.show_older', count: group.older.size)
= safe_join(group.older.map(&row_for))