Git commit kinda sorta working
Tomas Doran [Sun, 17 Jan 2010 23:30:29 +0000 (23:30 +0000)]
root/commit/commit.tt2 [new file with mode: 0644]
root/fragment/commit/commit.tt2 [new file with mode: 0644]

diff --git a/root/commit/commit.tt2 b/root/commit/commit.tt2
new file mode 100644 (file)
index 0000000..20b1cca
--- /dev/null
@@ -0,0 +1,5 @@
+[% INCLUDE 'nav/actions.tt2' object = commit %]
+
+<div class='content'>
+  [% subinclude('/fragment/commit/commit', c.req.captures) %]
+</div>
diff --git a/root/fragment/commit/commit.tt2 b/root/fragment/commit/commit.tt2
new file mode 100644 (file)
index 0000000..708ad43
--- /dev/null
@@ -0,0 +1,39 @@
+<div class='commit-message'>
+  [%
+    short_cmt(Commit.comment) | html;
+    INCLUDE '_refs.tt2' object = commit;
+  %]
+  </div>
+  <!-- [% USE dumper; dumper.dump(commit.parents) %] -->
+  <dl class='commit-info'>
+   <dt>author</dt>
+    <dd>[% Commit.author.name | html %] &lt;[% Commit.author.email %]&gt;<br/>
+       [% Commit.authored_time %]</dd>
+   <dt>committer</dt>
+    <dd>[% Commit.committer.name %] &lt;[% Commit.committer.email %]&gt;<br/>
+       [% Commit.committed_time %]</dd>
+   <dt>commit</dt>
+    <dd>[% Commit.sha1 %]</dd>
+   <dt>tree</dt>
+    <dd>[% Commit.tree_sha1 %]
+       <span class='action-list'><a href="[% c.uri_for(c.controller.action_for("tree"), c.req.captureargs) %]">tree</a></span>
+    </dd>
+   [% FOREACH parent IN Commit.parents %]
+   <dt>parent</dt>
+    <dd>[% parent.sha1  %]
+      <span class='action-list'>
+       <a href="[% c.uri_for(c.action, [Repository.name, parent.sha1]) %]">commit</a>
+       <a href="[% c.uri_for(c.controller.action_for('diff'), [Repository.name, parent.sha1]) %]">diff</a>
+      </span>
+     </dd>
+   [% END %]
+  </dl>
+
+  <pre class='commit-message'>[% Commit.comment | html%]</pre>
+
+  [%
+    # In the case of merge commits there will be no diff tree.
+    IF diff_tree.size > 0;
+      INCLUDE '_diff_tree.tt2';
+    END;
+  %]
\ No newline at end of file