Initial templates for diff, nothing displays yet
Tomas Doran [Sun, 17 Jan 2010 22:52:06 +0000 (22:52 +0000)]
root/commit/diff.tt2 [new file with mode: 0644]
root/fragment/commit/diff.tt2 [new file with mode: 0644]

diff --git a/root/commit/diff.tt2 b/root/commit/diff.tt2
new file mode 100644 (file)
index 0000000..1790d1d
--- /dev/null
@@ -0,0 +1,15 @@
+[% PROCESS 'nav/actions.tt2' object = commit %]
+
+<div class='content'>
+  <div class='commit-message'>
+  [% # XXX Wah, stuff like this doesn't work because end() isn't called as we forward to View::SyntaxHighlight
+  short_cmt(commit.comment) | html %]
+  </div>
+
+  <div class='author'>
+    [% commit.author.name | html %] [[% commit.authored_time %]]
+  </div>
+
+
+  [% subinclude('/fragment/commit/diff', c.req.captures) %]
+</div>
diff --git a/root/fragment/commit/diff.tt2 b/root/fragment/commit/diff.tt2
new file mode 100644 (file)
index 0000000..75e461e
--- /dev/null
@@ -0,0 +1,20 @@
+[%
+  # In the case of merge commits there will be no diff tree.
+  IF diff_tree.size > 0;
+    INCLUDE '_diff_tree.tt2';
+  END;
+  IF diff.size > 0;
+    INCLUDE '_diff.tt2';
+  ELSE
+  %]
+  <div class='no-difference'>
+  [%
+    IF commit.parents > 1;
+      'Trivial merge';
+    ELSE;
+      'No differences found';
+    END;
+  %]
+  </div>
+  [% END %]
+  
\ No newline at end of file