|
125 | 125 | </div> |
126 | 126 | </div> |
127 | 127 | </div> |
128 | | - </div> |
| 128 | + </div> <!-- Closes scenario row --> |
| 129 | + |
| 130 | + <div class="row"> |
| 131 | + <div class="col-md-12 col-sm-12 col-xs-12"> |
| 132 | + <div class="x_panel" style="height: auto;"> |
| 133 | + <div class="x_title"> |
| 134 | + <h2>Screenshots</h2> |
| 135 | + <div class="clearfix"></div> |
| 136 | + </div> |
| 137 | + <div class="x_content"> |
| 138 | + <div class="container"> |
| 139 | + <div class="row"> |
| 140 | + <% f["steps"].each do |s| %> |
| 141 | + <div class="col-md-2"> |
| 142 | + <div class="step_title"> |
| 143 | + <i class="fa fa-arrow-right step_title_icon"></i> |
| 144 | + <%= s["keyword"] %> <%= s["name"] %> |
| 145 | + </div> |
| 146 | + <% if(s["after"] && s["after"].count > 0 && s["after"].first["embeddings"] && s["after"].first["embeddings"].count > 0) %> |
| 147 | + <% step_image = s["after"].first["embeddings"].first["data"] %> |
| 148 | + <img src='<%= "data:image/png;base64,#{step_image}" %>' alt="" class="img-responsive step_image" onclick='<%= "openImageNewTab(\"#{step_image}\")" %>'> |
| 149 | + <% else %> |
| 150 | + <div class="not_available"> |
| 151 | + NO IMAGE AVAILABLE |
| 152 | + </div> |
| 153 | + <% end %> |
| 154 | + </div> |
| 155 | + <% end %> |
| 156 | + </div> |
| 157 | + </div> |
| 158 | + </div> |
| 159 | + </div> |
| 160 | + </div> |
| 161 | + </div> <!-- Closes screenshots row --> |
| 162 | + <% end %> |
129 | 163 | </div> |
130 | | - <% end %> |
131 | 164 |
|
132 | 165 | <script src="../../assets/js/jquery-3.2.1.min.js" ></script> |
133 | 166 | <script src="../../assets/js/bootstrap.min.js"></script> |
|
136 | 169 | <script src="../../assets/js/dataTables.responsive.min.js"></script> |
137 | 170 | <script src="../../assets/js/Chart.min.js"></script> |
138 | 171 | <script> |
139 | | - $(document).ready(function () { |
140 | | - passed_scenarios = parseInt("<%= passed_scenarios(@feature).count %>") |
141 | | - failed_scenarios = parseInt("<%= failed_scenarios(@feature).count %>") |
| 172 | + function openImageNewTab(imageData) { |
| 173 | + var im = new Image(); |
| 174 | + im.src = "data:image/png;base64," + imageData |
| 175 | + var w = window.open("",'_blank'); |
| 176 | + w.document.write(im.outerHTML); |
| 177 | + w.document.close(); |
| 178 | + } |
142 | 179 |
|
143 | | - scenarios_data = [passed_scenarios,failed_scenarios]; |
144 | | - var scenarioOptions = { |
145 | | - legend: false, |
146 | | - responsive: false |
147 | | - }; |
| 180 | + $(document).ready(function () { |
148 | 181 |
|
149 | | - new Chart(document.getElementById("scenario-chart"), { |
150 | | - type: 'doughnut', |
151 | | - tooltipFillColor: "rgba(51, 51, 51, 0.55)", |
152 | | - data: { |
153 | | - labels: [ |
154 | | - "Passed", |
155 | | - "Failed" |
156 | | - ], |
157 | | - datasets: [{ |
158 | | - data: scenarios_data, |
159 | | - backgroundColor: [ |
160 | | - "#26B99A", |
161 | | - "#E74C3C" |
162 | | - ] |
163 | | - }] |
164 | | - }, |
165 | | - options: scenarioOptions |
166 | | - }); |
| 182 | + passed_scenarios = parseInt("<%= passed_scenarios(@feature).count %>") |
| 183 | + failed_scenarios = parseInt("<%= failed_scenarios(@feature).count %>") |
| 184 | + |
| 185 | + scenarios_data = [passed_scenarios,failed_scenarios]; |
| 186 | + var scenarioOptions = { |
| 187 | + legend: false, |
| 188 | + responsive: false |
| 189 | + }; |
| 190 | + |
| 191 | + new Chart(document.getElementById("scenario-chart"), { |
| 192 | + type: 'doughnut', |
| 193 | + tooltipFillColor: "rgba(51, 51, 51, 0.55)", |
| 194 | + data: { |
| 195 | + labels: [ |
| 196 | + "Passed", |
| 197 | + "Failed" |
| 198 | + ], |
| 199 | + datasets: [{ |
| 200 | + data: scenarios_data, |
| 201 | + backgroundColor: [ |
| 202 | + "#26B99A", |
| 203 | + "#E74C3C" |
| 204 | + ] |
| 205 | + }] |
| 206 | + }, |
| 207 | + options: scenarioOptions |
| 208 | + }); |
167 | 209 |
|
168 | | - $('body').tooltip({ |
169 | | - selector: '[data-toggle="tooltip"]' |
| 210 | + $('body').tooltip({ |
| 211 | + selector: '[data-toggle="tooltip"]' |
| 212 | + }); |
170 | 213 | }); |
171 | | - }); |
172 | 214 | </script> |
173 | 215 | </body> |
174 | 216 | </html> |
0 commit comments