From 3f07a838ae438f5675f9794b483dd0993800d2c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 22 Apr 2020 21:40:27 +0200 Subject: [PATCH] misc: cleanup section name stuff --- panikweb/paniktags/templatetags/paniktags.py | 2 +- panikweb_templates/static/js/specifics.js | 12 ------------ panikweb_templates/templates/base.html | 6 +++--- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/panikweb/paniktags/templatetags/paniktags.py b/panikweb/paniktags/templatetags/paniktags.py index a8f9e7d..6a9958a 100644 --- a/panikweb/paniktags/templatetags/paniktags.py +++ b/panikweb/paniktags/templatetags/paniktags.py @@ -130,7 +130,7 @@ def player(context): } @register.inclusion_tag('includes/metaNav.html', takes_context=True) -def metanav(context, active=None): +def metanav(context): try: request_path = context['request'].path except KeyError: diff --git a/panikweb_templates/static/js/specifics.js b/panikweb_templates/static/js/specifics.js index 9e898a8..32a7f17 100644 --- a/panikweb_templates/static/js/specifics.js +++ b/panikweb_templates/static/js/specifics.js @@ -61,18 +61,6 @@ $(function() { var newTitle = html?html.match(/(.*?)<\/title>/):''; if(newTitle){document.title = newTitle[1].trim().decodeHTML();} - /* - Quite UGLY but needed for styling the whole body with ID - Feel free to correct and find a better way - According to this link the probles is that $(html).filter('body').Attr('id') will not work! - http://www.devnetwork.net/viewtopic.php?f=13&t=117065 - */ - if(sectionName = $(html).find('[data-section]').attr('data-section')){ - $('body').attr('id',sectionName); - }else{ - var bodyID = html.match(/<body id="(.*?)">/); - if(bodyID){$('body').attr('id',bodyID[1].trim());} - } $.scrollTo('#Changing',1000,{offset:-$('#metaNav').height()+2}); init(); diff --git a/panikweb_templates/templates/base.html b/panikweb_templates/templates/base.html index b20b7cd..97df707 100644 --- a/panikweb_templates/templates/base.html +++ b/panikweb_templates/templates/base.html @@ -45,9 +45,9 @@ {% block extrascripts %}{% endblock %} </head> -<body {% block bodyattr %}id="{{sectionName}}" class="section-{{sectionName}}"{% endblock %}> +<body {% block bodyattr %}{% endblock %}> <div id="All"> - {% block meta %}<div id="metaNav">{% metanav active=sectionName %}</div>{% endblock %} + {% block meta %}<div id="metaNav">{% metanav %}</div>{% endblock %} <div id="Commons" class="cf" > <div class="wrapper sided" > <div id="backgroundBox" class="cf"> @@ -60,7 +60,7 @@ </div> </div> </div> - <div id="Changing" class="cf" data-section="{{ sectionName }}"> + <div id="Changing" class="cf"> {% block toptitle %}{% endblock %} <div id="Nav" class="cf" > {% block nav %}{% endblock %} -- 2.39.2