]> iEval git - gruntmaster-page.git/commitdiff
Direct people to the archive when viewing a problem in a finished contest
authorMarius Gavrilescu <marius@ieval.ro>
Sun, 8 Feb 2015 10:55:11 +0000 (12:55 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sun, 8 Feb 2015 10:55:11 +0000 (12:55 +0200)
lib/Plack/App/Gruntmaster/HTML.pm
tmpl/pb_entry.en

index 3404ddb2b04ecbc4a5a23a56870a7abd06ee3f06..bdd20c2d183439a6ef7635abc3bf38b075282e82 100644 (file)
@@ -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
        }
 }
index 27985443074c132e60637fc303c56453d6f49955..c76c56cf3d5f23961d48aabe2ff858fcd85064ed 100644 (file)
 <a href="/log/?problem=problem_id" id="job_log">Job log</a><br>
 <a href="/sol/problem_id" id="solution" data-toggle="modal" data-target="#solution_modal">Solution</a>
 
-<div id="submit">
 <h1>Submit solution</h1>
+
+<div id="nosubmit">
+The contest has finished.<br>
+To submit solutions to this problem, please visit the problem <a href="/pb/id">outside&nbsp;the&nbsp;contest</a>.
+</div>
+
+<div id="submit">
 <form action="/action/submit" method="POST" enctype="multipart/form-data" role="form">
 <input type="hidden" name="problem" value="problem_id">
 <input type="hidden" name="contest" value="contest_id">
This page took 0.02607 seconds and 4 git commands to generate.