]> iEval git - gruntmaster-page.git/commitdiff
Merge branch 'master' into mindcoding
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 8 Feb 2014 18:14:59 +0000 (20:14 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 8 Feb 2014 18:14:59 +0000 (20:14 +0200)
21 files changed:
lib/Gruntmaster/Page/Base.pm
lib/Gruntmaster/Page/Ct.pm
lib/Gruntmaster/Page/Ct/Entry.pm
lib/Gruntmaster/Page/Log.pm
lib/Gruntmaster/Page/Log/Entry.pm
lib/Gruntmaster/Page/Pb.pm
lib/Gruntmaster/Page/Pb/Entry.pm
lib/Gruntmaster/Page/St.pm
lib/Gruntmaster/Page/Us.pm
lib/Gruntmaster/Page/Us/Entry.pm
tmpl/ct.en [new file with mode: 0644]
tmpl/ct_entry.en [new file with mode: 0644]
tmpl/footer.en [new file with mode: 0644]
tmpl/header.en [new file with mode: 0644]
tmpl/log.en [new file with mode: 0644]
tmpl/log_entry.en [new file with mode: 0644]
tmpl/pb.en [new file with mode: 0644]
tmpl/pb_entry.en [new file with mode: 0644]
tmpl/st.en [new file with mode: 0644]
tmpl/us.en [new file with mode: 0644]
tmpl/us_entry.en [new file with mode: 0644]

index ee8a3101768148125a468ce5bb71f55d5348ad4c..89f8478e6c62ce5cfa9c01cd7dd542ed0a66e911 100644 (file)
@@ -9,12 +9,34 @@ use HTML::Template::Compiled;
 
 ##################################################
 
+sub read_templates {
+       my $root = 'tmpl';
+       my $name = shift;
+
+       map { m/\.(.+)$/; $1 => scalar read_file $_ } <tmpl/$name.*>;
+}
+
+my %header_templates = read_templates 'header';
+my %footer_templates = read_templates 'footer';
+
+sub header{
+  my ($language, $title) = @_;
+  $header_templates{$language} =~ s/TITLE_GOES_HERE/$title/ger;
+}
+
+sub footer{
+  $footer_templates{$_[0]};
+}
+
+##################################################
+
 use POSIX ();
 use Gruntmaster::Data ();
 use List::Util ();
 use LWP::UserAgent;
 
 my $ua = LWP::UserAgent->new;
+my %templates;
 
 sub import {
        my $caller = caller;
@@ -25,8 +47,6 @@ sub import {
 
        no strict 'refs';
        *{"${caller}::strftime"} = \&POSIX::strftime;
-       *{"${caller}::NAME"} = sub () { $name };
-       *{"${caller}::TITLE"} = sub () { $title };
        *{"${caller}::debug"} = sub {
                local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1;
                $_[0]->{'psgix.logger'}->({qw/level debug message/ => $_[1]})
@@ -37,141 +57,19 @@ sub import {
                my $req = HTTP::Request->new(PURGE => "http://$ENV{PURGE_HOST}$_[0]");
                $ua->request($req)
        };
-}
-
-##################################################
 
-my %orig_header_templates = (
-  en => <<'HTML',
-<!DOCTYPE html>
-<title>TITLE_GOES_HERE | MindCoding</title>
-<meta charset="utf-8">
-<meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-<link rel="shortcut icon" href="/static/favicon.png">
-<link rel="stylesheet" href="/css/cosmo" id="stylesheet">
-<script src="/js" type="text/javascript"></script>
-
-<nav class="navbar navbar-default navbar-static-top" role="navigation">
-<div class="container-fluid">
-<div class="navbar-header">
-<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>
-<a class="navbar-brand" href="/"><div class="logo logo-sigla"></div></a>
-</div>
-
-<div class="collapse navbar-collapse">
-<ul class="nav navbar-nav">
-<li><a href="/pb/">Problems</a>
-<li><a href="/ct/">Contests</a>
-<li><a href="/account">Account</a>
-</ul>
-
-<ul class="nav navbar-nav navbar-right">
-<li><a class="dropdown-toggle" data-toggle="dropdown"> Theme <span class="caret"></span></a>
-
-<ul class="dropdown-menu" role="menu">
-<li><a href="#" id="theme_slate">Gunmetal gray</a>
-<li><a href="#" id="theme_cyborg">Black</a>
-<li><a href="#" id="theme_cerulean">White</a>
-<li><a href="#" id="theme_cosmo">Metro</a>
-</ul>
-
-<li><a href="/log/">Job log</a>
-</ul>
-</div>
-</div>
-</nav>
-
-<div class="container-fluid">
-
-<div class="logo logo-mindcoding center-block"></div>
-
-<h1 id="title">TITLE_GOES_HERE</h1>
-<div id="result"></div>
-
-<div id="content">
-HTML
-);
-
-my %orig_footer_templates = (
-  en => <<'HTML',
-
-</div>
-
-<div id="sponsors">
-<h3>Official sponsors</h3>
-<div class="logo logo-yardi"></div>
-</div>
-
-<footer>
-<div class="row">
-<div class="col-md-6 column text-center">
-<a class="logo logo-hermes" href="http://www.societatea-hermes.ro"></a>
-</div>
-
-<div class="col-md-6 column text-center">
-<a class="logo logo-facebook" href="http://www.facebook.com/mindcodingcluj"></a>
-</div>
-</div>
-
-<h3> Partners </h3>
-<a href="http://cs.ubbcluj.ro" class="logo logo-csf"></a>
-<a href="http://www.uniunea.ro" class="logo logo-usr"></a>
-<a href="http://www.coscj.ro" class="logo logo-cos"></a>
-<a href="http://www.cluj2015.ro/romana" class="logo logo-eyc"></a>
-<h3> Media Partners </h3>
-<a href="http://www.clujlife.com" class="logo logo-clujlife"></a>
-<a href="http://www.vinsieu.ro/eveniment/cluj/cluj-napoca/alte-evenimente/mindcoding/88970/e.html" class="logo logo-vinsieu"></a>
-<a href="http://www.welcome2cluj.com" class="logo logo-welcome2cluj"></a>
-</footer>
-</div>
-HTML
-);
-
-sub patch_templates {
-       my $root = 'tmpl';
-       return %{$_[0]} unless -d $root;
-       my ($templates, $name) = @_;
-       my %out = %$templates;
-       for (<$root/$name.*>) {
-               m/\.(.+)$/;
-               $out{$1} = read_file $_
+       if ($name) {
+               $templates{$caller} = { read_templates $name };
+               $templates{$caller}{$_}  = header ($_, $title) . $templates{$caller}{$_} for keys $templates{$caller};
+               $templates{$caller}{$_} .= footer  $_  for keys $templates{$caller};
        }
-
-       %out
-}
-
-my %header_templates = patch_templates \%orig_header_templates, 'header';
-my %footer_templates = patch_templates \%orig_footer_templates, 'footer';
-
-sub header{
-  my ($language, $title) = @_;
-  $header_templates{$language} =~ s/TITLE_GOES_HERE/$title/ger;
-}
-
-sub footer{
-  $footer_templates{$_[0]};
-}
-
-sub cook_templates {
-       my ($templates, $name, $title) = @_;
-
-       my %out = patch_templates $templates, $name;
-       $out{$_}  = header ($_, $title) . $out{$_} for keys %out;
-       $out{$_} .= footer  $_  for keys %out;
-
-       %out
 }
 
 ##################################################
 
-my %templates;
-
 sub generate{
        my ($self, $lang, @args) = @_;
 
-       $templates{$self} = { cook_templates $self->TEMPLATES, $self->NAME => $self->TITLE } unless exists $templates{$self};
-
        my $htc = HTML::Template::Compiled->new(scalarref => \$templates{$self}{$lang}, default_escape => 'HTML',);
        $self->_generate($htc, $lang, @args);
        my $out = $htc->output;
@@ -184,7 +82,7 @@ sub _generate {}
 sub max_age { 60 }
 
 sub variants {
-       [ map { [ $_, 1, 'text/html', undef, undef, $_, undef ]} keys $_[0]->TEMPLATES ]
+       [ map { [ $_, 1, 'text/html', undef, undef, $_, undef ]} keys $templates{$_[0]} ]
 }
 
 1
index ede25624f3dc5969c208fe3d01f8a5a8fa07a0f6..b62b9751fd82972dd8d6aee59c1962d24e1a82ae 100644 (file)
@@ -7,52 +7,6 @@ use Gruntmaster::Page::Base ct => 'Contests';
 our @ISA = qw/Gruntmaster::Page::Base/;
 our $VERSION = '0.001';
 
-use constant TEMPLATES => {
-       en => <<'HTML',
-<tmpl_if running>
-<h1>Running contests</h1>
-<table border class="table table-bordered table-striped">
-<thead>
-<tr><th>Name<th>Start date<th>End date<th>Owner
-<tbody>
-<tmpl_loop running><tr><td><a href="<tmpl_var id>"><tmpl_var name></a>
-<td><tmpl_var start>
-<td><tmpl_var end>
-<td><tmpl_var owner>
-</tmpl_loop>
-</table>
-</tmpl_if>
-
-<tmpl_if pending>
-<h1>Pending contests</h1>
-<table border class="table table-bordered table-striped">
-<thead>
-<tr><th>Name<th>Start date<th>End date<th>Owner
-<tbody>
-<tmpl_loop pending><tr><td><a href="<tmpl_var id>"><tmpl_var name></a>
-<td><tmpl_var start>
-<td><tmpl_var end>
-<td><tmpl_var owner>
-</tmpl_loop>
-</table>
-</tmpl_if>
-
-<tmpl_if finished>
-<h1>Finished contests</h1>
-<table border class="table table-bordered table-striped">
-<thead>
-<tr><th>Name<th>Start date<th>End date<th>Owner
-<tbody>
-<tmpl_loop finished><tr><td><a href="<tmpl_var id>"><tmpl_var name></a>
-<td><tmpl_var start>
-<td><tmpl_var end>
-<td><tmpl_var owner>
-</tmpl_loop>
-</table>
-</tmpl_if>
-HTML
-};
-
 sub _generate{
        my ($self, $htc, $lang, $env) = @_;
        debug $env => "language is '$lang'";
index 83e270548c11002479eddd89c6845585a15cef64..acc076ead75666d4be6147ce3850669e535fd152 100644 (file)
@@ -7,17 +7,6 @@ use Gruntmaster::Page::Base ct_entry => '<tmpl_var name>';
 our @ISA = qw/Gruntmaster::Page::Base/;
 our $VERSION = '0.001';
 
-use constant TEMPLATES => {
-       en => <<'HTML',
-Contest start time: <tmpl_var start><br>
-Contest end time: <tmpl_var end><p>
-
-<tmpl_if started><a href="<tmpl_var id>/pb/">Problems</a><br>
-<a href="<tmpl_var id>/log/">Job log</a><br>
-<a href="<tmpl_var id>/log/st">Standings</a></tmpl_if>
-HTML
-};
-
 sub _generate{
        my ($self, $htc, $lang, $env, $id) = @_;
        debug $env => "language is '$lang' and id is '$id'";
index 9192d9580b2b198d6eb30783917c124eaeabf216..68f45fdc3790bfe8ca045740d0782c1a36cd911a 100644 (file)
@@ -9,27 +9,6 @@ our $VERSION = '0.001';
 
 use constant PAGE_SIZE => 10;
 
-use constant TEMPLATES => {
-       en => <<'HTML',
-<table border class="table table-bordered table-striped">
-<thead>
-<tr><th>ID<th>Problem<th>Date<th>Size<th>User<th>Result
-<tbody>
-<tmpl_loop log><tr><td><a href="job/<tmpl_var id>"><tmpl_var id></a>
-<td><a href="../pb/<tmpl_var problem>"><tmpl_var name></a>
-<td><tmpl_var date>
-<td><a href="src/<tmpl_var id>.<tmpl_var extension>"<tmpl_if private> data-private</tmpl_if>><tmpl_var size></a>
-<td><tmpl_var user><td class="r<tmpl_var result>"><tmpl_var result_text>
-</tmpl_loop>
-</table>
-
-<ul class="pager">
-<tmpl_if prev><li class="previous"><a href="<tmpl_var prev>">Previous</a></tmpl_if>
-<tmpl_if next><li class="next"><a href="<tmpl_var next>">Next</a></tmpl_if>
-</ul>
-HTML
-};
-
 sub _generate{
        my ($self, $htc, $lang, $env, $ct, $page) = @_;
        debug $env => "language is '$lang', contest is '$ct' and page is '$page'";
index 66dad191b21d052d6ee2967aa4cdc1f3753c7d86..57591b5da3837d2bb3c8bfcd3e5fec057e9f051a 100644 (file)
@@ -7,22 +7,6 @@ use Gruntmaster::Page::Base log_entry => 'Job <tmpl_var id>';
 our @ISA = qw/Gruntmaster::Page::Base/;
 our $VERSION = '0.001';
 
-use constant TEMPLATES => {
-       en => <<'HTML',
-Compiler output:
-<pre><tmpl_var errors></pre>
-
-Results:
-<table border class="table table-border table-striped">
-<thead>
-<tr><th>Test number<th>Result<th>Time
-<tbody>
-<tmpl_loop tests><tr><td><tmpl_var id><td class="r<tmpl_var result>"><tmpl_var result_text><td><tmpl_var time>
-</tmpl_loop>
-</table>
-HTML
-};
-
 sub _generate{
        my ($self, $htc, $lang, $env, $ct, $id) = @_;
        debug $env => "language is '$lang', contest is '$ct' and id is '$id'";
index ffdde60697862c0b2db66533649082bb0d20ea7d..ba78869c5f763fbafcc40a1c187379117f37df1a 100644 (file)
@@ -7,37 +7,6 @@ use Gruntmaster::Page::Base pb => 'Problems';
 our @ISA = qw/Gruntmaster::Page::Base/;
 our $VERSION = '0.001';
 
-use constant TEMPLATES => {
-       en => <<'HTML',
-<tmpl_if levels>
-<h2>Beginner</h2>
-<div class="list-group">
-<tmpl_loop beginner><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
-</tmpl_loop></div>
-
-<h2>Easy</h2>
-<div class="list-group">
-<tmpl_loop easy><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
-</tmpl_loop></div>
-
-<h2>Medium</h2>
-<div class="list-group">
-<tmpl_loop medium><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
-</tmpl_loop></div>
-
-<h2>Hard</h2>
-<div class="list-group">
-<tmpl_loop hard><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
-</tmpl_loop></div>
-
-<tmpl_else>
-<div class="list-group">
-<tmpl_loop problems><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
-</tmpl_loop></div>
-</tmpl_if>
-HTML
-};
-
 sub _generate{
        my ($self, $htc, $lang, $env, $ct) = @_;
        debug $env => "language is '$lang' and contest is '$ct'";
index 771808b7b022a47d7a6a53af924294a20a191325..f178b5058232a6d049396352688c666405a517c0 100644 (file)
@@ -7,41 +7,6 @@ use Gruntmaster::Page::Base pb_entry => '<tmpl_var name>';
 our @ISA = qw/Gruntmaster::Page::Base/;
 our $VERSION = '0.001';
 
-use constant TEMPLATES => {
-       en => <<'HTML',
-<div class="row">
-<div class="col-md-9">
-<tmpl_var ESCAPE=0 statement>
-</div>
-
-<div class="col-md-3">
-<div id="sidebar"></div>
-
-<h3>Problem information</h3>
-<dl>
-<dt>Author</dt> <dd><tmpl_var author></dd>
-<dt>Owner</dt> <dd><tmpl_var owner></dd>
-</dl>
-
-<tmpl_if cansubmit>
-<h1>Submit solution</h1>
-<form action="<tmpl_var id>/submit" method="POST" enctype="multipart/form-data" role="form">
-<input type="hidden" name="problem" value="<tmpl_var id>">
-<tmpl_if_defined contest><input type="hidden" name="contest" value="<tmpl_var contest>"></tmpl_if_defined>
-
-<div class="form-group"><label for="prog">File:</label><input id="prog" name="prog" type="file"></div>
-<div class="form-group"><label for="source_code">Source code:</label> <textarea class="form-control" id="source_code" name="source_code"></textarea></div>
-<div class="form-group"><label for="prog_format">File format:</label><select id="prog_format" name="prog_format" class="form-control" required>
-<tmpl_loop formats><option value="<tmpl_var _>"><tmpl_var _></option>
-</tmpl_loop></select></div>
-
-<input type="submit" value="Submit job" class="btn btn-primary">
-</form>
-</tmpl_if>
-</div>
-HTML
-};
-
 use constant FORMATS => [qw/C CPP MONO JAVA PASCAL PERL PYTHON/];
 
 sub _generate{
index a812cfa0124b89bee6481e8a6b94cafed6cfd4e3..099c1936a6f6646c747fdd8a44ff0bb5530f3e81 100644 (file)
@@ -7,23 +7,6 @@ use Gruntmaster::Page::Base st => 'Standings';
 our @ISA = qw/Gruntmaster::Page::Base/;
 our $VERSION = '0.001';
 
-use constant TEMPLATES => {
-       en => <<'HTML',
-<table border class="table table-border table-striped">
-<thead>
-<tmpl_if problems><tr><th>Username<tmpl_loop problems><th><tmpl_var _></tmpl_loop><th>Total
-<tmpl_else><tr><th>Username<th>Score
-</tmpl_if>
-
-<tbody>
-<tmpl_loop st><tr><td><tmpl_var user>
-<tmpl_if problems><tmpl_loop scores><td><tmpl_var _>
-</tmpl_loop></tmpl_if><td><tmpl_var score>
-</tmpl_loop>
-</table>
-HTML
-};
-
 use constant LEVEL_VALUES => {
        beginner => 100,
        easy => 250,
index b4dcb3faf2858d982a49eecf2617ee686d732196..915ee50aa04e3fd01a8bc057ffd79f171e0cfdc2 100644 (file)
@@ -7,13 +7,6 @@ use Gruntmaster::Page::Base us => 'Users';
 our @ISA = qw/Gruntmaster::Page::Base/;
 our $VERSION = '0.001';
 
-use constant TEMPLATES => {
-       en => <<'HTML',
-<div class="list-group"><tmpl_loop users><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
-</tmpl_loop></ol>
-HTML
-};
-
 sub _generate{
        my ($self, $htc, $lang, $env) = @_;
        debug $env => "language is '$lang'";
index e375ab881f17db9ba28b21a7b1a396275106e4c5..628f9fa2a5d736f1713c9409ee8ae58fb7ef97b0 100644 (file)
@@ -7,15 +7,6 @@ use Gruntmaster::Page::Base us_entry => '<tmpl_var name>';
 our @ISA = qw/Gruntmaster::Page::Base/;
 our $VERSION = '0.001';
 
-use constant TEMPLATES => {
-       en => <<'HTML',
-<h1><tmpl_var name></h1>
-Town: <tmpl_var town><br>
-University: <tmpl_var university><br>
-Level: <tmpl_var level>
-HTML
-};
-
 sub _generate{
        my ($self, $htc, $lang, $env, $us) = @_;
        debug $env => "language is '$lang', user is '$us'";
diff --git a/tmpl/ct.en b/tmpl/ct.en
new file mode 100644 (file)
index 0000000..e18bc2a
--- /dev/null
@@ -0,0 +1,41 @@
+<tmpl_if running>
+<h1>Running contests</h1>
+<table border class="table table-bordered table-striped">
+<thead>
+<tr><th>Name<th>Start date<th>End date<th>Owner
+<tbody>
+<tmpl_loop running><tr><td><a href="<tmpl_var id>"><tmpl_var name></a>
+<td><tmpl_var start>
+<td><tmpl_var end>
+<td><tmpl_var owner>
+</tmpl_loop>
+</table>
+</tmpl_if>
+
+<tmpl_if pending>
+<h1>Pending contests</h1>
+<table border class="table table-bordered table-striped">
+<thead>
+<tr><th>Name<th>Start date<th>End date<th>Owner
+<tbody>
+<tmpl_loop pending><tr><td><a href="<tmpl_var id>"><tmpl_var name></a>
+<td><tmpl_var start>
+<td><tmpl_var end>
+<td><tmpl_var owner>
+</tmpl_loop>
+</table>
+</tmpl_if>
+
+<tmpl_if finished>
+<h1>Finished contests</h1>
+<table border class="table table-bordered table-striped">
+<thead>
+<tr><th>Name<th>Start date<th>End date<th>Owner
+<tbody>
+<tmpl_loop finished><tr><td><a href="<tmpl_var id>"><tmpl_var name></a>
+<td><tmpl_var start>
+<td><tmpl_var end>
+<td><tmpl_var owner>
+</tmpl_loop>
+</table>
+</tmpl_if>
diff --git a/tmpl/ct_entry.en b/tmpl/ct_entry.en
new file mode 100644 (file)
index 0000000..2919bb3
--- /dev/null
@@ -0,0 +1,6 @@
+Contest start time: <tmpl_var start><br>
+Contest end time: <tmpl_var end><p>
+
+<tmpl_if started><a href="<tmpl_var id>/pb/">Problems</a><br>
+<a href="<tmpl_var id>/log/">Job log</a><br>
+<a href="<tmpl_var id>/log/st">Standings</a></tmpl_if>
diff --git a/tmpl/footer.en b/tmpl/footer.en
new file mode 100644 (file)
index 0000000..c0f928d
--- /dev/null
@@ -0,0 +1,5 @@
+<footer>
+Dilmom: Why don't you call your product the Gruntmaster 6000?
+Dilbert: What kind of product do you see when you imagine a Gruntmaster 6000?
+Dilmom: Well, it's a stripped-down version of the Gruntmaster 9000, of course. But it's software-upgradeable.
+</footer>
diff --git a/tmpl/header.en b/tmpl/header.en
new file mode 100644 (file)
index 0000000..5ca7976
--- /dev/null
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>TITLE_GOES_HERE</title>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<link rel="stylesheet" href="/css/cyborg" id="stylesheet">
+<script src="/js" type="text/javascript"></script>
+
+<nav class="navbar navbar-default navbar-static-top" role="navigation">
+<div class="container-fluid">
+<div class="navbar-header">
+<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>
+<a class="navbar-brand" href="/">Gruntmaster 6000</a>
+</div>
+
+<div class="collapse navbar-collapse">
+<ul class="nav navbar-nav">
+<li><a href="/pb/">Problems</a>
+<li><a href="/ct/">Contests</a>
+<li><a href="/account">Account</a>
+</ul>
+
+<ul class="nav navbar-nav navbar-right">
+<li><a class="dropdown-toggle" data-toggle="dropdown"> Theme <span class="caret"></span></a>
+
+<ul class="dropdown-menu" role="menu">
+<li><a href="#" id="theme_slate">Gunmetal gray</a>
+<li><a href="#" id="theme_cyborg">Black</a>
+<li><a href="#" id="theme_cerulean">White</a>
+<li><a href="#" id="theme_cosmo">Metro</a>
+</ul>
+
+<li><a href="/log/">Job log</a>
+</ul>
+</div>
+</div>
+</nav>
+
+<div class="container-fluid">
+
+<h1 id="title">TITLE_GOES_HERE</h1>
+<div id="result"></div>
diff --git a/tmpl/log.en b/tmpl/log.en
new file mode 100644 (file)
index 0000000..2ef59af
--- /dev/null
@@ -0,0 +1,16 @@
+<table border class="table table-bordered table-striped">
+<thead>
+<tr><th>ID<th>Problem<th>Date<th>Size<th>User<th>Result
+<tbody>
+<tmpl_loop log><tr><td><a href="job/<tmpl_var id>"><tmpl_var id></a>
+<td><a href="../pb/<tmpl_var problem>"><tmpl_var name></a>
+<td><tmpl_var date>
+<td><a href="src/<tmpl_var id>.<tmpl_var extension>"<tmpl_if private> data-private</tmpl_if>><tmpl_var size></a>
+<td><tmpl_var user><td class="r<tmpl_var result>"><tmpl_var result_text>
+</tmpl_loop>
+</table>
+
+<ul class="pager">
+<tmpl_if prev><li class="previous"><a href="<tmpl_var prev>">Previous</a></tmpl_if>
+<tmpl_if next><li class="next"><a href="<tmpl_var next>">Next</a></tmpl_if>
+</ul>
diff --git a/tmpl/log_entry.en b/tmpl/log_entry.en
new file mode 100644 (file)
index 0000000..45cd405
--- /dev/null
@@ -0,0 +1,11 @@
+Compiler output:
+<pre><tmpl_var errors></pre>
+
+Results:
+<table border class="table table-border table-striped">
+<thead>
+<tr><th>Test number<th>Result<th>Time
+<tbody>
+<tmpl_loop tests><tr><td><tmpl_var id><td class="r<tmpl_var result>"><tmpl_var result_text><td><tmpl_var time>
+</tmpl_loop>
+</table>
diff --git a/tmpl/pb.en b/tmpl/pb.en
new file mode 100644 (file)
index 0000000..3a8194f
--- /dev/null
@@ -0,0 +1,26 @@
+<tmpl_if levels>
+<h2>Beginner</h2>
+<div class="list-group">
+<tmpl_loop beginner><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
+</tmpl_loop></div>
+
+<h2>Easy</h2>
+<div class="list-group">
+<tmpl_loop easy><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
+</tmpl_loop></div>
+
+<h2>Medium</h2>
+<div class="list-group">
+<tmpl_loop medium><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
+</tmpl_loop></div>
+
+<h2>Hard</h2>
+<div class="list-group">
+<tmpl_loop hard><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
+</tmpl_loop></div>
+
+<tmpl_else>
+<div class="list-group">
+<tmpl_loop problems><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
+</tmpl_loop></div>
+</tmpl_if>
diff --git a/tmpl/pb_entry.en b/tmpl/pb_entry.en
new file mode 100644 (file)
index 0000000..4933cb1
--- /dev/null
@@ -0,0 +1,27 @@
+<div class="row">
+<div class="col-md-9">
+<tmpl_var ESCAPE=0 statement>
+</div>
+
+<div class="col-md-3">
+<dl>
+<dt>Author</dt> <dd><tmpl_var author></dd>
+<dt>Owner</dt> <dd><tmpl_var owner></dd>
+</dl>
+
+<tmpl_if cansubmit>
+<h1>Submit solution</h1>
+<form action="<tmpl_var id>/submit" method="POST" enctype="multipart/form-data" role="form">
+<input type="hidden" name="problem" value="<tmpl_var id>">
+<tmpl_if_defined contest><input type="hidden" name="contest" value="<tmpl_var contest>"></tmpl_if_defined>
+
+<div class="form-group"><label for="prog">File:</label><input id="prog" name="prog" type="file"></div>
+<div class="form-group"><label for="source_code">Source code:</label> <textarea class="form-control" id="source_code" name="source_code"></textarea></div>
+<div class="form-group"><label for="prog_format">File format:</label><select id="prog_format" name="prog_format" class="form-control" required>
+<tmpl_loop formats><option value="<tmpl_var _>"><tmpl_var _></option>
+</tmpl_loop></select></div>
+
+<input type="submit" value="Submit job" class="btn btn-primary">
+</form>
+</tmpl_if>
+</div>
diff --git a/tmpl/st.en b/tmpl/st.en
new file mode 100644 (file)
index 0000000..1e4c8ec
--- /dev/null
@@ -0,0 +1,12 @@
+<table border class="table table-border table-striped">
+<thead>
+<tmpl_if problems><tr><th>Username<tmpl_loop problems><th><tmpl_var _></tmpl_loop><th>Total
+<tmpl_else><tr><th>Username<th>Score
+</tmpl_if>
+
+<tbody>
+<tmpl_loop st><tr><td><tmpl_var user>
+<tmpl_if problems><tmpl_loop scores><td><tmpl_var _>
+</tmpl_loop></tmpl_if><td><tmpl_var score>
+</tmpl_loop>
+</table>
diff --git a/tmpl/us.en b/tmpl/us.en
new file mode 100644 (file)
index 0000000..174bc80
--- /dev/null
@@ -0,0 +1,2 @@
+<div class="list-group"><tmpl_loop users><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
+</tmpl_loop></ol>
diff --git a/tmpl/us_entry.en b/tmpl/us_entry.en
new file mode 100644 (file)
index 0000000..b6c988d
--- /dev/null
@@ -0,0 +1,4 @@
+<h1><tmpl_var name></h1>
+Town: <tmpl_var town><br>
+University: <tmpl_var university><br>
+Level: <tmpl_var level>
This page took 0.054539 seconds and 4 git commands to generate.