From a2323b87ffd5cfbaff3f8ab190a4a30442d27b9e Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Sun, 23 Sep 2018 22:46:05 -0700 Subject: [PATCH 1/4] Navigation menus work without JavaScript Currently the JavaScript experience of the main header is broken. It doesn't need to be so let's fix that. --- openlibrary/templates/lib/nav_head.html | 2 +- static/css/components/header-bar.less | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/openlibrary/templates/lib/nav_head.html b/openlibrary/templates/lib/nav_head.html index f6ec584de8c..50cb7713bda 100644 --- a/openlibrary/templates/lib/nav_head.html +++ b/openlibrary/templates/lib/nav_head.html @@ -112,7 +112,7 @@ - diff --git a/openlibrary/templates/home/stats.html b/openlibrary/templates/home/stats.html index d5c7261ca76..b7a70e43a18 100644 --- a/openlibrary/templates/home/stats.html +++ b/openlibrary/templates/home/stats.html @@ -45,7 +45,7 @@

Around the Library

+ + + + + + + + + + $if query_param("_firebug") == "true": + + + $if any([path in request.canonical_url for path in ['/account/create', '/books/add', '/edit', '/books']]): + + + + + + diff --git a/openlibrary/templates/site/head.html b/openlibrary/templates/site/head.html index 8561b54ba70..5265fd58109 100644 --- a/openlibrary/templates/site/head.html +++ b/openlibrary/templates/site/head.html @@ -24,7 +24,18 @@ $ style = 'build/page-%s.css'%ctx.get('bodyid', 'user') - + + + $ styleJS = static_url('build/js-all.css'); + $if 'v2' not in page: + $# Load CSS via render blocking style tag + + $else: + $# Load CSS via JavaScript later to speed up first paint + $if "dev" in ctx.features: @@ -33,24 +44,18 @@ - $if 'v2' in page: - - - - $else: + $if 'v2' not in page: - - - - - - - + + + + + $if query_param("_firebug") == "true": diff --git a/openlibrary/templates/site/stats.html b/openlibrary/templates/site/stats.html index 89aef831fae..f846dcdd3b4 100644 --- a/openlibrary/templates/site/stats.html +++ b/openlibrary/templates/site/stats.html @@ -16,7 +16,7 @@

Details

$s.data