projects
/
plack-app-gruntmaster.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
db82668
)
Remove X-Static support
author
Marius Gavrilescu
<marius@ieval.ro>
Thu, 6 Aug 2015 09:45:09 +0000
(12:45 +0300)
committer
Marius Gavrilescu
<marius@ieval.ro>
Thu, 6 Aug 2015 09:45:09 +0000
(12:45 +0300)
lib/Plack/App/Gruntmaster.pm
patch
|
blob
|
blame
|
history
lib/Plack/App/Gruntmaster/HTML.pm
patch
|
blob
|
blame
|
history
tmpl/pb_entry.en
patch
|
blob
|
blame
|
history
tmpl/skel.en
patch
|
blob
|
blame
|
history
diff --git
a/lib/Plack/App/Gruntmaster.pm
b/lib/Plack/App/Gruntmaster.pm
index 2ccbeb50d8e216211e656d9b0046a0e469ee5d84..4872da563fd8506f262c248cf21fa41a88c1a25f 100644
(file)
--- a/
lib/Plack/App/Gruntmaster.pm
+++ b/
lib/Plack/App/Gruntmaster.pm
@@
-98,11
+98,10
@@
sub dispatch_request{
response_filter {
my ($r) = @_;
return $r if ref $r ne 'Plack::App::Gruntmaster::Response';
response_filter {
my ($r) = @_;
return $r if ref $r ne 'Plack::App::Gruntmaster::Response';
- my $vary = 'X-Static';
- $vary .= ', Authorization' if $privacy eq 'private';
- my @hdrs = ('X-Forever' => 1, 'Cache-Control' => "$privacy, max-age=$r->{maxage}", Vary => $vary);
+ my @hdrs = ('X-Forever' => 1, 'Cache-Control' => "$privacy, max-age=$r->{maxage}");
+ push @hdrs, Vary => 'Authorization' if $privacy eq 'private';
return [200, ['Content-Type' => 'application/json; charset=utf-8', @hdrs], [encode_json $r->{params}]] if $format eq 'json';
return [200, ['Content-Type' => 'application/json; charset=utf-8', @hdrs], [encode_json $r->{params}]] if $format eq 'json';
- my $ret = render $r->{template}, 'en', title => $r->{title}, %{$r->{params}}
, maybe static => $env->{HTTP_X_STATIC}
;
+ my $ret = render $r->{template}, 'en', title => $r->{title}, %{$r->{params}};
[200, ['Content-Type' => 'text/html; charset=utf-8', @hdrs], [encode 'UTF-8', $ret]]
},
},
[200, ['Content-Type' => 'text/html; charset=utf-8', @hdrs], [encode 'UTF-8', $ret]]
},
},
@@
-167,7
+166,7
@@
sub dispatch_request{
sub (/) { redispatch_to '/index' },
sub (/favicon.ico) { redirect '/static/favicon.ico' },
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=3600', 'X-Forever' => 1
, Vary => 'X-Static'], [render_article $_{article}, 'en', maybe static => $env->{HTTP_X_STATIC}
]] }
+ 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) {
},
sub (POST) {
diff --git
a/lib/Plack/App/Gruntmaster/HTML.pm
b/lib/Plack/App/Gruntmaster/HTML.pm
index 3af06081a76ed1cde437a249885056e27842006f..f08b66be3faadb6dca1b64fa77105410e700cb2f 100644
(file)
--- a/
lib/Plack/App/Gruntmaster/HTML.pm
+++ b/
lib/Plack/App/Gruntmaster/HTML.pm
@@
-91,8
+91,6
@@
sub _render {
$tree->defmap(smap => \%args);
my $process = __PACKAGE__->can("process_$tmpl");
$process->($tree, %args) if $process;
$tree->defmap(smap => \%args);
my $process = __PACKAGE__->can("process_$tmpl");
$process->($tree, %args) if $process;
- $_->detach for $tree->look_down(static => $args{static} ? 'no' : 'yes');
- $_->attr('static', undef) for $tree->look_down(sub {$_[0]->attr('static')});
$_->attr('smap', undef) for $tree->look_down(sub {$_[0]->attr('smap')});
$tree->as_HTML(undef, undef, $optional_end_tags);
}
$_->attr('smap', undef) for $tree->look_down(sub {$_[0]->attr('smap')});
$tree->as_HTML(undef, undef, $optional_end_tags);
}
diff --git
a/tmpl/pb_entry.en
b/tmpl/pb_entry.en
index ec801c6254ff041ab5bae4001af231579ae4b4ef..8f42d1bb46e81b0bc2dd47505c07945ffc04c3e5 100644
(file)
--- a/
tmpl/pb_entry.en
+++ b/
tmpl/pb_entry.en
@@
-13,14
+13,14
@@
<a href="/log/?problem=problem_id" id="job_log">Job log</a><br>
<a href="/sol/problem_id" id="solution">Solution</a>
<a href="/log/?problem=problem_id" id="job_log">Job log</a><br>
<a href="/sol/problem_id" id="solution">Solution</a>
-<h1
static="no"
>Submit solution</h1>
+<h1>Submit solution</h1>
<div id="nosubmit">
The contest has finished.<br>
To submit solutions to this problem, please visit the problem <a href="/pb/id">outside the contest</a>.
</div>
<div id="nosubmit">
The contest has finished.<br>
To submit solutions to this problem, please visit the problem <a href="/pb/id">outside the contest</a>.
</div>
-<div id="submit"
static="no"
>
+<div id="submit">
<form id="submitform" action="/action/submit" method="POST" enctype="multipart/form-data" role="form">
<input type="hidden" name="problem" value="problem_id">
<input type="hidden" name="contest" value="contest_id">
<form id="submitform" action="/action/submit" method="POST" enctype="multipart/form-data" role="form">
<input type="hidden" name="problem" value="problem_id">
<input type="hidden" name="contest" value="contest_id">
diff --git
a/tmpl/skel.en
b/tmpl/skel.en
index d2d070fdf0fb01ca65ede8908e8f3d9d560b814c..3533f5642496810523322620a2f82e2666d18005 100644
(file)
--- a/
tmpl/skel.en
+++ b/
tmpl/skel.en
@@
-14,14
+14,13
@@
<li id="nav-ct"><a href="/ct/">Contests</a>
<li id="nav-log"><a href="/log/">Job log</a>
<li id="nav-us"><a href="/us/">Users</a>
<li id="nav-ct"><a href="/ct/">Contests</a>
<li id="nav-log"><a href="/log/">Job log</a>
<li id="nav-us"><a href="/us/">Users</a>
-<li id="nav-account"
static="no"
><a href="/account">Account</a>
+<li id="nav-account"><a href="/account">Account</a>
<li id="nav-contribute"><a href="/contribute">Contribute!</a>
</ul>
</nav>
<h1 id="title">TITLE</h1>
<li id="nav-contribute"><a href="/contribute">Contribute!</a>
</ul>
</nav>
<h1 id="title">TITLE</h1>
-<div id="static" class="alert alert-info" static="yes">This is a static version of Gruntmaster 6000.</div>
<div id="result"></div>
<div id="result"></div>
This page took
0.014442 seconds
and
4
git commands to generate.