X-Git-Url: http://git.ieval.ro/?p=gruntmaster-page.git;a=blobdiff_plain;f=lib%2FPlack%2FApp%2FGruntmaster%2FHTML.pm;h=ff998b96a4e654b999a5cebb5d60618506c63182;hp=04127828de03ee7704f2deb2887d0eba9142a2ee;hb=e4d5bdf52a921932551c051df63ea8087d2037da;hpb=514df99ce102d24d3b920f55c53f7c76d6b7056f diff --git a/lib/Plack/App/Gruntmaster/HTML.pm b/lib/Plack/App/Gruntmaster/HTML.pm index 0412782..ff998b9 100644 --- a/lib/Plack/App/Gruntmaster/HTML.pm +++ b/lib/Plack/App/Gruntmaster/HTML.pm @@ -118,11 +118,14 @@ sub process_pb_entry { my ($tree, %args) = @_; $tree->fid('owner')->edit_href(sub{s/owner_id/$args{owner}/}); $tree->fid('job_log')->edit_href(sub{s/problem_id/$args{id}/}); + $tree->fid('solution')->edit_href(sub{s/problem_id/$args{id}/}); $tree->content_handler( statement => literal $args{statement}, author => $args{author}, owner => $args{owner_name} || $args{owner}); if ($args{contest_stop}) { + $tree->fid('solution')->detach; + $tree->fid('solution_modal')->detach; my $countdown = $tree->fid('countdown'); $countdown->attr('data-start' => $args{contest_start}); $countdown->attr('data-stop' => $args{contest_stop}); @@ -133,6 +136,7 @@ sub process_pb_entry { $tree->fid('score')->replace_content(Gruntmaster::Data::calc_score($args{value}, $args{time} - $args{contest_start}, 0, $args{contest_stop} - $args{contest_start})); } else { $_->detach for $tree->fclass('rc'); # requires contest + $tree->fid('solution_modal')->fclass('modal-body')->replace_content(literal $args{solution}); } if ($args{cansubmit}) { $tree->look_down(name => 'problem')->attr(value => $args{id}); @@ -144,6 +148,11 @@ sub process_pb_entry { } } +sub process_sol { + my ($tree, %args) = @_; + $tree->content_handler(solution => literal $args{solution}); +} + sub process_pb { my ($tree, %args) = @_; my $titer = sub {