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/wmd/showdown.js" %}'></script>
\r 
  22         <script type='text/javascript' src='{% media  "/media/js/wmd/wmd.js" %}'></script>
\r 
  23         <link rel="stylesheet" type="text/css" href="{% media  "/media/js/wmd/wmd.css" %}" />
\r 
  26         <script type="text/javascript">
\r 
  27         $().ready(function(){
\r 
  28             $("#nav_questions").attr('className',"on");
\r 
  29             var answer_sort_tab = "{{ tab_id }}";
\r 
  31             if (answer_sort_tab) {
\r 
  32                 $("#" + answer_sort_tab).attr('className',"on");
\r 
  35             $('#editor').TextAreaResizer();
\r 
  37             //toggle preview of editor
\r 
  39             var txt = "[{% trans "hide preview" %}]";
\r 
  40             $('#pre-collapse').text(txt);
\r 
  41             $('#pre-collapse').bind('click', function(){
\r 
  42                 txt = display ? "[{% trans "show preview" %}]" : "[{% trans "hide preview" %}]";
\r 
  44                 $('#previewer').toggle();
\r 
  45                 $('#pre-collapse').text(txt);
\r 
  49         function submitClicked(e, f) {
\r 
  50             if(!(browserTester('chrome') || browserTester('safari'))) {
\r 
  51                 $("input.submit")[0].disabled=true;
\r 
  53             window.removeEventListener('beforeunload', beforeUnload, true);
\r 
  59         function beforeUnload(e) {
\r 
  61             if($("textarea#editor")[0].value != "") {
\r 
  62                 return yourWorkWillBeLost(e);
\r 
  65             var commentBoxes = $("textarea.commentBox");
\r 
  66             for(var index = 0; index < commentBoxes.length; index++) {
\r 
  67                 if(commentBoxes[index].value != "") {
\r 
  68                     return yourWorkWillBeLost(e);
\r 
  72         window.addEventListener('beforeunload', beforeUnload, true);
\r 
  76                 .comment.not_top_scorer {
\r 
  79                 .comment-form-container {
\r 
  82                 .div.comment-tools {
\r 
  90 <div class="headNormal">
\r 
  91     <h1><a href="{{ question.get_absolute_url }}">{{ question.headline }}</a></h1>
\r 
  93 <div id="main-body" class="">
\r 
  95             <table style="width:100%;" id="question-table" {% post_classes question %}>
\r 
  97                     <td style="width:30px;vertical-align:top">
\r 
  98                         <div class="vote-buttons">
\r 
  99                             {% vote_buttons question request.user %}
\r 
 100                             {% favorite_mark question request.user %}                            
\r 
 104                         <div id="item-right">
\r 
 105                             <div class="question-body">
\r 
 106                                 {{ question.html|safe }}
\r 
 108                             <div id="question-tags" class="tags-container tags">
\r 
 109                                 {% for tag in question.tagname_list %}
\r 
 110                                     <a href="{% url tag_questions tag|urlencode %}" class="post-tag tag-link-{{ tag }}"
\r 
 111                                         title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }}</a>
\r 
 114                             <div id="question-controls" class="post-controls">                            
\r 
 115                                 {% post_controls question request.user %}
\r 
 116                                 {% wiki_symbol request.user question %}
\r 
 118                             <div class="post-update-info-container">
\r 
 119                                     {% contributors_info question %}
\r 
 121                             {% comments question request.user %}
\r 
 127             {% if question.nis.closed %}
\r 
 128             <div class="question-status" style="margin-bottom:15px">
\r 
 130                 {% blocktrans with question.nstate.closed.extra as close_reason %}The question has been closed for the following reason "{{ close_reason }}" by{% endblocktrans %}
\r 
 131                 <a href="{{ question.nstate.closed.by.get_profile_url }}">{{ question.nstate.closed.by.username }}</a>
\r 
 132                  {% diff_date question.nstate.closed.at %}
\r 
 138                 <div class="tabBar">
\r 
 139                     <a name="sort-top"></a>
\r 
 140                     <div class="headQuestions">
\r 
 141                     {% blocktrans count answers.paginator.count as counter %}One Answer:{% plural %}{{counter}} Answers:{% endblocktrans %}
\r 
 143                     {{ answers.paginator.sort_tabs }}
\r 
 145                 {{ answers.paginator.page_numbers }}
\r 
 147                 {% for answer in answers.paginator.page %}
\r 
 148                     <a name="{{ answer.id }}"></a>
\r 
 149                     <div id="answer-container-{{ answer.id }}" class="answer {% post_classes answer %}">
\r 
 150                         <table style="width:100%;">
\r 
 152                                 <td style="width:30px;vertical-align:top">
\r 
 153                                     <div class="vote-buttons">
\r 
 154                                         {% vote_buttons answer request.user %}
\r 
 155                                         {% accept_button answer request.user %}
\r 
 159                                     <div class="item-right">
\r 
 160                                         <div class="answer-body">
\r 
 161                                             {{ answer.html|safe }}
\r 
 163                                         <div class="answer-controls post-controls">
\r 
 164                                             {% post_controls answer request.user %}
\r 
 165                                             {% wiki_symbol request.user answer %}
\r 
 167                                         <div class="post-update-info-container">
\r 
 168                                             {% contributors_info answer %}
\r 
 170                                         {% comments answer request.user %}
\r 
 177                 <div class="paginator-container-left">
\r 
 178                     {{ answers.paginator.page_numbers }}
\r 
 181         <form id="fmanswer" action="{% url answer question.id %}" method="post">
\r 
 182             <div style="clear:both">
\r 
 185             {% if not question.closed %}
\r 
 186                 <div style="padding:10px 0 0 0;">
\r 
 188                     <div class="headNormal">
\r 
 190                             {% trans "Your answer" %}
\r 
 192                             {% trans "Be the first one to answer this question!" %}
\r 
 198                 {% if not request.user.is_authenticated %}
\r 
 199                     <div class="message">{% trans "You can answer anonymously and then login." %}</div>
\r 
 201                     <p class="message">
\r 
 202                         {% ifequal request.user question.author  %}
\r 
 203                             {% trans "Answer your own question only to give an answer." %}
\r 
 205                             {% trans "Please only give an answer, no discussions." %}
\r 
 207                         {% if not request.user.email_valid_and_can_answer %}
\r 
 208                             {% blocktrans %}Remember, your answer will not be published until you validate your email.{% endblocktrans %}
\r 
 209                             <a href="{% url send_validation_email %}">{% trans "Send me a validation link." %}</a>
\r 
 215                 <div id="description" class="" >
\r 
 216                     <div id="wmd-button-bar" class="wmd-panel"></div>
\r 
 218                     <div class="preview-toggle">
\r 
 219                         <table width="100%">
\r 
 222                                     <span id="pre-collapse" 
\r 
 223                                         title="{% trans "Toggle the real time Markdown editor preview" %}">
\r 
 224                                             {% trans "toggle preview" %}
\r 
 227                                 <td style="text-align: right;" id="editor-metrics"></td>
\r 
 228                                 {% if settings.WIKI_ON %}
\r 
 229                                 <td style="text-align:right;">
\r 
 231                                     <span style="font-weight:normal;cursor:help" 
\r 
 232                                         title="{{answer.wiki.help_text}}">
\r 
 233                                             {{ answer.wiki.label_tag }} 
\r 
 241                     {{ answer.text.errors }}
\r 
 242                     <div id="previewer" class="wmd-preview"></div>
\r 
 245                     {% if answer.recaptcha %}
\r 
 246                     <div class="question-captcha" style="float: left;">
\r 
 247                         {{ answer.recaptcha.errors }}
\r 
 248                         {{ answer.recaptcha }}
\r 
 250                     <div class="clear"></div>
\r 
 253                 <p><span class="form-error"></span></p>
\r 
 254                 <input type="button"
\r 
 255                     {% if user.is_anonymous %}
\r 
 256                         value="{% trans "Login/Signup to Post Your Answer" %}" 
\r 
 258                         {% if user == question.author %}
\r 
 259                         value="{% trans "Answer Your Own Question" %}" 
\r 
 261                         value="{% trans "Answer the question" %}" 
\r 
 264                     class="submit" style="float:left" onclick="submitClicked(event, this.form)"/>
\r 
 271 {% block sidebar %}
\r 
 272 <div class="boxC" id="subscription_box">
\r 
 273     {% include "subscription_status.html" %}
\r 
 276 {% markdown_help %}
\r 
 278 {% sidebar_upper %}
\r 
 280 {% cache 60 questions_tags settings.APP_URL question.id %}
\r 
 283                 {% trans "Question tags" %}:
\r 
 286         {% for tag in question.tags.all %}
\r 
 287                 <a href="{% url tag_questions tag.name|urlencode %}"
\r 
 288             class="tag-link-{{ tag.name }}"
\r 
 289                         title="{% trans "see questions tagged"%}'{{tag.name}}'{% trans "using tags" %}"
\r 
 290                         rel="tag">{{ tag.name }}</a> <span class="tag-number">×{{ tag.used_count|intcomma }}</span><br/>
\r 
 294         {% trans "question asked" %}: <strong title="{{ question.added_at }}">{% diff_date question.added_at %}</strong>
\r 
 297         {% trans "question was seen" %}: <strong>{{ question.view_count|intcomma }} {% trans "times" %}</strong>
\r 
 300         {% trans "last updated" %}: <strong title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</strong>
\r 
 304 {% sidebar_lower %}
\r 
 306     <h3 class="subtitle">{% trans "Related questions" %}</h3>
\r 
 307     <div class="questions-related">
\r 
 309         {% for question in similar_questions %}
\r 
 311             <a href="{{ question.get_absolute_url }}">{{ question.headline }}</a>
\r 
 322 <!-- end question.html -->
\r