View raw

1 <% content_for :title, "Liste des Relevé" %> 2 3 <h1 class="display-1">Liste des Relevés</h1> 4 5 <div class="d-flex justify-content-between align-items-center mb-3"> 6 <div class="btn-group"> 7 <%= link_to "Nouvelle mesure", new_nutrient_measurement_path, class: "btn btn-primary" %> 8 <%= link_to "Retour", root_path, class: "btn btn-outline-secondary" %> 9 </div> 10 </div> 11 12 <div class="table-responsive"> 13 <table class="table table-sm table-striped table-hover align-middle table-nutrient mb-0"> 14 <thead class="table-light"> 15 <tr> 16 <th>Date</th> 17 <th class="text-end" title="Total N = NO₃-N + NH₄-N">N (total)</th> 18 <th class="text-end">P</th> 19 <th class="text-end">K</th> 20 <th class="text-end" title="Ammonia nitrogen">NH₄-N</th> 21 </tr> 22 </thead> 23 <tbody> 24 <% @nutrient_measurements.each do |m| %> 25 <tr> 26 <td><%= l(m.measured_on) %></td> 27 <td class="text-end"> 28 <%= number_with_precision(m.nno3.to_f + m.nnh4.to_f, precision: 2) if m.nno3 || m.nnh4 %> 29 </td> 30 <td class="text-end"><%= number_with_precision(m.p, precision: 2) if m.p %></td> 31 <td class="text-end"><%= number_with_precision(m.k, precision: 2) if m.k %></td> 32 <td class="text-end"><%= number_with_precision(m.nnh4, precision: 2) if m.nnh4 %></td> 33 </tr> 34 <% end %> 35 </tbody> 36 </table> 37 </div> 38 39 <%= line_chart @npk_measurement_data, 40 title: "NPK", 41 ytitle: "Concentration (mg/L)" %> 42