sub process_log_entry {
my ($tree, %args) = @_;
+ $tree->fid('problem')->namedlink(@args{qw/problem problem_name/});
+ $tree->fid('owner')->namedlink(@args{qw/owner owner_name/});
+ $tree->fid('source')->namedlink("$args{id}.$args{extension}", sprintf '%.2fKB', $args{size}/1024);
+ if ($args{contest}) {
+ $tree->fid('contest')->namedlink(@args{qw/contest contest_name/});
+ $tree->fid('problem')->find('a')->edit_href(sub {$_.="?contest=$args{contest}"});
+ } else {
+ $tree->fid('contest')->left->detach;
+ $tree->fid('contest')->detach;
+ }
+
$args{errors} ? $tree->fid('errors')->find('pre')->replace_content($args{errors}) : $tree->fid('errors')->detach;
my $iter = sub {
my ($data, $tr) = @_;
$tr->defmap(class => $data);
$tr->fclass('result_text')->attr(class => "r$data->{result}")
};
- @{$args{results}} ? $tree->fid('results')->find('tbody')->find('tr')->iter3($args{results}, $iter) : $tree->fid('results')->detach;
+ $args{results} ? $tree->fid('results')->find('tbody')->find('tr')->iter3($args{results}, $iter) : $tree->fid('results')->detach;
}
sub process_log {
+<dl>
+<dt>Owner</dt> <dd id="owner"><a href="/us/id">owner</a></dd>
+<dt>Problem</dt> <dd id="problem"><a href="/pb/id">problem</a></dd>
+<dt>Contest</dt> <dd id="contest"><a href="/ct/id">contest</a></dd>
+<dt>Source</dt> <dd><a id="source" href="/log/id">1.55 KB</a></dd>
+
<div id="errors">
<h2>Compiler output</h2>
<pre></pre>