* An action to find what branches have been merged, either as a list or through a search mechanism.
* An action to find which branches a given commit is on.
* Fix any not text/html bits e.g the patch action.
+* Simplify the creation of links.
);
}
+=head2 tree
+
+The tree of a given commit.
+
+=cut
+
+sub tree : Local {
+ my ( $self, $c ) = @_;
+
+ $c->stash(
+ # XXX Useful defaults needed ...
+ commit => $c->model('Git')->get_object($c->req->param('h')),
+ tree => $c->model('Git')->get_object($c->req->param('hb')),
+ action => 'tree',
+ );
+}
+
=head2 auto
Populate the header and footer. Perhaps not the best location.
my ($mode, $type, $object, $file) = split /\s+/, $line, 4;
push @ret, {
- mode => oct $mode,
- type => $type,
- object => $object,
- file => $file,
+ mode => oct $mode,
+ modestr => $self->get_object_mode_string({mode=>oct $mode}),
+ type => $type,
+ object => $object,
+ file => $file,
};
}
-[% PROCESS 'commit-nav.tt2' object = head %]
<link rel="stylesheet" type="text/css" href="/static/css/syntax-dark.css"/>
+
+[% PROCESS 'commit-nav.tt2' object = head %]
<div class='commit-message'>
[% head.comment.substr(0, 85) %] ...
</div>
<td class='action-list'>
<a href="/commit?p=[% project %];h=[% line.sha1 %]">commit</a>
<a href="/commitdiff?p=[% project %];h=[% line.sha1 %]">commitdiff</a>
- <a href="/tree?p=[% project %];h=[% line.sha1 %];hb=[% line.tree_sha1 %]">history</a>
+ <a href="/tree?p=[% project %];h=[% line.sha1 %];hb=[% line.tree_sha1 %]">tree</a>
</td>
</tr>
[% END %]
--- /dev/null
+[% INCLUDE 'commit-nav.tt2' object = commit %]
+
+<div class='commit-message'>
+[% commit.comment.substr(0, 85) %] ...
+</div>
+
+<table>
+ <thead>
+ <tr>
+ <td>mode</td>
+ <td>file</td>
+ <td>actions</td>
+ </tr>
+ </thead>
+
+ <tbody>
+ [% FOREACH item IN c.model('Git').list_tree(commit.sha1) %]
+ <tr>
+ <td>[% item.modestr %]</td>
+ [% theact = item.type == 'tree' ? 'tree' : 'blob' -%]
+ <td>
+ <a href="/[% theact %]?h=[% item.object %];hb=[% commit.sha1 %];f=[% item.file %]">[% item.file %]</a>
+ </td>
+ <td class='action-list'>
+ <a href="/[% theact %]?p=[% project %];h=[% item.object %]">[% theact %]</a>
+ <a href="/history?p=[% project %];h=[% item.object %]">history</a>
+ <a href="/raw?p=[% project %];h=[% item.object %]">raw</a>
+ </td>
+ </tr>
+ [% END %]
+ </tbody>
+
+ <tfoot>
+ <tr>
+ <td>mode</td>
+ <td>file</td>
+ <td>actions</td>
+ </tr>
+ </tfoot>
+</table>