]> iEval git - plack-app-gruntmaster.git/blobdiff - lib/Plack/App/Gruntmaster/HTML.pm
Hide editorial link before contest is finished
[plack-app-gruntmaster.git] / lib / Plack / App / Gruntmaster / HTML.pm
index d68874b425274763859e783a847a462e90a48103..87dc8b48837fa23dddbad6c30e0a3fe336596284 100644 (file)
@@ -114,6 +114,7 @@ sub process_us {
 sub process_ct_entry {
        my ($tree, %args) = @_;
        $_->edit_href (sub {s/contest_id/$args{id}/}) for $tree->find('a');
+       $tree->fid('editorial')->detach unless $args{finished};
        $tree->fid('links')->detach unless $args{started};
        $tree->content_handler(
                start       => ftime   $args{start},
@@ -266,3 +267,15 @@ sub process_st {
        };
        $tree->find('tbody')->find('tr')->iter3($args{st}, $iter);
 }
+
+sub process_ed {
+       my ($tree, %args) = @_;
+       my $iter = sub {
+               my ($data, $div) = @_;
+               $div->set_child_content(class => 'value', $data->{value});
+               $div->set_child_content(class => 'solution', literal $data->{solution});
+               $div->fclass('problem')->namedlink($data->{id}, $data->{name});
+       };
+       my @pb = map { @{$args{$_}} } qw/beginner easy medium hard/;
+       $tree->fclass('well')->iter3(\@pb, $iter);
+}
This page took 0.017348 seconds and 4 git commands to generate.