Files
growstuff/app/views/job_ideas/_idea.html.haml
T

40 lines
2.0 KiB
Plaintext

-# One suggested job: what it is, why, and what can be done with it.
- crop = idea.crop
.idea{ data: { key: idea.key } }
%span.idea-icon{ 'aria-hidden': 'true' }
%svg{ width: 28, height: 28, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', 'stroke-width': 1.8,
'stroke-linecap': 'round', 'stroke-linejoin': 'round' }
- case idea.kind
- when :template, :past_planting
%path{ d: 'M12 21v-9M12 12c0-4-3-6-7-6 0 4 3 6 7 6zM12 14c0-3 2-5 6-5 0 3-2 5-6 5z' }
- when :harvest
%path{ d: 'M3 10h18l-2 9H5zM8 10l3-6M16 10l-3-6' }
- else
%path{ d: 'M14 6a4 4 0 005 5l-9 9a2 2 0 01-3-3l9-9a4 4 0 00-2-2z' }
.idea-body
.idea-title= job_idea_title(idea)
- if crop && idea.kind != :template
= link_to crop_path(crop), class: 'notepad-chip' do
= image_tag crop_path(crop, format: 'svg'), alt: '', width: 18, height: 18
= crop.name
.idea-why= job_idea_reason(idea)
- if idea.schedule
%details.idea-preview
%summary= t('job_ideas.preview', count: idea.schedule.size)
%ul
- idea.schedule.each do |entry|
%li
%span.idea-preview-day= l(entry.date, format: '%-d %b')
= entry.step.name
.idea-actions
- add = idea.kind == :template ? t('job_ideas.add_all', count: idea.schedule.size) : t('job_ideas.add')
= button_to add, job_ideas_path(skip:), params: { key: idea.key }, class: 'idea-add', form_class: 'idea-form'
.idea-later
- dismiss = { params: { key: idea.key }, class: 'idea-link', form_class: 'idea-form' }
= button_to t('job_ideas.dismiss'), hide_job_ideas_path(skip:), dismiss
%details.idea-snooze
%summary= t('job_ideas.snooze.label')
- JobIdeaDismissal::SNOOZES.each_key do |length|
- snooze = { params: { key: idea.key, length: }, class: 'idea-link', form_class: 'idea-form' }
= button_to t("job_ideas.snooze.#{length}"), hide_job_ideas_path(skip:), snooze