From 0f9e151c159211a73b423112a7352c979e0b8c2e Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sun, 13 Oct 2024 02:22:49 +0000 Subject: [PATCH 01/28] Swap to native datepicker --- app/views/activities/_form.html.haml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/views/activities/_form.html.haml b/app/views/activities/_form.html.haml index f00f041f6f..6198a02a3c 100644 --- a/app/views/activities/_form.html.haml +++ b/app/views/activities/_form.html.haml @@ -40,9 +40,8 @@ = 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?' + = f.date_field :due_date, + value: @activity.due_date ? @activity.due_date.to_fs(:ymd) : '', label: 'When?' %hr From 4b0e228525e47ff06352d557b5b2c6bdb31ed1a8 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sun, 13 Oct 2024 02:24:20 +0000 Subject: [PATCH 02/28] Swap to native datepicker --- app/views/seeds/_form.html.haml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/views/seeds/_form.html.haml b/app/views/seeds/_form.html.haml index a501ac32e4..80a3e05b14 100644 --- a/app/views/seeds/_form.html.haml +++ b/app/views/seeds/_form.html.haml @@ -29,19 +29,18 @@ = link_to "Request new crops.", new_crop_path .row .col-12.col-md-4 - = f.text_field :saved_at, + = f.date_field :saved_at, value: @seed.saved_at ? @seed.saved_at.to_fs(:ymd) : '', - class: 'add-datepicker', label: 'When were the seeds harvested/saved?' + label: 'When were the seeds harvested/saved?' .col-12.col-md-4= f.number_field :quantity, label: 'Quantity' .col-12.col-md-4 - = f.text_field :plant_before, class: 'add-datepicker', - value: @seed.plant_before ? @seed.plant_before.to_fs(:ymd) : '' + = f.date_field :plant_before, value: @seed.plant_before ? @seed.plant_before.to_fs(:ymd) : '' .row .col-12.col-md-4 = f.check_box :finished, label: 'Mark as finished' .col-12.col-md-4 - = f.text_field :finished_at, class: 'add-datepicker', value: @seed.finished_at ? @seed.finished_at.to_fs(:ymd) : '' + = f.date_field :finished_at, value: @seed.finished_at ? @seed.finished_at.to_fs(:ymd) : '' .col-12.col-md-4 %span.help-inline= t('.finish_helper') From defc3def4fcd04e90430824adbb502dc06fe6033 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Sun, 13 Oct 2024 02:26:16 +0000 Subject: [PATCH 03/28] Allow autosuggests to be required --- app/helpers/auto_suggest_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/auto_suggest_helper.rb b/app/helpers/auto_suggest_helper.rb index 1b8521c82d..19ebbb1e1e 100644 --- a/app/helpers/auto_suggest_helper.rb +++ b/app/helpers/auto_suggest_helper.rb @@ -13,7 +13,7 @@ def auto_suggest(resource, source, options = {}) resource = resource.class.name.downcase source_path = Rails.application.routes.url_helpers.send("search_#{source}s_path", format: :json) %( -