From: Marius Gavrilescu Date: Mon, 2 Mar 2015 15:08:18 +0000 (+0200) Subject: Merge branch 'master' into newmc X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;ds=sidebyside;h=d2a977e374a40ff05a877e183f2d015ae0f1b877;hp=-c;p=gruntmaster-page.git Merge branch 'master' into newmc Conflicts: js/90-themes.js tmpl/skel.en --- d2a977e374a40ff05a877e183f2d015ae0f1b877 diff --combined app.psgi index 728e144,5372109..be72e9b --- a/app.psgi +++ 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 = < 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 3c5d5c5,1e6fdce..b7d7322 --- a/js/90-themes.js +++ b/js/90-themes.js @@@ -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 17804ad,93e07b8..1f7f60e --- a/tmpl/skel.en +++ b/tmpl/skel.en @@@ -3,20 -3,19 +3,20 @@@ - - - - ++ ++
+

TITLE

@@@ -32,7 -30,6 +32,7 @@@
Content goes here
+
Themes: @@@ -57,34 -54,8 +57,34 @@@ Tracking +

Official sponsors

+
+ + + + + + +
+