-{% extends "base.html" %}\r
-<!-- question.html -->\r
-{% load node_tags %}\r
-{% load extra_tags %}\r
-{% load extra_filters %}\r
-{% load smart_if %}\r
-{% load humanize %}\r
-{% load i18n %}\r
-{% load cache %}\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
- <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/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
-\r
- <script type="text/javascript">\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
- $('#editor').TextAreaResizer();\r
- });\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
- <a href="{{ question.get_absolute_url }}">{{ question.headline }}</a>\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
- <tr>\r
- <td style="width:30px;vertical-align:top">\r
- <div class="vote-buttons">\r
- {% vote_buttons question request.user %}\r
- {% favorite_mark question request.user %} \r
- </div>\r
- </td>\r
- <td>\r
- <div id="item-right">\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
- {% post_controls question request.user %}\r
- </div>\r
- <div class="post-update-info-container">\r
- {% contributors_info question %}\r
- </div>\r
- {% comments question request.user %}\r
- </div>\r
- \r
- </td>\r
- </tr>\r
- </table>\r
- {% if question.marked %}\r
- <div class="question-status" style="margin-bottom:15px">\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
- <hr/>\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="{{ question.get_absolute_url }}?sort=oldest#sort-top"\r
- title="{% trans "oldest answers will be shown first" %}">{% trans "oldest answers" %}</a>\r
- <a id="latest" href="{{ question.get_absolute_url }}?sort=latest#sort-top"\r
- title="{% trans "newest answers will be shown first" %}">{% trans "newest answers" %}</a>\r
- <a id="votes" href="{{ question.get_absolute_url }}?sort=votes#sort-top" \r
- title="{% trans "most voted answers will be shown first" %}">{% trans "popular answers" %}</a> \r
- </div>\r
- </div>\r
- {% cnprog_paginator context %}\r
- \r
- {% for answer in answers %}\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
- <table style="width:100%;">\r
- <tr>\r
- <td style="width:30px;vertical-align:top">\r
- <div class="vote-buttons">\r
- {% vote_buttons answer request.user %}\r
- {% accept_button answer request.user %}\r
- </div>\r
- </td>\r
- <td>\r
- <div class="item-right">\r
- <div class="answer-body">\r
- {{ answer.html|safe }}\r
- </div>\r
- <div class="answer-controls post-controls">\r
- {% post_controls answer request.user %}\r
- </div>\r
- <div class="post-update-info-container">\r
- {% contributors_info answer %}\r
- </div>\r
- {% comments answer request.user %}\r
- </div>\r
- </td>\r
- </tr>\r
- </table>\r
- </div>\r
- {% endfor %}\r
- <div class="paginator-container-left">\r
- {% cnprog_paginator context %}\r
- </div>\r
- {% endif %}\r
- <form id="fmanswer" action="{% url answer question.id %}" method="post">\r
- <div style="clear:both">\r
- </div>\r
- \r
- {% if not question.closed %}\r
- <div style="padding:10px 0 0 0;">\r
- {% spaceless %}\r
- <div class="headNormal">\r
- {% if answers %}\r
- {% trans "Your answer" %}\r
- {% else %}\r
- {% trans "Be the first one to answer this question!" %}\r
- {% endif %}\r
- </div>\r
- {% endspaceless %}\r
- </div>\r
- {% if not request.user.is_authenticated %}\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
- {% trans "answer your own question only to give an answer" %}\r
- {% else %}\r
- {% trans "please only give an answer, no discussions" %}\r
- {% endifequal %}\r
- </p>\r
- {% endif %}\r
-\r
- <div id="description" class="" >\r
- <div id="wmd-button-bar" class="wmd-panel"></div>\r
- {{ answer.text }}\r
- <div class="preview-toggle">\r
- <table width="100%">\r
- <tr>\r
- <td>\r
- <span id="pre-collapse" \r
- title="{% trans "Toggle the real time Markdown editor preview" %}">\r
- {% trans "toggle preview" %}\r
- </span>\r
- </td>\r
- {% if settings.WIKI_ON %}\r
- <td style="text-align:right;">\r
- {{ answer.wiki }} \r
- <span style="font-weight:normal;cursor:help" \r
- title="{{answer.wiki.help_text}}">\r
- {{ answer.wiki.label_tag }} \r
- </span>\r
- </td>\r
- {% endif %}\r
- </tr>\r
- \r
- </table> \r
- </div>\r
- <div id="previewer" class="wmd-preview"></div>\r
- {{ answer.text.errors }}\r
- </div>\r
- <p><span class="form-error"></span></p>\r
- <input type="submit" \r
- {% if user.is_anonymous %}\r
- value="{% trans "Login/Signup to Post Your Answer" %}" \r
- {% else %}\r
- {% if user == question.author %}\r
- value="{% trans "Answer Your Own Question" %}" \r
- {% else %}\r
- value="{% trans "Answer the question" %}" \r
- {% endif %}\r
- {% endif %}\r
- class="submit" style="float:left"/>\r
- {% endif %}\r
- </form>\r
- </div>\r
-</div>\r
-{% endblock %}\r
-\r
-{% block sidebar %}\r
-<div class="boxC" id="subscription_box">\r
- {% include "subscription_status.html" %}\r
-</div>\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
- <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">×{{ tag.used_count|intcomma }}</span><br/>\r
- {% endfor %}\r
- </p>\r
- <p>\r
- {% trans "question asked" %}: <strong title="{{ question.added_at }}">{% diff_date question.added_at %}</strong>\r
- </p>\r
- <p> \r
- {% trans "question was seen" %}: <strong>{{ question.view_count|intcomma }} {% trans "times" %}</strong>\r
- </p>\r
- <p> \r
- {% trans "last updated" %}: <strong title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</strong>\r
- </p>\r
-</div>\r
-{% endcache %}\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.headline }}</a>\r
- </p>\r
- {% endfor %}\r
-\r
- </div>\r
-</div>\r
-\r
-{% endblock %}\r
-\r
-{% block endjs %}\r
-{% endblock %}\r
-<!-- end question.html -->\r
+{% extends "base.html" %}
+<!-- question.html -->
+{% load node_tags %}
+{% load extra_tags %}
+{% load extra_filters %}
+{% load general_sidebar_tags %}
+{% load smart_if %}
+{% load humanize %}
+{% load i18n %}
+{% load cache %}
+{% block metadescription %}{{ question.meta_description }}{% endblock %}
+{% block metakeywords %}{{question.tagname_meta_generator}}{% endblock %}
+{% block meta %}
+ <link rel="canonical" href="{{settings.APP_BASE_URL}}{{question.get_absolute_url}}" />
+ <link rel="alternate" type="application/rss+xml" title="RSS" href="{{ question.get_absolute_url }}?type=rss">
+{% endblock %}
+{% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %}
+{% block forejs %}
+ {% if not question.nis.closed %}
+ <script type='text/javascript' src='{% media "/media/js/osqa.question.js" %}'></script>
+ <script type='text/javascript' src='{% media "/media/js/jquery.caret.js" %}'></script>
+ <script type='text/javascript' src='{% media "/media/js/wmd/showdown.js" %}'></script>
+ <script type='text/javascript' src='{% media "/media/js/wmd/wmd.js" %}'></script>
+ <script type='text/javascript' src='{% media "/media/js/html_sanitizer.js" %}'></script>
+ <link rel="stylesheet" type="text/css" href="{% media "/media/js/wmd/wmd.css" %}" />
+
+ {% if embed_youtube_videos %}
+ <script type='text/javascript' src='{% media "/media/js/viewbox_min.js" %}'></script>
+ <script type='text/javascript' src='{% media "/media/js/youtube.js" %}'></script>
+ <link rel="stylesheet" type="text/css" href="{% media "/media/js/viewbox.css" %}" />
+ {% endif %}
+ {% endif %}
+
+ <script type="text/javascript">
+ $().ready(function(){
+ $("#nav_questions").attr('className',"on");
+ var answer_sort_tab = "{{ tab_id }}";
+
+ if (answer_sort_tab) {
+ $("#" + answer_sort_tab).attr('className',"on");
+ }
+
+ $('#editor').TextAreaResizer();
+
+ //toggle preview of editor
+ var display = true;
+ var txt = "[{% trans "hide preview" %}]";
+ $('#pre-collapse').text(txt);
+ $('#pre-collapse').bind('click', function(){
+ txt = display ? "[{% trans "show preview" %}]" : "[{% trans "hide preview" %}]";
+ display = !display;
+ $('#previewer').toggle();
+ $('#pre-collapse').text(txt);
+ });
+ });
+
+ function submitClicked(e, f) {
+ if(!(browserTester('chrome') || browserTester('safari'))) {
+ $("input.submit")[0].disabled=true;
+ }
+ window.removeEventListener('beforeunload', beforeUnload, true);
+ if (f) {
+ f.submit();
+ }
+ }
+
+ function beforeUnload(e) {
+
+ if($("textarea#editor")[0].value != "") {
+ return yourWorkWillBeLost(e);
+ }
+
+ var commentBoxes = $("textarea.commentBox");
+ for(var index = 0; index < commentBoxes.length; index++) {
+ if(commentBoxes[index].value != "") {
+ return yourWorkWillBeLost(e);
+ }
+ }
+ }
+ window.addEventListener('beforeunload', beforeUnload, true);
+ </script>
+ <noscript>
+ <style>
+ .comment.not_top_scorer {
+ display: block;
+ }
+ .comment-form-container {
+ display: block;
+ }
+ .div.comment-tools {
+ display: none;
+ }
+ </style>
+ </noscript>
+{% endblock %}
+
+{% block content %}
+<div class="headNormal">
+ <h1><a href="{{ question.get_absolute_url }}">{{ question.headline }}</a></h1>
+</div>
+<div id="main-body" class="">
+ <div id="askform">
+ <table style="width:100%;" id="question-table" {% post_classes question %}>
+ <tr>
+ <td style="width:30px;vertical-align:top">
+ <div class="vote-buttons">
+ {% vote_buttons question request.user %}
+ {% favorite_mark question request.user %}
+ </div>
+ </td>
+ <td>
+ <div id="item-right">
+ <div class="question-body">
+ {{ question.html|safe }}
+ </div>
+ <div id="question-tags" class="tags-container tags">
+ {% for tag in question.tagname_list %}
+ <a href="{% url "tag_questions" tag|urlencode %}" class="post-tag tag-link-{{ tag }}"
+ title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }}</a>
+ {% endfor %}
+ </div>
+ <div id="question-controls" class="post-controls">
+ {% post_controls question request.user %}
+ {% wiki_symbol request.user question %}
+ </div>
+ <div class="post-update-info-container">
+ {% contributors_info question %}
+ </div>
+ {% comments question request.user %}
+ </div>
+
+ </td>
+ </tr>
+ </table>
+ {% if question.nis.closed %}
+ <div class="question-status" style="margin-bottom:15px">
+ <h3>
+ {% blocktrans with question.nstate.closed.extra as close_reason %}The question has been closed for the following reason "{{ close_reason }}" by{% endblocktrans %}
+ <a href="{{ question.nstate.closed.by.get_profile_url }}">{{ question.nstate.closed.by.username }}</a>
+ {% diff_date question.nstate.closed.at %}
+ </h3>
+ </div>
+ {% endif %}
+ {% if answers %}
+ <hr/>
+ <div class="tabBar">
+ <a name="sort-top"></a>
+ <div class="headQuestions">
+ {% blocktrans count answers.paginator.count as counter %}One Answer:{% plural %}{{counter}} Answers:{% endblocktrans %}
+ </div>
+ {{ answers.paginator.sort_tabs }}
+ </div>
+ {{ answers.paginator.page_numbers }}
+
+ {% for answer in answers.paginator.page %}
+ <a name="{{ answer.id }}"></a>
+ <div id="answer-container-{{ answer.id }}" class="answer {% post_classes answer %}{% ifequal answer.id focused_answer_id %} focusedAnswer{% endifequal %}">
+ <table style="width:100%;">
+ <tr>
+ <td style="width:30px;vertical-align:top">
+ <div class="vote-buttons">
+ {% vote_buttons answer request.user %}
+ {% accept_button answer request.user %}
+ </div>
+ </td>
+ <td>
+ <div class="item-right">
+ <div class="answer-body">
+ {{ answer.html|safe }}
+ </div>
+ <div class="answer-controls post-controls">
+ {% post_controls answer request.user %}
+ {% wiki_symbol request.user answer %}
+ </div>
+ <div class="post-update-info-container">
+ {% contributors_info answer %}
+ </div>
+ {% comments answer request.user %}
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+ {% endfor %}
+ <div class="paginator-container-left">
+ {{ answers.paginator.page_numbers }}
+ </div>
+ {% endif %}
+ <form id="fmanswer" action="{% url "answer" question.id %}" method="post">
+ {% csrf_token %}
+ <div style="clear:both">
+ </div>
+
+ {% if not question.closed %}
+ <div style="padding:10px 0 0 0;">
+ {% spaceless %}
+ <div class="headNormal">
+ {% if answers %}
+ {% trans "Your answer" %}
+ {% else %}
+ {% trans "Be the first one to answer this question!" %}
+ {% endif %}
+ </div>
+ {% endspaceless %}
+ </div>
+ {% comment %}
+ {% if not request.user.is_authenticated %}
+ <div class="message">{% trans "You can answer anonymously and then login." %}</div>
+ {% else %}
+ <p class="message">
+ {% ifequal request.user question.author %}
+ {% trans "Answer your own question only to give an answer." %}
+ {% else %}
+ {% trans "Please only give an answer, no discussions." %}
+ {% endifequal %}
+ {% if not request.user.email_valid_and_can_answer %}
+ {% blocktrans %}Remember, your answer will not be published until you validate your email.{% endblocktrans %}
+ <a href="{% url "send_validation_email" %}">{% trans "Send me a validation link." %}</a>
+ {% endif %}
+ </p>
+ {% endif %}
+ {% endcomment %}
+
+ <div id="description" class="" >
+ <div id="wmd-button-bar" class="wmd-panel"></div>
+ {{ answer.text }}
+ <div class="preview-toggle">
+ <table width="100%">
+ <tr>
+ <td>
+ <span id="pre-collapse"
+ title="{% trans "Toggle the real time Markdown editor preview" %}">
+ {% trans "toggle preview" %}
+ </span>
+ </td>
+ <td style="text-align: right;" id="editor-metrics"></td>
+ {% if settings.WIKI_ON %}
+ <td style="text-align:right;">
+ {{ answer.wiki }}
+ <span style="font-weight:normal;cursor:help"
+ title="{{answer.wiki.help_text}}">
+ {{ answer.wiki.label_tag }}
+ </span>
+ </td>
+ {% endif %}
+ </tr>
+
+ </table>
+ </div>
+ {{ answer.text.errors }}
+ <div id="previewer" class="wmd-preview"></div>
+ </div>
+
+ {% if answer.recaptcha %}
+ <div class="question-captcha" style="float: left;">
+ {{ answer.recaptcha.errors }}
+ {{ answer.recaptcha }}
+ </div>
+ <div class="clear"></div>
+ {% endif %}
+
+ <p><span class="form-error"></span></p>
+ <input type="button"
+ {% if user.is_anonymous %}
+ value="{% trans "Login/Signup to Post Your Answer" %}"
+ {% else %}
+ {% if user == question.author %}
+ value="{% trans "Answer Your Own Question" %}"
+ {% else %}
+ value="{% trans "Answer the question" %}"
+ {% endif %}
+ {% endif %}
+ class="submit" style="float:left" onclick="submitClicked(event, this.form)"/>
+ {% endif %}
+ </form>
+ </div>
+</div>
+{% endblock %}
+
+{% block sidebar %}
+<div class="boxC" id="subscription_box">
+ {% include "subscription_status.html" %}
+</div>
+
+{% markdown_help %}
+
+{% sidebar_upper %}
+
+{% cache 60 questions_tags settings.APP_URL question.id %}
+<div class="boxC">
+ <p>
+ {% trans "Question tags" %}:
+ </p>
+ <p class="tags" >
+ {% for tag in question.tags.all %}
+ <a href="{% url "tag_questions" tag.name|urlencode %}"
+ class="tag-link-{{ tag.name }}"
+ title="{% trans "see questions tagged"%}'{{tag.name}}'{% trans "using tags" %}"
+ rel="tag">{{ tag.name }}</a> <span class="tag-number">×{{ tag.used_count|intcomma }}</span><br/>
+ {% endfor %}
+ </p>
+ <p>
+ {% trans "question asked" %}: <strong title="{{ question.added_at }}">{% diff_date question.added_at %}</strong>
+ </p>
+ <p>
+ {% trans "question was seen" %}: <strong>{{ question.view_count|intcomma }} {% trans "times" %}</strong>
+ </p>
+ <p>
+ {% trans "last updated" %}: <strong title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</strong>
+ </p>
+</div>
+{% endcache %}
+{% sidebar_lower %}
+<div class="boxC">
+ <h3 class="subtitle">{% trans "Related questions" %}</h3>
+ <div class="questions-related">
+
+ {% for question in similar_questions %}
+ <p>
+ <a href="{{ question.get_absolute_url }}">{{ question.headline }}</a>
+ </p>
+ {% endfor %}
+
+ </div>
+</div>
+
+{% endblock %}
+
+{% block endjs %}
+{% endblock %}
+<!-- end question.html -->