diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-06-20 23:29:28 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-06-20 23:29:28 -0400 |
commit | 5c98329e509268afe01107b3f9e2048c8fa66641 (patch) | |
tree | e40d5ee23ac6c01ea124b0ff8534fdace6a641fe | |
parent | bb290f37db5c93509cc336595be828343381d9cd (diff) | |
download | askbot-5c98329e509268afe01107b3f9e2048c8fa66641.tar.gz askbot-5c98329e509268afe01107b3f9e2048c8fa66641.tar.bz2 askbot-5c98329e509268afe01107b3f9e2048c8fa66641.zip |
added a little better caching to template questions.html
-rw-r--r-- | askbot/skins/default/templates/questions.html | 58 |
1 files changed, 23 insertions, 35 deletions
diff --git a/askbot/skins/default/templates/questions.html b/askbot/skins/default/templates/questions.html index dca26dc9..658dd335 100644 --- a/askbot/skins/default/templates/questions.html +++ b/askbot/skins/default/templates/questions.html @@ -26,28 +26,8 @@ <script type='text/javascript' src='{% media "/media/js/com.cnprog.tag_selector.js" %}'></script> {% endblock %} {% block content %} +{% cache 600 "scope_sort_tabs" search_tags scope sort query LANGUAGE_CODE context.page context.page_size %} <div class="tabBar"> - {% comment %} - <div class="headUsers"> - {% if searchtag %} - {% trans "Found by tags" %} - {% else %} - {% if searchtitle %} - {% if settings.USE_SPHINX_SEARCH %} - {% trans "Search results" %} - {% else %} - {% trans "Found by title" %} - {% endif %} - {% else %} - {% if is_unanswered %} - {% trans "Unanswered questions" %} - {% else %} - {% trans "All questions" %} - {% endif %} - {% endif %} - {% endif %} - </div><br/> - {% endcomment %} <div class="tabsC"> <span class="label">{% trans "In:" %}</span> <a id="all" class="off" href="?scope=all" title="{% trans "see all questions" %}">{% trans "all" %}</a> @@ -135,6 +115,7 @@ {% endif %} </div> </div> +{% endcache %} {% if questions_count > 0 %} <div style="clear:both"> <p class="search-result-summary"> @@ -187,7 +168,7 @@ {% endif %} <div id="listA"> {% get_current_language as LANGUAGE_CODE %} -{% cache 600 questions search_tags scope sort query LANGUAGE_CODE %} +{% cache 600 questions search_tags scope sort query LANGUAGE_CODE context.page context.page_size %} {% include "question_list.html" %} {% endcache %} {% comment %}todo: fix css here{% endcomment %} @@ -237,20 +218,22 @@ {% endblock %} {% block tail %} - {% if questions_count > 10 %}{%comment%}todo: remove magic number{%endcomment%} - <div class="pager">{% cnprog_paginator context %}</div> - <div class="pagesize">{% cnprog_pagesize context %}</div> - {% endif %} + {% if questions_count > 10 %}{%comment%}todo: remove magic number{%endcomment%} + <div class="pager">{% cnprog_paginator context %}</div> + <div class="pagesize">{% cnprog_pagesize context %}</div> + {% endif %} {% endblock %} {% block sidebar %} {% if contributors %} + {% cache 600 contributors search_tags scope sort query LANGUAGE_CODE context.page context.page_size %} <div class="boxC"> <h3 class="subtitle">{% trans "Contributors" %}</h3> {% for person in contributors %} {% gravatar person 48 %} {% endfor %} </div> + {% endcache %} {% endif %} {% if request.user.is_authenticated %} @@ -258,16 +241,21 @@ {% endif %} {% if tags %} - <div class="boxC"> - <h3 class="subtitle">{% trans "Related tags" %}</h3> - <div class="tags"> - {% for tag in tags %} - <a rel="tag" title="{% blocktrans with tag.name as tag_name %}see questions tagged '{{ tag_name }}'{% endblocktrans %}" href="{% url questions %}?tags={{tag.name|urlencode}}">{{ tag.name }}</a> - <span class="tag-number">× {{ tag.used_count|intcomma }}</span> - <br /> - {% endfor %} + {% cache 600 tags search_tags scope sort query LANGUAGE_CODE context.page context.page_size %} + <div class="boxC"> + <h3 class="subtitle">{% trans "Related tags" %}</h3> + <div class="tags"> + {% for tag in tags %} + <a + rel="tag" + title="{% blocktrans with tag.name as tag_name %}see questions tagged '{{ tag_name }}'{% endblocktrans %}" + href="{% url questions %}?tags={{tag.name|urlencode}}">{{ tag.name }}</a> + <span class="tag-number">× {{ tag.used_count|intcomma }}</span> + <br /> + {% endfor %} + </div> </div> - </div> + {% endcache %} {% endif %} {% endblock %} <!-- end questions.html --> |