From: Marius Gavrilescu Date: Sat, 14 Feb 2015 09:13:52 +0000 (+0200) Subject: Add editorial header X-Git-Url: http://git.ieval.ro/?p=gruntmaster-page.git;a=commitdiff_plain;h=42243f04db2175b78c83c50aa1aa82bc14d7a00b Add editorial header (cherry picked from commit 00c887ce06707532ce45ad863139f79455480d24) Conflicts: lib/Plack/App/Gruntmaster.pm --- diff --git a/lib/Plack/App/Gruntmaster.pm b/lib/Plack/App/Gruntmaster.pm index 2c3b2a2..aa473d8 100644 --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@ -166,7 +166,8 @@ sub dispatch_request{ sub (/ed/:contest) { forbid !contest->is_finished; - 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 eb3c567..7fa63f5 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