Browse Source

fix #851: Wrapped fallback categories list with noscript so they don't flash to users

Rafał Pitoń 8 years ago
parent
commit
643ce8a41b

+ 13 - 11
misago/templates/misago/threadslist/base.html

@@ -29,17 +29,19 @@
 
 
     {% block list-container %}
     {% block list-container %}
       {% if subcategories %}
       {% if subcategories %}
-        <section class="toolbar" itemscope itemtype="http://schema.org/SiteNavigationElement">
-          <ul class="list-inline subcategories-list">
-            {% for subcategory in subcategories %}
-              <li>
-                <a href="{{ subcategory.get_absolute_url }}{% if list_type != 'all' %}{{ list_type }}/{% endif %}" class="subcategory {% if subcategory.css_class %}subcategory-{{ subcategory.css_class }}{% endif %}">
-                  {{ subcategory.name }}
-                </a>
-              </li>
-            {% endfor %}
-          </ul>
-        </section>
+        <noscript>
+          <section class="toolbar" itemscope itemtype="http://schema.org/SiteNavigationElement">
+            <ul class="list-inline subcategories-list">
+              {% for subcategory in subcategories %}
+                <li>
+                  <a href="{{ subcategory.get_absolute_url }}{% if list_type != 'all' %}{{ list_type }}/{% endif %}" class="subcategory {% if subcategory.css_class %}subcategory-{{ subcategory.css_class }}{% endif %}">
+                    {{ subcategory.name }}
+                  </a>
+                </li>
+              {% endfor %}
+            </ul>
+          </section>
+        </noscript>
       {% endif %}
       {% endif %}
 
 
       <section>
       <section>

+ 4 - 4
misago/templates/misago/threadslist/category.html

@@ -81,11 +81,11 @@
 
 
 {% block list-container %}
 {% block list-container %}
   {% if category.description %}
   {% if category.description %}
-  <div class="category-description">
-    <div class="page-lead {{ category.description|escape|linebreaks|isdescriptionshort|iftrue:"lead" }}">
-      {{ category.description|escape|urlize|linebreaks|safe }}
+    <div class="category-description">
+      <div class="page-lead {{ category.description|escape|linebreaks|isdescriptionshort|iftrue:"lead" }}">
+        {{ category.description|escape|urlize|linebreaks|safe }}
+      </div>
     </div>
     </div>
-  </div>
   {% endif %}
   {% endif %}
 
 
   {{ block.super }}
   {{ block.super }}