From: Marius Gavrilescu Date: Sat, 14 Feb 2015 09:13:52 +0000 (+0200) Subject: Add editorial header X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=00c887ce06707532ce45ad863139f79455480d24;p=gruntmaster-page.git Add editorial header --- diff --git a/lib/Plack/App/Gruntmaster.pm b/lib/Plack/App/Gruntmaster.pm index 3ec4e78..425dc31 100644 --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@ -159,7 +159,8 @@ sub dispatch_request{ sub (/ed/:contest) { forbid contest->is_running; - response ed => 'Editorial of ' . contest->name, db->problem_list(contest => $_{contest}, solution => 1); + my $pblist = db->problem_list(contest => $_{contest}, solution => 1); + response ed => 'Editorial of ' . contest->name, {%$pblist, editorial => contest->editorial}; }, sub (/login) { diff --git a/lib/Plack/App/Gruntmaster/HTML.pm b/lib/Plack/App/Gruntmaster/HTML.pm index 0a68116..ce7ca79 100644 --- a/lib/Plack/App/Gruntmaster/HTML.pm +++ b/lib/Plack/App/Gruntmaster/HTML.pm @@ -278,6 +278,7 @@ sub process_st { sub process_ed { my ($tree, %args) = @_; + $tree->content_handler(editorial => literal $args{editorial}); my $iter = sub { my ($data, $div) = @_; $div->set_child_content(class => 'value', $data->{value}); diff --git a/tmpl/ed.en b/tmpl/ed.en index 12d47a7..7102cd9 100644 --- a/tmpl/ed.en +++ b/tmpl/ed.en @@ -1,7 +1,5 @@ -
+

250 - Name

-
-
-
+
\ No newline at end of file