Kaynağa Gözat

Clicking on category in article opens categories page with the relevant section uncollapsed

Talha Mansoor 11 yıl önce
ebeveyn
işleme
6440cbfc7f
2 değiştirilmiş dosya ile 11 ekleme ve 1 silme
  1. 1 1
      templates/article.html
  2. 10 0
      templates/categories.html

+ 1 - 1
templates/article.html

@@ -40,7 +40,7 @@
                 {{ article.date.strftime(', %Y') }}    
                 </p>
                 <p>
-                Published by <a href="{{ SITEURL }}/{{ article.author.url }}">{{ article.author }}</a> in <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a> 
+                Published by <a href="{{ SITEURL }}/{{ article.author.url }}">{{ article.author }}</a> in <a href="{{ SITEURL }}/categories.html#collapse{{ category|replace(' ', '_')|e }}" "{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a> 
                 </p>
                 {% if article.modified %} 
                 <p>Updated on {{ article.modified }}

+ 10 - 0
templates/categories.html

@@ -5,6 +5,13 @@ All Categories - {{ super() }}
 {% endblock title %}
 
 {% block content %}
+<script  language="javascript" type="text/javascript">
+    function uncollapse() {
+            $(window.location.hash).collapse({
+                toggle: true
+            })
+    }
+</script>
 <div class="row-fluid">
     <header class="page_header span7 offset3">
     <h1>All Categories</h1>
@@ -44,4 +51,7 @@ All Categories - {{ super() }}
         </div>
     </div>
 </div>
+<script type="text/javascript" language="JavaScript">
+    uncollapse(); 
+</script>
 {% endblock content %}