]> iEval git - gruntmaster-page.git/commitdiff
Merge branch 'master' into newmc
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 5 Feb 2015 17:37:14 +0000 (19:37 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 5 Feb 2015 17:37:14 +0000 (19:37 +0200)
1  2 
lib/Plack/App/Gruntmaster.pm
lib/Plack/App/Gruntmaster/HTML.pm

index bd11fe04e33c429dd3ef7ed8cc7342ddd5cead95,77a8828aab25fc687a9876ee9169cd5a68612ed5..45cdfd1c5107e7babaad66a51a1f0a4885a5d406
@@@ -113,7 -113,8 +113,8 @@@ sub dispatch_request
  
                sub (/src/:job) {
                        return NOT_FOUND if !job;
-                       forbid job->private || job->problem->private || job->contest && job->contest->is_running;
+                       my $isowner = remote_user && remote_user->id eq job->rawowner;
+                       forbid !$isowner && (job->private || job->problem->private || job->contest && job->contest->is_running);
                        my @headers = ('X-Forever' => 1, 'Cache-Control' => 'public, max-age=604800', 'Content-Type' => CONTENT_TYPES->{job->format});
                        [200, \@headers, [job->source]]
                },
  
                        my $source = $prog ? read_file $prog->path : $_{source_code};
                        unlink $prog->path if $prog;
 +                      my $private = (problem->private && !$_{contest}) ? 1 : 0;
                        my $newjob = db->jobs->create({
                                maybe contest => $_{contest},
 -                              maybe private => problem->private && !$_{contest},
 +                              private => $private,
                                date => time,
                                extension => FORMAT_EXTENSION->{$_{prog_format}},
                                format => $_{prog_format},
index 87dc8b48837fa23dddbad6c30e0a3fe336596284,d37d1a703557d15cf4c245b43e5ea99c06f2904f..8e36af534b5b3b11af75619472d3a57b4f612542
@@@ -114,7 -114,6 +114,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};
        $tree->content_handler(
                start       => ftime   $args{start},
@@@ -255,6 -254,7 +255,7 @@@ sub process_st 
                my ($data, $th) = @_;
                $th->attr(class => undef);
                $th->namedlink(@$data);
+               $th->find('a')->edit_href(sub{s/$/?contest=$args{args}{contest}/});
        };
        $tree->fclass('problem')->iter3($args{problems}, $pbiter);
        my $iter = sub {
This page took 0.025909 seconds and 4 git commands to generate.