%style
:plain img { width: 100%; height: auto; } label.bold{ font-weight: bold; } label.collapse{ cursor: pointer; display: block; background: green; } label.collapse.failed{ background: red; } label.collapse + input{ display: none; /* hide the checkboxes */ } label.collapse + input + div{ display:none; } label.collapse + input:checked + div{ display:block; }
%h1 Compatriot
Test Report
-
$tests.each_with_index do |test,i| %label.collapse{ for: “_#{i}”, class: test }= test %input{id: “_#{i}”, type: “checkbox”} %div
%table %tbody %tr %td %label.bold Control %img{src: test[:control_image_path]} %td %label.bold Variable %img{src: test[:variable_image_path]} %td %label.bold Diff %img{src: test[:diff_image_path]}