# HG changeset patch # User neko259 # Date 2015-01-02 14:43:28 # Node ID 6c3fa27aee576581ae8705dbbd5014db7064ea51 # Parent a211f7864d2f7dd80df82e9c1b1be05d0c619913 Refactored thread template. Removed JS compression from it. diff --git a/boards/templates/boards/thread.html b/boards/templates/boards/thread.html --- a/boards/templates/boards/thread.html +++ b/boards/templates/boards/thread.html @@ -4,7 +4,6 @@ {% load cache %} {% load static from staticfiles %} {% load board %} -{% load compress %} {% block head %} {{ opening_post.get_title|striptags|truncatewords:10 }} @@ -35,50 +34,43 @@ <div class="thread"> {% with can_bump=thread.can_bump %} {% for post in thread.get_replies %} - {% if forloop.first %} - {% post_view post moderator=moderator is_opening=True thread=thread can_bump=can_bump opening_post_id=opening_post.id %} - {% else %} - {% post_view post moderator=moderator is_opening=False thread=thread can_bump=can_bump opening_post_id=opening_post.id %} - {% endif %} + {% with is_opening=forloop.first %} + {% post_view post moderator=moderator is_opening=is_opening thread=thread can_bump=can_bump opening_post_id=opening_post.id %} + {% endwith %} {% endfor %} {% endwith %} </div> {% if not thread.archived %} - - <div class="post-form-w" id="form"> - <script src="{% static 'js/panel.js' %}"></script> - <div class="form-title">{% trans "Reply to thread" %} #{{ opening_post.id }}</div> - <div class="post-form" id="compact-form"> - <div class="swappable-form-full"> - <form enctype="multipart/form-data" method="post" - >{% csrf_token %} + <div class="post-form-w" id="form"> + <script src="{% static 'js/panel.js' %}"></script> + <div class="form-title">{% trans "Reply to thread" %} #{{ opening_post.id }}</div> + <div class="post-form" id="compact-form"> + <div class="swappable-form-full"> + <form enctype="multipart/form-data" method="post" + >{% csrf_token %} <div class="compact-form-text"></div> - {{ form.as_div }} - <div class="form-submit"> - <input type="submit" value="{% trans "Post" %}"/> - </div> - </form> + {{ form.as_div }} + <div class="form-submit"> + <input type="submit" value="{% trans "Post" %}"/> + </div> + </form> + </div> + <a onclick="swapForm(); return false;" href="#"> + {% trans 'Switch mode' %} + </a> + <div><a href="{% url "staticpage" name="help" %}"> + {% trans 'Text syntax' %}</a></div> </div> - <a onclick="swapForm(); return false;" href="#"> - {% trans 'Switch mode' %} - </a> - <div><a href="{% url "staticpage" name="help" %}"> - {% trans 'Text syntax' %}</a></div> </div> - </div> <script src="{% static 'js/jquery.form.min.js' %}"></script> - {% compress js %} - <script src="{% static 'js/thread_update.js' %}"></script> - <script src="{% static 'js/3party/centrifuge.js' %}"></script> - {% endcompress %} + <script src="{% static 'js/thread_update.js' %}"></script> + <script src="{% static 'js/3party/centrifuge.js' %}"></script> {% endif %} - {% compress js %} - <script src="{% static 'js/form.js' %}"></script> - <script src="{% static 'js/thread.js' %}"></script> - {% endcompress %} + <script src="{% static 'js/form.js' %}"></script> + <script src="{% static 'js/thread.js' %}"></script> {% endcache %}