From 52b044d6a4278c229992404ad5801769c2d13363 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sun, 24 Aug 2025 20:29:54 +0200 Subject: First commit. Vive le Castel Peter ! --- app/views/recipes/show.html.erb | 108 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 app/views/recipes/show.html.erb (limited to 'app/views/recipes/show.html.erb') diff --git a/app/views/recipes/show.html.erb b/app/views/recipes/show.html.erb new file mode 100644 index 0000000..180fdae --- /dev/null +++ b/app/views/recipes/show.html.erb @@ -0,0 +1,108 @@ + +<%# Controls header %> +
+
+
Ferti© Recipe
+ +
+ <%= form_with url: ferti_recipe_path, method: :get, local: true, class: "d-flex flex-wrap gap-2 align-items-center", id: "recipe-form" do %> +
+ + +
+ +
+ +
+ + +
+ <% end %> + + <%= link_to "Back", root_path, class: "btn btn-sm btn-secondary" %> +
+
+ +
+ + + + + + + + + + + <% @recipe.each do |component, kg| %> + <% prod_name = commercial_name_for(component) %> + + + + + + + <% end %> + <% if @recipe.blank? %> + + <% end %> + +
ProductFertilizerQty (kg)Per portion (kg)
<%= prod_name %><%= component.name %><%= fmt_kg(kg) %><%= fmt_kg(kg / (params[:portions].presence || 2).to_f) %>
No supplementation required.
+
+ + +
+ +<%# Tiny vanilla JS: auto-submit on volume change; live per-portion update %> + -- cgit v1.2.3