From a221db10cdbfda88bfab58aa45c820ab6d8f3fb6 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 8 Feb 2015 12:55:11 +0200 Subject: [PATCH] Direct people to the archive when viewing a problem in a finished contest --- lib/Plack/App/Gruntmaster/HTML.pm | 2 ++ tmpl/pb_entry.en | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/Plack/App/Gruntmaster/HTML.pm b/lib/Plack/App/Gruntmaster/HTML.pm index 3404ddb..bdd20c2 100644 --- a/lib/Plack/App/Gruntmaster/HTML.pm +++ b/lib/Plack/App/Gruntmaster/HTML.pm @@ -162,11 +162,13 @@ sub process_pb_entry { $tree->fid('solution_modal')->fclass('modal-body')->replace_content(literal $args{solution}); } if ($args{cansubmit}) { + $tree->fid('nosubmit')->detach; $tree->look_down(name => 'problem')->attr(value => $args{id}); my $contest = $tree->look_down(name => 'contest'); $contest->attr(value => $args{contest}) if $args{contest}; $contest->detach unless $args{contest} } else { + $tree->fid('nosubmit')->find('a')->edit_href(sub{s/id/$args{id}/}); $tree->fid('submit')->detach } } diff --git a/tmpl/pb_entry.en b/tmpl/pb_entry.en index 2798544..c76c56c 100644 --- a/tmpl/pb_entry.en +++ b/tmpl/pb_entry.en @@ -16,8 +16,14 @@ Job log
Solution -

Submit solution

+ +
+The contest has finished.
+To submit solutions to this problem, please visit the problem outside the contest. +
+ +
-- 2.39.2