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 <link rel="stylesheet" type="text/css" href="{% media "/media/js/wmd/wmd.css" %}" />
\r
26 {% if embed_youtube_videos %}
\r
27 <script type='text/javascript' src='{% media "/media/js/viewbox_min.js" %}'></script>
\r
28 <script type='text/javascript' src='{% media "/media/js/youtube.js" %}'></script>
\r
29 <link rel="stylesheet" type="text/css" href="{% media "/media/js/viewbox.css" %}" />
\r
33 <script type="text/javascript">
\r
34 $().ready(function(){
\r
35 $("#nav_questions").attr('className',"on");
\r
36 var answer_sort_tab = "{{ tab_id }}";
\r
38 if (answer_sort_tab) {
\r
39 $("#" + answer_sort_tab).attr('className',"on");
\r
42 $('#editor').TextAreaResizer();
\r
44 //toggle preview of editor
\r
46 var txt = "[{% trans "hide preview" %}]";
\r
47 $('#pre-collapse').text(txt);
\r
48 $('#pre-collapse').bind('click', function(){
\r
49 txt = display ? "[{% trans "show preview" %}]" : "[{% trans "hide preview" %}]";
\r
51 $('#previewer').toggle();
\r
52 $('#pre-collapse').text(txt);
\r
56 function submitClicked(e, f) {
\r
57 if(!(browserTester('chrome') || browserTester('safari'))) {
\r
58 $("input.submit")[0].disabled=true;
\r
60 window.removeEventListener('beforeunload', beforeUnload, true);
\r
66 function beforeUnload(e) {
\r
68 if($("textarea#editor")[0].value != "") {
\r
69 return yourWorkWillBeLost(e);
\r
72 var commentBoxes = $("textarea.commentBox");
\r
73 for(var index = 0; index < commentBoxes.length; index++) {
\r
74 if(commentBoxes[index].value != "") {
\r
75 return yourWorkWillBeLost(e);
\r
79 window.addEventListener('beforeunload', beforeUnload, true);
\r
83 .comment.not_top_scorer {
\r
86 .comment-form-container {
\r
89 .div.comment-tools {
\r
97 <div class="headNormal">
\r
98 <h1><a href="{{ question.get_absolute_url }}">{{ question.headline }}</a></h1>
\r
100 <div id="main-body" class="">
\r
102 <table style="width:100%;" id="question-table" {% post_classes question %}>
\r
104 <td style="width:30px;vertical-align:top">
\r
105 <div class="vote-buttons">
\r
106 {% vote_buttons question request.user %}
\r
107 {% favorite_mark question request.user %}
\r
111 <div id="item-right">
\r
112 <div class="question-body">
\r
113 {{ question.html|safe }}
\r
115 <div id="question-tags" class="tags-container tags">
\r
116 {% for tag in question.tagname_list %}
\r
117 <a href="{% url tag_questions tag|urlencode %}" class="post-tag tag-link-{{ tag }}"
\r
118 title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }}</a>
\r
121 <div id="question-controls" class="post-controls">
\r
122 {% post_controls question request.user %}
\r
123 {% wiki_symbol request.user question %}
\r
125 <div class="post-update-info-container">
\r
126 {% contributors_info question %}
\r
128 {% comments question request.user %}
\r
134 {% if question.nis.closed %}
\r
135 <div class="question-status" style="margin-bottom:15px">
\r
137 {% blocktrans with question.nstate.closed.extra as close_reason %}The question has been closed for the following reason "{{ close_reason }}" by{% endblocktrans %}
\r
138 <a href="{{ question.nstate.closed.by.get_profile_url }}">{{ question.nstate.closed.by.username }}</a>
\r
139 {% diff_date question.nstate.closed.at %}
\r
145 <div class="tabBar">
\r
146 <a name="sort-top"></a>
\r
147 <div class="headQuestions">
\r
148 {% blocktrans count answers.paginator.count as counter %}One Answer:{% plural %}{{counter}} Answers:{% endblocktrans %}
\r
150 {{ answers.paginator.sort_tabs }}
\r
152 {{ answers.paginator.page_numbers }}
\r
154 {% for answer in answers.paginator.page %}
\r
155 <a name="{{ answer.id }}"></a>
\r
156 <div id="answer-container-{{ answer.id }}" class="answer {% post_classes answer %}{% ifequal answer.id focused_answer_id %} focusedAnswer{% endifequal %}">
\r
157 <table style="width:100%;">
\r
159 <td style="width:30px;vertical-align:top">
\r
160 <div class="vote-buttons">
\r
161 {% vote_buttons answer request.user %}
\r
162 {% accept_button answer request.user %}
\r
166 <div class="item-right">
\r
167 <div class="answer-body">
\r
168 {{ answer.html|safe }}
\r
170 <div class="answer-controls post-controls">
\r
171 {% post_controls answer request.user %}
\r
172 {% wiki_symbol request.user answer %}
\r
174 <div class="post-update-info-container">
\r
175 {% contributors_info answer %}
\r
177 {% comments answer request.user %}
\r
184 <div class="paginator-container-left">
\r
185 {{ answers.paginator.page_numbers }}
\r
188 <form id="fmanswer" action="{% url answer question.id %}" method="post">
\r
190 <div style="clear:both">
\r
193 {% if not question.closed %}
\r
194 <div style="padding:10px 0 0 0;">
\r
196 <div class="headNormal">
\r
198 {% trans "Your answer" %}
\r
200 {% trans "Be the first one to answer this question!" %}
\r
206 {% if not request.user.is_authenticated %}
\r
207 <div class="message">{% trans "You can answer anonymously and then login." %}</div>
\r
209 <p class="message">
\r
210 {% ifequal request.user question.author %}
\r
211 {% trans "Answer your own question only to give an answer." %}
\r
213 {% trans "Please only give an answer, no discussions." %}
\r
215 {% if not request.user.email_valid_and_can_answer %}
\r
216 {% blocktrans %}Remember, your answer will not be published until you validate your email.{% endblocktrans %}
\r
217 <a href="{% url send_validation_email %}">{% trans "Send me a validation link." %}</a>
\r
223 <div id="description" class="" >
\r
224 <div id="wmd-button-bar" class="wmd-panel"></div>
\r
226 <div class="preview-toggle">
\r
227 <table width="100%">
\r
230 <span id="pre-collapse"
\r
231 title="{% trans "Toggle the real time Markdown editor preview" %}">
\r
232 {% trans "toggle preview" %}
\r
235 <td style="text-align: right;" id="editor-metrics"></td>
\r
236 {% if settings.WIKI_ON %}
\r
237 <td style="text-align:right;">
\r
239 <span style="font-weight:normal;cursor:help"
\r
240 title="{{answer.wiki.help_text}}">
\r
241 {{ answer.wiki.label_tag }}
\r
249 {{ answer.text.errors }}
\r
250 <div id="previewer" class="wmd-preview"></div>
\r
253 {% if answer.recaptcha %}
\r
254 <div class="question-captcha" style="float: left;">
\r
255 {{ answer.recaptcha.errors }}
\r
256 {{ answer.recaptcha }}
\r
258 <div class="clear"></div>
\r
261 <p><span class="form-error"></span></p>
\r
262 <input type="button"
\r
263 {% if user.is_anonymous %}
\r
264 value="{% trans "Login/Signup to Post Your Answer" %}"
\r
266 {% if user == question.author %}
\r
267 value="{% trans "Answer Your Own Question" %}"
\r
269 value="{% trans "Answer the question" %}"
\r
272 class="submit" style="float:left" onclick="submitClicked(event, this.form)"/>
\r
279 {% block sidebar %}
\r
280 <div class="boxC" id="subscription_box">
\r
281 {% include "subscription_status.html" %}
\r
284 {% markdown_help %}
\r
286 {% sidebar_upper %}
\r
288 {% cache 60 questions_tags settings.APP_URL question.id %}
\r
291 {% trans "Question tags" %}:
\r
294 {% for tag in question.tags.all %}
\r
295 <a href="{% url tag_questions tag.name|urlencode %}"
\r
296 class="tag-link-{{ tag.name }}"
\r
297 title="{% trans "see questions tagged"%}'{{tag.name}}'{% trans "using tags" %}"
\r
298 rel="tag">{{ tag.name }}</a> <span class="tag-number">×{{ tag.used_count|intcomma }}</span><br/>
\r
302 {% trans "question asked" %}: <strong title="{{ question.added_at }}">{% diff_date question.added_at %}</strong>
\r
305 {% trans "question was seen" %}: <strong>{{ question.view_count|intcomma }} {% trans "times" %}</strong>
\r
308 {% trans "last updated" %}: <strong title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</strong>
\r
312 {% sidebar_lower %}
\r
314 <h3 class="subtitle">{% trans "Related questions" %}</h3>
\r
315 <div class="questions-related">
\r
317 {% for question in similar_questions %}
\r
319 <a href="{{ question.get_absolute_url }}">{{ question.headline }}</a>
\r
330 <!-- end question.html -->
\r