]> iEval git - gruntmaster-page.git/commitdiff
Merge branch 'master' into newmc
authorMarius Gavrilescu <marius@ieval.ro>
Sun, 15 Feb 2015 21:42:09 +0000 (23:42 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sun, 15 Feb 2015 21:42:09 +0000 (23:42 +0200)
1  2 
lib/Plack/App/Gruntmaster.pm
lib/Plack/App/Gruntmaster/HTML.pm

index c590bc9e2309977edb92554854dd0e66c8605e8b,62bef3283d6b6672af1051bd4748ef295f1162a9..185017b82b38cf1abe9445621ec75367887f3507
@@@ -18,7 -18,6 +18,6 @@@ use Plack::App::Gruntmaster::HTML
  
  use warnings NONFATAL => 'all';
  no warnings 'illegalproto';
- no if $] >= 5.017011, warnings => 'experimental::smartmatch';
  
  ##################################################
  
@@@ -34,6 -33,7 +33,7 @@@ use constant CONTENT_TYPES => +
        pas => 'text/x-pascal',
        pl => 'text/x-perl',
        py => 'text/x-python',
+       l => 'text/plain',
  };
  
  use constant FORMAT_EXTENSION => {
@@@ -160,8 -160,7 +160,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 f0c49cd66813882540b0db71f552c49ecb26d9b5,947f039238b0fb20ba4a638ae25dbad03609ddd0..319a5e509d70d71b881829a4addeb27fd010bae2
@@@ -71,7 -71,6 +71,7 @@@ sub _render 
  
  sub process_skel {
        my ($tree, %args) = @_;
 +      $tree->fid('logo')->replace_with(literal scalar read_file "mclogo.svg");
        $tree->content_handler(
                title   =>         $args{title},
                content => literal $args{meat});
@@@ -115,7 -114,6 +115,7 @@@ sub process_us 
  sub process_ct_entry {
        my ($tree, %args) = @_;
        $_->edit_href (sub {s/contest_id/$args{id}/}) for $tree->find('a');
 +      $tree->fid('editorial')->detach unless $args{finished};
        $tree->fid('links')->detach unless $args{started};
        my $status = ($args{time} < $args{start} ? 'starts' : 'ends');
        $tree->fclass('timer')->attr('data-stop', $status eq 'ends' ? $args{stop} : $args{start});
@@@ -197,6 -195,7 +197,7 @@@ sub process_pb 
                $div->find('tbody')->find('tr')->iter3($args{$data}, $titer);
        };
        $tree->fid('beginner')->iter3([grep {$args{$_}} qw/beginner easy medium hard/], $iter);
+       $tree->fid('open-alert')->detach unless $args{contest};
  }
  
  sub process_log_entry {
@@@ -279,7 -278,6 +280,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});
This page took 0.026424 seconds and 4 git commands to generate.