]> iEval git - gruntmaster-page.git/commitdiff
Merge branch 'master' into newmc
authorMarius Gavrilescu <marius@ieval.ro>
Mon, 2 Mar 2015 15:08:18 +0000 (17:08 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Mon, 2 Mar 2015 15:08:18 +0000 (17:08 +0200)
Conflicts:
js/90-themes.js
tmpl/skel.en

1  2 
app.psgi
js/90-themes.js
tmpl/skel.en

diff --combined app.psgi
index 728e144e4cf0b742cf7f22765925419d51f350e1,53721091fb1bf799c058206d811e4bfc12eaf186..be72e9b18b9bd2fa4dd7ea7317d41d84a44e035c
+++ b/app.psgi
@@@ -5,14 -5,11 +5,11 @@@ no if $] >= 5.017011, warnings => 'expe
  use Gruntmaster::Data;
  use Plack::App::Gruntmaster;
  use Plack::Builder;
- use Plack::Request;
  use Plack::Util;
- use Digest::SHA qw/sha256/;
  use Log::Log4perl;
- use Tie::Hash::Expire;
  
  use constant AUTH_TIMEOUT => 5 * 60;
 -use constant ACCESSLOG_FORMAT => 'combined';
 +use constant ACCESSLOG_FORMAT => '%{X-Forwarded-For}i %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i"';
  
  sub CONTENT_SECURITY_POLICY () {
        my $csp = <<CSP;
@@@ -20,10 -17,10 +17,10 @@@ default-src 'none
  connect-src 'self'
  form-action 'self'
  frame-ancestors 'none'
 -img-src 'self'
 +img-src 'self' https://static.mindcoding.ro https://www.google-analytics.com/collect
  referrer origin-when-cross-origin
- script-src https://static.mindcoding.ro/js.js https://www.google-analytics.com/analytics.js
- style-src https://static.mindcoding.ro/css/
 -script-src 'self'
 -style-src 'self'
++script-src https://static.mindcoding.ro/static/js.js https://www.google-analytics.com/analytics.js
++style-src https://static.mindcoding.ro/static/css/
  CSP
        chomp $csp;
        $csp =~ s/\n/; /gr;
  
  my $db;
  
- tie my %auth, 'Tie::Hash::Expire', {expire_seconds => AUTH_TIMEOUT};
- sub authenticate {
-       my ($user, $pass, $env) = @_;
-       my $key = sha256 "$user:$pass";
-       $env->{'gruntmaster.user'} = $user;
-       return 1 if exists $auth{$key};
-       return unless $db->user($user) && $db->user($user)->check_passphrase($pass);
-       $auth{key} = 1;
- }
  sub add_database {
        my $app = $_[0];
        sub {
@@@ -76,6 -62,9 +62,9 @@@ builder 
        enable 'Static', path => qr,^/static/,;
        enable 'Log4perl', category => 'plack';
        enable \&add_database;
-       enable_if { shift->{HTTP_AUTHORIZATION} } 'Auth::Basic', authenticator => \&authenticate, realm => 'Gruntmaster 6000';
+       enable '+Plack::App::Gruntmaster::Auth',
+         dbi_connect => [$ENV{GRUNTMASTER_DSN} // 'dbi:Pg:', '', ''],
+         realm       => 'Gruntmaster 6000',
+         mail_from   => $ENV{GRUNTMASTER_RESET_FROM};
        Plack::App::Gruntmaster->run_if_script
  }
diff --combined js/90-themes.js
index 3c5d5c57b5f82db72b7b5310ae10d8560dfaa164,1e6fdceb66d996c31291974f5d44412a4abce126..b7d73221bc1a255a63c1f6570a0e1fd9ecc0d045
@@@ -1,14 -1,8 +1,14 @@@
  (function(){
        'use strict';
        function set_style(name){
-               $('#stylesheet').attr("href", "https://static.mindcoding.ro/css/" + name + ".css");
 -              $('#stylesheet').attr("href", "/static/css/" + name + ".css");
++              $('#stylesheet').attr("href", "https://static.mindcoding.ro/static/css/" + name + ".css");
                localStorage.setItem("theme", name);
 +              $(document).ready(function() {
 +                      if(name == 'slate' || name == 'cyborg')
 +                              $('.logo').removeClass('logo-light');
 +                      else
 +                              $('.logo').addClass('logo-light');
 +              });
        }
  
        $( document ).ready(function() {
diff --combined tmpl/skel.en
index 17804ad0eff9098e9c8eb205c8e97008c476a84b,93e07b87142f8b68e5cea212865788296c2c3b67..1f7f60e8aa8e30ffefac3777b04873d0720bf43c
@@@ -3,20 -3,19 +3,20 @@@
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
- <link rel="stylesheet" href="https://static.mindcoding.ro/css/slate.css" id="stylesheet">
- <script src="https://static.mindcoding.ro/js.js" type="text/javascript" async defer></script>
 -<link rel="stylesheet" href="/static/css/cyborg.css" id="stylesheet">
 -<script src="/static/js.js" type="text/javascript" async defer></script>
++<link rel="stylesheet" href="https://static.mindcoding.ro/static/css/cyborg.css" id="stylesheet">
++<script src="https://static.mindcoding.ro/static/js.js" type="text/javascript" async defer></script>
  
  <body>
  <nav role="navigation">
  <div class="container-fluid">
  <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"><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>
@@@ -24,7 -23,6 +24,7 @@@
  </nav>
  
  <div class="container-fluid">
 +<div id="logo"></div>
  
  <h1 id="title">TITLE</h1>
  <div id="result"></div>
@@@ -32,7 -30,6 +32,7 @@@
  <div id="content">Content goes here</div>
  
  <div id="login" class="reqjs"><a href="/login">Log in</a></div>
 +<div id="webchat"><a href="http://webchat.oftc.net/?channels=%23mindcoding" target="_blank">Webchat</a></div>
  
  <div id="theme-selector" class="reqjs">
  Themes:
@@@ -57,34 -54,8 +57,34 @@@ Tracking <a href="#" id="tracker_userli
  </div>
  </div>
  
 +<div id="sponsors">
 +<h3>Official sponsors</h3>
 +<a class="logo logo-emag" href="http://www.fundatiaemag.ro/"></a>
 +<a class="logo logo-easyhost" href="http://ro.easyhost.com/"></a>
 +<a class="logo logo-takeofflabs" href="http://www.takeofflabs.com/"></a>
 +<a class="logo logo-bigstep" href="http://www.bigstep.com/"></a>
 +<a class="logo logo-yardi" href="https://www.facebook.com/YardiRomania"></a>
 +<a class="logo logo-bosch" href="http://www.bosch.com.ro/"></a>
 +<a class="logo logo-endava" href="http://www.endava.com/"></a>
 +</div>
 +
  <footer>
 -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="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="https://www.facebook.com/spyhce?fref=ts" class="logo logo-spyhce"></a>
 +<a href="https://www.facebook.com/telenav?fref=ts" class="logo logo-telenav"></a>
 +<h3>Media 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>
  </footer>
This page took 0.028627 seconds and 4 git commands to generate.