Switch to side-by-side view

--- a/Allura/allura/lib/widgets/templates/thread.html
+++ b/Allura/allura/lib/widgets/templates/thread.html
@@ -1,64 +1,56 @@
-<div xmlns="http://www.w3.org/1999/xhtml"
-     xmlns:xi="http://www.w3.org/2001/XInclude"
-     xmlns:py="http://genshi.edgewall.org/" py:strip="True">
-     <xi:include href="${g.allura_templates}/lib.html"/>
-  <?python from allura.lib.security import has_artifact_access ?>
+{% import 'jinja_master/lib.html' as lib with context %}
+
+<div>
  	<div class="content">
  		<div class="row">
  			<div class="column grid_12">
-        <py:if test="limit">
-          ${widgets.page_list.display(limit=limit, page=page, count=count)}
-        </py:if>
+        {% if limit %}
+          {{widgets.page_list.display(limit=limit, page=page, count=count)}}
+        {% endif %}
         <div id="comment">
-          <py:def function="show_post(post, indent, supress_promote=False)">
-            <li>
-              ${widgets.post.display(value=post, show_subject=show_subject, indent=indent,
-                                     supress_promote=supress_promote, page=page, limit=limit)}
+          {% set posts = value.find_posts(page=page, limit=limit) %}
+            {% if posts %}
+              {% for t in value.create_post_threads(posts) %}
               <ul>
-              <py:for each="child in post.descendants()"
-                      py:if="child.status == 'ok' and child.parent_id == post._id">
-                <li>${show_post(child, indent+1)}</li>
-              </py:for>
+                {{widgets.post_thread.display(value=t['post'], indent=0, show_subject=show_subject,
+                                               supress_promote=True, page=page, limit=limit)}}
               </ul>
-            </li>
-          </py:def>
-          <py:with vars="posts=value.find_posts(page=page, limit=limit)">
-            <py:if test="posts">
-              <ul py:for="t in value.create_post_threads(posts)">
-                ${show_post(t['post'], 0, supress_promote=True)}
-              </ul>
-            </py:if>
-          </py:with>
-          <div id="allow_moderate" py:if="has_artifact_access('moderate', value)()"/>
-          <py:if test="has_artifact_access('post', value)()">
+              {% endfor %}
+            {% endif %}
+          {% if h.has_artifact_access('moderate', value)() %}
+            <div id="allow_moderate"></div>
+          {% endif %}
+          {% if h.has_artifact_access('post', value)() %}
             <div id="tag_thread_holder" style="display:none">
-              ${widgets.tag_post.display(value=value,submit_text='Save', action=value.url() + 'tag')}
+              {{widgets.tag_post.display(value=value,submit_text='Save', action=value.url() + 'tag')}}
             </div>
-          </py:if>
+          {% endif %}
         </div>
-        <div style="clear:both"/>
-        <div py:if="limit">
-          ${widgets.page_list.display(limit=limit, page=page, count=count)}
-          ${widgets.page_size.display(limit=limit)}
+        <div style="clear:both"></div>
+        {% if limit %}
+        <div>
+          {{widgets.page_list.display(limit=limit, page=page, count=count)}}
+          {{widgets.page_size.display(limit=limit)}}
         </div>
+        {% endif %}
       </div>
     </div>
   </div>
-  <py:if test="has_artifact_access('post', value)()">
+  {% if h.has_artifact_access('post', value)() %}
     <div id="new_post_holder">
       <a name="comment"></a>
       <div class="row reply">
       	<div class="column grid_1 tcenter">
       		<p class="gravatar">
-                ${gravatar(c.user)}<br/><br/>
-      			<a href="${c.user.url()}">$c.user.display_name</a>
+                {{lib.gravatar(c.user)}}<br/><br/>
+      			<a href="{{c.user.url()}}">{{c.user.display_name}}</a>
       		</p>
       	</div>
       	<div class="column grid_8">
-          ${widgets.edit_post.display(submit_text='Save', action=value.url() + 'post')}
+          {{widgets.edit_post.display(submit_text='Save', action=value.url() + 'post')}}
         </div>
       </div>
     </div>
-  </py:if>
+  {% endif %}
   &nbsp;
 </div>