[#892] Jinja templates for hg

Jenny Steele Jenny Steele 2010-09-14

added ForgeHg/forgehg/templates/hg_log.html
removed ForgeSVN/forgesvn/templates/admin_extensions.html
removed ForgeSVN/forgesvn/templates/commit.html
removed ForgeSVN/forgesvn/templates/diff.html
removed ForgeSVN/forgesvn/templates/file.html
removed ForgeSVN/forgesvn/templates/tree.html
removed ForgeSVN/forgesvn/widgets/templates/log.html
changed Allura/allura/config/app_cfg.py
changed Allura/allura/controllers/repository.py
changed Allura/allura/templates/repo/diff.html
changed Allura/allura/templates/repo/file.html
changed ForgeHg/forgehg/model/hg.py
changed ForgeHg/forgehg/tests/functional/test_controllers.py
changed ForgeHg/forgehg/widgets/__init__.py
changed ForgeHg/forgehg/widgets/revisions.py
changed ForgeHg/forgehg/controllers.py
changed ForgeHg/forgehg/hg_main.py
copied ForgeHg/forgehg/templates/admin_extensions.html -> ForgeHg/forgehg/widgets/templates/hg_log_widget.html
copied ForgeHg/forgehg/templates/commit.html -> ForgeHg/forgehg/templates/hg_index.html
copied ForgeHg/forgehg/templates/fork.html -> ForgeHg/forgehg/templates/hg_tree.html
copied ForgeHg/forgehg/templates/index.html -> ForgeHg/forgehg/templates/hg_admin_extensions.html
copied ForgeHg/forgehg/widgets/templates/revision.html -> ForgeHg/forgehg/widgets/templates/hg_revision_widget.html
copied ForgeSVN/forgesvn/templates/index.html -> ForgeHg/forgehg/templates/hg_commit.html
copied ForgeSVN/forgesvn/templates/log.html -> ForgeHg/forgehg/templates/hg_fork.html
copied ForgeSVN/forgesvn/widgets/templates/revision.html -> ForgeHg/forgehg/widgets/log.py
ForgeHg/forgehg/templates/hg_log.html Diff Switch to side-by-side view
Loading...
Allura/allura/config/app_cfg.py Diff Switch to side-by-side view
Loading...
Allura/allura/controllers/repository.py Diff Switch to side-by-side view
Loading...
Allura/allura/templates/repo/diff.html Diff Switch to side-by-side view
Loading...
Allura/allura/templates/repo/file.html Diff Switch to side-by-side view
Loading...
ForgeHg/forgehg/model/hg.py Diff Switch to side-by-side view
Loading...
ForgeHg/forgehg/tests/functional/test_controllers.py Diff Switch to side-by-side view
Loading...
ForgeHg/forgehg/widgets/__init__.py Diff Switch to side-by-side view
Loading...
ForgeHg/forgehg/widgets/revisions.py Diff Switch to side-by-side view
Loading...
ForgeHg/forgehg/controllers.py Diff Switch to side-by-side view
Loading...
ForgeHg/forgehg/hg_main.py Diff Switch to side-by-side view
Loading...
ForgeHg/forgehg/templates/admin_extensions.html to ForgeHg/forgehg/widgets/templates/hg_log_widget.html
--- a/ForgeHg/forgehg/templates/admin_extensions.html
+++ b/ForgeHg/forgehg/widgets/templates/hg_log_widget.html
@@ -1,51 +1,53 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-                    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
-      xmlns:py="http://genshi.edgewall.org/"
-      xmlns:xi="http://www.w3.org/2001/XInclude">
-
-  <xi:include href="master.html" />
-
-  <?python from allura.lib.security import has_artifact_access ?>
-
-  <head>
-    <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
-    <title>$app.config.options.mount_point Admin Viewable Files</title>
-  </head>
-
-  <body>
-    <h1 class="title">$app.config.options.mount_point Admin Viewable Files</h1>
-    <div class="content">
-      <div class="row">
-        <div class="column grid_12">
-          <form>
-            <ol>
-              <li>
-				  <label>Extensions:</label>
-				  <input type="text" name="additional_viewable_extensions" id="additional_viewable_extensions" value="${additional_viewable_extensions}"
-                       py:if="allow_config" title="e.g., .svnignore,.gitignore,.ini"/>
-                <span py:if="not allow_config">${additional_viewable_extensions}</span>
-              </li>
-              <hr/>
-              <li>
-				  <label>&nbsp;</label>
-                <input type="button" onclick="save_extensions()"
-                        py:if="allow_config" value="Save"/>
-              </li>
-            </ol>
-          </form>
-        </div>
-      </div>
+{% from 'jinja_master/lib.html' import email_gravatar with context %}
+<div>
+  {% if show_paging %}
+    <div style="clear:both">
+      {{fields['page_list'].display(limit=limit, page=page, count=count)}}
     </div>
-  </body>
-  <script type="text/javascript" py:if="allow_config">
-function save_extensions(){
-    $.post('set_extensions', {
-        additional_viewable_extensions: $('#additional_viewable_extensions').val()
-    },
-    function(){
-        location.reload();
-    });
-}
-  </script>
-</html>
+  {% endif %}
+  <table>
+    <thead>
+      <tr>
+        <th style="text-align:left">Commit</th>
+        <th style="text-align:left">Date</th>
+        <th>&nbsp;</th>
+      </tr>
+    </thead>
+    <tbody>
+      {% for commit in value %}
+        {% set cv = commit.value %}
+        <tr>
+          <td>
+            <b>{{h.really_unicode(h.text.truncate(cv.description(), 75))}}</b><br/>
+            <a href="{{cv.url()}}">{{h.text.truncate(cv.hex(), 10)}}</a>
+            {% if cv.user_url %}
+              by
+              <a href="{{cv.user_url}}">{{email_gravatar(cv.user.email, title=cv.user.name, size=16)}}
+              {{cv.user.name}}</a>
+            {% else %}
+              by
+              {{email_gravatar(cv.user.email, title=cv.user.name, size=16)}} {{cv.user.name}}
+            {% endif %}
+          </td>
+          <td>
+            {% if cv.datetime %}{{h.ago(cv.datetime)}}{% endif %}
+          </td>
+          <td style="text-align: right">
+            {% if commit.prev %}
+              Parent(s):
+              {% for ci in commit.prev %}<a href="{{ci.url()}}">{{h.text.truncate(ci._id, 10)}}</a>{% endfor %}
+              <br/>
+            {% endif %}
+            <a href="{{cv.tree().url()}}">Tree</a>
+          </td>
+        </tr>
+      {% endfor %}
+    </tbody>
+  </table>
+  {% if show_paging %}
+    <div style="clear:both">
+      {{fields['page_list'].display(limit=limit, page=page, count=count)}}
+      {{fields['page_size'].display(limit=limit)}}
+    </div>
+  {% endif %}
+</div>
ForgeHg/forgehg/templates/commit.html to ForgeHg/forgehg/templates/hg_index.html
--- a/ForgeHg/forgehg/templates/commit.html
+++ b/ForgeHg/forgehg/templates/hg_index.html
@@ -1,33 +1,37 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
-      xmlns:py="http://genshi.edgewall.org/"
-      xmlns:xi="http://www.w3.org/2001/XInclude">
+{% extends 'jinja_master/master.html' %}
 
-  <xi:include href="${g.allura_templates}/master.html"/>
+{% block title %}
+  {% if c.app.repo %}
+    Mercurial Repository: {{c.app.repo.name}}
+  {% else %}
+    Mercurial Repository
+  {% endif %}
+{% endblock %}
 
-  <head>
-    <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
-    <link rel="stylesheet" type="text/css" href="/css/hilite.css"/>
-    <title>$c.project.name / $c.app.config.options.mount_label / Changeset</title>
-    <style type="text/css">
-      ins { text-decoration: none; background-color: #dfd; }
-      del { text-decoration: none; background-color: #fdd; }
-    </style>
-  </head>
+{% block header %}{{c.app.config.options.mount_label}}{% endblock %}
 
-  <body>
-    ${c.revision_widget.display(value=commit, prev=prev, next=next)}
-    <table>
-      <tbody>
-        <tr py:for="kind, path in commit.diff_summarize()">
-          <td>$kind</td>
-          <td>
-            <a py:if="kind != 'remove'" href="./tree/$path">$path</a>
-            <py:if test="kind == 'remove'">$path</py:if>
-          </td>
-        </tr>
-      </tbody>
-    </table>
-  </body>
-</html>
+{% block content %}
+<h2>Project: {{c.project.shortname}}</h2>
+  {% if c.app.repo %}
+    <p>
+      Read access: <code>hg clone http://{{c.app.repo.scm_url_path}}</code><br/>
+      Read/write access: <code>hg clone ssh://{{c.user == c.user.anonymous() and 'USERNAME' or c.user.username}}@{{c.app.repo.scm_url_path}}</code><br/>
+      {% if allow_fork and c.user != c.user.anonymous() %}
+        <form action="{{c.app.repo.url()}}fork" method="GET">
+          <input type="submit" value="Fork"/>
+        </form>
+      {% endif %}
+    </p>
+  {% endif %}
+  <div style="clear:both">&nbsp;</div>
+  {% if log %}
+    <h2>Recent Commits{% if branch %} on {{branch}}{% endif %}</h2>
+    {{c.log_widget.display(value=log, show_paging=False,
+                           limit=limit, page=page, count=count)}}
+    {% if int(count) > int(limit) %}
+      <a href="log?page=1">More</a>
+    {% endif %}
+  {% else %}
+    <b>No (more) commits</b>
+  {% endif %}
+{% endblock %}
ForgeHg/forgehg/templates/fork.html to ForgeHg/forgehg/templates/hg_tree.html
--- a/ForgeHg/forgehg/templates/fork.html
+++ b/ForgeHg/forgehg/templates/hg_tree.html
@@ -1,30 +1,43 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
-      xmlns:py="http://genshi.edgewall.org/"
-      xmlns:xi="http://www.w3.org/2001/XInclude">
+{% extends 'jinja_master/master.html' %}
 
-  <xi:include href="${g.allura_templates}/master.html"/>
+{% block title %}
+  {{c.project.name}} / {{c.app.config.options.mount_label}}
+  {% if tree %}
+    / @{{h.text.truncate(tree._commit._id, 10)}}: {{lib.path_links(tree.path().split('/')[1:-1])}}
+  {% endif %}
+{% endblock %}
 
-  <head>
-    <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
-    <title>$c.project.name / $c.app.config.options.mount_label / Fork ${from_repo.name}</title>
-  </head>
+{% block header %}
+  {% if tree %}
+    <a href="{{tree._commit.url()}}">@{{h.text.truncate(tree._commit._id, 10)}}</a>:
+    {{lib.path_links(tree.path().split('/')[1:-1])}}
+  {% else %}
+    No files
+  {% endif %}
+{% endblock %}
 
-  <body>
-    <h1 class="title">Fork ${from_repo.name}</h1>
-    <div class="content">
-      <div class="row">
-        <div class="column grid_12">
-          <form action="." method="POST">
-              ${to_project_name}/<input type="text" name="to_name" value="${to_name}"/>
-              <input type="submit" value="Fork" py:if="c.user != c.user.anonymous()"/>
+{% block content %}
+  {% if tree %}
+    {% if c.app.repo %}
+      <p>
+        Read access: <code>hg clone http://{{c.app.repo.scm_url_path}}</code><br/>
+        Read/write access: <code>hg clone ssh://{{c.user == c.user.anonymous() and 'USERNAME' or c.user.username}}@{{c.app.repo.scm_url_path}}</code><br/>
+        {% if c.user != c.user.anonymous() %}
+          <form action="{{c.app.repo.url()}}fork" method="GET">
+            <input type="submit" value="Fork"/>
           </form>
-          <div id="in-use" style="display:none">
-              <span py:for="used in in_use">${used}</span>
-          </div>
-        </div>
+        {% endif %}
+      </p>
+    {% endif %}
+    <div style="clear:both;"></div>
+    {% if tree.readme() %}
+      <div class="clip">
+        <h3><span class="ico-l"><b class="ui-icon ui-icon-document"></b> Read Me</span></h3>
+        {{g.markdown.convert(tree.readme())}}
       </div>
-    </div>
-  </body>
-</html>
+    {% endif %}
+    {{c.tree_widget.display(tree=tree)}}
+  {% else %}
+    No files
+  {% endif %}
+{% endblock %}
ForgeHg/forgehg/templates/index.html to ForgeHg/forgehg/templates/hg_admin_extensions.html
--- a/ForgeHg/forgehg/templates/index.html
+++ b/ForgeHg/forgehg/templates/hg_admin_extensions.html
@@ -1,45 +1,44 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
-      xmlns:py="http://genshi.edgewall.org/"
-      xmlns:xi="http://www.w3.org/2001/XInclude">
+{% extends 'jinja_master/master.html' %}
 
-  <xi:include href="${g.allura_templates}/master.html"/>
+{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / Admin Viewable Files{% endblock %}
 
-  <head>
-    <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
-    <title py:if="not repo">Mercurial Repository</title>
-    <title py:if="repo">Mercurial Repository: ${repo.name}</title>
-  </head>
+{% block header %}{{app.config.options.mount_point}} Admin Viewable Files{% endblock %}
 
-  <body>
-    <h1 class="title">$c.app.config.options.mount_label</h1>
-    <div class="content">
-      <div class="row">
-        <div class="column grid_12">
-          <h2>Project: $c.project.shortname</h2>
-          <py:if test="repo">
-            <dl>
-              <dt>read access</dt>
-              <dd>hg clone http://$repo.scm_url_path</dd>
-              <dt>read/write access</dt>
-              <dd>hg clone ssh://$repo.scm_url_path</dd>
-              <dt>status</dt>
-              <dd>${repo.status}</dd>
-            </dl>
-            <form py:if="allow_fork" action="${c.app.repo.url()}fork" method="GET">
-              <input type="submit" value="Fork" py:if="c.user != c.user.anonymous()"/>
-            </form>
-          </py:if>
-          <h2>Recent Commits</h2>
-          <h3 py:if="branch">Branch: $branch</h3>
-          <h3 py:if="tag">Tag: $tag</h3>
-          <py:for each="r in revisions">
-            ${c.revision_widget.display(**r)}
-          </py:for>
-          <a py:if="next_link" href="$next_link">More</a>
-        </div>
-      </div>
-    </div>
-  </body>
-</html>
+{% block content %}
+<form>
+  <ol>
+    <li>
+      <label>Extensions:</label>
+      {% if allow_config %}
+        <input type="text" name="additional_viewable_extensions"
+               id="additional_viewable_extensions" title="e.g., .svnignore,.gitignore,.ini"
+               {% if additional_viewable_extensions %} value="{{additional_viewable_extensions}}"{% endif %}/>
+      {% else %}
+        <span>{{additional_viewable_extensions}}</span>
+      {% endif %}
+    </li>
+    <hr/>
+    <li>
+      <label>&nbsp;</label>
+      {% if allow_config %}
+        <input type="button" onclick="save_extensions()" value="Save"/>
+      {% endif %}
+    </li>
+  </ol>
+</form>
+{% endblock %}
+
+{% block extra_js %}
+  {% if allow_config %}
+    <script type="text/javascript">
+      function save_extensions(){
+          $.post('set_extensions', {
+              additional_viewable_extensions: $('#additional_viewable_extensions').val()
+          },
+          function(){
+              location.reload();
+          });
+      }
+    </script>
+  {% endif %}
+{% endblock %}
ForgeHg/forgehg/widgets/templates/revision.html to ForgeHg/forgehg/widgets/templates/hg_revision_widget.html
--- a/ForgeHg/forgehg/widgets/templates/revision.html
+++ b/ForgeHg/forgehg/widgets/templates/hg_revision_widget.html
@@ -1,29 +1,24 @@
-<div xmlns="http://www.w3.org/1999/xhtml"
-     xmlns:py="http://genshi.edgewall.org/"
-     xmlns:xi="http://www.w3.org/2001/XInclude"
-     style="background-color:#eee;border-top:1px solid #333;">
-  <xi:include href="${g.allura_templates}/lib.html"/>
-  Changeset <a href="${value.url()}">${h.text.truncate(value.hex(), 10)}</a>:
-  ${h.ago(value.datetime)}<br/>
-  <a href="${value.tree().url()}">Tree</a><br/>
-  <py:if test="prev">
-    Parent(s):
-    <py:for each="ci in prev"><a href="${ci.url()}">${h.text.truncate(ci._id, 10)}</a></py:for>
-    <br/>
-  </py:if>
-  <py:if test="next">
-    Child(ren):
-    <py:for each="ci in next"><a href="${ci.url()}">${h.text.truncate(ci._id, 10)}</a></py:for>
-  </py:if>
-  ${Markup(g.markdown.convert(value.description()))}
-  <p class="gravatar">
-    <py:if test="value.user_url is not None">
-      <a href="${value.user_url}">${email_gravatar(value.user.email, title=value.user.name)}</a><br/>
-      <a href="${value.user_url}">$value.user.name</a> (user)<br/>
-    </py:if>
-    <py:if test="value.user_url is None">
-      ${email_gravatar(value.user.email, title=value.user.name)}<br/>
-      $value.user.name<br/>
-    </py:if>
-  </p> 
-</div>
+{% from 'jinja_master/lib.html' import email_gravatar with context %}
+{% if value.user_url %}
+  Authored by
+  <a href="{{value.user_url}}">{{email_gravatar(value.user.email, title=value.user.name, size=16)}}</a>
+  <a href="{{value.user_url}}">{{value.user.name}}</a>
+{% else %}
+  Authored by
+  {{email_gravatar(value.user.email, title=value.user.name, size=16)}} {{value.user.name}}
+{% endif %}
+{% if value.datetime %}{{h.ago(value.datetime)}}{% endif %}
+
+<br/>
+<a href="{{value.tree().url()}}">Tree</a><br/>
+{% if prev %}
+  Parent(s):
+  {% for ci in prev %}<a href="{{ci.url()}}">{{h.text.truncate(ci._id, 10)}}</a>{% endfor %}
+  <br/>
+{% endif %}
+{% if next %}
+  Child(ren):
+  {% for ci in next %}<a href="{{ci.url()}}">{{h.text.truncate(ci._id, 10)}}</a>{% endfor %}
+  <br/>
+{% endif %}
+{{g.markdown.convert(h.really_unicode(value.description()))}}
ForgeSVN/forgesvn/templates/index.html to ForgeHg/forgehg/templates/hg_commit.html
--- a/ForgeSVN/forgesvn/templates/index.html
+++ b/ForgeHg/forgehg/templates/hg_commit.html
@@ -1,37 +1,21 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
-      xmlns:py="http://genshi.edgewall.org/"
-      xmlns:xi="http://www.w3.org/2001/XInclude">
+{% extends 'jinja_master/master.html' %}
 
-  <xi:include href="${g.allura_templates}/master.html"/>
+{% block title %}
+  {{c.project.name}} / {{c.app.config.options.mount_label}} / Changeset {{h.text.truncate(commit.hex(), 10)}}
+{% endblock %}
 
-  <head>
-    <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
-    <title py:if="not c.app.repo">SVN Repository</title>
-    <title py:if="c.app.repo">SVN Repository: ${c.app.repo.name}</title>
-  </head>
+{% block header %}Changeset <a href="{{commit.url()}}">{{h.text.truncate(commit.hex(), 10)}}</a>{% endblock %}
 
-  <body>
-    <h1 class="title">$c.app.config.options.mount_label</h1>
-    <div class="content">
-      <div class="row">
-        <div class="column grid_12">
-          <p py:if="c.app.repo">
-            Read access: <code>svn checkout svn://$c.app.repo.scm_url_path</code><br/>
-            Read/write access: <code>svn checkout svn+ssh://${c.user == c.user.anonymous() and 'USERNAME' or c.user.username}@$c.app.repo.scm_url_path</code><br/>
-          </p>
-          <py:if test="log">
-            <h2>Recent Commits</h2>
-            ${c.log_widget.display(value=log, show_paging=False,
-                                   limit=limit, page=page, count=count)}
-            <a py:if="int(count) &gt; int(limit)" href="${c.app.url}log?page=1">More</a>
-          </py:if>
-          <py:if test="not log">
-            <b>No (more) commits</b>
-          </py:if>
-        </div>
-      </div>
-    </div>
-  </body>
-</html>
+{% block content %}
+{{c.revision_widget.display(value=commit, prev=prev, next=next)}}
+<table>
+  <tbody>
+    {% for kind, path in commit.diff_summarize() %}
+      <tr>
+        <td>{{kind}}</td>
+        <td><a href="./tree/{{h.really_unicode(path)}}">{{h.really_unicode(path)}}</a></td>
+      </tr>
+    {% endfor %}
+  </tbody>
+</table>
+{% endblock %}
ForgeSVN/forgesvn/templates/log.html to ForgeHg/forgehg/templates/hg_fork.html
--- a/ForgeSVN/forgesvn/templates/log.html
+++ b/ForgeHg/forgehg/templates/hg_fork.html
@@ -1,30 +1,19 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
-      xmlns:py="http://genshi.edgewall.org/"
-      xmlns:xi="http://www.w3.org/2001/XInclude">
+{% extends 'jinja_master/master.html' %}
 
-  <xi:include href="${g.allura_templates}/master.html"/>
+{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / Fork {{from_repo.name}}{% endblock %}
 
-  <head>
-    <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
-    <title py:if="not c.app.repo">SVN Repository</title>
-    <title py:if="c.app.repo">SVN Repository: ${c.app.repo.name}</title>
-  </head>
+{% block header %}Fork {{from_repo.name}}{% endblock %}
 
-  <body>
-    <h1 class="title">$c.app.config.options.mount_label Log</h1>
-    <div class="content">
-      <div class="row">
-        <div class="column grid_12">
-          <py:if test="log">
-            ${c.log_widget.display(value=log, limit=limit, page=page, count=count)}
-          </py:if>
-          <py:if test="not log">
-            <b>No (more) commits</b>
-          </py:if>
-        </div>
-      </div>
-    </div>
-  </body>
-</html>
+{% block content %}
+<form action="." method="POST">
+    {{to_project_name}}/<input type="text" name="to_name" value="{{to_name}}"/>
+    {% if c.user != c.user.anonymous() %}
+      <input type="submit" value="Fork"/>
+    {% endif %}
+</form>
+<div id="in-use" style="display:none">
+    {% for used in in_use %}
+      <span>{{used}}</span>
+    {% endfor %}
+</div>
+{% endblock %}
ForgeSVN/forgesvn/widgets/templates/revision.html to ForgeHg/forgehg/widgets/log.py
--- a/ForgeSVN/forgesvn/widgets/templates/revision.html
+++ b/ForgeHg/forgehg/widgets/log.py
@@ -1,14 +1,15 @@
-<div xmlns="http://www.w3.org/1999/xhtml"
-     xmlns:py="http://genshi.edgewall.org/"
-     xmlns:xi="http://www.w3.org/2001/XInclude">
-  <xi:include href="${g.allura_templates}/lib.html"/>
-  <py:if test="value.author">
-    <a href="${value.author.url()}">${gravatar(value.author, size=16)}</a>
-    <a href="${value.author.url()}">${value.author.display_name}</a>
-  </py:if>
-  <py:if test="not value.author">
-    ${email_gravatar(value.author_username, size=16)} $value.author_username
-  </py:if>
-  ${h.ago(value.datetime)}<br/>
-  ${Markup(g.markdown.convert(h.really_unicode(value.message)))}
-</div>+import ew
+from allura.lib.widgets import form_fields as ffw
+
+class HgLog(ew.Widget):
+    template='jinja:hg_log_widget.html'
+    params=['value', 'limit', 'page', 'count', 'show_paging', 'fields']
+    value=None
+    limit=None
+    page=0
+    count=0
+    show_paging=True
+
+    class fields(ew.WidgetsList):
+        page_list=ffw.PageList()
+        page_size=ffw.PageSize()