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.summary}}{% endblock %}
\r
12 {% block metakeywords %}{{question.tagname_meta_generator}}{% endblock %}
\r
13 {% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %}
\r
15 <link rel="canonical" href="{{settings.APP_URL}}{{question.get_absolute_url}}" />
\r
16 <link rel="alternate" type="application/rss+xml" title="RSS" href="{{ question.get_absolute_url }}?type=rss">
\r
17 {% if not question.nis.closed %}
\r
18 <script type='text/javascript' src='{% media "/media/js/wmd/showdown.js" %}'></script>
\r
19 <script type='text/javascript' src='{% media "/media/js/wmd/wmd.js" %}'></script>
\r
20 <link rel="stylesheet" type="text/css" href="{% media "/media/js/wmd/wmd.css" %}" />
\r
23 <script type="text/javascript">
\r
24 $().ready(function(){
\r
25 $("#nav_questions").attr('className',"on");
\r
26 var answer_sort_tab = "{{ tab_id }}";
\r
28 if (answer_sort_tab) {
\r
29 $("#" + answer_sort_tab).attr('className',"on");
\r
32 $('#editor').TextAreaResizer();
\r
34 //toggle preview of editor
\r
36 var txt = "[{% trans "hide preview" %}]";
\r
37 $('#pre-collapse').text(txt);
\r
38 $('#pre-collapse').bind('click', function(){
\r
39 txt = display ? "[{% trans "show preview" %}]" : "[{% trans "hide preview" %}]";
\r
41 $('#previewer').toggle();
\r
42 $('#pre-collapse').text(txt);
\r
47 function beforeUnload(e) {
\r
48 if($("textarea#editor")[0].value != "") {
\r
49 yourWorkWillBeLost(e);
\r
52 $("textarea.commentBox").each(function() {
\r
53 if(this.value != "") {
\r
54 yourWorkWillBeLost(e);
\r
60 window.addEventListener('beforeunload', beforeUnload, true);
\r
62 function submitClicked() {
\r
63 window.removeEventListener('beforeunload', beforeUnload, true);
\r
64 $("input.submit").each(function() {
\r
72 .comment.not_top_scorer {
\r
75 .comment-form-container {
\r
78 .div.comment-tools {
\r
86 <div class="headNormal">
\r
87 <h1><a href="{{ question.get_absolute_url }}">{{ question.headline }}</a></h1>
\r
89 <div id="main-body" class="">
\r
91 <table style="width:100%;" id="question-table" {% post_classes question %}>
\r
93 <td style="width:30px;vertical-align:top">
\r
94 <div class="vote-buttons">
\r
95 {% vote_buttons question request.user %}
\r
96 {% favorite_mark question request.user %}
\r
100 <div id="item-right">
\r
101 <div class="question-body">
\r
102 {{ question.html|safe }}
\r
104 <div id="question-tags" class="tags-container tags">
\r
105 {% for tag in question.tagname_list %}
\r
106 <a href="{% url tag_questions tag|urlencode %}" class="post-tag"
\r
107 title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }}</a>
\r
110 <div id="question-controls" class="post-controls">
\r
111 {% post_controls question request.user %}
\r
112 {% wiki_symbol request.user question %}
\r
114 <div class="post-update-info-container">
\r
115 {% contributors_info question %}
\r
117 {% comments question request.user %}
\r
123 {% if question.nis.closed %}
\r
124 <div class="question-status" style="margin-bottom:15px">
\r
126 {% blocktrans with question.nstate.closed.extra as close_reason %}The question has been closed for the following reason "{{ close_reason }}" by{% endblocktrans %}
\r
127 <a href="{{ question.nstate.closed.by.get_profile_url }}">{{ question.nstate.closed.by.username }}</a>
\r
128 {% diff_date question.nstate.closed.at %}
\r
134 <div class="tabBar">
\r
135 <a name="sort-top"></a>
\r
136 <div class="headQuestions">
\r
137 {% blocktrans count answers.paginator.count as counter %}One Answer:{% plural %}{{counter}} Answers:{% endblocktrans %}
\r
139 {{ answers.paginator.sort_tabs }}
\r
141 {{ answers.paginator.page_numbers }}
\r
143 {% for answer in answers.paginator.page %}
\r
144 <a name="{{ answer.id }}"></a>
\r
145 <div id="answer-container-{{ answer.id }}" class="answer {% post_classes answer %}">
\r
146 <table style="width:100%;">
\r
148 <td style="width:30px;vertical-align:top">
\r
149 <div class="vote-buttons">
\r
150 {% vote_buttons answer request.user %}
\r
151 {% accept_button answer request.user %}
\r
155 <div class="item-right">
\r
156 <div class="answer-body">
\r
157 {{ answer.html|safe }}
\r
159 <div class="answer-controls post-controls">
\r
160 {% post_controls answer request.user %}
\r
161 {% wiki_symbol request.user answer %}
\r
163 <div class="post-update-info-container">
\r
164 {% contributors_info answer %}
\r
166 {% comments answer request.user %}
\r
173 <div class="paginator-container-left">
\r
174 {{ answers.paginator.page_numbers }}
\r
177 <form id="fmanswer" action="{% url answer question.id %}" method="post">
\r
178 <div style="clear:both">
\r
181 {% if not question.closed %}
\r
182 <div style="padding:10px 0 0 0;">
\r
184 <div class="headNormal">
\r
186 {% trans "Your answer" %}
\r
188 {% trans "Be the first one to answer this question!" %}
\r
194 {% if not request.user.is_authenticated %}
\r
195 <div class="message">{% trans "You can answer anonymously and then login." %}</div>
\r
197 <p class="message">
\r
198 {% ifequal request.user question.author %}
\r
199 {% trans "Answer your own question only to give an answer." %}
\r
201 {% trans "Please only give an answer, no discussions." %}
\r
203 {% if not request.user.email_valid_and_can_answer %}
\r
204 {% blocktrans %}Remember, your answer will not be published until you validate your email.{% endblocktrans %}
\r
205 <a href="{% url send_validation_email %}">{% trans "Send me a validation link." %}</a>
\r
211 <div id="description" class="" >
\r
212 <div id="wmd-button-bar" class="wmd-panel"></div>
\r
214 <div class="preview-toggle">
\r
215 <table width="100%">
\r
218 <span id="pre-collapse"
\r
219 title="{% trans "Toggle the real time Markdown editor preview" %}">
\r
220 {% trans "toggle preview" %}
\r
223 {% if settings.WIKI_ON %}
\r
224 <td style="text-align:right;">
\r
226 <span style="font-weight:normal;cursor:help"
\r
227 title="{{answer.wiki.help_text}}">
\r
228 {{ answer.wiki.label_tag }}
\r
236 {{ answer.text.errors }}
\r
237 <div id="previewer" class="wmd-preview"></div>
\r
239 <p><span class="form-error"></span></p>
\r
240 <input type="submit"
\r
241 {% if user.is_anonymous %}
\r
242 value="{% trans "Login/Signup to Post Your Answer" %}"
\r
244 {% if user == question.author %}
\r
245 value="{% trans "Answer Your Own Question" %}"
\r
247 value="{% trans "Answer the question" %}"
\r
250 class="submit" style="float:left" onclick="submitClicked()" />
\r
257 {% block sidebar %}
\r
258 <div class="boxC" id="subscription_box">
\r
259 {% include "subscription_status.html" %}
\r
261 {% sidebar_upper %}
\r
262 {% cache 60 questions_tags settings.APP_URL question.id %}
\r
265 {% trans "Question tags" %}:
\r
268 {% for tag in question.tags.all %}
\r
269 <a href="{% url tag_questions tag.name|urlencode %}"
\r
270 title="{% trans "see questions tagged"%}'{{tag.name}}'{% trans "using tags" %}"
\r
271 rel="tag">{{ tag.name }}</a> <span class="tag-number">×{{ tag.used_count|intcomma }}</span><br/>
\r
275 {% trans "question asked" %}: <strong title="{{ question.added_at }}">{% diff_date question.added_at %}</strong>
\r
278 {% trans "question was seen" %}: <strong>{{ question.view_count|intcomma }} {% trans "times" %}</strong>
\r
281 {% trans "last updated" %}: <strong title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</strong>
\r
285 {% sidebar_lower %}
\r
287 <h3 class="subtitle">{% trans "Related questions" %}</h3>
\r
288 <div class="questions-related">
\r
290 {% for question in similar_questions %}
\r
292 <a href="{{ question.get_absolute_url }}">{{ question.headline }}</a>
\r
303 <!-- end question.html -->
\r