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