Files
growstuff/app/views/activities/_form.html.haml
Daniel O'Connor 5be0153c74 Activities (#3646)
* Implement activities

* Add activities to timeline

* Add factory

* Add coverage

* Fix misc issues

* Activities display

* Add activities to garden and plantings

* Add activities to garden and plantings

* Add planting

* Add to planting, harvest show

* More CRUD

* More CRUD

* index

* index

* Extract card view

* Permissions

* Add edit

* Remove workaround fro vs code

* Fix title

* CSV

* CSV

* Add RSS, ical

* Extend ical slightly

* Cleanup

* Rubocop

* Remove doubled form

* Change icon

* Fix short description

* Add menus

* Put homepage widget in

* Add activity icon - MIT licenced - https://www.svgrepo.com/svg/336823/plan

* Naming

* Missing files

* Revert VS Code lag induced change

* Update app/views/home/_harvests.html.haml

* Update activities_controller.rb

* Update activities_controller.rb

* Update app/controllers/activities_controller.rb

* Update index.html.haml

* Apply suggestions from code review

* Apply suggestions from code review

* Typo

* Translation

* Apply suggestions from code review

* Update app/views/plantings/index.ics.erb

* Update app/models/activity.rb

* Update plantings_spec.rb

* Update plantings_spec.rb

* We are now rendering an extra event, so check the next one for the old behaviour
2024-03-10 11:36:24 +10:30

56 lines
1.7 KiB
Plaintext

.card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2
.card-header
- if content_for? :title
%h1.h2-responsive.text-center
= planting_icon
%strong=yield :title
= bootstrap_form_for(@activity) do |f|
.card-body
= required_field_help_text
- if @activity.errors.any?
#error_explanation
%h2
= pluralize(@activity.errors.size, "error")
prohibited this activity from being saved:
%ul
- @activity.errors.full_messages.each do |msg|
%li= msg
.row
.col-md-12
= f.text_field :name, required: true, label: 'What needs to be done?'
.row
.col-md-4
= f.select(:category, Activity::CATEGORIES, include_blank: true)
.row
.col-md-12
= f.text_area :description, rows: 6, label: 'Tell us more about it'
.row
.col-md-4
= f.collection_radio_buttons(:garden_id, @activity.owner.gardens.active,
:id, :name,
label: 'Is this for a specific garden?')
= link_to "Add a garden.", new_garden_path
.col-md-4
= f.collection_radio_buttons(:planting_id, @activity.owner.plantings.active,
:id, :crop_name,
label: 'Is this for a specific planting?')
= link_to "Add a planting.", new_planting_path
.col-md-4
= f.text_field :due_date,
value: @activity.due_date ? @activity.due_date.to_fs(:ymd) : '',
class: 'add-datepicker', label: 'When?'
%hr
.row
.col-md-6
= f.check_box :finished, label: 'Mark as finished'
%span.help-block= t('.finish_helper')
.card-footer
.text-right= f.submit 'Save'