|
42 | 42 | </thead>
|
43 | 43 |
|
44 | 44 | <tbody>
|
45 |
| - <% @submission.test_case_runs.each do |tcr| %> |
46 |
| - <tr> |
47 |
| - <td><%= tcr.test_case_name %></td> |
48 |
| - <td> |
49 |
| - <% if cannot? :read_results, @submission %> |
50 |
| - <span class="hidden_status">Hidden</span> |
51 |
| - <% elsif tcr.successful? %> |
52 |
| - <span class="success">Ok</span> |
53 |
| - <% else %> |
54 |
| - <span class="failure">Fail</span> |
55 |
| - <% end %> |
56 |
| - </td> |
57 |
| - <% if !@submission.all_tests_passed? && (can? :read_results, @submission) %> |
| 45 | + <% if can? :read_results, @submission %> |
| 46 | + <% @submission.test_case_runs.each do |tcr| %> |
| 47 | + <tr> |
| 48 | + <td><%= tcr.test_case_name %></td> |
58 | 49 | <td>
|
59 |
| - <%= tcr.message %> |
60 |
| - <% if tcr.exception != nil %> |
61 |
| - <div class="stack-trace"> |
62 |
| - <%= format_exception_chain(ActiveSupport::JSON.decode(tcr.exception)) %> |
63 |
| - </div> |
64 |
| - <% end %> |
65 |
| - <% if tcr.detailed_message != nil %> |
66 |
| - <br /> |
67 |
| - <div class="detailed-message"> |
68 |
| - <%= raw( ("".html_safe + tcr.detailed_message).gsub("\n", "<br>") ) %> |
69 |
| - </div> |
| 50 | + <% if cannot? :read_results, @submission %> |
| 51 | + <span class="hidden_status">Hidden</span> |
| 52 | + <% elsif tcr.successful? %> |
| 53 | + <span class="success">Ok</span> |
| 54 | + <% else %> |
| 55 | + <span class="failure">Fail</span> |
70 | 56 | <% end %>
|
71 | 57 | </td>
|
72 |
| - <% end %> |
73 |
| - </tr> |
| 58 | + <% if !@submission.all_tests_passed? && (can? :read_results, @submission) %> |
| 59 | + <td> |
| 60 | + <%= tcr.message %> |
| 61 | + <% if tcr.exception != nil %> |
| 62 | + <div class="stack-trace"> |
| 63 | + <%= format_exception_chain(ActiveSupport::JSON.decode(tcr.exception)) %> |
| 64 | + </div> |
| 65 | + <% end %> |
| 66 | + <% if tcr.detailed_message != nil %> |
| 67 | + <br /> |
| 68 | + <div class="detailed-message"> |
| 69 | + <%= raw( ("".html_safe + tcr.detailed_message).gsub("\n", "<br>") ) %> |
| 70 | + </div> |
| 71 | + <% end %> |
| 72 | + </td> |
| 73 | + <% end %> |
| 74 | + </tr> |
| 75 | + <% end %> |
74 | 76 | <% end %>
|
75 | 77 | </tbody>
|
76 | 78 | </table>
|
|
0 commit comments