X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FPlack%2FApp%2FGruntmaster.pm;h=bd11fe04e33c429dd3ef7ed8cc7342ddd5cead95;hb=02ce2ef628e5973f32dd1ff8c94b79ce00293c93;hp=59e5720c96bd28ce571c8021be6dd972156903a2;hpb=ca0c7ea2c90553352245a398f62fcb25c3294c3f;p=gruntmaster-page.git diff --git a/lib/Plack/App/Gruntmaster.pm b/lib/Plack/App/Gruntmaster.pm index 59e5720..bd11fe0 100644 --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@ -152,6 +152,11 @@ sub dispatch_request{ }, 10 }, + sub (/ed/:contest) { + forbid contest->is_running; + response ed => 'Editorial of ' . contest->name, db->problem_list(contest => $_{contest}, solution => 1); + }, + sub (/login) { forbid !remote_user; @@ -195,6 +200,7 @@ sub dispatch_request{ }, sub (/) { redispatch_to '/index' }, + sub (/favicon.ico) { redirect '/static/favicon.ico' }, sub (/:article) { [200, ['Content-Type' => 'text/html', 'Cache-Control' => 'public, max-age=60', 'X-Forever' => 1], [render_article $_{article}, 'en']] } }, @@ -232,9 +238,10 @@ sub dispatch_request{ 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},