]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/templates/question.html
Some improvements in cache.
[osqa.git] / forum / skins / default / templates / question.html
index 7a265c6370f318be29cd4e1355458df72a262da5..466df6a4907242f0c6ccf04f83bf3b5125794f30 100644 (file)
@@ -3,11 +3,12 @@
 {% load node_tags %}\r
 {% load extra_tags %}\r
 {% load extra_filters %}\r
+{% load general_sidebar_tags %}\r
 {% load smart_if %}\r
 {% load humanize %}\r
 {% load i18n %}\r
 {% load cache %}\r
-{% block title %}{% spaceless %}{{ question.get_question_title }}{% endspaceless %}{% endblock %}\r
+{% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %}\r
 {% block forejs %}\r
         <meta name="description" content="{{question.summary}}" />\r
         <meta name="keywords" content="{{question.tagname_meta_generator}}" />\r
         {% endif %}\r
 \r
         <script type="text/javascript">\r
-        // define reputation needs for comments\r
-        var repNeededForComments = 50;\r
         $().ready(function(){\r
             $("#nav_questions").attr('className',"on");\r
             var answer_sort_tab = "{{ tab_id }}";\r
-            $("#" + answer_sort_tab).attr('className',"on");\r
+\r
+            if (answer_sort_tab) {\r
+                $("#" + answer_sort_tab).attr('className',"on");\r
+            }\r
 \r
             $('#editor').TextAreaResizer();\r
+            \r
+            //toggle preview of editor\r
+            var display = true;\r
+            var txt = "[{% trans "hide preview" %}]";\r
+            $('#pre-collapse').text(txt);\r
+            $('#pre-collapse').bind('click', function(){\r
+                txt = display ? "[{% trans "show preview" %}]" : "[{% trans "hide preview" %}]";\r
+                display = !display;\r
+                $('#previewer').toggle();\r
+                $('#pre-collapse').text(txt);\r
+            });\r
         });\r
         </script>\r
         <noscript>\r
@@ -46,7 +59,7 @@
         \r
 {% block content %}\r
 <div class="headNormal">\r
-    <a href="{{ question.get_absolute_url }}">{{ question.get_question_title }}</a>\r
+    <a href="{{ question.get_absolute_url }}">{{ question.headline }}</a>\r
 </div>\r
 <div id="main-body" class="">\r
     <div id="askform">\r
@@ -73,8 +86,7 @@
                                 {% post_controls question request.user %}\r
                             </div>\r
                             <div class="post-update-info-container">\r
-                                    {% post_contributor_info question "original_author" %}\r
-                                    {% post_contributor_info question "last_updater" %}\r
+                                    {% contributors_info question %}\r
                             </div>\r
                             {% comments question request.user %}\r
                         </div>\r
                     </td>\r
                 </tr>\r
             </table>\r
-            {% if question.closed %}\r
+            {% if question.marked %}\r
             <div class="question-status" style="margin-bottom:15px">\r
-            <h3>{% blocktrans with question.get_close_reason_display as close_reason %}The question has been closed for the following reason "{{ close_reason }}" by{% endblocktrans %} \r
-            <a href="{{ question.closed_by.get_profile_url }}">{{ question.closed_by.username }}</a> \r
-            {% blocktrans with question.closed_at as closed_at %}close date {{closed_at}}{% endblocktrans %}</h3>\r
+            <h3>\r
+                {% blocktrans with question.closed.extra as close_reason %}\r
+                    The question has been closed for the following reason "{{ close_reason }}" by\r
+                {% endblocktrans %}\r
+                <a href="{{ question.closed.by.get_profile_url }}">{{ question.closed.by.username }}</a>\r
+                 {% diff_date question.closed.at %}\r
+            </h3>\r
             </div>\r
             {% endif %}\r
             {% if answers %}\r
                                             {% post_controls answer request.user %}\r
                                         </div>\r
                                         <div class="post-update-info-container">\r
-                                                {% post_contributor_info answer "original_author" %}\r
-                                                {% post_contributor_info answer "last_updater" %}\r
+                                            {% contributors_info answer %}\r
                                         </div>\r
                                         {% comments answer request.user %}\r
                                     </div>\r
                         \r
                         </table>  \r
                     </div>\r
-                    <div id="previewer" class="wmd-preview"></div>\r
                     {{ answer.text.errors }}\r
+                    <div id="previewer" class="wmd-preview"></div>                    \r
                 </div>\r
                 <p><span class="form-error"></span></p>\r
                 <input type="submit" \r
 <div class="boxC" id="subscription_box">\r
     {% include "subscription_status.html" %}\r
 </div>\r
+{% sidebar_upper %}\r
 {% cache 60 questions_tags settings.APP_URL question.id %}\r
 <div class="boxC">\r
     <p>\r
                {% trans "Question tags" %}:\r
     </p>\r
     <p class="tags" >\r
-        {% for tag in tags %}\r
+        {% for tag in question.tags.all %}\r
                <a href="{% url tag_questions tag.name|urlencode %}" \r
                        title="{% trans "see questions tagged"%}'{{tag.name}}'{% trans "using tags" %}" \r
                        rel="tag">{{ tag.name }}</a> <span class="tag-number">&#215;{{ tag.used_count|intcomma }}</span><br/>\r
     </p>\r
 </div>\r
 {% endcache %}\r
+{% sidebar_lower %}\r
 <div class="boxC">\r
     <h3 class="subtitle">{% trans "Related questions" %}</h3>\r
     <div class="questions-related">\r
 \r
         {% for question in similar_questions %}\r
         <p>\r
-            <a href="{{ question.get_absolute_url }}">{{ question.get_question_title }}</a>\r
+            <a href="{{ question.get_absolute_url }}">{{ question.headline }}</a>\r
         </p>\r
         {% endfor %}\r
 \r