]> iEval git - plack-app-gruntmaster.git/commitdiff
Add editorial header
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 14 Feb 2015 09:13:52 +0000 (11:13 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Wed, 25 Feb 2015 18:03:30 +0000 (20:03 +0200)
(cherry picked from commit 00c887ce06707532ce45ad863139f79455480d24)

Conflicts:
lib/Plack/App/Gruntmaster.pm

lib/Plack/App/Gruntmaster.pm
lib/Plack/App/Gruntmaster/HTML.pm
tmpl/ed.en

index 2c3b2a2c6c619b2f916976ad8b4cebbcbfa8d65e..aa473d866c1376d349c722c053329af5a3338232 100644 (file)
@@ -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) {
index eb3c56765964e4d1ec09fb70d14b7865c64b3738..7fa63f5fc94690df252b5a269770f82138732ed3 100644 (file)
@@ -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});
index 12d47a7be68f803400702b40c4a4506b2644a7e6..7102cd9886f470570a46b35102d7117d3e7c6d82 100644 (file)
@@ -1,7 +1,5 @@
-<div>
+<div id="editorial"></div>
 <div class="well">
 <h2><span class="value">250</span> - <a class="problem" href="/pb/id">Name</a></h2>
-<div class="solution">
-</div>
-</div>
+<div class="solution"></div>
 </div>
\ No newline at end of file
This page took 0.025326 seconds and 4 git commands to generate.