1 {% extends "base.html" %}
\r
2 <!-- question.html -->
\r
4 {% load extra_tags %}
\r
5 {% load extra_filters %}
\r
6 {% load general_sidebar_tags %}
\r
11 {% block metadescription %}{{ question.meta_description }}{% endblock %}
\r
12 {% block metakeywords %}{{question.tagname_meta_generator}}{% endblock %}
\r
14 <link rel="canonical" href="{{settings.APP_BASE_URL}}{{question.get_absolute_url}}" />
\r
15 <link rel="alternate" type="application/rss+xml" title="RSS" href="{{ question.get_absolute_url }}?type=rss">
\r
17 {% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %}
\r
19 {% if not question.nis.closed %}
\r
20 <script type='text/javascript' src='{% media "/media/js/osqa.question.js" %}'></script>
\r
21 <script type='text/javascript' src='{% media "/media/js/jquery.caret.js" %}'></script>
\r
22 <script type='text/javascript' src='{% media "/media/js/wmd/showdown.js" %}'></script>
\r
23 <script type='text/javascript' src='{% media "/media/js/wmd/wmd.js" %}'></script>
\r
24 <script type='text/javascript' src='{% media "/media/js/html_sanitizer.js" %}'></script>
\r
25 <link rel="stylesheet" type="text/css" href="{% media "/media/js/wmd/wmd.css" %}" />
\r
27 {% if embed_youtube_videos %}
\r
28 <script type='text/javascript' src='{% media "/media/js/viewbox_min.js" %}'></script>
\r
29 <script type='text/javascript' src='{% media "/media/js/youtube.js" %}'></script>
\r
30 <link rel="stylesheet" type="text/css" href="{% media "/media/js/viewbox.css" %}" />
\r
34 <script type="text/javascript">
\r
35 $().ready(function(){
\r
36 $("#nav_questions").attr('className',"on");
\r
37 var answer_sort_tab = "{{ tab_id }}";
\r
39 if (answer_sort_tab) {
\r
40 $("#" + answer_sort_tab).attr('className',"on");
\r
43 $('#editor').TextAreaResizer();
\r
45 //toggle preview of editor
\r
47 var txt = "[{% trans "hide preview" %}]";
\r
48 $('#pre-collapse').text(txt);
\r
49 $('#pre-collapse').bind('click', function(){
\r
50 txt = display ? "[{% trans "show preview" %}]" : "[{% trans "hide preview" %}]";
\r
52 $('#previewer').toggle();
\r
53 $('#pre-collapse').text(txt);
\r
57 function submitClicked(e, f) {
\r
58 if(!(browserTester('chrome') || browserTester('safari'))) {
\r
59 $("input.submit")[0].disabled=true;
\r
61 window.removeEventListener('beforeunload', beforeUnload, true);
\r
67 function beforeUnload(e) {
\r
69 if($("textarea#editor")[0].value != "") {
\r
70 return yourWorkWillBeLost(e);
\r
73 var commentBoxes = $("textarea.commentBox");
\r
74 for(var index = 0; index < commentBoxes.length; index++) {
\r
75 if(commentBoxes[index].value != "") {
\r
76 return yourWorkWillBeLost(e);
\r
80 window.addEventListener('beforeunload', beforeUnload, true);
\r
84 .comment.not_top_scorer {
\r
87 .comment-form-container {
\r
90 .div.comment-tools {
\r
98 <div class="headNormal">
\r
99 <h1><a href="{{ question.get_absolute_url }}">{{ question.headline }}</a></h1>
\r
101 <div id="main-body" class="">
\r
103 <table style="width:100%;" id="question-table" {% post_classes question %}>
\r
105 <td style="width:30px;vertical-align:top">
\r
106 <div class="vote-buttons">
\r
107 {% vote_buttons question request.user %}
\r
108 {% favorite_mark question request.user %}
\r
112 <div id="item-right">
\r
113 <div class="question-body">
\r
114 {{ question.html|safe }}
\r
116 <div id="question-tags" class="tags-container tags">
\r
117 {% for tag in question.tagname_list %}
\r
118 <a href="{% url tag_questions tag|urlencode %}" class="post-tag tag-link-{{ tag }}"
\r
119 title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }}</a>
\r
122 <div id="question-controls" class="post-controls">
\r
123 {% post_controls question request.user %}
\r
124 {% wiki_symbol request.user question %}
\r
126 <div class="post-update-info-container">
\r
127 {% contributors_info question %}
\r
129 {% comments question request.user %}
\r
135 {% if question.nis.closed %}
\r
136 <div class="question-status" style="margin-bottom:15px">
\r
138 {% blocktrans with question.nstate.closed.extra as close_reason %}The question has been closed for the following reason "{{ close_reason }}" by{% endblocktrans %}
\r
139 <a href="{{ question.nstate.closed.by.get_profile_url }}">{{ question.nstate.closed.by.username }}</a>
\r
140 {% diff_date question.nstate.closed.at %}
\r
146 <div class="tabBar">
\r
147 <a name="sort-top"></a>
\r
148 <div class="headQuestions">
\r
149 {% blocktrans count answers.paginator.count as counter %}One Answer:{% plural %}{{counter}} Answers:{% endblocktrans %}
\r
151 {{ answers.paginator.sort_tabs }}
\r
153 {{ answers.paginator.page_numbers }}
\r
155 {% for answer in answers.paginator.page %}
\r
156 <a name="{{ answer.id }}"></a>
\r
157 <div id="answer-container-{{ answer.id }}" class="answer {% post_classes answer %}{% ifequal answer.id focused_answer_id %} focusedAnswer{% endifequal %}">
\r
158 <table style="width:100%;">
\r
160 <td style="width:30px;vertical-align:top">
\r
161 <div class="vote-buttons">
\r
162 {% vote_buttons answer request.user %}
\r
163 {% accept_button answer request.user %}
\r
167 <div class="item-right">
\r
168 <div class="answer-body">
\r
169 {{ answer.html|safe }}
\r
171 <div class="answer-controls post-controls">
\r
172 {% post_controls answer request.user %}
\r
173 {% wiki_symbol request.user answer %}
\r
175 <div class="post-update-info-container">
\r
176 {% contributors_info answer %}
\r
178 {% comments answer request.user %}
\r
185 <div class="paginator-container-left">
\r
186 {{ answers.paginator.page_numbers }}
\r
189 <form id="fmanswer" action="{% url answer question.id %}" method="post">
\r
191 <div style="clear:both">
\r
194 {% if not question.closed %}
\r
195 <div style="padding:10px 0 0 0;">
\r
197 <div class="headNormal">
\r
199 {% trans "Your answer" %}
\r
201 {% trans "Be the first one to answer this question!" %}
\r
207 {% if not request.user.is_authenticated %}
\r
208 <div class="message">{% trans "You can answer anonymously and then login." %}</div>
\r
210 <p class="message">
\r
211 {% ifequal request.user question.author %}
\r
212 {% trans "Answer your own question only to give an answer." %}
\r
214 {% trans "Please only give an answer, no discussions." %}
\r
216 {% if not request.user.email_valid_and_can_answer %}
\r
217 {% blocktrans %}Remember, your answer will not be published until you validate your email.{% endblocktrans %}
\r
218 <a href="{% url send_validation_email %}">{% trans "Send me a validation link." %}</a>
\r
224 <div id="description" class="" >
\r
225 <div id="wmd-button-bar" class="wmd-panel"></div>
\r
227 <div class="preview-toggle">
\r
228 <table width="100%">
\r
231 <span id="pre-collapse"
\r
232 title="{% trans "Toggle the real time Markdown editor preview" %}">
\r
233 {% trans "toggle preview" %}
\r
236 <td style="text-align: right;" id="editor-metrics"></td>
\r
237 {% if settings.WIKI_ON %}
\r
238 <td style="text-align:right;">
\r
240 <span style="font-weight:normal;cursor:help"
\r
241 title="{{answer.wiki.help_text}}">
\r
242 {{ answer.wiki.label_tag }}
\r
250 {{ answer.text.errors }}
\r
251 <div id="previewer" class="wmd-preview"></div>
\r
254 {% if answer.recaptcha %}
\r
255 <div class="question-captcha" style="float: left;">
\r
256 {{ answer.recaptcha.errors }}
\r
257 {{ answer.recaptcha }}
\r
259 <div class="clear"></div>
\r
262 <p><span class="form-error"></span></p>
\r
263 <input type="button"
\r
264 {% if user.is_anonymous %}
\r
265 value="{% trans "Login/Signup to Post Your Answer" %}"
\r
267 {% if user == question.author %}
\r
268 value="{% trans "Answer Your Own Question" %}"
\r
270 value="{% trans "Answer the question" %}"
\r
273 class="submit" style="float:left" onclick="submitClicked(event, this.form)"/>
\r
280 {% block sidebar %}
\r
281 <div class="boxC" id="subscription_box">
\r
282 {% include "subscription_status.html" %}
\r
285 {% markdown_help %}
\r
287 {% sidebar_upper %}
\r
289 {% cache 60 questions_tags settings.APP_URL question.id %}
\r
292 {% trans "Question tags" %}:
\r
295 {% for tag in question.tags.all %}
\r
296 <a href="{% url tag_questions tag.name|urlencode %}"
\r
297 class="tag-link-{{ tag.name }}"
\r
298 title="{% trans "see questions tagged"%}'{{tag.name}}'{% trans "using tags" %}"
\r
299 rel="tag">{{ tag.name }}</a> <span class="tag-number">×{{ tag.used_count|intcomma }}</span><br/>
\r
303 {% trans "question asked" %}: <strong title="{{ question.added_at }}">{% diff_date question.added_at %}</strong>
\r
306 {% trans "question was seen" %}: <strong>{{ question.view_count|intcomma }} {% trans "times" %}</strong>
\r
309 {% trans "last updated" %}: <strong title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</strong>
\r
313 {% sidebar_lower %}
\r
315 <h3 class="subtitle">{% trans "Related questions" %}</h3>
\r
316 <div class="questions-related">
\r
318 {% for question in similar_questions %}
\r
320 <a href="{{ question.get_absolute_url }}">{{ question.headline }}</a>
\r
331 <!-- end question.html -->
\r