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_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/wmd/showdown.js" %}'></script>
\r 
  21         <script type='text/javascript' src='{% media  "/media/js/wmd/wmd.js" %}'></script>
\r 
  22         <link rel="stylesheet" type="text/css" href="{% media  "/media/js/wmd/wmd.css" %}" />
\r 
  25         <script type="text/javascript">
\r 
  26         $().ready(function(){
\r 
  27             $("#nav_questions").attr('className',"on");
\r 
  28             var answer_sort_tab = "{{ tab_id }}";
\r 
  30             if (answer_sort_tab) {
\r 
  31                 $("#" + answer_sort_tab).attr('className',"on");
\r 
  34             $('#editor').TextAreaResizer();
\r 
  36             //toggle preview of editor
\r 
  38             var txt = "[{% trans "hide preview" %}]";
\r 
  39             $('#pre-collapse').text(txt);
\r 
  40             $('#pre-collapse').bind('click', function(){
\r 
  41                 txt = display ? "[{% trans "show preview" %}]" : "[{% trans "hide preview" %}]";
\r 
  43                 $('#previewer').toggle();
\r 
  44                 $('#pre-collapse').text(txt);
\r 
  48         function submitClicked(e, f) {
\r 
  49             if(!(browserTester('chrome') || browserTester('safari'))) {
\r 
  50                 $("input.submit")[0].disabled=true;
\r 
  52             window.removeEventListener('beforeunload', beforeUnload, true);
\r 
  58         function beforeUnload(e) {
\r 
  60             if($("textarea#editor")[0].value != "") {
\r 
  61                 return yourWorkWillBeLost(e);
\r 
  64             var commentBoxes = $("textarea.commentBox");
\r 
  65             for(var index = 0; index < commentBoxes.length; index++) {
\r 
  66                 if(commentBoxes[index].value != "") {
\r 
  67                     return yourWorkWillBeLost(e);
\r 
  71         window.addEventListener('beforeunload', beforeUnload, true);
\r 
  75                 .comment.not_top_scorer {
\r 
  78                 .comment-form-container {
\r 
  81                 .div.comment-tools {
\r 
  89 <div class="headNormal">
\r 
  90     <h1><a href="{{ question.get_absolute_url }}">{{ question.headline }}</a></h1>
\r 
  92 <div id="main-body" class="">
\r 
  94             <table style="width:100%;" id="question-table" {% post_classes question %}>
\r 
  96                     <td style="width:30px;vertical-align:top">
\r 
  97                         <div class="vote-buttons">
\r 
  98                             {% vote_buttons question request.user %}
\r 
  99                             {% favorite_mark question request.user %}                            
\r 
 103                         <div id="item-right">
\r 
 104                             <div class="question-body">
\r 
 105                                 {{ question.html|safe }}
\r 
 107                             <div id="question-tags" class="tags-container tags">
\r 
 108                                 {% for tag in question.tagname_list %}
\r 
 109                                     <a href="{% url tag_questions tag|urlencode %}" class="post-tag"
\r 
 110                                         title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }}</a>
\r 
 113                             <div id="question-controls" class="post-controls">                            
\r 
 114                                 {% post_controls question request.user %}
\r 
 115                                 {% wiki_symbol request.user question %}
\r 
 117                             <div class="post-update-info-container">
\r 
 118                                     {% contributors_info question %}
\r 
 120                             {% comments question request.user %}
\r 
 126             {% if question.nis.closed %}
\r 
 127             <div class="question-status" style="margin-bottom:15px">
\r 
 129                 {% blocktrans with question.nstate.closed.extra as close_reason %}The question has been closed for the following reason "{{ close_reason }}" by{% endblocktrans %}
\r 
 130                 <a href="{{ question.nstate.closed.by.get_profile_url }}">{{ question.nstate.closed.by.username }}</a>
\r 
 131                  {% diff_date question.nstate.closed.at %}
\r 
 137                 <div class="tabBar">
\r 
 138                     <a name="sort-top"></a>
\r 
 139                     <div class="headQuestions">
\r 
 140                     {% blocktrans count answers.paginator.count as counter %}One Answer:{% plural %}{{counter}} Answers:{% endblocktrans %}
\r 
 142                     {{ answers.paginator.sort_tabs }}
\r 
 144                 {{ answers.paginator.page_numbers }}
\r 
 146                 {% for answer in answers.paginator.page %}
\r 
 147                     <a name="{{ answer.id }}"></a>
\r 
 148                     <div id="answer-container-{{ answer.id }}" class="answer {% post_classes answer %}">
\r 
 149                         <table style="width:100%;">
\r 
 151                                 <td style="width:30px;vertical-align:top">
\r 
 152                                     <div class="vote-buttons">
\r 
 153                                         {% vote_buttons answer request.user %}
\r 
 154                                         {% accept_button answer request.user %}
\r 
 158                                     <div class="item-right">
\r 
 159                                         <div class="answer-body">
\r 
 160                                             {{ answer.html|safe }}
\r 
 162                                         <div class="answer-controls post-controls">
\r 
 163                                             {% post_controls answer request.user %}
\r 
 164                                             {% wiki_symbol request.user answer %}
\r 
 166                                         <div class="post-update-info-container">
\r 
 167                                             {% contributors_info answer %}
\r 
 169                                         {% comments answer request.user %}
\r 
 176                 <div class="paginator-container-left">
\r 
 177                     {{ answers.paginator.page_numbers }}
\r 
 180         <form id="fmanswer" action="{% url answer question.id %}" method="post">
\r 
 181             <div style="clear:both">
\r 
 184             {% if not question.closed %}
\r 
 185                 <div style="padding:10px 0 0 0;">
\r 
 187                     <div class="headNormal">
\r 
 189                             {% trans "Your answer" %}
\r 
 191                             {% trans "Be the first one to answer this question!" %}
\r 
 197                 {% if not request.user.is_authenticated %}
\r 
 198                     <div class="message">{% trans "You can answer anonymously and then login." %}</div>
\r 
 200                     <p class="message">
\r 
 201                         {% ifequal request.user question.author  %}
\r 
 202                             {% trans "Answer your own question only to give an answer." %}
\r 
 204                             {% trans "Please only give an answer, no discussions." %}
\r 
 206                         {% if not request.user.email_valid_and_can_answer %}
\r 
 207                             {% blocktrans %}Remember, your answer will not be published until you validate your email.{% endblocktrans %}
\r 
 208                             <a href="{% url send_validation_email %}">{% trans "Send me a validation link." %}</a>
\r 
 214                 <div id="description" class="" >
\r 
 215                     <div id="wmd-button-bar" class="wmd-panel"></div>
\r 
 217                     <div class="preview-toggle">
\r 
 218                         <table width="100%">
\r 
 221                                     <span id="pre-collapse" 
\r 
 222                                         title="{% trans "Toggle the real time Markdown editor preview" %}">
\r 
 223                                             {% trans "toggle preview" %}
\r 
 226                                 <td style="text-align: right;" id="editor-metrics"></td>
\r 
 227                                 {% if settings.WIKI_ON %}
\r 
 228                                 <td style="text-align:right;">
\r 
 230                                     <span style="font-weight:normal;cursor:help" 
\r 
 231                                         title="{{answer.wiki.help_text}}">
\r 
 232                                             {{ answer.wiki.label_tag }} 
\r 
 240                     {{ answer.text.errors }}
\r 
 241                     <div id="previewer" class="wmd-preview"></div>                    
\r 
 243                 <p><span class="form-error"></span></p>
\r 
 244                 <input type="button"
\r 
 245                     {% if user.is_anonymous %}
\r 
 246                         value="{% trans "Login/Signup to Post Your Answer" %}" 
\r 
 248                         {% if user == question.author %}
\r 
 249                         value="{% trans "Answer Your Own Question" %}" 
\r 
 251                         value="{% trans "Answer the question" %}" 
\r 
 254                     class="submit" style="float:left" onclick="submitClicked(event, this.form)"/>
\r 
 261 {% block sidebar %}
\r 
 262 <div class="boxC" id="subscription_box">
\r 
 263     {% include "subscription_status.html" %}
\r 
 265 {% sidebar_upper %}
\r 
 266 {% cache 60 questions_tags settings.APP_URL question.id %}
\r 
 269                 {% trans "Question tags" %}:
\r 
 272         {% for tag in question.tags.all %}
\r 
 273                 <a href="{% url tag_questions tag.name|urlencode %}" 
\r 
 274                         title="{% trans "see questions tagged"%}'{{tag.name}}'{% trans "using tags" %}" 
\r 
 275                         rel="tag">{{ tag.name }}</a> <span class="tag-number">×{{ tag.used_count|intcomma }}</span><br/>
\r 
 279         {% trans "question asked" %}: <strong title="{{ question.added_at }}">{% diff_date question.added_at %}</strong>
\r 
 282         {% trans "question was seen" %}: <strong>{{ question.view_count|intcomma }} {% trans "times" %}</strong>
\r 
 285         {% trans "last updated" %}: <strong title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</strong>
\r 
 289 {% sidebar_lower %}
\r 
 291     <h3 class="subtitle">{% trans "Related questions" %}</h3>
\r 
 292     <div class="questions-related">
\r 
 294         {% for question in similar_questions %}
\r 
 296             <a href="{{ question.get_absolute_url }}">{{ question.headline }}</a>
\r 
 307 <!-- end question.html -->
\r