]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/templates/questions.html
OSQA-809, Include question summaries in question and answers views, wrap that in...
[osqa.git] / forum / skins / default / templates / questions.html
index 4c3b96d22e4f4081a229f94a3ee23231ca8c06cc..f470ba3ef36fb58e5ed971a911ddb8d137660c04 100644 (file)
 {% extends "base.html" %}\r
 <!-- questions.html -->\r
-{% load extra_tags %}\r
+{% load question_list_tags %}\r
 {% load i18n %}\r
-{% load humanize %}\r
-{% load extra_filters %}\r
-{% load smart_if %}\r
-{% block title %}{% spaceless %}{% trans "Questions" %}{% endspaceless %}{% endblock %}\r
-{% block forejs %}\r
-       <script type="text/javascript">\r
-           var tags = {{ tags_autocomplete|safe }};\r
-           $().ready(function(){\r
-               var tab_id = "{{ tab_id }}";\r
-               $("#"+tab_id).attr('className',"on");\r
-               var on_tab = {% if is_unanswered %}'#nav_unanswered'{% else %}'#nav_questions'{% endif %};\r
-               $(on_tab).attr('className','on');\r
-               Hilite.exact = false;\r
-               Hilite.elementid = "listA";\r
-               Hilite.debug_referrer = location.href;\r
-           });\r
-       </script>\r
-       <script type='text/javascript' src='{% media  "/media/js/com.cnprog.editor.js" %}'></script>\r
-       <script type='text/javascript' src='{% media  "/media/js/com.cnprog.tag_selector.js" %}'></script>\r
+{% load extra_tags %}\r
+{% load general_sidebar_tags %}\r
+\r
+{% block title %}{% spaceless %}{{ page_title }}{% endspaceless %}{% endblock %}\r
+\r
+{% block metadescription %}{% spaceless %}\r
+    {% if tag %}\r
+        {% blocktrans with settings.APP_TITLE as app_title %}Questions and answers about {{ tag }} on {{ app_title }}{% endblocktrans %}\r
+    {% endif %}\r
+{% endspaceless %}{% endblock %}\r
+\r
+{% block meta %}\r
+    <link rel="alternate" type="application/rss+xml" title="RSS" href="{{ feed_url }}" />\r
 {% endblock %}\r
+\r
 {% block content %}\r
+\r
 <div class="tabBar">\r
-    <div class="headQuestions">\r
-        {% if searchtag %}\r
-            {% trans "Found by tags" %}\r
-        {% else %}\r
-            {% if searchtitle %}\r
-                {% if settings.USE_SPHINX_SEARCH %}\r
-                    {% trans "Search results" %}\r
-                {% else %}\r
-                    {% trans "Found by title" %}\r
-                {% endif %}\r
-            {% else %}\r
-                {% if is_unanswered %}\r
-                    {% trans "Unanswered questions" %}\r
-                {% else %}\r
-                    {% trans "All questions" %}\r
-                {% endif %}\r
-            {% endif %}\r
-        {% endif %}\r
-    </div>\r
-    <div class="tabsA">\r
-        <a id="latest" href="{% if is_search %}{{ search_uri }}&{% else %}?{% endif %}sort=latest" class="off" title="{% trans "most recently asked questions" %}">{% trans "newest" %}</a>\r
-        <a id="active" href="{% if is_search %}{{ search_uri }}&{% else %}?{% endif %}sort=active" class="off" title="{% trans "most recently updated questions" %}">{% trans "active" %}</a>\r
-        <a id="hottest" href="{% if is_search %}{{ search_uri }}&{% else %}?{% endif %}sort=hottest" class="off" title="{% trans "hottest questions" %}">{% trans "hottest" %}</a>\r
-        <a id="mostvoted" href="{% if is_search %}{{ search_uri }}&{% else %}?{% endif %}sort=mostvoted" class="off" title="{% trans "most voted questions" %}">{% trans "most voted" %}</a>    \r
-    </div>\r
+    {% include "question_list/title.html" %}\r
+    <a class="feed-icon" style="background-image:url('{% media "media/images/feed-icon-small.png" %}');" href="{{ feed_url }}" title="{% trans "subscribe to question RSS feed" %}"></a>\r
+    {{ questions.paginator.sort_tabs }}\r
 </div>\r
-<div id="listA">\r
-    {% for question in questions.object_list %}\r
-    <div class="qstA"\r
-        {% if request.user.is_authenticated %}\r
-            {% if question.interesting_score > 0 %}\r
-                    style="background:#ffff99;"\r
-            {% else %}\r
-                {% if not request.user.hide_ignored_questions %}\r
-                    {% if question.ignored_score > 0 %}\r
-                    style="background:#f3f3f3;"\r
-                    {% endif %}\r
-                {% endif %}\r
-            {% endif %}\r
-        {% endif %}\r
-    >\r
-        <h2>\r
-            <a href="{{ question.get_absolute_url }}">{{ question.get_question_title }}</a>\r
-        </h2>\r
-        <div class="stat">\r
-            <table>\r
-                <tr>\r
-                    <td><span class="num">{{ question.answer_count|intcomma }}</span> </td>\r
-                    <td><span class="num">{{ question.score|intcomma }}</span> </td>\r
-                    <td><span class="num">{{ question.view_count|cnprog_intword|safe }}</span> </td>\r
-                </tr>  \r
-                <tr>\r
-                    <td><span class="unit">{% trans "answers" %}</span></td>\r
-                    <td><span class="unit">{% trans "votes" %}</span></td>\r
-                    <td><span class="unit">{% trans "views" %}</span></td>\r
-                </tr> \r
-            </table>\r
-        </div>\r
-        \r
-        <div class="summary">\r
-            {{ question.summary }}...                \r
-        </div>\r
-        \r
-        {% ifequal tab_id 'active'%}\r
-        {% if question.wiki and settings.WIKI_ON %}\r
-        <span class="from wiki">{% trans "community wiki" %}</span>\r
-        <span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span>\r
-        {% else %}\r
-        <div class="from">\r
-            {% comment %}{% gravatar question.last_activity_by 24 %}{% endcomment %}\r
-            <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span>\r
-            <span class="score">{% get_score_badge question.last_activity_by %} </span>\r
-            <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span>\r
-        </div>\r
-        {% endif %}\r
-        {% else %}\r
-        {% if question.wiki and settings.WIKI_ON %}\r
-        <span class="from wiki">{% trans "community wiki" %}</span>\r
-        <span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span>\r
-        {% else %}\r
-        <div class="from">\r
-            {% comment %}{% gravatar question.author 24 %}{% endcomment %}\r
-            {% if question.last_activity_at != question.added_at %}\r
-                {% if question.author.id != question.last_activity_by.id %}\r
-                    {% trans "Posted:" %}\r
-                    <span class="author"><a href="{{ question.author.get_profile_url }}">{{ question.author }}</a></span>\r
-                    <span class="score">{% get_score_badge question.author %} </span>\r
-                    / {% trans "Updated:" %}\r
-                    <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span>\r
-                    <span class="score">{% get_score_badge question.last_activity_by %} </span>\r
-                    <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span>\r
-                {% else %}\r
-                    {% trans "Updated:" %}\r
-                    <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span>\r
-                    <span class="score">{% get_score_badge question.last_activity_by %} </span>\r
-                    <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span>\r
-                {% endif %}\r
-            {% else %}\r
-                {% trans "Posted:" %}\r
-                <span class="author"><a href="{{ question.author.get_profile_url }}">{{ question.author }}</a></span>\r
-                <span class="score">{% get_score_badge question.author %} </span>\r
-                <span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span>\r
-            {% endif %}\r
-        </div>\r
-        {% endif %}\r
-        {% endifequal %}\r
-        \r
-        <div class="tags">\r
-        {% for tag in question.tagname_list %}\r
-        <a href="{% url tag_questions tag|urlencode %}" title="{% trans "see questions tagged" %}'{{ tag }}'{% trans "using tags" %}" rel="tag">{{ tag }}</a>\r
-        {% endfor %}\r
-        </div>\r
-    </div>\r
-    {% endfor %}\r
-    {% if searchtitle %}\r
-        {% if questions_count == 0 %}\r
-        <p class="evenMore" style="padding-top:30px;text-align:center;">\r
-            {% trans "Did not find anything?" %}\r
-        {% else %}\r
-        <p class="evenMore" style="padding-left:9px">\r
-            {% trans "Did not find what you were looking for?" %} \r
-        {% endif %}\r
-        <a href="{% url ask %}">{% trans "Please, post your question!" %}</a>\r
-        </p>\r
+<div id="listA">{% for question in questions.paginator.page %}\r
+    {% if show_summary %}\r
+      {% question_list_item question question_summary=yes %}\r
+    {% else %}\r
+      {% question_list_item question %}\r
     {% endif %}\r
-</div>\r
+{% endfor %}</div>\r
 {% endblock %}\r
 \r
 {% block tail %}\r
-    <div class="pager">{% cnprog_paginator context %}</div>\r
-    <div class="pagesize">{% cnprog_pagesize context %}</div>\r
+    <div class="pager">{{ questions.paginator.page_numbers }}</div>\r
+    <div class="pagesize">{{ questions.paginator.page_sizes }}</div>\r
 {% endblock %}\r
 \r
 {% block sidebar %}\r
-<div class="boxC">\r
-               {% if searchtag %}\r
-            {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num and searchtag as tagname %}\r
-            have total {{q_num}} questions tagged {{tagname}}\r
-            {% plural %}\r
-            have total {{q_num}} questions tagged {{tagname}}\r
-            {% endblocktrans %}\r
-               {% else %}\r
-                       {% if searchtitle %}\r
-                {% if settings.USE_SPHINX_SEARCH %}\r
-                    {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num %}\r
-                    have total {{q_num}} questions containing {{searchtitle}} in full text\r
-                    {% plural %}\r
-                    have total {{q_num}} questions containing {{searchtitle}} in full text\r
-                    {% endblocktrans %}\r
-                {% else %}\r
-                    {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num %}\r
-                    have total {{q_num}} questions containing {{searchtitle}}\r
-                    {% plural %}\r
-                    have total {{q_num}} questions containing {{searchtitle}}\r
-                    {% endblocktrans %}\r
-                {% endif %}\r
-                       {% else %}\r
-                {% if is_unanswered %}\r
-                    {% blocktrans count questions as cnt with questions_count|intcomma as q_num %}\r
-                    have total {{q_num}} unanswered questions\r
-                    {% plural %}\r
-                    have total {{q_num}} unanswered questions\r
-                    {% endblocktrans %}\r
-                {% else %}\r
-                    {% blocktrans count questions as cnt with questions_count|intcomma as q_num %}\r
-                    have total {{q_num}} questions\r
-                    {% plural %}\r
-                    have total {{q_num}} questions\r
-                    {% endblocktrans %}\r
-                {% endif %}\r
-                       {% endif %}\r
-               {% endif %}\r
-        <p class="nomargin">\r
-        {% ifequal tab_id "latest" %}\r
-                       {% trans "latest questions info" %}\r
-        {% endifequal %}\r
-        \r
-        {% ifequal tab_id "active" %}\r
-            {% trans "Questions are sorted by the <strong>time of last update</strong>." %} \r
-                       {% trans "Most recently answered ones are shown first." %}\r
-        {% endifequal %}\r
-        \r
-        {% ifequal tab_id "hottest" %}\r
-                       {% trans "Questions sorted by <strong>number of responses</strong>." %}\r
-            {% trans "Most answered questions are shown first." %}\r
-        {% endifequal %}\r
-        \r
-        {% ifequal tab_id "mostvoted" %}\r
-                       {% trans "Questions are sorted by the <strong>number of votes</strong>." %}\r
-            {% trans "Most voted questions are shown first." %}\r
-        {% endifequal %}\r
-        </p>\r
-</div>\r
-{% if request.user.is_authenticated %} \r
-{% include "tag_selector.html" %}\r
-{% endif %}\r
-<div class="boxC">\r
-       <h3 class="subtitle">{% trans "Related tags" %}</h3>\r
-    <div class="tags">\r
-        {% for tag in tags %}\r
-            <a rel="tag" title="{% blocktrans with tag.name as tag_name %}see questions tagged '{{ tag_name }}'{% endblocktrans %}"  href="{% url tag_questions tag.name|urlencode %}">{{ tag.name }}</a>\r
-            <span class="tag-number">&#215; {{ tag.used_count|intcomma }}</span>\r
-            <br />\r
-        {% endfor %}\r
-    </div>\r
-</div>\r
+    {% include "question_list/count.html" %}\r
+    {% sidebar_upper %}\r
+    {% tag_selector %}\r
+    {% sidebar_lower %}\r
+    {% question_list_related_tags questions.paginator.page %}\r
 \r
 {% endblock %}\r
 <!-- end questions.html -->\r