]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/templates/question.html
Some more tweaks and fixes.
[osqa.git] / forum / skins / default / templates / question.html
index 23c24113b090fdc511f7e28f6578ce8c0a48b210..1173ce94726a36782af95cde7057fcc7e1d2d0c8 100644 (file)
@@ -1,46 +1,39 @@
 {% extends "base.html" %}\r
 <!-- question.html -->\r
 {% extends "base.html" %}\r
 <!-- question.html -->\r
+{% load node_tags %}\r
 {% load extra_tags %}\r
 {% load extra_filters %}\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 smart_if %}\r
 {% load humanize %}\r
 {% load i18n %}\r
-{% block title %}{% spaceless %}{{ question.get_question_title }}{% endspaceless %}{% endblock %}\r
-{% block forejs %}\r
-        <meta name="description" content="{{question.summary}}" />\r
-        <meta name="keywords" content="{{question.tagname_meta_generator}}" />\r
+{% load cache %}\r
+{% block metadescription %}{{ question.meta_description }}{% endblock %}\r
+{% block metakeywords %}{{question.tagname_meta_generator}}{% endblock %}\r
+{% block meta %}\r
         <link rel="canonical" href="{{settings.APP_URL}}{{question.get_absolute_url}}" />\r
         <link rel="canonical" href="{{settings.APP_URL}}{{question.get_absolute_url}}" />\r
-        {% if not question.closed %}\r
-        <script type='text/javascript' src='{% media  "/media/js/com.cnprog.editor.js" %}'></script>\r
+        <link rel="alternate" type="application/rss+xml" title="RSS" href="{{ question.get_absolute_url }}?type=rss">\r
+{% endblock %}\r
+{% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %}\r
+{% block forejs %}\r
+        {% if not question.nis.closed %}\r
         <script type='text/javascript' src='{% media  "/media/js/wmd/showdown.js" %}'></script>\r
         <script type='text/javascript' src='{% media  "/media/js/wmd/wmd.js" %}'></script>\r
         <link rel="stylesheet" type="text/css" href="{% media  "/media/js/wmd/wmd.css" %}" />\r
         {% endif %}\r
         <script type='text/javascript' src='{% media  "/media/js/wmd/showdown.js" %}'></script>\r
         <script type='text/javascript' src='{% media  "/media/js/wmd/wmd.js" %}'></script>\r
         <link rel="stylesheet" type="text/css" href="{% media  "/media/js/wmd/wmd.css" %}" />\r
         {% endif %}\r
-        <script type='text/javascript' src='{% media  "/media/js/com.cnprog.post.js" %}'></script>\r
-        <script type='text/javascript' src='{% media  "/media/js/jquery.validate.pack.js" %}'></script>\r
 \r
         <script type="text/javascript">\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
         $().ready(function(){\r
             $("#nav_questions").attr('className',"on");\r
             var answer_sort_tab = "{{ tab_id }}";\r
-            $("#" + answer_sort_tab).attr('className',"on");\r
-            \r
-            Vote.init({{ question.id }}, '{{ question.title|slugify }}', '{{ question.author.id }}','{{ request.user.id }}');\r
-            \r
-            {% if not question.closed and request.user.is_authenticated %}initEditor();{% endif %}\r
-            \r
-            lanai.highlightSyntax();\r
-            $('#btLogin').bind('click', function(){window.location.href='{% url auth_signin %}'; } )\r
-        });\r
-        \r
-        function initEditor(){\r
+\r
+            if (answer_sort_tab) {\r
+                $("#" + answer_sort_tab).attr('className',"on");\r
+            }\r
+\r
             $('#editor').TextAreaResizer();\r
             $('#editor').TextAreaResizer();\r
-            //highlight code synctax when editor has new text\r
-            $("#editor").typeWatch({highlight: false, wait: 3000,\r
-                             captureLength: 5, callback: lanai.highlightSyntax});\r
-                             \r
+\r
+            //toggle preview of editor\r
             var display = true;\r
             var txt = "[{% trans "hide preview" %}]";\r
             $('#pre-collapse').text(txt);\r
             var display = true;\r
             var txt = "[{% trans "hide preview" %}]";\r
             $('#pre-collapse').text(txt);\r
                 $('#previewer').toggle();\r
                 $('#pre-collapse').text(txt);\r
             });\r
                 $('#previewer').toggle();\r
                 $('#pre-collapse').text(txt);\r
             });\r
-            \r
-            setupFormValidation("#fmanswer", CPValidator.getQuestionFormRules(), CPValidator.getQuestionFormMessages());\r
+        });\r
+\r
+        function submitClicked(e, f) {\r
+            if(!(browserTester('chrome') || browserTester('safari'))) {\r
+                $("input.submit")[0].disabled=true;\r
+            }\r
+            window.removeEventListener('beforeunload', beforeUnload, true);\r
+            if (f) {\r
+                f.submit();\r
+            }\r
+        }\r
+\r
+        function beforeUnload(e) {\r
+\r
+            if($("textarea#editor")[0].value != "") {\r
+                return yourWorkWillBeLost(e);\r
+            }\r
+\r
+            var commentBoxes = $("textarea.commentBox");\r
+            for(var index = 0; index < commentBoxes.length; index++) {\r
+                if(commentBoxes[index].value != "") {\r
+                    return yourWorkWillBeLost(e);\r
+                }\r
+            }\r
         }\r
         }\r
-         \r
+        window.addEventListener('beforeunload', beforeUnload, true);\r
         </script>\r
         </script>\r
+        <noscript>\r
+            <style>\r
+                .comment.not_top_scorer {\r
+                    display: block;\r
+                }\r
+                .comment-form-container {\r
+                    display: block;\r
+                }\r
+                .div.comment-tools {\r
+                    display: none;\r
+                }\r
+            </style>\r
+        </noscript>\r
 {% endblock %}\r
         \r
 {% block content %}\r
 <div class="headNormal">\r
 {% endblock %}\r
         \r
 {% block content %}\r
 <div class="headNormal">\r
-    <a href="{{ question.get_absolute_url }}">{{ question.get_question_title }}</a>\r
+    <h1><a href="{{ question.get_absolute_url }}">{{ question.headline }}</a></h1>\r
 </div>\r
 <div id="main-body" class="">\r
     <div id="askform">\r
 </div>\r
 <div id="main-body" class="">\r
     <div id="askform">\r
-            <table style="width:100%;" id="question-table" {% if question.deleted %}class="deleted"{%endif%}>\r
+            <table style="width:100%;" id="question-table" {% post_classes question %}>\r
                 <tr>\r
                     <td style="width:30px;vertical-align:top">\r
                         <div class="vote-buttons">\r
                 <tr>\r
                     <td style="width:30px;vertical-align:top">\r
                         <div class="vote-buttons">\r
-                            {% if question_vote %}\r
-                            <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote" \r
-                                {% if question_vote.is_upvote %}\r
-                                    src="{% media  "/media/images/vote-arrow-up-on.png" %}" \r
-                                {% else %}\r
-                                    src="{% media  "/media/images/vote-arrow-up.png" %}" \r
-                                {% endif %}\r
-                                alt="{% trans "i like this post (click again to cancel)" %}"\r
-                                title="{% trans "i like this post (click again to cancel)" %}" />\r
-                            <div id="question-vote-number-{{ question.id }}" class="vote-number" \r
-                                title="{% trans "current number of votes" %}">\r
-                                {{ question.score }}\r
-                            </div>\r
-                            <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote" \r
-                                {% if question_vote.is_downvote %}\r
-                                    src="{% media  "/media/images/vote-arrow-down-on.png" %}" \r
-                                {% else %}\r
-                                    src="{% media  "/media/images/vote-arrow-down.png" %}" \r
-                                {% endif %}\r
-                                alt="{% trans "i dont like this post (click again to cancel)" %}"\r
-                                title="{% trans "i dont like this post (click again to cancel)" %}" />\r
-                           \r
-                            {% else %}\r
-                            <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote" \r
-                                alt="{% trans "i like this post (click again to cancel)" %}"\r
-                                src="{% media  "/media/images/vote-arrow-up.png" %}" \r
-                                title="{% trans "i like this post (click again to cancel)" %}" />\r
-                            <div id="question-vote-number-{{ question.id }}" class="vote-number" \r
-                                title="{% trans "current number of votes" %}">\r
-                                {{ question.score }}\r
-                            </div>\r
-                            <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote" \r
-                                src="{% media  "/media/images/vote-arrow-down.png" %}"\r
-                                alt="{% trans "i dont like this post (click again to cancel)" %}"\r
-                                title="{% trans "i dont like this post (click again to cancel)" %}" />\r
-                            {% endif %}\r
-                            {% if favorited %}\r
-                            <img class="question-img-favorite" src="{% media  "/media/images/vote-favorite-on.png" %}"\r
-                                alt="{% trans "mark this question as favorite (click again to cancel)" %}"\r
-                                title="{% trans "mark this question as favorite (click again to cancel)" %}" />\r
-                            <div id="favorite-number" class="favorite-number my-favorite-number">\r
-                                {{ question.favourite_count }}\r
-                            </div>\r
-                            {% else %}\r
-                            <img class="question-img-favorite" src="{% media  "/media/images/vote-favorite-off.png" %}"\r
-                                alt="{% trans "remove favorite mark from this question (click again to restore mark)" %}"\r
-                                title="{% trans "remove favorite mark from this question (click again to restore mark)" %}" />\r
-                            <div id="favorite-number" class="favorite-number">\r
-                               {% ifnotequal question.favourite_count 0 %}{{ question.favourite_count }}{% endifnotequal %}\r
-                            </div>\r
-                            {% endif %}\r
-                            \r
+                            {% vote_buttons question request.user %}\r
+                            {% favorite_mark question request.user %}                            \r
                         </div>\r
                     </td>\r
                     <td>\r
                         </div>\r
                     </td>\r
                     <td>\r
                             <div class="question-body">\r
                                 {{ question.html|safe }}\r
                             </div>\r
                             <div class="question-body">\r
                                 {{ question.html|safe }}\r
                             </div>\r
-                            <div id="question-controls" class="post-controls">\r
-                                <div id="question-tags" class="tags">\r
-                                    {% for tag in question.tagname_list %}\r
-                                        <a href="{% url tag_questions tag|urlencode %}" class="post-tag"\r
-                                            title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }}</a>\r
-                                    {% endfor %}\r
-                                </div>\r
-                                {% joinitems using '<span class="action-link-separator">|</span>' %}    \r
-                                    {% if request.user|can_edit_post:question %}\r
-                                    <span class="action-link"><a href="{% url edit_question question.id %}">{% trans 'edit' %}</a></span>\r
-                                    {% endif %}\r
-                                {% separator %}\r
-                                    {% if question.closed %}\r
-                                    {% if request.user|can_reopen_question:question %}\r
-                                    <span class="action-link"><a href="{% url reopen question.id %}">{% trans "reopen" %}</a></span>\r
-                                    {% endif %}\r
-                                    {% else %}\r
-                                    {% if request.user|can_close_question:question %}\r
-                                    <span class="action-link"><a href="{% url close question.id %}">{% trans "close" %}</a></span>\r
-                                    {% endif %}\r
-                                    {% endif %}\r
-                                {% separator %}\r
-                                    {% if request.user|can_flag_offensive %}\r
-                                    <span id="question-offensive-flag-{{ question.id }}" class="offensive-flag" \r
-                                        title="{% trans "report as offensive (i.e containing spam, advertising, malicious text, etc.)" %}">\r
-                                        <a>{% trans "flag offensive" %}</a>\r
-                                        {% if request.user|can_view_offensive_flags and question.offensive_flag_count %}\r
-                                        <span class="darkred">({{ question.offensive_flag_count }})</span>\r
-                                        {% endif %}\r
-                                    </span>\r
-                                    {% endif %}\r
-                                {% separator %}\r
-                                    {% if request.user|can_delete_post:question %}\r
-                                    <span class="action-link"><a id="question-delete-link-{{question.id}}">{% trans "delete" %}</a></span>\r
-                                    {% endif %}\r
-                                {% endjoinitems %}\r
-                            </div>\r
-                            <div class="post-update-info-container">\r
-                                {% post_contributor_info question "original_author" %}\r
-                                {% post_contributor_info question "last_updater" %}\r
+                            <div id="question-tags" class="tags-container tags">\r
+                                {% for tag in question.tagname_list %}\r
+                                    <a href="{% url tag_questions tag|urlencode %}" class="post-tag"\r
+                                        title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }}</a>\r
+                                {% endfor %}\r
                             </div>\r
                             </div>\r
-                            <div class="comments-container" id="comments-container-question-{{question.id}}">\r
-                            {% for comment in question.get_comments|slice:":5" %}\r
-                                <p class="comment" id="comment-{{comment.id}}">\r
-                                    {{comment.comment}} \r
-                                    - <a class="comment-user" href="{{comment.user.get_profile_url}}">{{comment.user}}</a>\r
-                                    {% spaceless %}\r
-                                    <span class="comment-age">({% diff_date comment.added_at %})</span>\r
-                                    {% if request.user|can_delete_comment:comment %}\r
-                                        <img class="delete-icon" \r
-                                            src="{% media  "/media/images/close-small.png" %}"\r
-                                            title="{% trans "delete this comment" %}"/>\r
-                                    {% endif %}\r
-                                    {% endspaceless %}\r
-                                </p>\r
-                            {% endfor %}\r
+                            <div id="question-controls" class="post-controls">                            \r
+                                {% post_controls question request.user %}\r
+                                {% wiki_symbol request.user question %}\r
                             </div>\r
                             </div>\r
-                            <div class="post-comments" style="margin-bottom:20px">\r
-                                <input id="can-post-comments-question-{{question.id}}" type="hidden" value="{{ request.user|can_add_comments:question }}"/>\r
-                                {% if request.user|can_add_comments:question or question.comment_count > 5 %}\r
-                                    <a id="comments-link-question-{{question.id}}" class="comments-link">\r
-                                    {% if request.user|can_add_comments:question %}\r
-                                        {% trans "add comment" %}\r
-                                    {% endif %}\r
-                                    {% if question.comment_count > 5 %}\r
-                                        {% if request.user|can_add_comments:question %}/\r
-                                            {% blocktrans count question.get_comments|slice:"5:"|length as counter %}\r
-                                            see <strong>one</strong> more \r
-                                            {% plural %}\r
-                                            see <strong>{{counter}}</strong> more\r
-                                            {% endblocktrans %}\r
-                                        {% else %}\r
-                                            {% blocktrans count question.get_comments|slice:"5:"|length as counter %}\r
-                                            see <strong>one</strong> more comment\r
-                                            {% plural %}\r
-                                            see <strong>{{counter}}</strong> more comments\r
-                                            {% endblocktrans %}\r
-                                        {% endif %}\r
-                                    {% endif %}</a>\r
-                                {% endif %}\r
+                            <div class="post-update-info-container">\r
+                                    {% contributors_info question %}\r
                             </div>\r
                             </div>\r
+                            {% comments question request.user %}\r
                         </div>\r
                         \r
                     </td>\r
                 </tr>\r
             </table>\r
                         </div>\r
                         \r
                     </td>\r
                 </tr>\r
             </table>\r
-            {% if question.closed %}\r
+            {% if question.nis.closed %}\r
             <div class="question-status" style="margin-bottom:15px">\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.nstate.closed.extra as close_reason %}The question has been closed for the following reason "{{ close_reason }}" by{% endblocktrans %}\r
+                <a href="{{ question.nstate.closed.by.get_profile_url }}">{{ question.nstate.closed.by.username }}</a>\r
+                 {% diff_date question.nstate.closed.at %}\r
+            </h3>\r
             </div>\r
             {% endif %}\r
             {% if answers %}\r
             </div>\r
             {% endif %}\r
             {% if answers %}\r
                 <div class="tabBar">\r
                     <a name="sort-top"></a>\r
                     <div class="headQuestions">\r
                 <div class="tabBar">\r
                     <a name="sort-top"></a>\r
                     <div class="headQuestions">\r
-                    {% blocktrans count answers|length as counter %}\r
-                    One Answer:\r
-                    {% plural %}\r
-                    {{counter}} Answers:\r
-                    {% endblocktrans %}\r
-                    </div>\r
-                    <div class="tabsA">\r
-                         <a id="oldest" href="{% url question question.id %}?sort=oldest#sort-top" \r
-                            title="{% trans "oldest answers will be shown first" %}">{% trans "oldest answers" %}</a>\r
-                        <a id="latest" href="{% url question question.id %}?sort=latest#sort-top" \r
-                            title="{% trans "newest answers will be shown first" %}">{% trans "newest answers" %}</a>\r
-                        <a id="votes" href="{% url question question.id %}?sort=votes#sort-top" \r
-                            title="{% trans "most voted answers will be shown first" %}">{% trans "popular answers" %}</a>   \r
+                    {% blocktrans count answers.paginator.count as counter %}One Answer:{% plural %}{{counter}} Answers:{% endblocktrans %}\r
                     </div>\r
                     </div>\r
+                    {{ answers.paginator.sort_tabs }}\r
                 </div>\r
                 </div>\r
-                {% cnprog_paginator context %}\r
+                {{ answers.paginator.page_numbers }}\r
   \r
   \r
-                {% for answer in answers %}\r
+                {% for answer in answers.paginator.page %}\r
                     <a name="{{ answer.id }}"></a>\r
                     <a name="{{ answer.id }}"></a>\r
-                    <div id="answer-container-{{ answer.id }}" class="answer {% if answer.accepted %}accepted-answer{% endif %} {% ifequal answer.author_id question.author_id %} answered-by-owner{% endifequal %} {% if answer.deleted %}deleted{% endif %}">\r
+                    <div id="answer-container-{{ answer.id }}" class="answer {% post_classes answer %}">\r
                         <table style="width:100%;">\r
                             <tr>\r
                                 <td style="width:30px;vertical-align:top">\r
                                     <div class="vote-buttons">\r
                         <table style="width:100%;">\r
                             <tr>\r
                                 <td style="width:30px;vertical-align:top">\r
                                     <div class="vote-buttons">\r
-                                        <img id="answer-img-upvote-{{ answer.id }}" class="answer-img-upvote" \r
-                                                src="{% blockmedia %}/media/images/vote-arrow-up{% get_user_vote_image user_answer_votes answer.id 1 %}.png{% endblockmedia %}" \r
-                                                alt="{% trans "i like this answer (click again to cancel)" %}"\r
-                                                title="{% trans "i like this answer (click again to cancel)" %}"/>\r
-                                        <div id="answer-vote-number-{{ answer.id }}" class="vote-number" title="{% trans "current number of votes" %}">\r
-                                            {{ answer.score }}\r
-                                        </div>\r
-                                        <img id="answer-img-downvote-{{ answer.id }}" class="answer-img-downvote" \r
-                                            src="{% blockmedia %}/media/images/vote-arrow-down{% get_user_vote_image user_answer_votes answer.id -1 %}.png{% endblockmedia %}" \r
-                                            alt="{% trans "i dont like this answer (click again to cancel)" %}"\r
-                                            title="{% trans "i dont like this answer (click again to cancel)" %}" />\r
-                                     \r
-                                        {% ifequal request.user question.author  %}\r
-                                        <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" \r
-                                            src="{% blockmedia %}/media/images/vote-accepted{% if answer.accepted %}-on{% endif %}.png{% endblockmedia %}" \r
-                                            alt="{% trans "mark this answer as favorite (click again to undo)" %}"\r
-                                            title="{% trans "mark this answer as favorite (click again to undo)" %}" />\r
-                                        {% else %}\r
-                                            {% if answer.accepted %}\r
-                                            <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" \r
-                                                src="{% blockmedia %}/media/images/vote-accepted{% if answer.accepted %}-on{% endif %}.png{% endblockmedia %}" \r
-                                                alt="{% trans "the author of the question has selected this answer as correct" %}"\r
-                                                title="{% trans "the author of the question has selected this answer as correct" %}" />\r
-                                            {% endif %}\r
-                                        {% endifequal %}\r
+                                        {% vote_buttons answer request.user %}\r
+                                        {% accept_button answer request.user %}\r
                                     </div>\r
                                 </td>\r
                                 <td>\r
                                     </div>\r
                                 </td>\r
                                 <td>\r
                                             {{ answer.html|safe }}\r
                                         </div>\r
                                         <div class="answer-controls post-controls">\r
                                             {{ answer.html|safe }}\r
                                         </div>\r
                                         <div class="answer-controls post-controls">\r
-                                            {% joinitems using '<span class="action-link-separator">|</span>' %}    \r
-                                                <span class="linksopt">\r
-                                                    <a href="#{{ answer.id }}" title="{% trans "answer permanent link" %}">\r
-                                                        {% trans "permanent link" %}\r
-                                                    </a>\r
-                                                </span>\r
-                                            {% separator %}\r
-                                                {% if request.user|can_edit_post:answer %}\r
-                                                <span class="action-link"><a href="{% url edit_answer answer.id %}">{% trans 'edit' %}</a></span>\r
-                                                {% endif %}\r
-                                            {% separator %}\r
-                                                {% if request.user|can_flag_offensive %}\r
-                                                <span id="answer-offensive-flag-{{ answer.id }}" class="offensive-flag" \r
-                                                    title="{% trans "report as offensive (i.e containing spam, advertising, malicious text, etc.)" %}">\r
-                                                    <a>{% trans "flag offensive" %}</a>\r
-                                                    {% if request.user|can_view_offensive_flags and answer.offensive_flag_count %}\r
-                                                    <span class="darkred">({{ answer.offensive_flag_count }})</span>\r
-                                                    {% endif %}\r
-                                                </span>\r
-                                                {% endif %}\r
-                                            {% separator %}\r
-                                                {% if request.user|can_delete_post:answer %}\r
-                                                    {% spaceless %}\r
-                                                    <span class="action-link">\r
-                                                        <a id="answer-delete-link-{{answer.id}}">\r
-                                                        {% if answer.deleted %}{% trans "undelete" %}{% else %}{% trans "delete" %}{% endif %}</a>\r
-                                                    </span>\r
-                                                    {% endspaceless %}\r
-                                                {% endif %}\r
-                                            {% endjoinitems %}\r
+                                            {% post_controls answer request.user %}\r
+                                            {% wiki_symbol request.user answer %}\r
                                         </div>\r
                                         <div class="post-update-info-container">\r
                                         </div>\r
                                         <div class="post-update-info-container">\r
-                                            {% post_contributor_info answer "original_author" %}\r
-                                            {% post_contributor_info answer "last_updater" %}\r
-                                        </div>\r
-                                        <div class="comments-container" id="comments-container-answer-{{answer.id}}">\r
-                                        {% for comment in answer.get_comments|slice:":5" %}\r
-                                            <p id="comment-{{comment.id}}" class="comment">\r
-                                                {{comment.comment}} \r
-                                                - <a class="comment-user" href="{{comment.user.get_profile_url}}">{{comment.user}}</a>\r
-                                                {% spaceless %}\r
-                                                <span class="comment-age">({% diff_date comment.added_at %})</span>\r
-                                                {% if request.user|can_delete_comment:comment %}\r
-                                                    <img class="delete-icon" \r
-                                                        src="{% media  "/media/images/close-small.png" %}"\r
-                                                        title="{% trans "delete this comment" %}"/>\r
-                                                {% endif %}\r
-                                                {% endspaceless %}\r
-                                            </p>\r
-                                        {% endfor %}\r
-                                        </div>\r
-                                        <div class="post-comments" style="margin-bottom:20px">\r
-                                            <input id="can-post-comments-answer-{{answer.id}}" type="hidden" value="{{ request.user|can_add_comments:answer}}"/>\r
-                                            {% if request.user|can_add_comments:answer or answer.comment_count > 5 %}\r
-                                                <a id="comments-link-answer-{{answer.id}}" class="comments-link">\r
-                                                {% if request.user|can_add_comments:answer %}\r
-                                                    {% trans "add comment" %}\r
-                                                {% endif %}\r
-                                                {% if answer.comment_count > 5 %}\r
-                                                    {% if request.user|can_add_comments:answer %}/\r
-                                                        {% blocktrans count answer.get_comments|slice:"5:"|length as counter %}\r
-                                                        see <strong>one</strong> more \r
-                                                        {% plural %}\r
-                                                        see <strong>{{counter}}</strong> more\r
-                                                        {% endblocktrans %}\r
-                                                    {% else %}\r
-                                                        {% blocktrans count answer.get_comments|slice:"5:"|length as counter %}\r
-                                                        see <strong>one</strong> more comment\r
-                                                        {% plural %}\r
-                                                        see <strong>{{counter}}</strong> more comments\r
-                                                        {% endblocktrans %}\r
-                                                    {% endif %}\r
-                                                {% endif %}</a>\r
-                                            {% endif %}\r
+                                            {% contributors_info answer %}\r
                                         </div>\r
                                         </div>\r
+                                        {% comments answer request.user %}\r
                                     </div>\r
                                     </div>\r
-                                    \r
                                 </td>\r
                             </tr>\r
                         </table>\r
                     </div>\r
                 {% endfor %}\r
                 <div class="paginator-container-left">\r
                                 </td>\r
                             </tr>\r
                         </table>\r
                     </div>\r
                 {% endfor %}\r
                 <div class="paginator-container-left">\r
-                    {% cnprog_paginator context %}\r
+                    {{ answers.paginator.page_numbers }}\r
                 </div>\r
             {% endif %}\r
         <form id="fmanswer" action="{% url answer question.id %}" method="post">\r
                 </div>\r
             {% endif %}\r
         <form id="fmanswer" action="{% url answer question.id %}" method="post">\r
-            {% if request.user.is_authenticated %}\r
-                <p style="padding-left:3px">\r
-                {{ answer.email_notify }} \r
-                <label for="question-subscribe-updates">\r
-                {% ifequal request.user.get_q_sel_email_feed_frequency 'n' %}\r
-                    {% trans "Notify me once a day when there are any new answers" %}\r
-                {% else %}\r
-                    {% ifequal request.user.get_q_sel_email_feed_frequency 'd' %}\r
-                        {% trans "Notify me once a day when there are any new answers" %}\r
-                    {% else %}\r
-                        {% ifequal request.user.get_q_sel_email_feed_frequency 'w' %}\r
-                            {% trans "Notify me weekly when there are any new answers" %}\r
-                        {% endifequal %}\r
-                    {% endifequal %}\r
-                {% endifequal %}\r
-                </label>\r
-                {% blocktrans with request.user.get_profile_url as profile_url %}\r
-                You can always adjust frequency of email updates from your {{profile_url}}\r
-                {% endblocktrans %}\r
-                </p>\r
-            {% else %}\r
-                <p style="padding-left:3px">\r
-                    <input class="nomargin" type="checkbox" disabled="disabled" />\r
-                    <label>{% trans "once you sign in you will be able to subscribe for any updates here" %}</label>\r
-                </p>\r
-            {% endif %}\r
             <div style="clear:both">\r
             </div>\r
             \r
             <div style="clear:both">\r
             </div>\r
             \r
                     </div>\r
                     {% endspaceless %}\r
                 </div>\r
                     </div>\r
                     {% endspaceless %}\r
                 </div>\r
+                {% comment %}\r
                 {% if not request.user.is_authenticated %}\r
                 {% if not request.user.is_authenticated %}\r
-                    <div class="message">{% trans "you can answer anonymously and then login" %}</div>\r
+                    <div class="message">{% trans "You can answer anonymously and then login." %}</div>\r
                 {% else %}\r
                     <p class="message">\r
                         {% ifequal request.user question.author  %}\r
                 {% else %}\r
                     <p class="message">\r
                         {% ifequal request.user question.author  %}\r
-                            {% trans "answer your own question only to give an answer" %}\r
+                            {% trans "Answer your own question only to give an answer." %}\r
                         {% else %}\r
                         {% else %}\r
-                            {% trans "please only give an answer, no discussions" %}\r
+                            {% trans "Please only give an answer, no discussions." %}\r
                         {% endifequal %}\r
                         {% endifequal %}\r
+                        {% if not request.user.email_valid_and_can_answer %}\r
+                            {% blocktrans %}Remember, your answer will not be published until you validate your email.{% endblocktrans %}\r
+                            <a href="{% url send_validation_email %}">{% trans "Send me a validation link." %}</a>\r
+                        {% endif %}\r
                     </p>\r
                 {% endif %}\r
                     </p>\r
                 {% endif %}\r
+                {% endcomment %}\r
 \r
                 <div id="description" class="" >\r
                     <div id="wmd-button-bar" class="wmd-panel"></div>\r
 \r
                 <div id="description" class="" >\r
                     <div id="wmd-button-bar" class="wmd-panel"></div>\r
                                             {% trans "toggle preview" %}\r
                                     </span>\r
                                 </td>\r
                                             {% trans "toggle preview" %}\r
                                     </span>\r
                                 </td>\r
+                                <td style="text-align: right;" id="editor-metrics"></td>\r
                                 {% if settings.WIKI_ON %}\r
                                 <td style="text-align:right;">\r
                                     {{ answer.wiki }} \r
                                 {% if settings.WIKI_ON %}\r
                                 <td style="text-align:right;">\r
                                     {{ answer.wiki }} \r
                         \r
                         </table>  \r
                     </div>\r
                         \r
                         </table>  \r
                     </div>\r
-                    <div id="previewer" class="wmd-preview"></div>\r
                     {{ answer.text.errors }}\r
                     {{ answer.text.errors }}\r
+                    <div id="previewer" class="wmd-preview"></div>                    \r
                 </div>\r
                 <p><span class="form-error"></span></p>\r
                 </div>\r
                 <p><span class="form-error"></span></p>\r
-                <input type="submit" \r
+                <input type="button"\r
                     {% if user.is_anonymous %}\r
                         value="{% trans "Login/Signup to Post Your Answer" %}" \r
                     {% else %}\r
                     {% if user.is_anonymous %}\r
                         value="{% trans "Login/Signup to Post Your Answer" %}" \r
                     {% else %}\r
                         value="{% trans "Answer the question" %}" \r
                         {% endif %}\r
                     {% endif %}\r
                         value="{% trans "Answer the question" %}" \r
                         {% endif %}\r
                     {% endif %}\r
-                    class="submit" style="float:left"/>\r
+                    class="submit" style="float:left" onclick="submitClicked(event, this.form)"/>\r
             {% endif %}\r
         </form>\r
     </div>\r
             {% endif %}\r
         </form>\r
     </div>\r
 {% endblock %}\r
 \r
 {% block sidebar %}\r
 {% endblock %}\r
 \r
 {% block sidebar %}\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
 <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
                <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
         {% trans "last updated" %}: <strong title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</strong>\r
     </p>\r
 </div>\r
         {% trans "last updated" %}: <strong title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</strong>\r
     </p>\r
 </div>\r
-\r
+{% endcache %}\r
+{% sidebar_lower %}\r
 <div class="boxC">\r
     <h3 class="subtitle">{% trans "Related questions" %}</h3>\r
     <div class="questions-related">\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
         {% 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
         </p>\r
         {% endfor %}\r
+\r
     </div>\r
 </div>\r
 \r
     </div>\r
 </div>\r
 \r