]> iEval git - gruntmaster-page.git/commitdiff
Merge branch 'master' into newmc
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 21 Mar 2015 11:36:45 +0000 (13:36 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 21 Mar 2015 11:36:45 +0000 (13:36 +0200)
css/themes/cyborg.css
css/themes/readable.css
css/themes/slate.css
lib/Plack/App/Gruntmaster.pm
lib/Plack/App/Gruntmaster/HTML.pm

index 5d80614ecda48817dd5896f7eab40ce5ca63237f..e0a75aececf79a2fb85f69d4899929e49849da38 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * bootswatch v3.3.2
+ * bootswatch v3.3.4
  * Homepage: http://bootswatch.com
  * Copyright 2012-2015 Thomas Park
  * Licensed under MIT
@@ -363,6 +363,9 @@ hr {
   overflow: visible;
   clip: auto;
 }
+[role="button"] {
+  cursor: pointer;
+}
 h1,
 h2,
 h3,
@@ -1055,10 +1058,13 @@ output {
 .form-control[disabled],
 .form-control[readonly],
 fieldset[disabled] .form-control {
-  cursor: not-allowed;
   background-color: #adafae;
   opacity: 1;
 }
+.form-control[disabled],
+fieldset[disabled] .form-control {
+  cursor: not-allowed;
+}
 textarea.form-control {
   height: auto;
 }
@@ -1125,6 +1131,7 @@ input[type="search"] {
 }
 .radio-inline,
 .checkbox-inline {
+  position: relative;
   display: inline-block;
   padding-left: 20px;
   margin-bottom: 0;
@@ -1161,6 +1168,7 @@ fieldset[disabled] .checkbox label {
   padding-top: 9px;
   padding-bottom: 9px;
   margin-bottom: 0;
+  min-height: 34px;
 }
 .form-control-static.input-lg,
 .form-control-static.input-sm {
@@ -1202,6 +1210,7 @@ select[multiple].form-group-sm .form-control {
   padding: 5px 10px;
   font-size: 12px;
   line-height: 1.5;
+  min-height: 32px;
 }
 .input-lg {
   height: 54px;
@@ -1238,6 +1247,7 @@ select[multiple].form-group-lg .form-control {
   padding: 14px 16px;
   font-size: 18px;
   line-height: 1.3333333;
+  min-height: 38px;
 }
 .has-feedback {
   position: relative;
@@ -1673,11 +1683,9 @@ input[type="button"].btn-block {
 }
 .collapse {
   display: none;
-  visibility: hidden;
 }
 .collapse.in {
   display: block;
-  visibility: visible;
 }
 tr.collapse.in {
   display: table-row;
@@ -1932,7 +1940,7 @@ button.close {
   right: 0;
   bottom: 0;
   left: 0;
-  z-index: 1040;
+  z-index: 1050;
   -webkit-overflow-scrolling: touch;
   outline: 0;
 }
@@ -1973,10 +1981,12 @@ button.close {
   outline: 0;
 }
 .modal-backdrop {
-  position: absolute;
+  position: fixed;
   top: 0;
   right: 0;
+  bottom: 0;
   left: 0;
+  z-index: 1040;
   background-color: #000000;
 }
 .modal-backdrop.fade {
@@ -2104,7 +2114,6 @@ button.close {
 }
 .hidden {
   display: none !important;
-  visibility: hidden !important;
 }
 .affix {
   position: fixed;
index 14c47d663a99018657b8c9ecd9f58b6f9a06dc85..c9df18070625d0996156704da8d352f6ecbd6536 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * bootswatch v3.3.2
+ * bootswatch v3.3.4
  * Homepage: http://bootswatch.com
  * Copyright 2012-2015 Thomas Park
  * Licensed under MIT
@@ -363,6 +363,9 @@ hr {
   overflow: visible;
   clip: auto;
 }
+[role="button"] {
+  cursor: pointer;
+}
 h1,
 h2,
 h3,
@@ -1055,10 +1058,13 @@ output {
 .form-control[disabled],
 .form-control[readonly],
 fieldset[disabled] .form-control {
-  cursor: not-allowed;
   background-color: #eeeeee;
   opacity: 1;
 }
+.form-control[disabled],
+fieldset[disabled] .form-control {
+  cursor: not-allowed;
+}
 textarea.form-control {
   height: auto;
 }
@@ -1125,6 +1131,7 @@ input[type="search"] {
 }
 .radio-inline,
 .checkbox-inline {
+  position: relative;
   display: inline-block;
   padding-left: 20px;
   margin-bottom: 0;
@@ -1161,6 +1168,7 @@ fieldset[disabled] .checkbox label {
   padding-top: 9px;
   padding-bottom: 9px;
   margin-bottom: 0;
+  min-height: 38px;
 }
 .form-control-static.input-lg,
 .form-control-static.input-sm {
@@ -1202,6 +1210,7 @@ select[multiple].form-group-sm .form-control {
   padding: 5px 10px;
   font-size: 14px;
   line-height: 1.5;
+  min-height: 36px;
 }
 .input-lg {
   height: 57px;
@@ -1238,6 +1247,7 @@ select[multiple].form-group-lg .form-control {
   padding: 14px 16px;
   font-size: 20px;
   line-height: 1.3333333;
+  min-height: 42px;
 }
 .has-feedback {
   position: relative;
@@ -1673,11 +1683,9 @@ input[type="button"].btn-block {
 }
 .collapse {
   display: none;
-  visibility: hidden;
 }
 .collapse.in {
   display: block;
-  visibility: visible;
 }
 tr.collapse.in {
   display: table-row;
@@ -1932,7 +1940,7 @@ button.close {
   right: 0;
   bottom: 0;
   left: 0;
-  z-index: 1040;
+  z-index: 1050;
   -webkit-overflow-scrolling: touch;
   outline: 0;
 }
@@ -1973,10 +1981,12 @@ button.close {
   outline: 0;
 }
 .modal-backdrop {
-  position: absolute;
+  position: fixed;
   top: 0;
   right: 0;
+  bottom: 0;
   left: 0;
+  z-index: 1040;
   background-color: #000000;
 }
 .modal-backdrop.fade {
@@ -2104,7 +2114,6 @@ button.close {
 }
 .hidden {
   display: none !important;
-  visibility: hidden !important;
 }
 .affix {
   position: fixed;
index 7e9ac71bb499f8a900e4213d71e363cff1bc3ed2..f722ec2dbdc791b9a2d21331db4927b0c12f9a8b 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * bootswatch v3.3.2
+ * bootswatch v3.3.4
  * Homepage: http://bootswatch.com
  * Copyright 2012-2015 Thomas Park
  * Licensed under MIT
@@ -363,6 +363,9 @@ hr {
   overflow: visible;
   clip: auto;
 }
+[role="button"] {
+  cursor: pointer;
+}
 h1,
 h2,
 h3,
@@ -1055,10 +1058,13 @@ output {
 .form-control[disabled],
 .form-control[readonly],
 fieldset[disabled] .form-control {
-  cursor: not-allowed;
   background-color: #999999;
   opacity: 1;
 }
+.form-control[disabled],
+fieldset[disabled] .form-control {
+  cursor: not-allowed;
+}
 textarea.form-control {
   height: auto;
 }
@@ -1125,6 +1131,7 @@ input[type="search"] {
 }
 .radio-inline,
 .checkbox-inline {
+  position: relative;
   display: inline-block;
   padding-left: 20px;
   margin-bottom: 0;
@@ -1161,6 +1168,7 @@ fieldset[disabled] .checkbox label {
   padding-top: 9px;
   padding-bottom: 9px;
   margin-bottom: 0;
+  min-height: 34px;
 }
 .form-control-static.input-lg,
 .form-control-static.input-sm {
@@ -1202,6 +1210,7 @@ select[multiple].form-group-sm .form-control {
   padding: 5px 10px;
   font-size: 12px;
   line-height: 1.5;
+  min-height: 32px;
 }
 .input-lg {
   height: 54px;
@@ -1238,6 +1247,7 @@ select[multiple].form-group-lg .form-control {
   padding: 14px 16px;
   font-size: 18px;
   line-height: 1.3333333;
+  min-height: 38px;
 }
 .has-feedback {
   position: relative;
@@ -1673,11 +1683,9 @@ input[type="button"].btn-block {
 }
 .collapse {
   display: none;
-  visibility: hidden;
 }
 .collapse.in {
   display: block;
-  visibility: visible;
 }
 tr.collapse.in {
   display: table-row;
@@ -1932,7 +1940,7 @@ button.close {
   right: 0;
   bottom: 0;
   left: 0;
-  z-index: 1040;
+  z-index: 1050;
   -webkit-overflow-scrolling: touch;
   outline: 0;
 }
@@ -1973,10 +1981,12 @@ button.close {
   outline: 0;
 }
 .modal-backdrop {
-  position: absolute;
+  position: fixed;
   top: 0;
   right: 0;
+  bottom: 0;
   left: 0;
+  z-index: 1040;
   background-color: #000000;
 }
 .modal-backdrop.fade {
@@ -2104,7 +2114,6 @@ button.close {
 }
 .hidden {
   display: none !important;
-  visibility: hidden !important;
 }
 .affix {
   position: fixed;
index 7a3dc348b065037ae139a111b2494945a85eb747..9284acc1a8b1eae97cd01e579b894d3d4e647481 100644 (file)
@@ -71,7 +71,7 @@ sub problem { db->problem ($_{problem}) }
 sub job     { db->job     ($_{job})     }
 sub user    { db->user    ($_{user})    }
 
-sub redirect { [301, ['X-Forever' => 1, 'Location' => $_[0]], []] }
+sub redirect { [301, ['X-Forever' => 1, 'Cache-Control' => 'public, max-age=86400', 'Location' => $_[0]], []] }
 sub reply    { [200, ['Content-Type' => 'text/plain; charset=utf-8'], \@_] }
 sub response {
        my ($template, $title, $params, $maxage) = @_;
@@ -81,7 +81,7 @@ sub response {
        }
        $params->{time} = time;
        $params->{args} = {%_};
-       bless {template => $template, title => $title, params => $params, maxage => ($maxage // 1)}, __PACKAGE__.'::Response'
+       bless {template => $template, title => $title, params => $params, maxage => ($maxage // 3600)}, __PACKAGE__.'::Response'
 }
 
 sub forbid {
@@ -135,7 +135,7 @@ sub dispatch_request{
                sub (/ed/:contest) {
                        forbid !contest->is_finished;
                        my $pblist = db->problem_list(contest => $_{contest}, solution => 1);
-                       response ed => 'Editorial of ' . contest->name, {%$pblist, editorial => contest->editorial};
+                       response ed => 'Editorial of ' . contest->name, {%$pblist, editorial => contest->editorial}, contest->is_finished(time - 86400) ? 60 : ();
                },
 
                sub (/login) {
@@ -146,10 +146,10 @@ sub dispatch_request{
                sub (/ct/:contest/log/st) { redirect "/st/$_{contest}" },
 
                sub (/us/)                                        { response us => 'Users', {us => db->user_list} },
-               sub (/ct/  + ?:owner~)                            { response ct => 'Contests', db->contest_list(%_) },
+               sub (/ct/  + ?:owner~)                            { response ct => 'Contests', db->contest_list(%_), 300 },
                sub (/log/ + ?:contest~&:owner~&:page~&:problem~&:private~&:result~) {
                        forbid $_{private};
-                       response log => 'Job list', {%{db->job_list(%_)}, maybe contest => $_{contest},}
+                       response log => 'Job list', db->job_list(%_), 5
                },
                sub (/pb/  + ?:owner~&:contest~&:private~)                  {
                        forbid $_{private};
@@ -158,10 +158,10 @@ sub dispatch_request{
                },
 
                sub (/us/:user)    { response us_entry => user->name, db->user_entry($_{user}) },
-               sub (/ct/:contest) { response ct_entry => contest->name, db->contest_entry($_{contest}) },
+               sub (/ct/:contest) { response ct_entry => contest->name, db->contest_entry($_{contest}), 60 },
                sub (/log/:job)    {
                        forbid job->private;
-                       response log_entry => "Job  $_{job}", db->job_entry($_{job})
+                       response log_entry => "Job  $_{job}", db->job_entry($_{job}), 10
                },
                sub (/pb/:problem + ?contest~) {
                        my (undef, undef, $contest) = @_;
@@ -173,7 +173,7 @@ sub dispatch_request{
                                forbid !remote_user;
                                $privacy = 'private';
                        }
-                       response pb_entry => problem->name, {%{db->problem_entry($_{problem}, $_{contest}, remote_user && remote_user->id)}, maybe contest => $_{contest}};
+                       response pb_entry => problem->name, db->problem_entry($_{problem}, $_{contest}, remote_user && remote_user->id), $_{contest} ? 10 : ();
                },
                sub (/sol/:problem) {
                        forbid problem->private;
@@ -182,7 +182,7 @@ sub dispatch_request{
 
                sub (/) { redispatch_to '/index' },
                sub (/favicon.ico) { redirect '/static/favicon.ico' },
-               sub (/:article) { [200, ['Content-Type' => 'text/html; charset=utf-8', 'Cache-Control' => 'public, max-age=60', 'X-Forever' => 1], [render_article $_{article}, 'en']] }
+               sub (/:article) { [200, ['Content-Type' => 'text/html; charset=utf-8', 'Cache-Control' => 'public, max-age=3600', 'X-Forever' => 1], [render_article $_{article}, 'en']] }
        },
 
        sub (POST) {
index 59ee37734ab42b8d1918fd07a05f293b58b5c530..382641ed0227c69124352ecfcc577de2f504a9e9 100644 (file)
@@ -172,8 +172,8 @@ sub process_pb_entry {
                $tree->fid('nosubmit')->detach;
                $tree->look_down(name => 'problem')->attr(value => $args{id});
                my $contest = $tree->look_down(name => 'contest');
-               $contest->attr(value => $args{contest}) if $args{contest};
-               $contest->detach unless $args{contest}
+               $contest->attr(value => $args{args}{contest}) if $args{args}{contest};
+               $contest->detach unless $args{args}{contest}
        } else {
                $tree->fid('nosubmit')->find('a')->edit_href(sub{s/id/$args{id}/});
                $tree->fid('submit')->detach
@@ -237,7 +237,7 @@ sub process_log {
                my ($data, $tr) = @_;
                $tr->fclass('id')->namedlink($data->{id});
                $tr->fclass('problem')->namedlink($data->{problem}, $data->{problem_name});
-               $tr->fclass('problem')->find('a')->edit_href(sub{$_ .= "?contest=$args{contest}"}) if $args{contest};
+               $tr->fclass('problem')->find('a')->edit_href(sub{$_ .= "?contest=$args{args}{contest}"}) if $args{args}{contest};
                $tr->fclass('contest')->namedlink($data->{contest}, $data->{contest_name}) if $data->{contest};
                $tr->fclass('contest')->replace_content('None') unless $data->{contest};
                $tr->fclass('date')->replace_content(ftime $data->{date});
This page took 0.050937 seconds and 4 git commands to generate.