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 
  46         function submitClicked(e) {
\r 
  47             if(!is_chrome)$("input.submit")[0].disabled=true;
\r 
  48             window.removeEventListener('beforeunload', beforeUnload, true);
\r 
  51         function beforeUnload(e) {
\r 
  52             var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
\r 
  54             if($("textarea#editor")[0].value != "") {
\r 
  56                     return "Are you sure you want to leave?  Your work will be lost.";
\r 
  58                     yourWorkWillBeLost(e);
\r 
  62             var commentBoxes = $("textarea.commentBox");
\r 
  63             for(var index = 0; index < commentBoxes.length; index++) {
\r 
  64                 if(commentBoxes[index].value != "") {
\r 
  66                         return "You sure you want to leave?  Your work will be lost.";
\r 
  68                         yourWorkWillBeLost(e);
\r 
  73         window.addEventListener('beforeunload', beforeUnload, true);
\r 
  77                 .comment.not_top_scorer {
\r 
  80                 .comment-form-container {
\r 
  83                 .div.comment-tools {
\r 
  91 <div class="headNormal">
\r 
  92     <h1><a href="{{ question.get_absolute_url }}">{{ question.headline }}</a></h1>
\r 
  94 <div id="main-body" class="">
\r 
  96             <table style="width:100%;" id="question-table" {% post_classes question %}>
\r 
  98                     <td style="width:30px;vertical-align:top">
\r 
  99                         <div class="vote-buttons">
\r 
 100                             {% vote_buttons question request.user %}
\r 
 101                             {% favorite_mark question request.user %}                            
\r 
 105                         <div id="item-right">
\r 
 106                             <div class="question-body">
\r 
 107                                 {{ question.html|safe }}
\r 
 109                             <div id="question-tags" class="tags-container tags">
\r 
 110                                 {% for tag in question.tagname_list %}
\r 
 111                                     <a href="{% url tag_questions tag|urlencode %}" class="post-tag"
\r 
 112                                         title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }}</a>
\r 
 115                             <div id="question-controls" class="post-controls">                            
\r 
 116                                 {% post_controls question request.user %}
\r 
 117                                 {% wiki_symbol request.user question %}
\r 
 119                             <div class="post-update-info-container">
\r 
 120                                     {% contributors_info question %}
\r 
 122                             {% comments question request.user %}
\r 
 128             {% if question.nis.closed %}
\r 
 129             <div class="question-status" style="margin-bottom:15px">
\r 
 131                 {% blocktrans with question.nstate.closed.extra as close_reason %}The question has been closed for the following reason "{{ close_reason }}" by{% endblocktrans %}
\r 
 132                 <a href="{{ question.nstate.closed.by.get_profile_url }}">{{ question.nstate.closed.by.username }}</a>
\r 
 133                  {% diff_date question.nstate.closed.at %}
\r 
 139                 <div class="tabBar">
\r 
 140                     <a name="sort-top"></a>
\r 
 141                     <div class="headQuestions">
\r 
 142                     {% blocktrans count answers.paginator.count as counter %}One Answer:{% plural %}{{counter}} Answers:{% endblocktrans %}
\r 
 144                     {{ answers.paginator.sort_tabs }}
\r 
 146                 {{ answers.paginator.page_numbers }}
\r 
 148                 {% for answer in answers.paginator.page %}
\r 
 149                     <a name="{{ answer.id }}"></a>
\r 
 150                     <div id="answer-container-{{ answer.id }}" class="answer {% post_classes answer %}">
\r 
 151                         <table style="width:100%;">
\r 
 153                                 <td style="width:30px;vertical-align:top">
\r 
 154                                     <div class="vote-buttons">
\r 
 155                                         {% vote_buttons answer request.user %}
\r 
 156                                         {% accept_button answer request.user %}
\r 
 160                                     <div class="item-right">
\r 
 161                                         <div class="answer-body">
\r 
 162                                             {{ answer.html|safe }}
\r 
 164                                         <div class="answer-controls post-controls">
\r 
 165                                             {% post_controls answer request.user %}
\r 
 166                                             {% wiki_symbol request.user answer %}
\r 
 168                                         <div class="post-update-info-container">
\r 
 169                                             {% contributors_info answer %}
\r 
 171                                         {% comments answer request.user %}
\r 
 178                 <div class="paginator-container-left">
\r 
 179                     {{ answers.paginator.page_numbers }}
\r 
 182         <form id="fmanswer" action="{% url answer question.id %}" method="post">
\r 
 183             <div style="clear:both">
\r 
 186             {% if not question.closed %}
\r 
 187                 <div style="padding:10px 0 0 0;">
\r 
 189                     <div class="headNormal">
\r 
 191                             {% trans "Your answer" %}
\r 
 193                             {% trans "Be the first one to answer this question!" %}
\r 
 199                 {% if not request.user.is_authenticated %}
\r 
 200                     <div class="message">{% trans "You can answer anonymously and then login." %}</div>
\r 
 202                     <p class="message">
\r 
 203                         {% ifequal request.user question.author  %}
\r 
 204                             {% trans "Answer your own question only to give an answer." %}
\r 
 206                             {% trans "Please only give an answer, no discussions." %}
\r 
 208                         {% if not request.user.email_valid_and_can_answer %}
\r 
 209                             {% blocktrans %}Remember, your answer will not be published until you validate your email.{% endblocktrans %}
\r 
 210                             <a href="{% url send_validation_email %}">{% trans "Send me a validation link." %}</a>
\r 
 216                 <div id="description" class="" >
\r 
 217                     <div id="wmd-button-bar" class="wmd-panel"></div>
\r 
 219                     <div class="preview-toggle">
\r 
 220                         <table width="100%">
\r 
 223                                     <span id="pre-collapse" 
\r 
 224                                         title="{% trans "Toggle the real time Markdown editor preview" %}">
\r 
 225                                             {% trans "toggle preview" %}
\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 
 244                 <p><span class="form-error"></span></p>
\r 
 245                 <input type="submit"
\r 
 246                     {% if user.is_anonymous %}
\r 
 247                         value="{% trans "Login/Signup to Post Your Answer" %}" 
\r 
 249                         {% if user == question.author %}
\r 
 250                         value="{% trans "Answer Your Own Question" %}" 
\r 
 252                         value="{% trans "Answer the question" %}" 
\r 
 255                     class="submit" style="float:left" onclick="submitClicked(event)"/>
\r 
 262 {% block sidebar %}
\r 
 263 <div class="boxC" id="subscription_box">
\r 
 264     {% include "subscription_status.html" %}
\r 
 266 {% sidebar_upper %}
\r 
 267 {% cache 60 questions_tags settings.APP_URL question.id %}
\r 
 270                 {% trans "Question tags" %}:
\r 
 273         {% for tag in question.tags.all %}
\r 
 274                 <a href="{% url tag_questions tag.name|urlencode %}" 
\r 
 275                         title="{% trans "see questions tagged"%}'{{tag.name}}'{% trans "using tags" %}" 
\r 
 276                         rel="tag">{{ tag.name }}</a> <span class="tag-number">×{{ tag.used_count|intcomma }}</span><br/>
\r 
 280         {% trans "question asked" %}: <strong title="{{ question.added_at }}">{% diff_date question.added_at %}</strong>
\r 
 283         {% trans "question was seen" %}: <strong>{{ question.view_count|intcomma }} {% trans "times" %}</strong>
\r 
 286         {% trans "last updated" %}: <strong title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</strong>
\r 
 290 {% sidebar_lower %}
\r 
 292     <h3 class="subtitle">{% trans "Related questions" %}</h3>
\r 
 293     <div class="questions-related">
\r 
 295         {% for question in similar_questions %}
\r 
 297             <a href="{{ question.get_absolute_url }}">{{ question.headline }}</a>
\r 
 308 <!-- end question.html -->
\r