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/rafts/editor.html.erb | 108 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 app/views/rafts/editor.html.erb (limited to 'app/views/rafts') diff --git a/app/views/rafts/editor.html.erb b/app/views/rafts/editor.html.erb new file mode 100644 index 0000000..cde56d8 --- /dev/null +++ b/app/views/rafts/editor.html.erb @@ -0,0 +1,108 @@ +
+

Rafts editor

+ <%= link_to "Back to dashboard", root_path, class: "btn btn-outline-secondary" %> +
+ + +
+
Assign ALL rafts
+
+ <%= form_with url: assign_all_rafts_path, method: :patch, class: "row g-2", data: { turbo: false } do %> +
+ +
+
+ +
+ <% end %> +
+
+ +
+ + + + + <% max_cols = @beds.map { |b| b.rafts.count }.max %> + <% (1..max_cols).each do |i| %> + + <% end %> + + + + <% @beds.each do |bed| %> + + + <% bed.rafts.order(:location).each do |raft| %> + + <% end %> + + <% end %> + +
BedR<%= i %>
<%= bed.location %> + <% if raft.crop %> + <%= raft.crop.name %> + <% else %> + — + <% end %> +
+
+ + +<% @beds.each do |bed| %> +
+
+ Bed #<%= bed.location %> + <%= form_with url: assign_bed_rafts_path, method: :patch, class: "d-flex gap-2 align-items-center", data: { turbo: false } do %> + + + + <% end %> +
+
+
+ + + + + + + + + + <% bed.rafts.order(:location).each do |raft| %> + + + + + + <% end %> + +
RaftCropActions
<%= raft.location %> + <%= form_with url: assign_one_raft_path(raft), method: :patch, class: "d-flex gap-2", data: { turbo: false } do %> + + + <% end %> + + <%= button_to "Clear", assign_one_raft_path(raft, crop_id: ""), method: :patch, + form: { data: { turbo: false } }, class: "btn btn-outline-secondary btn-sm" %> +
+
+
+
+<% end %> -- cgit v1.2.3