Merge branch 'master' into newmc
authorMarius Gavrilescu <marius@ieval.ro>
Tue, 4 Aug 2015 20:43:46 +0000 (23:43 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Tue, 4 Aug 2015 20:43:46 +0000 (23:43 +0300)
1  2 
css/custom.css
css/mindcoding.css
lib/Plack/App/Gruntmaster/HTML.pm
tmpl/pb_entry.en
tmpl/skel.en

diff --combined css/custom.css
index 5f6a8e43696f45d658e99ddd2145348f353aea2e,f844fa92d796900ed89d16d15a0f2da264605fa6..f12650dbf340323357420689fae1ada1c8821db0
@@@ -1,3 -1,8 +1,8 @@@
+ body {
+       padding-left: 15px;
+       padding-right: 15px;
+ }
  h1#title{
        font-weight: bold;
        text-align: center;
@@@ -48,7 -53,7 +53,7 @@@ nav li 
        display: none !important;
  }
  
 -td.user, td.owner {
 +td.user, td.owner, .break-all {
        word-break: break-all;
  }
  
  .transition-color, .transition-color * {
        transition: color 0.5s ease-in, background-color 0.5s ease-in;
  }
+ @media (min-width:768px) {
+       #content {
+               float: left;
+               width: 75%;
+       }
+       #sidebar {
+               float: right;
+               width: 23%
+       }
+       footer {
+               clear: both;
+       }
+ }
diff --combined css/mindcoding.css
index 6965804e5572333fbdd373180c38d34510747c87,0000000000000000000000000000000000000000..70cd5f54247878d2605ca5877b8f54c47ddb2634
mode 100644,000000..100644
--- /dev/null
@@@ -1,11 -1,0 +1,23 @@@
 +footer {
 +      padding: 1.5em 0;
 +      width: auto;
 +      matgin: auto;
 +      white-space: inherit;
 +      color: inherit;
 +}
 +
 +#sponsors a.logo {
 +      margin-bottom: 1em;
 +}
++
++@media (min-width:768px) {
++      .left-half {
++              float: left;
++              width: 49%;
++      }
++
++      .right-half {
++              float: right;
++              width: 49%;
++      }
++}
index d4afb4c69a8703371200bd9f7b5ae7625995defa,59e0293df4399ab68f8c9877ef46c66c57c0ec1f..b23ddb970b0269edbb13aa3f0228403d30ce8db0
@@@ -64,7 -64,15 +64,15 @@@ sub render 
        my ($tmpl, $lang, %args) = @_;
        $lang //= 'en';
        my $meat = _render($tmpl, $lang, %args);
-       _render('skel', $lang, %args, meat => $meat)
+       my $html = _render('skel', $lang, %args, meat => $meat);
+       if ($tmpl eq 'pb_entry') { # Move sidebar to correct position
+               my $builder = HTML::TreeBuilder->new;
+               $builder->ignore_unknown(0);
+               my $tree = $builder->parse_content($html);
+               $tree->fid('content')->postinsert($tree->fid('sidebar'));
+               $html = $tree->as_HTML(undef, undef, $optional_end_tags)
+       }
+       $html
  }
  
  sub render_article {
@@@ -176,7 -184,10 +184,7 @@@ sub process_pb_entry 
        if ($args{contest_stop}) {
                $tree->fid('solution')->detach;
                $tree->fid('solution_modal')->detach;
 -              my $score = $tree->fid('score');
 -              $score->attr('data-start' => $args{open_time});
 -              $score->attr('data-stop'  => $args{contest_stop});
 -              $score->attr('data-value'  => $args{value});
 +              $tree->fid('score')->replace_content($args{value});
                $tree->fid('countdown')->attr('data-stop' => $args{contest_stop});
        } else {
                $tree->fid('job_log')->edit_href(sub{$_ .= "&private=$args{private}"}) if $args{private};
diff --combined tmpl/pb_entry.en
index 2dd499bc4a897b7ecf5fcd2e236b449df83c4a12,ec801c6254ff041ab5bae4001af231579ae4b4ef..ce2c100a2fcca4e37b04523f762a2f7679144c0b
@@@ -1,15 -1,12 +1,12 @@@
- <div class="row">
- <div class="col-md-9">
  <div id="statement"></div>
- </div>
  
- <div class="col-md-3" id="sidebar">
+ <aside id="sidebar">
  <dl>
  <dt>Author</dt> <dd id="author">author</dd>
  <dt>Owner</dt> <dd id="owner">owner</dd>
  <dt>Level</dt> <dd id="level">Easy</dd>
  <dt>Time limit (seconds)</dt> <dd smap="timeout">1</dd>
 -<dt class="rc reqjs">Score</dt> <dd id="score" class="timer reqjs rc" data-start="..." data-stop="..." data-value="100">50</dd>
 +<dt class="rc reqjs">Score</dt> <dd id="score" class="rc">50</dd>
  <dt class="rc reqjs">Contest ends in</dt> <dd id="countdown" class="timer reqjs rc" data-stop="...">01:30</dd>
  </dl>
  
@@@ -31,25 -28,24 +28,24 @@@ To submit solutions to this problem, pl
  <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>
 -<option value="C">C (gcc)</option>
 -<option value="CPP" selected>C++ (g++)</option>
 -<option value="GCCGO">Go (gccgo)</option>
 -<option value="GOLANG">Go (gc)</option>
 -<option value="GOLFSCRIPT">Golfscript (golfscript.rb)</option>
 -<option value="HASKELL">Haskell (ghc)</option>
 -<option value="JAVA">Java (javac)</option>
 -<option value="PASCAL">Pascal (fpc)</option>
 -<option value="PERL">Perl (perl)</option>
 -<option value="PYTHON">Python (python)</option>
 -<option value="RUBY">Ruby (ruby)</option>
 -<option value="SBCL">Common Lisp (sbcl)</option>
 +<option value="C">C11 (gcc 4.9.2)</option>
 +<option value="CPP" selected>C++11 (g++ 4.9.2)</option>
 +<option value="GCCGO">Go (gccgo 4.9.2)</option>
 +<option value="GOLANG">Go (gc 1.3.3)</option>
 +<!-- <option value="GOLFSCRIPT">Golfscript (golfscript.rb)</option> -->
 +<option value="HASKELL">Haskell (ghc 7.6.3)</option>
 +<option value="JAVA">Java (openjdk 7u75)</option>
 +<option value="PASCAL">Pascal (fpc 2.6.4)</option>
 +<option value="PERL">Perl (perl 5.20.2)</option>
 +<option value="PYTHON">Python (python 2.7.9)</option>
 +<option value="RUBY">Ruby (ruby 2.1.5)</option>
 +<option value="SBCL">Common Lisp (sbcl 1.2.4)</option>
  </select></div>
  
  <input type="submit" value="Submit job" class="btn btn-primary">
  </form>
  </div>
- </div>
- </div>
+ </aside>
  
  <div class="hidden backdrop"></div>
  <div id="solution_modal" class="hidden modal"></div>
diff --combined tmpl/skel.en
index 49d2bb82f165a2c94b4f7689259871e0e0fe7b82,d2d070fdf0fb01ca65ede8908e8f3d9d560b814c..f7ca6226f9320600d79528326c0c3627c097fe41
@@@ -1,51 -1,34 +1,48 @@@
  <!DOCTYPE html>
 +<html class="slate">
  <title smap="title">TITLE</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
 +<link href="/static/favicon.png" rel="shortcut icon">
  <link href="/static/css/all.css" rel="stylesheet" integrity="x">
  <script src="/static/js/all.js" type="text/javascript" async defer integrity="x"></script>
  
  <body>
- <div class="container-fluid">
  <nav role="navigation">
  <ul class="nav nav-pills nav-justified">
 -<li id="nav-home"><a href="/">Gruntmaster 6000</a>
 +<li id="nav-home"><a href="/">Home</a>
  <li id="nav-pb"><a href="/pb/">Problems</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-about"><a href="/about">About / Help</a>
  <li id="nav-contribute"><a href="/contribute">Contribute!</a>
  
  </ul>
  </nav>
  
 +<img id="logo" class="center-block" src="/static/logos/dark.svg#logo-mindcoding" width="600px" height="152px">
 +
  <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="static" class="alert alert-info" static="yes">This is a static version of MindCoding, useful when the <a class="alert-link" href="https://mindcoding.ro/">regular version</a> is overloaded.</div>
  
  <div id="result"></div>
  
  <main id="content">Content goes here</main>
  
 +<div id="webchat"><a href="http://webchat.oftc.net/?channels=%23mindcoding" target="_blank">Webchat</a></div>
 +
 +<div id="sponsors">
 +</div>
 +
  <footer>
- <div class="row">
- <div class="col-md-6 text-center">
 -Dilmom: Why don't you call your product the Gruntmaster 6000?<br>
 -Dilbert: What kind of product do you see when you imagine a Gruntmaster 6000?<br>
 -Dilmom: Well, it's a stripped-down version of the Gruntmaster 9000, of course. But it's software-upgradeable.
++<div class="left-half text-center">
 +<a href="http://www.societatea-hermes.ro"><img src="/static/logos/dark.svg#logo-hermes" alt="Societatea Hermes" width="164px" height="100px"></a>
 +</div>
 +
- <div class="col-md-6 text-center">
++<div class="right-half text-center">
 +<a href="http://www.facebook.com/mindcodingcluj"><img src="/static/logos/dark.svg#logo-facebook" alt="MindCoding Facebook page" width="100px" height="100px"></a>
 +</div>
- </div>
  </footer>
This page took 0.018853 seconds and 4 git commands to generate.