From b6afe55f5ac9c2e4dcac620a4614d5342ebed66a Mon Sep 17 00:00:00 2001 From: Kento HASEGAWA Date: Sat, 27 Jul 2019 00:47:47 +0900 Subject: [PATCH] Don't show the solution viewer when a solution is invalid --- static/css/adc2019.css | 9 ++------- static/js/adc2019.js | 2 +- templates/part_problem_status.html | 11 ++++++----- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/static/css/adc2019.css b/static/css/adc2019.css index e070961..078db36 100644 --- a/static/css/adc2019.css +++ b/static/css/adc2019.css @@ -60,8 +60,8 @@ body{ display: inline-block; } -#solution-list-container tr.solution-detail-row, -#solution-list-container tr.solution-detail-row td{ +#solution-list-container tr.solution-detail-row.valid-solution, +#solution-list-container tr.solution-detail-row.valid-solution td{ cursor: pointer; } @@ -90,8 +90,3 @@ body{ height: calc(100vh - 55px); overflow-y: scroll; } - -#content-right #solution-list-container table>tbody>tr, -#content-right #solution-list-container table>tbody>tr>td{ - cursor: pointer; -} diff --git a/static/js/adc2019.js b/static/js/adc2019.js index a2f5698..a04753a 100644 --- a/static/js/adc2019.js +++ b/static/js/adc2019.js @@ -34,7 +34,7 @@ class StatusView { _this.fire('refresh'); }); - _this.container.find('.solution-detail-row td').click((e) => { + _this.container.find('.solution-detail-row.valid-solution td').click((e) => { var solution_id = $(e.target).parent("tr").data("solution-id"); var problem_name = $(e.target).parent("tr").data("problem"); var viewer_url = "/view/solution#" + problem_name + "/" + solution_id; diff --git a/templates/part_problem_status.html b/templates/part_problem_status.html index 7548b1a..8aa0c24 100644 --- a/templates/part_problem_status.html +++ b/templates/part_problem_status.html @@ -22,11 +22,12 @@ {% for k, v in problem.get_solutions().items() %} - {% if k == problem.best_solution %} - - {% else %} - - {% endif %} + {% set tr_class = '' %} + {% set tr_class = tr_class + ' submit-solution' if k == problem.best_solution else '' %} + {% set tr_class = tr_class + ' valid-solution' if v.is_valid_solution() else '' %} + {#% else %#} + + {#% endif %#} {{v.timestamp_str}} {{v.worker}} -- 2.22.0