]> iEval git - plack-app-gruntmaster.git/blobdiff - lib/Plack/App/Gruntmaster.pm
Do not pass contest explicitly for /pb/
[plack-app-gruntmaster.git] / lib / Plack / App / Gruntmaster.pm
index 87e9e5a18586bc654a8a36852af55b7c39df1255..a3fde9ed9a33489307400236242977be10f679e4 100644 (file)
@@ -4,10 +4,8 @@ use 5.014000;
 use strict;
 our $VERSION = '5999.000_001';
 
-use CSS::Minifier::XS;
 use Encode qw/encode decode/;
 use File::Slurp qw/read_file/;
-use JavaScript::Minifier::XS;
 use JSON::MaybeXS qw/encode_json/;
 use PerlX::Maybe;
 use Scope::Upper qw/unwind SUB UP/;
@@ -55,8 +53,6 @@ use constant FORMAT_EXTENSION => {
 
 use constant NOT_FOUND => [404, ['X-Forever' => 1, 'Content-Type' => 'text/plain'], ['Not found']];
 
-sub development() { ($ENV{PLACK_ENV} // 'development') eq 'development' }
-
 my ($env, $privacy);
 
 sub db { $env->{'gruntmaster.dbic'} }
@@ -98,22 +94,6 @@ sub dispatch_request{
        $privacy = 'public';
 
        sub (GET) {
-               sub (/css/:theme) {
-                       my $theme = $_{theme};
-                       return NOT_FOUND unless -e "css/themes/$theme.css";
-                       my $css = read_file "css/themes/$theme.css";
-                       $css .= read_file $_ for <css/*.css>;
-                       my @headers = ('X-Forever' => 1, 'Cache-Control' => 'public, max-age=604800', 'Content-Type' => 'text/css; charset=utf-8');
-                       [200, \@headers, [development ? $css : CSS::Minifier::XS::minify $css]]
-               },
-
-               sub (/js.js) {
-                       my $js;
-                       $js .= read_file $_ for <js/*.js>;
-                       my @headers = ('X-Forever' => 1, 'Cache-Control' => 'public, max-age=604800', 'Content-Type' => 'application/javascript; charset=utf-8');
-                       [200, \@headers, [development ? $js : JavaScript::Minifier::XS::minify $js]]
-               },
-
                sub (/robots.txt) { NOT_FOUND },
 
                sub (/src/:job) {
@@ -185,7 +165,7 @@ sub dispatch_request{
                },
                sub (/pb/  + ?:owner~&:contest~&:private~)                  {
                        forbid $_{private};
-                       response pb => 'Problems', {%{db->problem_list(%_)}, maybe contest => $_{contest}}
+                       response pb => 'Problems', db->problem_list(%_)
                },
 
                sub (/us/:user)    { response us_entry => user->name, db->user_entry($_{user}) },
This page took 0.021922 seconds and 4 git commands to generate.