diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-04-19 02:55:19 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-04-19 02:55:19 -0400 |
commit | ddaff077f60d879010ea85c5cfe02570a744ef28 (patch) | |
tree | ef59df28a9e4cbb80f54d40a20020cd92c9af98f /askbot/templates | |
parent | 0f8e7139b1b417cceb9450022aba2f4cd5497d70 (diff) | |
download | askbot-ddaff077f60d879010ea85c5cfe02570a744ef28.tar.gz askbot-ddaff077f60d879010ea85c5cfe02570a744ef28.tar.bz2 askbot-ddaff077f60d879010ea85c5cfe02570a744ef28.zip |
responsive design on question page sort of works
Diffstat (limited to 'askbot/templates')
-rw-r--r-- | askbot/templates/macros.html | 53 | ||||
-rw-r--r-- | askbot/templates/question.html | 2 | ||||
-rw-r--r-- | askbot/templates/question/answer_card.html | 34 | ||||
-rw-r--r-- | askbot/templates/question/question_card.html | 58 |
4 files changed, 79 insertions, 68 deletions
diff --git a/askbot/templates/macros.html b/askbot/templates/macros.html index 933f47e7..6fd69647 100644 --- a/askbot/templates/macros.html +++ b/askbot/templates/macros.html @@ -392,7 +392,7 @@ for the purposes of the AJAX comment editor #} -%} {% spaceless %} {% if post.comment_count > 0 %} - <h2 id="comment-title">Comments</h2> + <h2 class="comment-title">Comments</h2> <div class="clean"></div> {% endif %} {% set widget_id = 'comments-for-' + post.post_type + '-' + post.id|string %} @@ -420,23 +420,38 @@ for the purposes of the AJAX comment editor #} <div class="upvote"></div> {% endif %} </div> - <div - id="post-{{comment.id}}-delete" - class="comment-delete" - > - <span class="delete-icon" title="{% trans %}delete this comment{% endtrans %}"></span> - </div> - <div class="comment-body"> - {{comment.html}} - <a class="author" href="{{comment.author.get_profile_url()}}">{{comment.author.username|escape}}</a> - <span class="age"> ({{ timeago(comment.added_at) }})</span> - <a id="post-{{comment.id}}-edit" - class="edit">{% trans %}edit{% endtrans %}</a> - <form action="{% url comment_to_answer %}" method="POST" accept-charset="utf-8" class='convert-comment'> - {% csrf_token %} - <input type="hidden" value="{{comment.id}}" name="comment_id" id="id_comment_id"> - <input type="submit" value="{% trans %}convert to answer{% endtrans %}"> - </form> + <div class="comment-content"> + <div + id="post-{{comment.id}}-delete" + class="comment-delete" + > + <span + class="delete-icon" + title="{% trans %}delete this comment{% endtrans %}" + ></span> + </div> + <div class="comment-body"> + {{comment.html}} + <a + class="author" + href="{{comment.author.get_profile_url()}}" + >{{comment.author.username|escape}}</a> + <span class="age"> ({{ timeago(comment.added_at) }})</span> + <a + id="post-{{comment.id}}-edit" + class="edit" + >{% trans %}edit{% endtrans %}</a> + <form + action="{% url comment_to_answer %}" + method="POST" + accept-charset="utf-8" + class='convert-comment' + > + {% csrf_token %} + <input type="hidden" value="{{comment.id}}" name="comment_id" id="id_comment_id"> + <input type="submit" value="{% trans %}convert to answer{% endtrans %}"> + </form> + </div> </div> </div> <script type="text/javascript"> @@ -552,7 +567,7 @@ for the purposes of the AJAX comment editor #} {%- endmacro -%} {%- macro answer_classes(answer, question) -%} -answer {% if answer.accepted() %}accepted-answer{% endif %} {% if answer.author_id==question.author_id %} answered-by-owner{% endif %} {% if answer.deleted %}deleted{% endif -%} + {% if answer.accepted() %}accepted-answer{% endif %} {% if answer.author_id==question.author_id %} answered-by-owner{% endif %} {% if answer.deleted %}deleted{% endif -%} {%- endmacro -%} {%- macro follow_toggle(follow, name, alias, id) -%} diff --git a/askbot/templates/question.html b/askbot/templates/question.html index 0ab4221a..8312a8a9 100644 --- a/askbot/templates/question.html +++ b/askbot/templates/question.html @@ -128,7 +128,7 @@ //still may need to hide because answer may be too long var answer_id = 'post-id-' + post_id; var answer_container = document.getElementById(answer_id); - var answerBody = findChildrenByClassName(answer_container, 'answer-body')[0]; + var answerBody = findChildrenByClassName(answer_container, 'post-body')[0]; //todo: this is not reliable var answerBodyNodes = answerBody.childNodes; var answerElement = answerBodyNodes[answerBodyNodes.length - 1]; diff --git a/askbot/templates/question/answer_card.html b/askbot/templates/question/answer_card.html index ae7d30fa..9d17e8c2 100644 --- a/askbot/templates/question/answer_card.html +++ b/askbot/templates/question/answer_card.html @@ -4,28 +4,28 @@ <a class="old_answer_id_anchor" name="{{ answer.old_answer_id }}"></a> {% endif %} <div - id="post-id-{{ answer.id }}" - class="{{ macros.answer_classes(answer, question) }}"> + id="post-id-{{ answer.id }}" + data-post-id="{{ answer.id }}" + class="post answer {{ macros.answer_classes(answer, question) }}" +> + <div class="vote-buttons"> {% include "question/answer_vote_buttons.html" %} </div> - <div class="answer-table"> - - <div class="item-right"> - <div class="answer-body"> - <div class="post-update-info-container"> - {% include "question/answer_author_info.html" %} - </div> - {% if answer.id in published_answer_ids %} - <p><strong>{% trans %}This response is published{% endtrans %}</strong></p> - {% endif %} - {{ answer.html }} + <div class="post-content"> + <div class="post-body"> + <div class="post-update-info-container"> + {% include "question/answer_author_info.html" %} </div> - <div class="answer-controls post-controls"> - {% include "question/answer_controls.html" %} - </div> - {% include "question/answer_comments.html" %} + {% if answer.id in published_answer_ids %} + <p><strong>{% trans %}This response is published{% endtrans %}</strong></p> + {% endif %} + {{ answer.html }} + </div> + <div class="answer-controls post-controls"> + {% include "question/answer_controls.html" %} </div> + {% include "question/answer_comments.html" %} </div> <div class="clean"></div> </div> diff --git a/askbot/templates/question/question_card.html b/askbot/templates/question/question_card.html index 91f8ee06..d0407dcb 100644 --- a/askbot/templates/question/question_card.html +++ b/askbot/templates/question/question_card.html @@ -1,40 +1,36 @@ -<div class="question-card"> +<div class="post question" data-post-id="{{ question.id }}"> <div class="vote-buttons"> {% include "question/question_vote_buttons.html" %} {% include "question/share_buttons.html" %} </div> - <div id="post-id-{{question.id}}" class="question-content{% if question.deleted %} deleted{% endif %}"> - <div id="question-table"> - <h1><a href="{{ question.get_absolute_url() }}">{{ thread.get_title(question)|escape }}</a></h1> - {% include "question/question_tags.html" %} + <div id="post-id-{{question.id}}" class="post-content{% if question.deleted %} deleted{% endif %}"> + <h1><a href="{{ question.get_absolute_url() }}">{{ thread.get_title(question)|escape }}</a></h1> + {% include "question/question_tags.html" %} + <div class="clearfix"></div> - <div class="clearfix"></div> - - <div class="question-body"> - <div class="post-update-info-container"> - {% include "question/question_author_info.html" %} - </div> - {{ question.html }} - </div> - <div id="question-controls" class="post-controls"> - {% include "question/question_controls.html" %} + <div class="post-body"> + <div class="post-update-info-container"> + {% include "question/question_author_info.html" %} </div> - <script type="text/javascript"> - (function(){ - if (askbot['data']['userIsAuthenticated'] === false){ - var ctrl = document.getElementById('question-controls') - ctrl.parentNode.removeChild(ctrl); - } - })(); - </script> - {% if thread.closed %} - <div class="clearfix"></div> - {# ==== START: question/closed_question_info.html ==== #} - {% include "question/closed_question_info.html" %} - {# ==== END: question/closed_question_info.html ==== #} - {% endif %} - {% include "question/question_comments.html" %} + {{ question.html }} </div> - + <div id="question-controls" class="post-controls"> + {% include "question/question_controls.html" %} + </div> + <script type="text/javascript"> + (function(){ + if (askbot['data']['userIsAuthenticated'] === false){ + var ctrl = document.getElementById('question-controls') + ctrl.parentNode.removeChild(ctrl); + } + })(); + </script> + {% if thread.closed %} + <div class="clearfix"></div> + {# ==== START: question/closed_question_info.html ==== #} + {% include "question/closed_question_info.html" %} + {# ==== END: question/closed_question_info.html ==== #} + {% endif %} + {% include "question/question_comments.html" %} </div> </div> |