]> 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>
Sat, 14 Feb 2015 09:13:52 +0000 (11:13 +0200)
lib/Plack/App/Gruntmaster.pm
lib/Plack/App/Gruntmaster/HTML.pm
tmpl/ed.en

index 3ec4e78300fd623a2c85457c0e5b07c715d2de18..425dc313779369d8d69fddc2f06117687d4055c4 100644 (file)
@@ -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) {
index 0a681161a51f91856bedde4e9b43d49177ef0a29..ce7ca7968d94cf733fd6e72d1b5f8d1584fd9d41 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.035257 seconds and 4 git commands to generate.